IntelliJ shortcut to define variables matching the method call

Viewed 17

I frequently find myself in a situtation where I want to call a method which takes numerous arguments and I want these arguments to be defined as local variables.

Let's say I have:

class MyService { 
  MyService(String arg1, Integer arg2, Long arg3) { }
}

now I type:

new MyService(

and I want Intellij to generate:

String arg1 = null;
Integer arg2 = null;
Long arg3 = null;
new MyService(arg1, arg2, arg3);

Is there a way how this can be done in IntelliJ?

0 Answers
Related