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 245041

Summary: Wrong completion for files/modules in child directory
Product: javascript Reporter: Vladimir Riha <vriha>
Component: RequireJSAssignee: Petr Pisl <ppisl>
Status: REOPENED ---    
Severity: normal    
Priority: P3    
Version: 8.0.1   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Attachments: sample project

Description Vladimir Riha 2014-06-13 13:23:14 UTC
Please check the attached project:
  - open bbb/fs.js

define(["a"], function(e){
    window.console.log("fs...");
    window.console.log(e);
})

  - invoke cc for module dependency after the "a" (first parameter of define())

=> it should offer app. If you remove "a" and repeat, it should offer app, bbb, jquery etc. as if you repeat this action in main.js. 

It works if "app/" is already entered you invoke cc after the last slash, then it offers correct files from inside the app folder

define(["app/"], function(e){



Product Version: NetBeans IDE Dev (Build web-main-894-on-20140613)
Java: 1.8.0_05; Java HotSpot(TM) Client VM 25.5-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_05-b13
System: Linux version 3.13.0-29-generic running on i386; UTF-8; en_US (nb)
Comment 1 Vladimir Riha 2014-06-13 13:24:04 UTC
Created attachment 147667 [details]
sample project
Comment 2 Petr Pisl 2014-06-16 15:05:13 UTC
Should be fixed in web-main.
Comment 3 Vladimir Riha 2014-06-20 11:25:45 UTC
I'm sorry but 

define([""], function(e){
    window.console.log("fs...");
    window.console.log(e);
})


in the bbb/fs.js still does not offer files/folders as if invoked from main.js instead it offers items from bbb folder.


Product Version: NetBeans IDE Dev (Build 201406190001)
Java: 1.8.0_05; Java HotSpot(TM) Client VM 25.5-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_05-b13
System: Linux version 3.13.0-29-generic running on i386; UTF-8; en_US (nb)
Comment 4 Vladimir Riha 2014-07-01 11:32:26 UTC
FYI similar issue is when you use

define([], function(){
    var moduleA = require("");   
});


in file "test.js" in project with structure:
 - Site Root/main.js - the main RequireJS config file
 - Site Root/js/app/c/test.js 

then if you invoke cc inside the double quotes in require(""), it should offer paths relative to main.js, not test.js


Product Version: NetBeans IDE Dev (Build 201407010002)