我的很多同事都喜欢留下注释掉的代码,如何使 Eclipse Formatter 不破坏该代码的格式(现在它会生成一个大块或 block )。
附:我知道我可以以某种方式将格式化程序配置为忽略该代码,我做过一次,但我不记得如何了。
最佳答案
在 Eclipse Formatter Settings (Preferences/Java/Code Style/Formatter) 选项卡中的 Comments 取消选中复选框“Enable Block Comment Formatting”和“Enable Line Comment Formatting”这些都应该被禁用。
https://stackoverflow.com/questions/4606699/