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

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

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

 

版权声明:本文为xyhero原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/xyhero/p/90f7867f5e910072ee30b4a8e3fc95e1.html