This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 247376

Summary: Try to show variable type where possible
Product: javascript Reporter: Vladimir Riha <vriha>
Component: Node.jsAssignee: Petr Pisl <ppisl>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.1   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

Description Vladimir Riha 2014-09-22 19:17:25 UTC
Please consider following:

responseError.js
======================================
function ResponseError(httpCode, msg) {
    this.httpCode = httpCode;
    this.msg = msg;
}
ResponseError.prototype.test = function(){};
ResponseError.prototype = Object.create(Error.prototype);
ResponseError.prototype.constructor = ResponseError;

module.exports = ResponseError;


myfile.js
======================================
var re = require("responseError");


var myError = new re();


=> both navigator and code completion show type of myError to be "re", would be nice if correct ResponseError would be displayed instead.


Thank you


Product Version: NetBeans IDE Dev (Build 201409220001)
Java: 1.7.0_45; Java HotSpot(TM) 64-Bit Server VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18
System: Linux version 3.13.0-35-generic running on amd64; UTF-8; en_US (nb)
Comment 1 Vladimir Riha 2014-09-22 19:17:57 UTC
I imagine there could be various "clear" cases
Comment 2 elennaro 2015-02-28 11:23:57 UTC
This is a totally needed feature!
If it could also act of cc suggestions arrangement it will be twice as great!