Frequence-based suggestions?

Is there any way to get code suggestions based on my own most-used keywords (the way it happens in eclipse) ?

Very often you use the same words/functions/identifiers etc. repeatedly in a same project but right now the suggestions are not based on the usage frequence so I always have to scroll.

 

(ex.: in a recent project I use document.getElementById() a lot, and it's pretty annoying to type it all every time)

4 comments

Hi there,

AFAIK it is like that by default (unless you have "Sort lookup items lexicographically" option checked in "Code Completion" settings).

Hints:

  1. You can "cut corners" -- type capital letters (e.g. "document.geb" will most likely select "getElementBy" item from the completion list)
  2. Create custom Live Template for most frequently used constructions (e.g. dgeb[TAB] to be expanded into "document.getElementById()") -- https://confluence.jetbrains.com/display/PhpStorm/Live+Templates+%28Snippets%29+in+PhpStorm
0

Hmm... Normally completion list is sorted by relevance - own properties come first, etc., sorted alphabetically. But variants chosen recently get higher priority. If it doesn't work for you, can you provide steps to recreate the issue?

0

Thanks for your answers.

As you can see, the "getElementById" item is only in 6th position, while I never used the other suggestions in this project (and as you can see, the "sort by relevance" option is checked).

Thanks for the suggestions Andriy, it helps indeed.

0

Seems this sorting doesn't work now, logged as https://youtrack.jetbrains.com/issue/WEB-20920. Please vote for it

0

Please sign in to leave a comment.