How to change the autocomplete suggestions sequence?

Webstorm 10.0.4 is better than 10.0.0, so I upgraded to WebStorm 10.0.4.

However, I found some annoying things in autocomplete suggestions on the followings:

1. requireRE always comes before require.

2. document always comes after documentMode.

3. document.getElementById always comes after getElementsByClassName and getElementsByName


Also, in WebStorm 9, if I write a function in a module like the following,

var inspect = function(){...};

exports.inspect = inspect; // actually, this is how Node.js export inspect function.

When I want to require this module's inspect function,

In WebStorm 9, it will autocomplete like the following:

     var inspect = require('util').inspect    // It saves a lot of time, because I can just add ';' to complete it.

But, in WebStorm 10, it will autocomplete like the following:

    var inspect = require('util').inspect()  // It's annoying because I have to type arrow and delete key to remove the parentheses.

I use Webstorm starting from 6.0, Webstorm is good. However, it is frustrated everytime that WebStorm launched a new major upgrade,
something will be changed, and you have to get used to it. I know I have to get used to it. But, in node.js, require is always the most popular keyword. Why WebStorm autocomplete suggest requireRE ( in Node.js 0.12.2 Core ) before require? Is it possible to configure it to make require come first?

And, since I put require, it usually means that I want to import a function from a module. Why Webstorm guess that I want to call the function? Sigh...

3 comments

1. to me, 'require' comes first - see attached screenshot

require.png

You must have chosen the 'requireRE' previously... When you invoke completion for the first time, it sorts items  alphabetically, but when some statistics is gathered WebStorm  prioritizes more often used items.

2. documentMode is a document property... I can see it when I invoke a completion on document (document.<ctrl+space>), but I can't see 'document' there - and it shouldn't be there...

3. well... this happens because the getElementsByClassName and getElementsByName are attached to HTMLDocument in DHTML.js whereas getElementById is defined as a property of Document (DOMCore.js predefined library). And, as 'document' in WebStorm is HTMLDocument, its own properties are shown first. IMO, it's a bug, I'd suggest logging it to youtrack

And, since I put require, it usually means that I want to import a function from a module. Why Webstorm guess that I want to call the function?



WebStorm can't guess what you like to do with your function... Both ways are perfectly valid. https://youtrack.jetbrains.com/issue/WEB-12987, BTW, requires to have parentheses inserted always...

-1

Elena, the question was clearly "How do I change autocomplete suggestion sequence" not "why do you think it suggests x over y". If you don't know, just say so, or don't.

I want to resurrect this thread, because I too get x every time when I want y 99% of the times even though I used x once or twice or several times...

-3

Jaroslav, I'm in agreement with you. 

0

Please sign in to leave a comment.