How to Export Code Formatting Configurations to Eclipse

Answered

Some of my team members use IntelliJ IDEA and Eclipse. I find IntelliJ code formatting to be better than eclipse. Is there a way I can export the configuration to be imported into eclipse ?

6 comments

No, the only way to have common formatting between IntelliJ IDEA and Eclipse is to use the third-party Eclipse formatter plug-in that will apply Eclipse formatting in IntelliJ IDEA. There is no way to get the opposite.

Slightly related feature request: https://youtrack.jetbrains.com/issue/IDEA-149529.

As there is Eclipse Code formatter for IntelliJ IDEA, maybe it would make sense to promote creating IDEA Code Formatter plug-in for Eclipse?

0

Thanks Serge.

I tried to use Eclipse Code Formatter plug-in. But there are certain rules that are part of Eclipse code cleanup not being carried over to formatting section of IntelliJ. Like forcing curly braces for if/else. I want to be able to override this rule in IntelliJ but apparently it picks only any settings that are set as part of the plug-in. Is it possible to override the plug-in's settings ?

Also I see an option to import eclipse xml in the IntelliJ formatter options window. I'm confused why we need the third party plug-in when IntelliJ can import.

0

Importing Eclipse code style will convert supported options to IDEA formatter. Using the third-party Eclipse formatter plug-in invokes the same formatting engine as used in Eclipse which can support more options and provides exactly the same results as in Eclipse. If you can't find certain options, please contact the plug-in maintainer for help.

0

Is it possible to override options set by the third-party plugins in IntelliJ ? 

0

The question is too generic. What options you want to override and why? I guess it would depend on the plugin implementation, so you'd better ask the developer of this plug-in.

0

I want to see if it is possible to override forcing if/else curly braces by IntellIiJ, besides what the Eclipse Formatter plugin does. Like once the eclipse formatter finishes its job, run just this one rule from IntelliJ in IntelliJ's way.

I'll try contacting the plug-in developer. Thank you for the quick responses. Appreciate that.

0

Please sign in to leave a comment.