简体   繁体   English

如何在Eclipse中配置自动格式设置?

[英]How do I configure autoformatting in Eclipse?

I dislike how auto format messes up empty cycle body, like: 我不喜欢自动格式化如何弄乱空的循环主体,例如:

Before 之前

for (int i = 0; isTest(i); i++); 

After

for (int i = 0; isTest(i); i++)
    ;

How to configure eclipse not to do this? 如何配置eclipse不这样做?

Go to Windows -> Preferences , and in the options table select Java -> Code Style -> Formatter , then configure to your hearts content. 转到Windows - > 首选项 ,并在选项表中选择Java - > 代码样式 - > 格式化 ,然后配置你的心内容。

For future reference, in the Preferences menu you can just type in a search term to find all options for that term - so just going onto the Preferences menu and typing "format" will show you all options 为了将来参考,您可以在“ 首选项”菜单中键入搜索词以查找该词的所有选项-因此,只需进入“ 首选项”菜单并输入“格式”即可显示所有选项

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM