WebStorm does not autocomplete properties of object which returned by a function (many nodejs modules are without autocomplete).
// If function returs an object created on the fly, autocomplete will work.
function fun1() {
return {
aaaa: 13
};
}
var obj1 = fun1();
//obj1.aa // Autocomplete works.
var obj2 = {
bbbb: 15
};
obj2.cccc = 16;
// No creation on the fly, autocompletion does not work.
function fun2() {
return obj2;
}
var obj3 = fun2();
//obj3.bb // Autocomplete does not work. You will laugh, but SublimeText will suggest variants (bbbb, aaaa, etc).
// Many Node.js modules use such an approach:
var innerObject = {};
innerObject.func1 = function(){};
innerObject.prop1 = 'bla bla bla';
module.exports = function() {
return innerObject;
}
//And WebStorm in such case does not provide autocompletion. A programmer have to open module source and search for object names by hands, how so :(.
Please sign in to leave a comment.
Logged as https://youtrack.jetbrains.com/issue/WEB-20083, please vote for it to be notified on updates