Eclipse Code Formatter for IDEA plugin configuration

The formatting results of Eclipse and Intellij idea are different, resulting in two development tools for a long time, idea developing eclipse for formatting. But now this problem can be solved. Use Eclipse Code Formatter.

1. Install the plugin:

Hard disk installation: Setting =>Plugins=>Install plugin from disk, select Download and go to the downloaded installation package [EclipseFormatter.zip] to install, it will take effect after restarting;

2. Configure the plugin:

Select Setting =>Other Settings =>Eclipse Code Formatter, check Use the Eclipse-code-formatter, and select the code-style.xml file used by Eclipse in the Eclipse  Java  Formatter config file, this option will determine the way to format the code. Then select the Java  formatter profile as the file you just imported. At the same time, the From File that configures the Import order is also the code-style.xml file used by Eclipse. This option will determine the way to organize the import area.

3. Use plugins

Use Intellij's formatting shortcut "Ctrl+ALT+L" to format. If there is an error, it will output a prompt to the Event Log. If you see 'xxx formatted sucessfully by Eclipse code formatter', it means the formatting is successful!

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326507423&siteId=291194637