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 247375 - Code completion right after require() call
Summary: Code completion right after require() call
Status: RESOLVED WORKSFORME
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-09-22 18:58 UTC by Vladimir Riha
Modified: 2015-04-30 08:47 UTC (History)
0 users

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-09-22 18:58:25 UTC
Please try to invoke cc after the require("err").  in api.js. CC should offer exported properties from the err.js. It works with following

var myErr = require("err");
myErr. 


but

var dbErr = require("err").

does not work.



err.js:
=====================
"use strict";
var err = {
    BadRequest: function (response, msg) {
        response.writeHead(400, {
            "Content-Type": "text/plain"
        });
        response.write(msg);
        response.end();
    },
    DatabaseError: function (response, msg) {
        response.writeHead(500, {
            "Content-Type": "text/plain"
        });
        response.write(msg);
        response.end();
    }
};
module.exports = err;


api.js:
===================
var dbError = require("err").




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:07:50 UTC
... also Go to declaration on 

require("something").registerRoute(app);

does not work in this case
Comment 2 Vladimir Riha 2014-12-05 13:46:39 UTC
Raising to P2, it is relatively common pattern. Thank you
Comment 3 Petr Pisl 2014-12-08 20:07:12 UTC
The cc works for me, the navigation doesn't. But it's more general problem, then just in the requirejs case.
Comment 4 Roman Svitanic 2015-04-30 08:47:18 UTC
CC is showed for the mentioned case in:

Product Version: NetBeans IDE Dev (Build 20150429-dbfa5313bcfb)
Java: 1.7.0_75; Java HotSpot(TM) 64-Bit Server VM 24.75-b04
Runtime: Java(TM) SE Runtime Environment 1.7.0_75-b13
System: Mac OS X version 10.10.3 running on x86_64; UTF-8; en_US (nb)