Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i make intellij select the code completion suggestion without me having to navigate to it?

I am using IntelliJ IDEA 15.0.6 with the Ruby plugin.

I noticed that when i write in java, the code completion popup automatically highlights the first suggestion like so - selected

this allows me to just press "enter" in order to complete the word and continue.

when i write in ruby, however, no suggestion is selected, like so - not selected

this makes it so that i have to navigate with the arrow keys in order to pick a suggestion before i can hit "enter".

i tried digging deep in the preferences and all over the internet, but i can't seem to find out why this is happening. i tried adding the option "insert selected variant by typing dot, space, etc.", but it doesn't work because there is no "selected variant"

i know this sounds small, but it's cutting off my workflow horribly, and i believe there are others out there who would like to know how to do this.

thanks to anyone who can help

like image 421
BelgishChoko Avatar asked May 31 '16 14:05

BelgishChoko


People also ask

What should you type to open up the autocomplete menu while you code?

Enabling/Disabling Auto-complete While typing your code in the editor: Press CTRL + Space key to trigger the auto-complete pop-up menu manually.

Why is IntelliJ autocomplete not working?

I have tried the following according to this thread (Intellij IDEA CE 12 Android XML Code Completion not working): Go to File->Power Save Mode and disable it - it is off. Go to Preferences->Editor->Code Completion and check Autopopup code completion - this has been checked. Go to File->Invalidate Caches and restart.

What feature in IntelliJ and even in other IDE that allows the program to provide suggestions in completing a statement in Java?

Intelligent code completion IntelliJ IDEA provides context-sensitive code completion, offering you suggestions that are only valid for the current caret position. You don't need to use any shortcuts or configure additional settings; code completion will start as soon as you begin typing your code in the editor.


1 Answers

Thanks to Eugen Martynov's comment, i found jetbrains' bug tracker site, where there i found an issue exactly like mine. click here to see the issue entry

to make it short, the answer is as follows:

  1. open "search everywhere" (double shift) registry action

  2. search for "registry" and choose the one under "Actions" this will open a new window. enter image description here

  3. here look for the key ide.completion.lookup.element.preselect.depends.on.context and uncheck its box. enter image description here

after the box has been unchecked code completion will select the first suggestion before user navigation.

Thanks again to Eugen for your help

like image 166
BelgishChoko Avatar answered Oct 23 '22 04:10

BelgishChoko