如何在Eclipse中配置自动格式化? [英] How do I configure autoformatting in Eclipse?

查看:218
本文介绍了如何在Eclipse中配置自动格式化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不喜欢自动格式如何混乱空循环体,如:



之前



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





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

如何配置eclipse不这样做?

解决方案

转到 Windows - > 首选项,在选项表中选择 Java - > >首选项菜单,您可以输入搜索字词来查找该词条的所有选项,因此只需进入首选项菜单并输入格式即可显示所有选项


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?

解决方案

Go to Windows -> Preferences, and in the options table select Java -> Code Style -> Formatter, then configure to your hearts content.

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

这篇关于如何在Eclipse中配置自动格式化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆