like in eclipse, if you wrote a for loop like this:
for (name : names)
eclipse auto complete would let you add the type, so you'll get:
for (String name : names)
is there a similar feature in IntelliJ?
normal auto complete CTRL+SHIFT+SPACE or CTRL+SPACE aren't working.
Invoke basic completion By default, IntelliJ IDEA displays the code completion popup automatically as you type. If automatic completion is disabled, press Ctrl+Space or choose Code | Code Completion | Basic from the main menu.
Configure completion options Press Ctrl+Alt+S to open the IDE settings and select Editor | General | Code Completion. To automatically display the suggestions list, select the Show suggestions as you type checkbox.
Intelligent code completion uses an automatically generated in-memory database of classes, variable names, and other constructs that given computer code defines or references.
I'm not familiar with the equivalent eclipse feature, but the closest thing I can think of (or alternative solution) is to use postfix completion.
if you type
names.for
and select the first suggestion, it will auto-expand into
for (Object name : names) {
}
and it will automatically add the type of name for you, based on what the collection type of names is.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With