在 Eclipse 中,如果你有一个方法:
String MyObject.getValue();
使用此功能时,您可以:
MyObject.getValue();
If you cursor is on the line and you hit CTRL + 1 you get a context menu to 'assign a new local variable', resulting in the following:
String value = MyObject.getValue();
你能在 IntelliJ 中轻松做到这一点吗?我在网上搜索过但没有成功。
Yep! This is the Introduce Variable http://www.jetbrains.com/idea/features/refactoring.html#Introduce_Variable refactoring. By default, select some text, and then hit Ctrl + Alt + V (for Mac: ⌘+⌥+V). If the expression is incomplete or invalid, IntelliJ will still make a good guess about what you meant and try to fix it for you.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)