Code completion in typescript/javascript

How come in typescript or javascript, typing space or enter doesn't automatically choose the top choice in the code completionn window like intellij does with java or actionscript?

Is there anyway I can set it so those keys trigger code completion?



Hi Alex.
Enter must trigger code completion, please describe your situation in detail when it doesn't trigger. As for space, please enable 'Insert selected variant by typing dot, space, etc..' checkbox in Settings | Editor | Code Completion.



For a language like java, if I start typing the name of a variable, it'll give me a list of possible names and pressing enter will automatically fill out the top on the list.

When I using Intellij for Javascript or Typescript, the list will still show up, but pressing space or enter doesn't complete the word, instead it just inserts a new line.

This works for Java even without the "Insert selected variant by typing dot, space, etc.." option. If the option is chosen, code completion becomes more like live templates rather than just completing the word. Even if I have this option chosen, the word completion doesn't activate for Javascript.


I have tried default settings, and the problem occurs.

To reproduce, just try to edit a JS file and press enter when the dropdown list occurs


Hello Alex,

Try to change "Preselect the first suggestion" method in "Settings | Editor | Code Completion" from 'Smart' to 'Always'.  

Yaroslav Bedrov.


Ah, it wasn't selected. That worked, Thanks!


Please sign in to leave a comment.