Reputation: 3517
In Visual Studio 2012 I can type something like aString = ''
. This variable hasn't been declared as yet and by pressing ctrl + .
the IDE is wonderful enough to create a private datamenber named aString of type String.
Is there a feature that mirrors this in IntelliJ?
I found an option for auto inserting methods on https://www.jetbrains.com/idea/features/code_assistance.html but couldn't find anything relating to private fields.
I don't have access to the IDE at the moment before anyone suggests the obvious :)
Upvotes: 3
Views: 1002
Reputation: 48075
Another way of doing it is by first typing only ""
and then .var
.
This is called Postfix Code Completion and is very useful. There are lots of other completions other than the .var
one. I often use the .cast
postfix completion for example.
Use it like this:
Then you just start typing the name of your variable:
And finally there it is your complete line:
Upvotes: 3
Reputation: 2884
Absolutely.
If you write aString = "" and you click alt-enter you'll get an option to create a field (private by default) for it along with several other options.
Upvotes: 3