eclipse代码规范需要调整的选项
文章目录
Code Style
Window->Prefrerence->Java->Code Style->Formatter
- 这个根据自己需要调整
保存时行为
Window->Prefrerence->Java->Editor->Save Actions
- 首先激活“Perform the selected actions on save”
- 仅仅选择"Organize imports"和"Additional actions"
- 点击“Configure”,打开新的对话框
- Code Organizing -> Remove trailing whitespaces -> All lines
- Code Style -> Variable declarations -> 全部选中
- Missing Code -> 去掉对'@Deprecated'的选择
- 点击OK
显式地显示空白字符
Window->Preferences->General->Editors->Text Editors->Show whitespace characters
用space代替tab
Window -> Preferences -> XML -> XML Files -> Editor,选择Indent using spaces,然后indentation size选择4
Window -> Preferences -> General -> Editors -> Text Editors,选择Insert spaces for tabs,Displayed tab width选择4
编码,Windows需特别注意
Window -> Preferences -> General -> Workspace -> Text file encoding,选择Other -> UTF-8

评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论