Can IntelliJ IDEA automatically fill the method call with variables?

Mateusz :

Can IntelliJ IDEA automatically fill the method call with variables?

Possibly using the names which are based on the names of the parameters of the method which is called and even also with possibility to extract those variables as parameters of the current method?

See the screenshots below for reference.

Before: IntelliJ knows what are the names of the parameters of the method which is being called. Before

After: IntelliJ created properly named variables for us. enter image description here

With automatic extracting of all parameters: IntellJ can automatically extract these variables to be parameters of the current method. enter image description here

lena :

It should work if there are the local variables with the same name exist in context:

enter image description here

See also IDEABKL-6690, IDEABKL-5496 requests. You can also try Smart Completion: https://www.jetbrains.com/help/idea/auto-completing-code.html#smart_completion.

There is a custom plugin that seems to do the thing - https://plugins.jetbrains.com/plugin/8638-auto-filling-java-call-arguments. You can give it a try

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=158855&siteId=1