没有人创建Java code格式化个人资料的Eclipse IDE,符合了Android code样式规则?样式、规则、个人资料、Java

2023-09-04 23:47:27 作者:钟晚

定义的Android code样式规则的Andr​​oid code风格指南 为了符合这些规则之一必须改变相当多的Java的code格式化的设置(窗口 - > preferences->爪哇 - > code风格 - >格式化程序)的默认配置文件(在Eclipse IDE )。

有没有人管理,配置格式化遵循Android的code样式规则了吗? 如果是,请导出格式化程序配置文件和发布要使用的社区。

PS:我试图做到这一点我自己,但我发现有太多的格式可供选择,其中大部分都没有code风格指南中提到的: - (

解决方案

有pre制格式可从的平台/ development.git 库( GitHub上镜,在文件夹/ide/eclipse).

所以,你可以简单地导入android-formatting.xml和android.importorder提到这里。

Android Code Style Guide defines "Android Code Style Rules". To conform to these rules one have to change quite a number of settings of the Java Code Formatter (Window->Preferences->Java->Code Style->Formatter) default profile (in Eclipse IDE).

Java on Visual Studio Code的更新 – 2021年7月

Did anyone manage to configure the formatter to follow the "Android Code Style Rules" already? If yes, please export the Formatter profile and publish to be used by community.

PS: I've tried to do this myself but I've found that there are too many formatter options available, and most of them are not mentioned in the Code Style Guide :-(

解决方案

There are pre-made formatter rules available from the platform/development.git repository (GitHub mirror, in folder /ide/eclipse).

So you can simply import android-formatting.xml and android.importorder as mentioned here.