Eclipse - 导入代码格式设置 [英] Eclipse - import code format settings
问题描述
您好我正在使用intellij,我按照以下步骤添加了代码设置jar:
Hi I was using intellij where I added code setting jar by following steps:
导入设置然后指向此JAR。然后右键单击模块并执行重新格式化代码
Import Settings and then point to this JAR. Then right click on the module and do "Reformat Code"
但现在我在eclipse中使用相同的项目。如何在clipse和格式代码中使用上面的设置jar?
But now I am using same project in eclipse. How can I use above setting jar in clipse and format code ?
推荐答案
除了@Dmitry Durkin的回答。
In addition to @Dmitry Durkin answer.
您必须手动创建新的格式化程序(和/或清理)配置文件,该配置文件与<$中的一对一设置相匹配C $ C> settings.jar 。希望eclipse提供所有一对一的映射。花费不多的时间。
You have to manually create new formatter(and/or clean up) profile which matches the one to one settings inside settings.jar
. Hoping eclipse provides all the one to one mapping. Not take much time.
在eclipse中转到窗口>首
。导航到 Java>代码风格>格式化器
。这里创建一个与settings.jar中的设置匹配的新格式化程序。
In eclipse go to Window > Preferences
. Navigate to Java > Code style > Formatter
. Here create new formatter which matches the settings in settings.jar.
使用这个新的格式化程序配置文件在 Java>中创建新的清理配置文件。代码风格>清理
以获取其他设置,例如删除尾随空格
等。
Use this new formatter profile to create new clean up profile in Java > Code style > Cleanup
for additional settings like Removing trailing spaces
etc.
右键单击您的项目(s)并转到来源>清理
或来源>格式
。一次性清理/格式化所有项目。
Right click on your project(s) and go to Source > Clean up
or Source > Format
. To clean up/format all your project(s) in one go.
这篇关于Eclipse - 导入代码格式设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!