Salil Surendran
Salil Surendran

Reputation: 2335

Autocomplete parenthesis around a variable in IntelliJ


Consider I have a statement like this in IntelliJ:

String spaces = "I have spaces";     
System.out.println(spaces)

I want to change the code to :

String spaces = "I have spaces";     
System.out.println(StringUtility.removeSpaces(spaces));

When I use IntelliJ autocomplete it auto-completes removeSpaces() for me but puts the variable spaces outside the parenthesis.

String spaces = "I have spaces";     
System.out.println(StringUtility.removeSpaces()spaces);

Any way to make it autocomplete with spaces inside as intended?

Upvotes: 0

Views: 596

Answers (1)

Bas Leijdekkers
Bas Leijdekkers

Reputation: 26462

Use the opening parenthesis ( to complete the auto-completion. You'll end up with:

String spaces = "I have spaces";     
System.out.println(StringUtility.removeSpaces(spaces);

Then use Complete Current Statement CommandShiftEnter to fix the closing parenthesis.

Upvotes: 3

Related Questions