How to infer and complete variable type with Intellij IDEA
I have found the IntelliJ Postfix Code Completion very useful and powerful.
In your case you could do like this:
Create your expression without any variable
Start typing
.var
at the end of the expression and you will get a context menu withvar
as a selectable item. Press Enter and a new variable will be created for you:
For Windows
Use Ctrl+Alt+V to create variable (as it says here)
For Mac OS
Use ⌘+⌥+V