Importing code style formatting settings into eclipse from intellij-idea

本小妞迷上赌 提交于 2020-04-08 09:30:35

问题


I've recently implemented the maven Check style plugging into my project and have changed all of the formater Settings in intellij (Which I use) to conform to this style guide (which they now do).

However I need to produce a settings .xml file for eclipse, so that my colleagues can automatically format there code so that it also conforms to this style guide.

The problem I am finding is that I cannot see a way of exporting the settings from intellij and importing them into eclipse. and I cannot manually configure eclipse to conform with the nuances of the new style guide (Continuation indentation being the main problem).

Any help or Ideas would be fantastic. :)


回答1:


I couldn't find a ready plugin for that. So here is a side by side code style configuration from UI perspective of Intellij IDEA 2017.3 and Eclipse OXYGEN.3 March 2018. If both configured this way the code will be formatted close enough, so for example github will show you code differences so that it make sense.

For our project we configured one XML for each IDE so they more or less match:

  • IntelliJ Config File is default of IDEA 2017.3 so not much to define in XML - enter link description here
  • Eclipse Config is modified a bit from the default to match IntelliJ - link
  • Here is also a PDF file to show all the options set in both IDEs side by side - link



回答2:


You can export settings in Intellij by clicking on File > Export Settings but they will be in .jar format.

According to this thread there is no easy way of importing settings.jar into eclipse.

Eclipse - import code format settings

I hope this helps :)



来源:https://stackoverflow.com/questions/36432438/importing-code-style-formatting-settings-into-eclipse-from-intellij-idea

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!