Eclipse Code Formatter

Compatible with all products except MPS
08.09.2016
730 704
Allows using Eclipse's code formatter directly from IntelliJ.
Solves the problem of maintaining a common code style in team environments where both IDEA and Eclipse are used.

Go to https://github.com/krasa/EclipseCodeFormatter#instructions for instructions how to use it.

Currently supports formatting of
-Java (bundled Eclipse 4.6 (requires JRE 1.8) and 4.4 libs, also emulates Eclipse's imports optimizing, configurable external Eclipse location for Eclipse 4.5+)
-C/C++ (Eclipse 4.6 (requires JRE 1.7))
-JavaScript (Eclipse 4.4)
-GWT (Eclipse 4.4)

Small donations are welcomed.

Download plugin

Version

Update date

Recent change notes


16.0 (2016-09-07)
- disabled asserts
15.9 (2016-08-29)
- bundled formatters from Eclipse 4.6 - requires JDK 1.8
- Import order fix for inner classes
- bundled formatters from Eclipse 4.6
- support for installation location in a default plugins folder
15.8 (2016-07-16)
- Another import order fix
15.7 (2016-07-01)
- Import order fix
15.6 (2016-06-10)
- configuration enabled for default project
- external Eclipse location fix for IJ 13
- import order edge case fixed
15.5 (2016-05-06)
- upgraded C, Java formatter from Eclipse 4.5.2
- installed Eclipse (4.5+) can be chosen to format Java code
- added new import ordering implementation to match Eclipse 4.5.2
- fixed: editor tab changes to blue when there's no changes after format
- repacked and compressed jars to reduce size
- settings scrollbar fixed
15.4 (2016-01-25)
- upgraded C, Java formatter from Eclipse Mars (4.5.1) - requires JRE 1.7
- fixed settings form for new IJ 15, 16
15.3 (2015-11-19)
- upgraded Java formatter from Eclipse Mars SR1 (4.5.1) - requires JRE 1.7
15.2.x.2 (2015-08-13)
- IndexOutOfBoundsException fix
15.2 (2015-08-07)
- fixed cursor jumping after formatting
- probably fixed 'Attempt to modify PSI for non-committed Document!' after import optimizing
- disabled info notification popups
15.1 (2015-07-21)
- C/C++ support - requires to run IDE with JRE 1.7, matched for file types defined in: 'Settings | Editor | File Types' with 'C++' name
- better matching of JS file types
- upgraded Java formatter from Eclipse Mars 4.5 - requires JRE 1.7
- configurable use of the old Java formatter from Eclipse 4.4 - requires JRE 1.6
15.0 (2015-06-22)
- new IJ 15 API
14.9 (2015-06-15)
- fixed reformat for 'only VCS changed text'
14.8 (2015-01-29)
- fixed jsp import optimizing
14.7 (2014-12-02)
- exception fix for Android Studio
14.6 (2014-11-05)
- libs from Eclipse 4.4.1
- configurable formatting for Live Templates (default off)
14.5 (2014-10-22)
- fixed notifications settings for IJ 14
- import optimizing fix
- settings scroll pane added
14.4 (2014-09-12)
- Live templates formatting fix
14.3 (2014-09-11)
- StringIndexOutOfBoundsException when formatting during commit
14.2 (2014-07-16)
- java formatter from Eclipse 4.4 - supports Java 1.8
- language level used for formatting is loaded from project settings
14.1 (2014-04-08)
- persisting of project specific enabling/disabling of the formatter
14.0 (2014-03-31)
- project specific enabling/disabling of the formatter
13.0.1.1 (2014-01-15)
- error handling
4.1.0 (2013-11-24)
- Updated libs for Java formatting to Eclipse 4.3.1
4.0.0 (2013-11-22)
- Proper Import Optimizer integration, it is no longer true that IntelliJ's Import Optimizing must be turned off, quite the opposite.
- Hard-coded using of language level to 1.7 if configured lower in eclipse settings file, to be more user friendly.
3.9.0 (2013-11-21)
- IJ 13 API changes
3.8.1 (2013-10-17)
- better error messages.
3.8.0 (2013-10-15)
- format "Only VCS changed text" fixed
3.7.0 (2013-08-07)
- fix for custom static imports order
- settings validations
3.6.0 (2013-04-22)
- import order fix - issue #44
...
0.1 (2011-11-01)
- Initial release

General usage instructions

meo
05.05.2016
rhygon: create another profile in settings, or report a bug on github
04.05.2016
When using multiple android studio projects, on the same machine, which require different paths to different code formatting files, when opening a different project, the eclipse code formatter remembers the path in the last project and tries to update the misc.xml file.
Anonymous
11.12.2015
Saved me from learning to use Eclipse again!
21.05.2015
Love it
meo
05.05.2015
@dorongold You're most welcome. I usually just run the inspection on the whole project and fix everything with one click.
05.05.2015
@meo, thanks for asking for the 'final' feature on intellij-plugin-save-actions. I hope it gets implemented soon. Regarding your comment about intellij's inspection for 'final', Such inspection indeed exists, and I already use it. But the inspection only highlights variables that can be declared final, it doesn't actually add the 'final' modifier. To add the modifier I have to go to every place in the code where I see the inspection highlighting a variable and click alt+enter (Quick-fix). Thanks again for eclipse code formatter. It's an awesome plugin! And it's great that you keep it constantly updated.
meo
03.05.2015
Thanks! IntelliJ has inspections for adding 'final' so it should be possible, unfortunately I do not have time to implement it, and it seems like a good feature for: https://github.com/dubreuia/intellij-plugin-save-actions so I would suggest to create an issue there.
Anonymous
03.05.2015
Great Plugin! I miss only one thing: I need Intellij to add the 'final' modifier everywhere possible. similar to Eclipse's: "Use modifier 'final' where possible" under "Save Actions". Is this somehow possible?
Anonymous
21.07.2014
I love it so much
Anonymous
15.07.2014
IntelliJ Community doesn't support JS formatting. With this plugin I was able to configure formatter for JS files based on eclipse file format. Thanks a lot!
meo
07.07.2014
I will try to find some time for it...
Anonymous
03.07.2014
love it, but it stopped working when I switched to java 8!? Any update on when this compatibility will be available?
meo
13.06.2014
It actually only complements to this plugin. This plugin works with 13.1, see "Since Build" and "Until Build" columns.
Please  sign in  to leave a comment.