Hacker News new | ask | show | jobs
by Insanity 3031 days ago
It's one of the things I really missed when going from C# to Java, but with IntelliJ, the typing experience is very similar from C#.

Imagine I want to have a variable like:

     Person p = new Person("John");
All I would type in IntelliJ is:

     new Person("John").var
After pressing "tab", that will autocomplete for me and put the focus on the variable name so I can rename it from the default inferred value.
2 comments

Also you can use "introduce variable" refactoring (ctrl+alt+V in Windows). Type "new Person("John")" and immediately press ctrl+alt+v.
Indeed, but for me that feels less natural. Matter of taste I suppose :-)
Don't most decent IDEs support something like that? In Eclipse you can just type

    new Person("John")
And then hit Ctrl-2 L.
Very well possible, but I'm not familiar with key combinations for other (Java) IDEs.