Categories
|
Apache
External Code FormatterProducts: IntelliJ IDEA, Android Studio Vendor: Esko Luontola Email: N/A Website: http://github.com/orfjackal/extformatter SourceCode: ExternalCodeFormatter_1605.zip Description:
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.
1 update is hidden
show all updates
Recent change notes:1.0.4 (2009-11-04)
1.0.3 (2009-06-23)
1.0.2 (2009-02-14)
1.0.1 (2008-01-22)
1.0.0 (2007-12-21)
0.5.0 (2007-12-19)
0.4.0 (2007-12-14)
0.3.0 (2007-12-12)
0.2.0 (2007-12-11)
0.1.0 (2007-12-05)
Known issues
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. |
||||||||||||||||||||||||||||
Comments:
It formattes directly from IntelliJ.
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!
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...
Carsten
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.
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.
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 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!
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