Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import IntelliJ formatter options into eclipse?

I'm the only one using eclipse in an all-IntelliJ team. Is there any way I can have eclipse format the code with the same style as the default IntelliJ formatter does, without having to manually adapt everything?

Something like the opposite to the IntelliJ eclipse formatter plugin

like image 571
Matt Avatar asked Nov 05 '13 14:11

Matt


People also ask

How do I import code formatter XML into Eclipse?

Exporting and Importing Code Templates To import a code template: Click Import to open the "Import Templates" browser. Select the relevant XML file containing the template information. Click Open.

How do I use IntelliJ formatter?

In the editor, select a code fragment you want to reformat. Before reformatting, you can take a look at the code style settings that are applied to the selected code: press Alt+Enter and click Adjust code style settings. From the main menu, select Code | Reformat Code or press Ctrl+Alt+L .


1 Answers

This subject has come up many times over the years in the IntelliJ IDEA forums. Having common code formatting definitions is probably one of the biggest sticking points in a poly-IDE environment. There is not a way to go from IDEA formatting rules to Eclipse formatting rules. Since IDEA users tend to be in the minority in groups, there tends to be a "if you want to use the odd ball IDE (i.e. IntelliJ IDEA), then you have to deal with keeping things in sync". Thus the availability of the IntelliJ eclipse formatter plugin you mention, but not the other way around.

like image 116
Javaru Avatar answered Sep 18 '22 06:09

Javaru