在Eclipse中重新格式化代码样式 [英] Reformat code style in Eclipse
问题描述
我在eclipse中寻找一种自动的方式,将大括号重新格式化为K& R风格,消除单个语句的大括号,如果是这样的方式?
在重新格式化之前,您需要自定义首选项对话框中的格式化程序设置
首选项对话框已打开(默认设置)。如果默认设置不符合您的要求,请将Java /代码样式/格式化添加到您的K&从主菜单/窗口/首选项
您甚至可以配置保存操作 Java / / Save Action
以保存时格式化源代码。
I'm looking for an automatic way in eclipse to reformat curly braces to K&R style, eliminating braces for single statements if, etc. Is there such a way?
Thanks.
Before you reformat you need to customize the formatter settings in the Preferences Dialog Java/ Code Style / Formatter
to your K&R settings if the default settings don't match your requirements.
The Preferences Dialog is opened from Mainmenu / Window / Preferences
You can even configure a save action Java / Editor / Save Action
to format source code on save.
这篇关于在Eclipse中重新格式化代码样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!