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 248197 - Completion completes invalid module from same folder
Summary: Completion completes invalid module from same folder
Status: VERIFIED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Node.js (show other bugs)
Version: 8.1
Hardware: PC Linux
: P2 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-26 14:01 UTC by Vladimir Riha
Modified: 2014-11-06 17:15 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-10-26 14:01:44 UTC
Please try following:

=== aaa.js
module.exports =11;

=== main.js
var e = require("");


and invoke cc in the main.js' require call. It offers "aaa.js" but if you select it and complete it, result is

   var e = require("aaa");

which is wrong if you try to run it, NodeJS throws exception. The proper way to complete it would be

   var e = require("./aaa");

so NodeJS knows it comes from local file.

Thank you


Product Version: NetBeans IDE Dev (Build 201410190001)
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-37-generic running on amd64; UTF-8; en_US (nb)
Comment 1 Vladimir Riha 2014-11-02 16:54:50 UTC
Petre, could you please look at this? The same happens with folders and so on. Thank you
Comment 2 Petr Pisl 2014-11-03 11:44:39 UTC
Should be fixed in web-main now.

Thanks
Comment 3 Quality Engineering 2014-11-04 10:33:42 UTC
Integrated into 'main-silver', will be available in build *201411040753* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/a3a89180558f
User: Petr Pisl <ppisl@netbeans.org>
Log: #248197 - Completion completes invalid module from same folder
Comment 4 Vladimir Riha 2014-11-06 17:15:36 UTC
Thank you, verified


Product Version: NetBeans IDE Dev (Build 201411060002)
Java: 1.8.0_20; Java HotSpot(TM) Client VM 25.20-b23
Runtime: Java(TM) SE Runtime Environment 1.8.0_20-b26
System: Linux version 3.13.0-35-generic running on i386; UTF-8; en_US (nb)