External Code Formatter

Compatible with  IntelliJ IDEA
5 736
Allows using external code formatters, especially Eclipse's code formatter, as well as any command line code formatting tools, from within IntelliJ IDEA. Solves the problem of maintaining a common code style in team environments where both IDEA and Eclipse are used.

Download plugin

Recent change notes

1.0.4 (2009-11-04)
- Compatible with IDEA 9

1.0.3 (2009-06-23)
- Fixed Eclipse code formatter on non-Windows platforms

1.0.2 (2009-02-14)
- Compatible with IDEA 8

1.0.1 (2008-01-22)
- Fixed a file cache issue: When a file was reformatted more than once, the changes between the reformats were lost.

1.0.0 (2007-12-21)
- Minor refactorings

0.5.0 (2007-12-19)
- Support for Undo (Ctrl+Z)
- Help documentation for using a custom code formatter

0.4.0 (2007-12-14)
- Support for any code formatter which has a command line interface

0.3.0 (2007-12-12)
- Improved performance: Reformats all selected files by starting Eclipse only once

0.2.0 (2007-12-11)
- Added help documentation
- Added program icons
- Switched development platform to IDEA 7.0 and JDK 1.5 for maximum compatibility

0.1.0 (2007-12-05)
- Initial release

Known issues
- Does not support reformatting a selection within a file. Implementation of this feature is not planned, until there is a code formatting tool (executable on the command line) which supports reformatting a text range.

General usage instructions

When enabled, this plugin replaces IDEA's built-in code formatter transparently. If the selected code formatter does not support a file type, or you try to reformat a text selection, the plugin will automatically fall back to using IDEA's built-in code formatter.

Click "Help" in the plugin's settings dialog for instructions. You must have Eclipse 3.2 or later installed to use the Eclipse code formatter. Any other command line code formatting tool can also be used.
I have to recommend my plugin Eclipse Code formatter http://plugins.intellij.net/plugin/?idea&id=6546

It formattes directly from IntelliJ.
This website can develop you to manage plugins from your IDE.Help you find more plugin information.Auto used parts in chicago also help consumer contented of its good quality products..http://www.northshoretowinginc.com/auto-wrecking-services/auto-parts
Not compatible with v 10.x
This plugin gets the job done once you've configured Eclipse correctly.
I also had the problem where it wouldn't format my files according to the eclipse formatting preferences, but I got it solved. This it what you have to do to get the plugin working correctly:
1. Make sure the following setting is enabled on the Eclipse project: Right click on the project in Eclipse --> Properties --> Formatter --> "Enable project specific settings". When this setting is enabled, the "workspace\yourProject\.settings\org.eclipse.jdt.core.prefs" file will be filled up with the formatter preferences.
2. Once you've done this, you can configure the plugin in Intellij according to the examples giving in the configuration window.

The downside of this plugin is that it takes some time to format a file compared to the build-in formatter and it also shows an eclipse splash screen. So I only use it right before I do a commit to SVN.

Thanks for creating this plugin!
Is there really no way of doing this without having to have eclipse installed?
Somehow convert the eclipse profile xml into IDEA's format?

I could use this feature for the current project I'm working on, but I am NOT installing eclipse just to get this plugin working. What an overhead...
Installed for community edition(Windows). It doesn't format code according to project-selected formatting style. My guess is that it formats using the default style. And BTW flashing Eclipse and command line window is also "no fun".
Today I installed the plugin for use with the IDEA9 Community Edition and it works great! Many thanks to ORFJackal and also to jaikiran for making it work with IDEA9.


As per this reply on the IDEA forum thread http://www.jetbrains.net/devnet/message/5247929#5248005 ,using the until-build is not recommended. So i am going to remove that attribute from the plugin.xml and commit it (to the forked repo), unless of-course you think otherwise.
I have now got this working locally. Just had to change the "until-build" number in the plugin.xml. However, i don't like the new build numbers as i explain here http://www.jetbrains.net/devnet/message/5247929#5247929

So the fix would either be to remove the until-build attribute from the plugin.xml (which i don't think is a great idea - but i don't know the best practices around this) or wait for someone from the IDEA team to comment on what is the correct upper limit for the build number against IDEA9.
Thanks for being responsive :) I'll take a look at it this week and report back here.
I'm hoping that somebody would pick up this project, as my time is limited. Anybody can fork the project at http://github.com/orfjackal/extformatter and make the necessary changes and then notify me about it.

The plugin API should not have changed much between IDEA 8 and 9, so it might be enough to just change the range of compatible build numbers and then test that it works.
I downloaded the community edition of IDEA (version 9.0 Beta) and tried using the latest 1.0.3 version of this plugin against it. However, it complains that it's not compatible with the version of IDEA. Admittedly, this plugin was meant for 8.x version of IDEA, so are there any plans to make it compatible with the community edition?

I posted about this in the IDEA forums http://www.jetbrains.net/devnet/thread/284308?tstart=30, but haven't seen any reply yet. So i thought this would be a better place to ask.
Thanks for your update. I tested on the ubuntu with intellij8.1. It works!
Same as in previous post - it doesn't work under linux
On linux, I got the following exceptions -
java.io.IOException: Cannot run program ""/home/myhomedirectory/installfiles/eclipse/eclipse"": java.io.IOException: error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:459)
at java.lang.Runtime.exec(Runtime.java:593)
at java.lang.Runtime.exec(Runtime.java:431)
at java.lang.Runtime.exec(Runtime.java:328)
at net.orfjackal.extformatter.ExecuterImpl.execute(ExecuterImpl.java:46)
at net.orfjackal.extformatter.EclipseCodeFormatter.reformatMany(EclipseCodeFormatter.java:70)
at net.orfjackal.extformatter.OptimizingReformatQueue.useReformatMany(OptimizingReformatQueue.java:82)
at net.orfjackal.extformatter.OptimizingReformatQueue.flush(OptimizingReformatQueue.java:59)
at net.orfjackal.extformatter.plugin.ExternalizedCodeStyleManager.reformatOptimally(ExternalizedCodeStyleManager.java:134)
at net.orfjackal.extformatter.plugin.ExternalizedCodeStyleManager.reformatWithUndoSupport(ExternalizedCodeStyleManager.java:116)
at net.orfjackal.extformatter.plugin.ExternalizedCodeStyleManager.access$200(ExternalizedCodeStyleManager.java:46)
at net.orfjackal.extformatter.plugin.ExternalizedCodeStyleManager$1.run(ExternalizedCodeStyleManager.java:88)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:171)
at net.orfjackal.extformatter.plugin.util.WriteActionRunner.run(WriteActionRunner.java:37)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:2)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:100)
at net.orfjackal.extformatter.plugin.util.CommandRunner.run(CommandRunner.java:46)
at net.orfjackal.extformatter.plugin.util.ConditionalRunner.run(ConditionalRunner.java:37)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:16)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at com.intellij.ide.IdeEventQueue.c(IdeEventQueue.java:35)
at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:99)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:217)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.(UNIXProcess.java:148)
at java.lang.ProcessImpl.start(ProcessImpl.java:65)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:452)
... 29 more
Please  sign in  to leave a comment.