Reputation: 7343
Coming from a language like python, I often forget to wrap parenthesis around if
conditions when writing Java.
Is there a parenthesis completer built into IntelliJ? If not, how do I best work around this issue? (short of manually wrapping with parenthesis myself -:))
Upvotes: 0
Views: 338
Reputation: 1709
if
code completion will ocurs. Push enter - your carret will land inside bracket.Surround With
option (on windows/linux by default it is Ctrl + Alt + T
) and choose if(expr)
.
Or if you want to only surround with paranthesis, then use (Surround With) and then choose (Curly Braces).ifn
which will initialize if block with comparison to null. You can also configure your own template.Also you might want to check if this option is selected in your IDE:
Settings(Preferences) | Editor | General | Smart Keys, Surround selection on typing quote or brace
Upvotes: 1