本文介绍了IntelliJ IDEA可以自动使用变量填充方法调用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

IntelliJ IDEA可以自动使用变量填充方法调用吗?

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.

之前:IntelliJ知道所调用方法的参数名称是什么.

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

之后:IntelliJ为我们创建了正确命名的变量.

After: IntelliJ created properly named variables for us.

自动提取所有参数:IntellJ可以自动将这些变量提取为当前方法的参数.

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

推荐答案

如果上下文中存在具有相同名称的局部变量,则该方法应该起作用:

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

另请参见 IDEABKL-6690 IDEABKL-5496 请求.您还可以尝试智能完成:https://www.jetbrains.com/help/idea/auto-completing-code.html#smart_completion .

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.

有一个自定义插件似乎可以解决问题- https://plugins.jetbrains.com/plugin/8638-auto-filling-java-call-arguments .您可以尝试一下

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

这篇关于IntelliJ IDEA可以自动使用变量填充方法调用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 15:10