Eclipse如何重构变量名?

Ben*_*Ben 8 java eclipse plugins refactoring

在我15年的Java项目中,标准Java约定不受尊重,变量名的第一个字母通常大写.

我想将我的项目重构为小写的变量名首字母,特别是在方法签名中:

public void creerProfil(String CodeProfil, Profil ProfilACreer) throws Exception {
...
}
Run Code Online (Sandbox Code Playgroud)

应该 :

public void creerProfil(String codeProfil, Profil profilACreer) throws Exception {
...
}
Run Code Online (Sandbox Code Playgroud)

如果您对插件有任何想法可以做到这一点,我会很高兴听到它:)

Viv*_*ngh 15

如果你在windows/ubuntu平台上使用alt+shift+R或在mac上使用command+option+r.它将重构使用变量的所有事件.

要获取eclipse中可用的快捷方式列表,请ctrl+shift+L在windows/ubuntu和command+shift+lmac中使用.


MrD*_*umb 6

您还可以在 Eclipse 中按 Alt+Shift+R 来重构变量。


Lui*_*ese 5

不需要插件,右键单击变量名称,然后“重构”->“重命名”。不过,以前没有尝试过,不知道它在整个项目中的可靠性如何。