eclipse设置代码模板和格式


该设置可以在保存文件时自动根据模板调整代码格式。

首先准备华为代码格式化文件:

FEFO-Formatter.xml

FEFO-codetemplates.xml

设置格式
Preferences-Java-Code Style-Formatter,右侧Import...FEFO-Formatter.xml文件
设置模板
Preferences-Java-Code Style-Code Templates,右侧Import...FEFO-codetemplates.xml文件
设置保存动作
Preferences-Java-Editor-Save Actions
右侧勾选以下选线:
Perform the selected actions on save Format source code Format all lines Organize imports



 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM