In IntelliJ, I have the inspection that checks for variables that can be made final
turned on so that IntelliJ will highlight those variables and let me quickly add the final
keyword with Alt + Enter.
当我打开通常不使用的其他人的代码时final
关键字,我想要一个快速添加的方法final
如果可能的话,可以覆盖整个文件甚至整个项目的所有变量。
在 IntelliJ 中是否有任何快捷方式或其他方法可以轻松做到这一点?
谢谢至@Mzf https://stackoverflow.com/questions/42283791/intellij-make-all-variables-final-that-can-be/42285289#comment71724617_42283791为了link https://intellij-support.jetbrains.com/hc/en-us/community/posts/206886125-Applying-Suggested-to-the-whole-File!
从那篇文章:
You can achieve this in the current file using the typical Alt + Enter shortcut when hovering over one such variable that can be made final
, press →, and select "Fix all 'Local variable or parameter can be final' problems in file".
该子菜单中的下一项是“运行检查...”,这将允许您将修复应用到项目中的多个文件。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)