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 249152 - No code completion for Instance of module exporting constructor
Summary: No code completion for Instance of module exporting constructor
Status: NEW
Alias: None
Product: javascript
Classification: Unclassified
Component: Node.js (show other bugs)
Version: 8.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-05 15:02 UTC by Vladimir Riha
Modified: 2015-05-05 15:49 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Riha 2014-12-05 15:02:59 UTC
Please try following setup:


src.js
===============
module.exports = function AAA(){
    this.pokus = 1;
}


main.js
===============
var my = require("./src");
var e = new my();
e.

=> it should offer "pokus" but it offers only the generic code completion


Thank you


Product Version: NetBeans IDE Dev (Build 201412050001)
Java: 1.7.0_71; Java HotSpot(TM) Client VM 24.71-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_71-b14
System: Linux version 3.13.0-35-generic running on i386; UTF-8; en_US (nb)
Comment 1 Petr Pisl 2015-04-03 11:50:21 UTC
Reproducible.
Comment 2 Roman Svitanic 2015-05-05 15:49:48 UTC
This can be reproduced even without Node (require):

Consider following cases (notice the name of function A in case [1] and no name in [2]):

[1]
demo.Modul = function A(){
    this.pokus = 1;
};

and

[2]
demo.Modul = function(){
    this.pokus = 1;
};

Then:

var X = demo.Modul;
var x = new X();
x.| // in case [1] pokus is NOT offered, while in [2] pokus IS offered.

----
Same applies for the original issue here.