krasa / eclipsecodeformatter Goto Github PK
View Code? Open in Web Editor NEWIntelliJ plugin - use Eclipse's code formatter directly from IntelliJ. https://plugins.jetbrains.com/plugin/6546
License: Apache License 2.0
IntelliJ plugin - use Eclipse's code formatter directly from IntelliJ. https://plugins.jetbrains.com/plugin/6546
License: Apache License 2.0
When trying to format a JavaScript file the format operation fails, if the following statement is present in the Code:
Ext.each(itemArray, function(row) {
if (row instanceof App.module.some.extjs.File) {
arrayVar.push(row.getValue());
}
});
This statement even breaks the format, when I only try to format a selection of lines in this file(excluding the statement/function which uses it). When deleting or commenting the statement, the format runs fine.
I'm using WebStorm 8.0.5 build 135.1297, with plugin 14.5.132.637.1
When using the EclipseCodeFormatter Plugin, you cant use the native re-arrange code of IntelliJ and you cant export the one from Eclipse or re-use them.
any tips handling this?
Hi,
I was just wondering if any license was applied to this project. I took some pieces of code to add import ordering to my Gradle format plugin (youribonnaffe/gradle-format-plugin#4) and I wondered if it would be ok to do so. It is mostly ImportsSorter and ImportSorterAdapter classes.
Thanks
If I surround a comment with format markers, it should not apply any formatting rules to the block.
Example:
//@Formatter:on
/**
Must not modify PSI inside save listener
com.intellij.util.IncorrectOperationException: Must not modify PSI inside save listener
at com.intellij.pom.core.impl.PomModelImpl.runTransaction(PomModelImpl.java:138)
at com.intellij.psi.impl.DocumentCommitProcessor$2.run(DocumentCommitProcessor.java:215)
at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl$8.compute(CodeStyleManagerImpl.java:674)
at com.intellij.psi.impl.source.PostprocessReformattingAspect.disablePostprocessFormattingInside(PostprocessReformattingAspect.java:121)
at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl$10.compute(CodeStyleManagerImpl.java:709)
at com.intellij.formatting.FormatterImpl.runWithFormattingDisabled(FormatterImpl.java:894)
at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.performActionWithFormatterDisabled(CodeStyleManagerImpl.java:705)
at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.performActionWithFormatterDisabled(CodeStyleManagerImpl.java:671)
at krasa.formatter.plugin.DelegatingCodeStyleManager.performActionWithFormatterDisabled(DelegatingCodeStyleManager.java:139)
at com.intellij.psi.impl.DocumentCommitProcessor.doActualPsiChange(DocumentCommitProcessor.java:200)
at com.intellij.psi.impl.DocumentCommitProcessor$1.process(DocumentCommitProcessor.java:136)
at com.intellij.psi.impl.DocumentCommitProcessor$1.process(DocumentCommitProcessor.java:126)
at com.intellij.psi.impl.PsiDocumentManagerBase.finishCommitInWriteAction(PsiDocumentManagerBase.java:322)
at com.intellij.psi.impl.PsiDocumentManagerImpl.finishCommitInWriteAction(PsiDocumentManagerImpl.java:133)
at com.intellij.psi.impl.PsiDocumentManagerBase$3.run(PsiDocumentManagerBase.java:292)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:931)
at com.intellij.psi.impl.PsiDocumentManagerBase.finishCommit(PsiDocumentManagerBase.java:289)
at com.intellij.psi.impl.DocumentCommitThread$5.run(DocumentCommitThread.java:521)
at com.intellij.psi.impl.DocumentCommitThread.commitSynchronously(DocumentCommitThread.java:417)
at com.intellij.psi.impl.PsiDocumentManagerBase$5.run(PsiDocumentManagerBase.java:374)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:931)
at com.intellij.psi.impl.PsiDocumentManagerBase.doCommit(PsiDocumentManagerBase.java:366)
at com.intellij.psi.impl.PsiDocumentManagerBase.commitDocument(PsiDocumentManagerBase.java:278)
at com.intellij.codeInsight.editorActions.XmlTagNameSynchronizer$TagNameSynchronizer.beforeDocumentChange(XmlTagNameSynchronizer.java:218)
at com.intellij.openapi.editor.impl.DocumentImpl.a(DocumentImpl.java:760)
at com.intellij.openapi.editor.impl.DocumentImpl.a(DocumentImpl.java:722)
at com.intellij.openapi.editor.impl.DocumentImpl.deleteString(DocumentImpl.java:528)
at com.intellij.openapi.editor.impl.DocumentImpl$2.run(DocumentImpl.java:223)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:931)
at com.intellij.util.DocumentUtil$1.run(DocumentUtil.java:64)
at com.intellij.openapi.command.impl.CoreCommandProcessor.runUndoTransparentAction(CoreCommandProcessor.java:296)
at com.intellij.util.DocumentUtil.writeInRunUndoTransparentAction(DocumentUtil.java:61)
at com.intellij.openapi.editor.impl.DocumentImpl.stripTrailingSpaces(DocumentImpl.java:220)
at com.intellij.openapi.editor.impl.TrailingSpacesStripper.stripIfNotCurrentLine(TrailingSpacesStripper.java:199)
at com.intellij.openapi.editor.impl.TrailingSpacesStripper.a(TrailingSpacesStripper.java:80)
at com.intellij.openapi.editor.impl.TrailingSpacesStripper.beforeDocumentSaving(TrailingSpacesStripper.java:60)
at sun.reflect.GeneratedMethodAccessor135.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.a(FileDocumentManagerImpl.java:159)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.access$000(FileDocumentManagerImpl.java:87)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl$1.invoke(FileDocumentManagerImpl.java:116)
at com.sun.proxy.$Proxy21.beforeDocumentSaving(Unknown Source)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl$4.run(FileDocumentManagerImpl.java:422)
at com.intellij.pom.core.impl.PomModelImpl.guardPsiModificationsIn(PomModelImpl.java:354)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.a(FileDocumentManagerImpl.java:419)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.a(FileDocumentManagerImpl.java:393)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.saveAllDocuments(FileDocumentManagerImpl.java:314)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.saveAllDocuments(FileDocumentManagerImpl.java:293)
at org.jetbrains.plugins.terminal.JBTerminalPanel.focusGained(JBTerminalPanel.java:257)
at java.awt.AWTEventMulticaster.focusGained(AWTEventMulticaster.java:202)
at java.awt.AWTEventMulticaster.focusGained(AWTEventMulticaster.java:202)
at java.awt.AWTEventMulticaster.focusGained(AWTEventMulticaster.java:202)
at java.awt.Component.processFocusEvent(Component.java:6303)
at java.awt.Component.processEvent(Component.java:6170)
at java.awt.Container.processEvent(Container.java:2084)
at java.awt.Component.dispatchEventImpl(Component.java:4776)
at java.awt.Container.dispatchEventImpl(Container.java:2142)
at java.awt.Component.dispatchEvent(Component.java:4604)
at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1856)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:911)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:523)
at java.awt.Component.dispatchEventImpl(Component.java:4648)
at java.awt.Container.dispatchEventImpl(Container.java:2142)
at java.awt.Component.dispatchEvent(Component.java:4604)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:717)
at java.awt.EventQueue.access$400(EventQueue.java:82)
at java.awt.EventQueue$2.run(EventQueue.java:676)
at java.awt.EventQueue$2.run(EventQueue.java:674)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:690)
at java.awt.EventQueue$3.run(EventQueue.java:688)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:687)
at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:734)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:569)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:382)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Below is event log from Intellij Idea 14.1, Using Eclipse Code Formatter 14.8.132.167, OSX 10.9.5
After this issue occurred, The file can not be edited. So I close and reopen it.
Negative start offset: (-32,-19);
java.lang.Throwable
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:115)
at com.intellij.openapi.util.TextRange.assertProperRange(TextRange.java:222)
at com.intellij.openapi.util.TextRange.assertProperRange(TextRange.java:214)
at com.intellij.openapi.util.TextRange.assertProperRange(TextRange.java:210)
at com.intellij.openapi.util.TextRange.<init>(TextRange.java:43)
at com.intellij.openapi.util.TextRange.<init>(TextRange.java:32)
at com.intellij.openapi.util.ProperTextRange.<init>(ProperTextRange.java:25)
at com.intellij.openapi.util.ProperTextRange.shiftRight(ProperTextRange.java:45)
at com.intellij.openapi.util.ProperTextRange.shiftRight(ProperTextRange.java:23)
at com.intellij.psi.formatter.common.InjectedLanguageBlockBuilder$1.visit(InjectedLanguageBlockBuilder.java:89)
at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil.enumerate(InjectedLanguageUtil.java:157)
at com.intellij.psi.formatter.common.InjectedLanguageBlockBuilder.addInjectedBlocks(InjectedLanguageBlockBuilder.java:111)
at com.intellij.psi.formatter.xml.AbstractXmlBlock.buildInjectedPsiBlocks(AbstractXmlBlock.java:434)
at com.intellij.psi.formatter.xml.XmlTagBlock.processChild(XmlTagBlock.java:152)
at com.intellij.psi.formatter.xml.XmlTagBlock.a(XmlTagBlock.java:183)
at com.intellij.psi.formatter.xml.XmlTagBlock.a(XmlTagBlock.java:173)
at com.intellij.psi.formatter.xml.XmlTagBlock.processChild(XmlTagBlock.java:150)
at com.intellij.psi.formatter.xml.XmlTagBlock.buildChildren(XmlTagBlock.java:119)
at com.intellij.psi.formatter.common.AbstractBlock.getSubBlocks(AbstractBlock.java:60)
at com.intellij.formatting.InitialInfoBuilder.a(InitialInfoBuilder.java:177)
at com.intellij.formatting.InitialInfoBuilder.a(InitialInfoBuilder.java:236)
at com.intellij.formatting.InitialInfoBuilder.iteration(InitialInfoBuilder.java:110)
at com.intellij.formatting.FormatProcessor$WrapBlocksState.doIteration(FormatProcessor.java:1335)
at com.intellij.formatting.FormatProcessor$State.iteration(FormatProcessor.java:1268)
at com.intellij.formatting.FormatProcessor.iteration(FormatProcessor.java:266)
at com.intellij.formatting.FormatterImpl.a(FormatterImpl.java:515)
at com.intellij.formatting.FormatterImpl.adjustLineIndent(FormatterImpl.java:448)
at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl$5.doPerform(CodeStyleManagerImpl.java:363)
at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl$5.doPerform(CodeStyleManagerImpl.java:360)
at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerRunnable.perform(CodeStyleManagerRunnable.java:106)
at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.a(CodeStyleManagerImpl.java:360)
at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.access$500(CodeStyleManagerImpl.java:60)
at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl$3.compute(CodeStyleManagerImpl.java:323)
at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl$3.compute(CodeStyleManagerImpl.java:320)
at com.intellij.psi.impl.source.PostprocessReformattingAspect.disablePostprocessFormattingInside(PostprocessReformattingAspect.java:121)
at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.adjustLineIndent(CodeStyleManagerImpl.java:320)
at krasa.formatter.plugin.DelegatingCodeStyleManager.adjustLineIndent(DelegatingCodeStyleManager.java:86)
at com.intellij.codeInsight.editorActions.EmacsStyleIndentAction$Handler.invoke(EmacsStyleIndentAction.java:81)
at com.intellij.codeInsight.actions.CodeInsightAction$1$1.run(CodeInsightAction.java:62)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:937)
at com.intellij.codeInsight.actions.CodeInsightAction$1.run(CodeInsightAction.java:66)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:124)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:99)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:85)
at com.intellij.codeInsight.actions.CodeInsightAction.actionPerformedImpl(CodeInsightAction.java:54)
at com.intellij.codeInsight.actions.CodeInsightAction.actionPerformed(CodeInsightAction.java:40)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$3.performAction(IdeKeyEventDispatcher.java:576)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.java:625)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.d(IdeKeyEventDispatcher.java:475)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:211)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:538)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:382)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
If blank_lines_before_field is set to 0, and number_of_empty_lines_to_preserve is > 0, then it seems like blank_lines_before_field is not always enforced. If there are any blank lines between fields, it will not always remove them.
I noticed that if I move some fields around before reformatting to force sorting, it will sometimes remove the blank lines, but not all of them. It seems to be affected by how much sorting was performed.
If I set blank_lines_before_field to 1, then it will always add a blank line where needed.
on formatting some file idea crashes. can't understand why. please fix it. it's really annoying!
my system is kubuntu. idea version 13.0.1, plugin version: 13.0.1.1. This crash was with older versions of plugin and older versions of idea (12.x)
stack trace:
Eclipse Import Optimizer failed: You must provide either *.importorder file or 'org.eclipse.jdt.ui.prefs' file, see instructions.
krasa.formatter.exception.ParsingFailedException: You must provide either *.importorder file or 'org.eclipse.jdt.ui.prefs' file, see instructions.
at krasa.formatter.settings.provider.ImportOrderProvider.readFile(ImportOrderProvider.java:38)
at krasa.formatter.settings.provider.ImportOrderProvider.readFile(ImportOrderProvider.java:19)
at krasa.formatter.settings.provider.CachedProvider.get(CachedProvider.java:26)
at krasa.formatter.plugin.EclipseImportOptimizer.getImportSorter(EclipseImportOptimizer.java:112)
at krasa.formatter.plugin.EclipseImportOptimizer.optimizeImportsByEclipse(EclipseImportOptimizer.java:87)
at krasa.formatter.plugin.EclipseImportOptimizer.process(EclipseImportOptimizer.java:62)
at krasa.formatter.plugin.EclipseImportOptimizer.access$000(EclipseImportOptimizer.java:28)
at krasa.formatter.plugin.EclipseImportOptimizer$1.run(EclipseImportOptimizer.java:46)
at com.intellij.codeInsight.actions.OptimizeImportsProcessor$1.run(OptimizeImportsProcessor.java:80)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at com.intellij.codeInsight.actions.ReformatAndOptimizeImportsProcessor$1.call(ReformatAndOptimizeImportsProcessor.java:90)
at com.intellij.codeInsight.actions.ReformatAndOptimizeImportsProcessor$1.call(ReformatAndOptimizeImportsProcessor.java:80)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$2.run(AbstractLayoutCodeProcessor.java:210)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:997)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$9$1$1.run(AbstractLayoutCodeProcessor.java:489)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:124)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:99)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:85)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$9$1.run(AbstractLayoutCodeProcessor.java:484)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:346)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:696)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:524)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:335)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Plugin Version: 14.2.132.637
IntelliJ: 13.1.3
I am getting this when I try to format:
StrategicInitiativeGroupRequiredValidator.java failed to format with Eclipse code formatter. Probably due to syntax error or wrong configuration file. languageLevel=JDK_1_3
My XML file already had these entries:
<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.7"/>
<setting id="org.eclipse.jdt.core.compiler.source" value="1.7"/>
<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.7"/>
OS: Ubuntu 14.04LTS
IntelliJ IDEA 14.0.3 (Community Edition)
Detail:>>>>>>>>>>>>>>>>>>>>>>
krasa.formatter.settings.ProjectSettingsComponent@7005f8c8: org/eclipse/jdt/core/formatter/CodeFormatter
java.lang.NoClassDefFoundError: org/eclipse/jdt/core/formatter/CodeFormatter
at krasa.formatter.plugin.EclipseCodeStyleManager.(EclipseCodeStyleManager.java:42)
at krasa.formatter.plugin.ProjectCodeStyleInstaller.installCodeFormatter(ProjectCodeStyleInstaller.java:55)
at krasa.formatter.plugin.ProjectCodeStyleInstaller.changeFormatterTo(ProjectCodeStyleInstaller.java:48)
at krasa.formatter.settings.ProjectSettingsComponent.install(ProjectSettingsComponent.java:66)
at krasa.formatter.settings.ProjectSettingsComponent.projectOpened(ProjectSettingsComponent.java:93)
at com.intellij.openapi.project.impl.ProjectImpl.projectOpened(ProjectImpl.java:421)
at com.intellij.openapi.project.impl.ProjectImpl.access$200(ProjectImpl.java:75)
at com.intellij.openapi.project.impl.ProjectImpl$MyProjectManagerListener.projectOpened(ProjectImpl.java:456)
at com.intellij.openapi.project.impl.ProjectManagerImpl$3.projectOpened(ProjectManagerImpl.java:157)
at com.intellij.openapi.project.impl.ProjectManagerImpl.fireProjectOpened(ProjectManagerImpl.java:930)
at com.intellij.openapi.project.impl.ProjectManagerImpl.openProject(ProjectManagerImpl.java:442)
at com.intellij.openapi.project.impl.ProjectManagerImpl.loadAndOpenProject(ProjectManagerImpl.java:544)
at com.intellij.ide.impl.ProjectUtil.openProject(ProjectUtil.java:181)
at com.intellij.ide.RecentProjectsManager.doOpenProject(RecentProjectsManager.java:46)
at com.intellij.ide.RecentProjectsManagerBase.doReopenLastProject(RecentProjectsManagerBase.java:340)
at com.intellij.ide.RecentProjectsManagerBase$MyAppLifecycleListener.appStarting(RecentProjectsManagerBase.java:367)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(MessageBusConnectionImpl.java:114)
at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:315)
at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:302)
at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(MessageBusImpl.java:287)
at com.intellij.util.messages.impl.MessageBusImpl.access$200(MessageBusImpl.java:41)
at com.intellij.util.messages.impl.MessageBusImpl$2.invoke(MessageBusImpl.java:177)
at com.sun.proxy.$Proxy45.appStarting(Unknown Source)
at com.intellij.idea.IdeaApplication.loadProject(IdeaApplication.java:306)
at com.intellij.idea.IdeaApplication.access$500(IdeaApplication.java:55)
at com.intellij.idea.IdeaApplication$IdeStarter$2.run(IdeaApplication.java:280)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:318)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:749)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:702)
at java.awt.EventQueue$3.run(EventQueue.java:696)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:719)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:748)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:577)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:384)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.ClassNotFoundException: org.eclipse.jdt.core.formatter.CodeFormatter PluginClassLoader[EclipseCodeFormatter, 14.8.132.637]
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:68)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 48 more
intellij already does some thing, we need to just hook them somehow.
When I select a config file under "Eclipse Java Formatter config file" it would be preferable for it to resolve into a relative path, relative to the project. On a team project where we try to keep our formatting synced up to avoid unnecessary edit wars, this would be convenient.
Also given your examples under the path text box, it looks like relative pathing is possible, but its very unclear where the reference point is. Making a few guessing as to where that is, I still cannot get it to find the file, even while trying variables like $PROJECT_DIR$
.
IntelliJ version: IU-133.818
Plugin version: 13.0.1.1
When I import eclipse formatter configuration into IntelliJ, if I don't change the import order configuration, wildcard configuration (count to use *) is applied the way it's supposed to be.
The moment I change the import order configuration, it doesn't care anymore about the wildcard configuration and it's always using wildcards even if I've configured it to require 99 occurrences.
As exemplified here:
It becomes incredibly annoying when you have autosave triggering the formatting.
Any idea what could be causing this?
I'm on Intellij Idea 14.1.4
, Eclipse Code Formatter plugin version 15.1.132.637.0
Here's my formatter config file
Hi,
Exception log:
Already disposed: Project (Disposed) xxxxxxx
java.lang.AssertionError: Already disposed: Project (Disposed) xxxxxx
at com.intellij.openapi.components.impl.ComponentManagerImpl.getComponent(ComponentManagerImpl.java:191)
at com.intellij.psi.PsiManager.getInstance(PsiManager.java:39)
at com.intellij.psi.impl.smartPointers.SelfElementInfo$1.compute(SelfElementInfo.java:238)
at com.intellij.psi.impl.smartPointers.SelfElementInfo$1.compute(SelfElementInfo.java:224)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:917)
at com.intellij.psi.impl.smartPointers.SelfElementInfo.restoreFileFromVirtual(SelfElementInfo.java:224)
at com.intellij.psi.impl.smartPointers.SelfElementInfo.restoreFile(SelfElementInfo.java:174)
at com.intellij.psi.impl.smartPointers.AnchorElementInfo.restoreElement(AnchorElementInfo.java:62)
at com.intellij.psi.impl.smartPointers.AnchorElementInfo.fastenBelt(AnchorElementInfo.java:105)
at com.intellij.psi.impl.smartPointers.SmartPsiElementPointerImpl.fastenBelt(SmartPsiElementPointerImpl.java:177)
at com.intellij.psi.impl.smartPointers.SmartPointerManagerImpl.fastenBelts(SmartPointerManagerImpl.java:67)
at com.intellij.psi.impl.PsiDocumentManagerBase.beforeDocumentChange(PsiDocumentManagerBase.java:614)
at sun.reflect.GeneratedMethodAccessor208.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.intellij.util.EventDispatcher.dispatch(EventDispatcher.java:88)
at com.intellij.util.EventDispatcher.access$100(EventDispatcher.java:34)
at com.intellij.util.EventDispatcher$1.invoke(EventDispatcher.java:68)
at com.sun.proxy.$Proxy19.beforeDocumentChange(Unknown Source)
at com.intellij.openapi.editor.impl.DocumentImpl.a(DocumentImpl.java:746)
at com.intellij.openapi.editor.impl.DocumentImpl.a(DocumentImpl.java:714)
at com.intellij.openapi.editor.impl.DocumentImpl.a(DocumentImpl.java:601)
at com.intellij.openapi.editor.impl.DocumentImpl.access$400(DocumentImpl.java:57)
at com.intellij.openapi.editor.impl.DocumentImpl$7.run(DocumentImpl.java:985)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:117)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:99)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:85)
at com.intellij.openapi.editor.impl.DocumentImpl.setText(DocumentImpl.java:992)
at krasa.formatter.plugin.EclipseCodeFormatter.formatWhenEditorIsOpen(EclipseCodeFormatter.java:84)
at krasa.formatter.plugin.EclipseCodeFormatter.format(EclipseCodeFormatter.java:50)
at krasa.formatter.plugin.EclipseCodeStyleManager.formatWithEclipse(EclipseCodeStyleManager.java:189)
at krasa.formatter.plugin.EclipseCodeStyleManager.format(EclipseCodeStyleManager.java:95)
at krasa.formatter.plugin.EclipseCodeStyleManager.reformatText(EclipseCodeStyleManager.java:59)
at com.intellij.codeInsight.actions.ReformatCodeProcessor$1.call(ReformatCodeProcessor.java:95)
at com.intellij.codeInsight.actions.ReformatCodeProcessor$1.call(ReformatCodeProcessor.java:89)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$1.call(AbstractLayoutCodeProcessor.java:206)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$1.call(AbstractLayoutCodeProcessor.java:198)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$1.call(AbstractLayoutCodeProcessor.java:202)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$1.call(AbstractLayoutCodeProcessor.java:198)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$3.run(AbstractLayoutCodeProcessor.java:307)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:974)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$8$1$1.run(AbstractLayoutCodeProcessor.java:415)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:124)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:99)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:85)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$8$1.run(AbstractLayoutCodeProcessor.java:410)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:318)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:744)
at java.awt.EventQueue.access$400(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:697)
at java.awt.EventQueue$3.run(EventQueue.java:691)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:714)
at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:748)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:577)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:384)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Hi, I'm not able to proceed because I'm not able to see the following path, sorry:
"Set path to the file (IntelliJ | Settings | Eclipse Code Formatter | field "Eclipse preference file")"
Eclipse Mars 4.5 has been released. Could you update the plugin to use the new jar files from the 4.5 distribution?!
The plugin is not compatible with current version of Android Studio (version 0.4.2). It would be appreciated greatly if the plugin is updated so I can use it again.
Hi,
I am using this plugin and since I updated to version 15.1.132.637.0, I systematically get a PluginException
whenever we try to format a java file, the formatting failed too :
startOffset2226, endOffset:2787, length of file 5395: org/eclipse/jdt/internal/formatter/DefaultCodeFormatter : Unsupported major.minor version 51.0 [Plugin: EclipseCodeFormatter]
com.intellij.diagnostic.PluginException: org/eclipse/jdt/internal/formatter/DefaultCodeFormatter : Unsupported major.minor version 51.0 [Plugin: EclipseCodeFormatter]
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClassInsideSelf(PluginClassLoader.java:130)
at com.intellij.ide.plugins.cl.PluginClassLoader.tryLoadingClass(PluginClassLoader.java:77)
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:66)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at krasa.formatter.eclipse.JavaCodeFormatterFacade.newCodeFormatter(JavaCodeFormatterFacade.java:65)
at krasa.formatter.eclipse.JavaCodeFormatterFacade.getCodeFormatter(JavaCodeFormatterFacade.java:47)
at krasa.formatter.eclipse.JavaCodeFormatterFacade.format(JavaCodeFormatterFacade.java:148)
at krasa.formatter.plugin.EclipseCodeFormatter.reformat(EclipseCodeFormatter.java:102)
at krasa.formatter.plugin.EclipseCodeFormatter.formatWhenEditorIsOpen(EclipseCodeFormatter.java:83)
at krasa.formatter.plugin.EclipseCodeFormatter.format(EclipseCodeFormatter.java:50)
at krasa.formatter.plugin.EclipseCodeStyleManager.formatWithEclipse(EclipseCodeStyleManager.java:203)
at krasa.formatter.plugin.EclipseCodeStyleManager.format(EclipseCodeStyleManager.java:103)
at krasa.formatter.plugin.EclipseCodeStyleManager.reformatText(EclipseCodeStyleManager.java:67)
at com.intellij.codeInsight.actions.ReformatCodeProcessor$1.call(ReformatCodeProcessor.java:128)
at com.intellij.codeInsight.actions.ReformatCodeProcessor$1.call(ReformatCodeProcessor.java:113)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$1$1.run(AbstractLayoutCodeProcessor.java:238)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:931)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$1.call(AbstractLayoutCodeProcessor.java:235)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$1.call(AbstractLayoutCodeProcessor.java:227)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$3.run(AbstractLayoutCodeProcessor.java:342)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$8$1$1.run(AbstractLayoutCodeProcessor.java:450)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:124)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:99)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:85)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$8$1.run(AbstractLayoutCodeProcessor.java:445)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:332)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)
at java.awt.EventQueue.access$400(EventQueue.java:82)
at java.awt.EventQueue$2.run(EventQueue.java:676)
at java.awt.EventQueue$2.run(EventQueue.java:674)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:685)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:734)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:569)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:382)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.lang.UnsupportedClassVersionError: org/eclipse/jdt/internal/formatter/DefaultCodeFormatter : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.lang.ClassLoader.defineClass(ClassLoader.java:471)
at com.intellij.util.lang.UrlClassLoader._defineClass(UrlClassLoader.java:259)
at com.intellij.util.lang.UrlClassLoader.defineClass(UrlClassLoader.java:255)
at com.intellij.util.lang.UrlClassLoader._findClass(UrlClassLoader.java:231)
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClassInsideSelf(PluginClassLoader.java:124)
... 46 more
I reproduced the issue on Android studio 1.22 and Android studio 1.3 RC 3.
If you need more information about my setup, don't hesitate to ask !
Thanks.
Do not call commitDocument() from inside PSI change listener: Do not call commitDocument() from inside PSI change listener
java.lang.AssertionError: Do not call commitDocument() from inside PSI change listener
at com.intellij.psi.impl.PsiDocumentManagerBase.a(PsiDocumentManagerBase.java:351)
at com.intellij.psi.impl.PsiDocumentManagerBase.commitDocument(PsiDocumentManagerBase.java:267)
at com.intellij.openapi.fileEditor.impl.text.PsiAwareTextEditorProvider.getStateImpl(PsiAwareTextEditorProvider.java:111)
at com.intellij.openapi.fileEditor.impl.text.TextEditorImpl.getState(TextEditorImpl.java:95)
at com.intellij.openapi.fileEditor.impl.EditorHistoryManager.a(EditorHistoryManager.java:210)
at com.intellij.openapi.fileEditor.impl.EditorHistoryManager.access$900(EditorHistoryManager.java:44)
at com.intellij.openapi.fileEditor.impl.EditorHistoryManager$MyEditorManagerListener.selectionChanged(EditorHistoryManager.java:346)
at sun.reflect.GeneratedMethodAccessor39.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(MessageBusConnectionImpl.java:114)
at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:228)
at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:234)
at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:219)
at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:216)
at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(MessageBusImpl.java:209)
at com.intellij.util.messages.impl.MessageBusImpl.access$000(MessageBusImpl.java:43)
at com.intellij.util.messages.impl.MessageBusImpl$1.invoke(MessageBusImpl.java:131)
at com.sun.proxy.$Proxy83.selectionChanged(Unknown Source)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl$16.run(FileEditorManagerImpl.java:1514)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl$13$1.run(FileEditorManagerImpl.java:960)
at com.intellij.openapi.wm.impl.FocusManagerImpl.a(FocusManagerImpl.java:638)
at com.intellij.openapi.wm.impl.FocusManagerImpl.g(FocusManagerImpl.java:622)
at com.intellij.openapi.wm.impl.FocusManagerImpl.e(FocusManagerImpl.java:592)
at com.intellij.openapi.wm.impl.FocusManagerImpl.access$200(FocusManagerImpl.java:59)
at com.intellij.openapi.wm.impl.FocusManagerImpl$7.run(FocusManagerImpl.java:488)
at com.intellij.util.ui.UIUtil.invokeLaterIfNeeded(UIUtil.java:1994)
at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:466)
at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.doWhenFocusSettlesDown(IdeFocusManagerImpl.java:59)
at com.intellij.ui.tabs.impl.JBTabsImpl.removeDeferred(JBTabsImpl.java:957)
at com.intellij.ui.tabs.impl.JBTabsImpl.access$2000(JBTabsImpl.java:62)
at com.intellij.ui.tabs.impl.JBTabsImpl$12.run(JBTabsImpl.java:847)
at com.intellij.openapi.util.ExecutionCallback.setExecuted(ExecutionCallback.java:58)
at com.intellij.openapi.util.ActionCallback.setRejected(ActionCallback.java:85)
at com.intellij.openapi.wm.impl.FocusManagerImpl.a(FocusManagerImpl.java:400)
at com.intellij.openapi.wm.impl.FocusManagerImpl.h(FocusManagerImpl.java:665)
at com.intellij.openapi.wm.impl.FocusManagerImpl.isFocusTransferReady(FocusManagerImpl.java:650)
at com.intellij.openapi.wm.impl.FocusManagerImpl.isFocusBeingTransferred(FocusManagerImpl.java:1106)
at com.intellij.openapi.wm.impl.FocusManagerImpl.getFocusOwner(FocusManagerImpl.java:892)
at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.getFocusOwner(IdeFocusManagerImpl.java:119)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl$2.run(FileEditorManagerImpl.java:201)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.a(FileEditorManagerImpl.java:229)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.getCurrentFile(FileEditorManagerImpl.java:515)
at com.intellij.openapi.fileEditor.impl.PsiAwareFileEditorManagerImpl$MyPsiTreeChangeListener.a(PsiAwareFileEditorManagerImpl.java:160)
at com.intellij.openapi.fileEditor.impl.PsiAwareFileEditorManagerImpl$MyPsiTreeChangeListener.childReplaced(PsiAwareFileEditorManagerImpl.java:139)
at com.intellij.psi.impl.PsiManagerImpl.a(PsiManagerImpl.java:453)
at com.intellij.psi.impl.PsiManagerImpl.childReplaced(PsiManagerImpl.java:354)
at com.intellij.pom.wrappers.PsiEventWrapperAspect.a(PsiEventWrapperAspect.java:103)
at com.intellij.pom.wrappers.PsiEventWrapperAspect.update(PsiEventWrapperAspect.java:50)
at com.intellij.pom.core.impl.PomModelImpl.runTransaction(PomModelImpl.java:171)
at com.intellij.psi.impl.DocumentCommitProcessor.doActualPsiChange(DocumentCommitProcessor.java:193)
at com.intellij.psi.impl.DocumentCommitProcessor$2$1.run(DocumentCommitProcessor.java:157)
at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl$8.compute(CodeStyleManagerImpl.java:681)
at com.intellij.psi.impl.source.PostprocessReformattingAspect.disablePostprocessFormattingInside(PostprocessReformattingAspect.java:113)
at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl$10.compute(CodeStyleManagerImpl.java:716)
at com.intellij.formatting.FormatterImpl.runWithFormattingDisabled(FormatterImpl.java:812)
at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.performActionWithFormatterDisabled(CodeStyleManagerImpl.java:712)
at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.performActionWithFormatterDisabled(CodeStyleManagerImpl.java:678)
at krasa.formatter.plugin.DelegatingCodeStyleManager.performActionWithFormatterDisabled(DelegatingCodeStyleManager.java:139)
at com.intellij.psi.impl.DocumentCommitProcessor$2.process(DocumentCommitProcessor.java:153)
at com.intellij.psi.impl.DocumentCommitProcessor$2.process(DocumentCommitProcessor.java:143)
at com.intellij.psi.impl.PsiDocumentManagerBase.finishCommitInWriteAction(PsiDocumentManagerBase.java:312)
at com.intellij.psi.impl.PsiDocumentManagerImpl.finishCommitInWriteAction(PsiDocumentManagerImpl.java:140)
at com.intellij.psi.impl.PsiDocumentManagerBase$2.run(PsiDocumentManagerBase.java:280)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:997)
at com.intellij.psi.impl.PsiDocumentManagerBase.finishCommit(PsiDocumentManagerBase.java:277)
at com.intellij.psi.impl.DocumentCommitThread$4.run(DocumentCommitThread.java:468)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)
at java.awt.EventQueue.access$400(EventQueue.java:82)
at java.awt.EventQueue$2.run(EventQueue.java:676)
at java.awt.EventQueue$2.run(EventQueue.java:674)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:685)
at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:696)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:524)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:335)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Hello. I`ve noticed a possible problem of this last version.
When you try to format using EclipseCodeFormatter, (ctrl+alt+L), lines get straight. Even if it was wraped. If you disable the plugin and configure the line wrap, the lines get wraped normally.
I using a IntelliJ Community, intellij version 14.1.4, Windows 7 and the last plugin release.
The attached formatter gives different results in IntelliJ 14 EAP vs. Eclipse. Specifically method declarations seem to always be wrapped after the open bracket in IntelliJ vs. Eclipse where they're only wrapped at 120 characters.
2014-05-14 18:23:18,512 [14772754] ERROR - plugin.EclipseCodeStyleManager - startOffset1823, endOffset:1951, length of file 1806
java.lang.StringIndexOutOfBoundsException: String index out of range: 1823
at java.lang.String.substring(String.java:1907)
at krasa.formatter.plugin.EclipseCodeFormatter.getLineStartOffset(EclipseCodeFormatter.java:110)
at krasa.formatter.plugin.EclipseCodeFormatter.reformat(EclipseCodeFormatter.java:100)
at krasa.formatter.plugin.EclipseCodeFormatter.formatWhenEditorIsOpen(EclipseCodeFormatter.java:84)
at krasa.formatter.plugin.EclipseCodeFormatter.format(EclipseCodeFormatter.java:52)
at krasa.formatter.plugin.EclipseCodeStyleManager.formatWithEclipse(EclipseCodeStyleManager.java:157)
at krasa.formatter.plugin.EclipseCodeStyleManager.format(EclipseCodeStyleManager.java:92)
at krasa.formatter.plugin.EclipseCodeStyleManager.reformatText(EclipseCodeStyleManager.java:65)
at com.intellij.codeInsight.actions.ReformatCodeProcessor$1.call(ReformatCodeProcessor.java:94)
at com.intellij.codeInsight.actions.ReformatCodeProcessor$1.call(ReformatCodeProcessor.java:83)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$1.call(AbstractLayoutCodeProcessor.java:199)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$1.call(AbstractLayoutCodeProcessor.java:191)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$ReformatFilesTask.iteration(AbstractLayoutCodeProcessor.java:549)
at com.intellij.util.SequentialModalProgressTask$1.run(SequentialModalProgressTask.java:95)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:241)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:697)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:524)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:335)
at com.intellij.ide.IdeEventQueue.pumpEventsForHierarchy(IdeEventQueue.java:767)
at com.intellij.openapi.progress.util.ProgressWindow.startBlocking(ProgressWindow.java:199)
at com.intellij.openapi.application.impl.ApplicationImpl.runProcessWithProgressSynchronously(ApplicationImpl.java:665)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.a(ProgressManagerImpl.java:277)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.run(ProgressManagerImpl.java:428)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$4.run(AbstractLayoutCodeProcessor.java:315)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$6.run(AbstractLayoutCodeProcessor.java:335)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:984)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$10$1$1.run(AbstractLayoutCodeProcessor.java:484)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:124)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:99)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:85)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$10$1.run(AbstractLayoutCodeProcessor.java:479)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:319)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:697)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:524)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:335)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:154)
at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:182)
at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:221)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:219)
at java.awt.Dialog.show(Dialog.java:1082)
at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:787)
at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:463)
at com.intellij.openapi.ui.DialogWrapper.showAndGetOk(DialogWrapper.java:1555)
at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1522)
at com.intellij.openapi.vcs.changes.ui.CommitChangeListDialog.a(CommitChangeListDialog.java:158)
at com.intellij.openapi.vcs.changes.ui.CommitChangeListDialog.commitChanges(CommitChangeListDialog.java:216)
at com.intellij.openapi.vcs.changes.ui.CommitChangeListDialog.commitChanges(CommitChangeListDialog.java:185)
at com.intellij.openapi.vcs.changes.ui.CommitChangeListDialog.commitPaths(CommitChangeListDialog.java:179)
at com.intellij.openapi.vcs.actions.AbstractCommonCheckinAction.performCheckIn(AbstractCommonCheckinAction.java:73)
at com.intellij.openapi.vcs.actions.AbstractCommonCheckinAction$1.run(AbstractCommonCheckinAction.java:59)
at com.intellij.openapi.vcs.changes.Waiter.onSuccess(Waiter.java:79)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.a(ProgressManagerImpl.java:294)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.run(ProgressManagerImpl.java:428)
at com.intellij.openapi.vcs.changes.CallbackData$3.run(CallbackData.java:85)
at com.intellij.openapi.vcs.changes.UpdateRequestsQueue.invokeAfterUpdate(UpdateRequestsQueue.java:218)
at com.intellij.openapi.vcs.changes.ChangeListManagerImpl.invokeAfterUpdate(ChangeListManagerImpl.java:336)
at com.intellij.openapi.vcs.actions.AbstractCommonCheckinAction.actionPerformed(AbstractCommonCheckinAction.java:57)
at com.intellij.openapi.vcs.actions.AbstractVcsAction.actionPerformed(AbstractVcsAction.java:61)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:164)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter$1.run(ActionMenuItem.java:266)
at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:924)
at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:124)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:236)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:105)
at com.intellij.ui.plaf.beg.BegMenuItemUI.a(BegMenuItemUI.java:512)
at com.intellij.ui.plaf.beg.BegMenuItemUI.access$300(BegMenuItemUI.java:44)
at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:532)
at java.awt.Component.processMouseEvent(Component.java:6505)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3320)
at java.awt.Component.processEvent(Component.java:6270)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4861)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2719)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:708)
at java.awt.EventQueue$4.run(EventQueue.java:706)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:705)
at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:697)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:520)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:335)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
2014-05-14 18:23:18,519 [14772761] ERROR - plugin.EclipseCodeStyleManager - IntelliJ IDEA 13.1.2 Build #IU-135.690
2014-05-14 18:23:18,520 [14772762] ERROR - plugin.EclipseCodeStyleManager - JDK: 1.7.0_40
2014-05-14 18:23:18,520 [14772762] ERROR - plugin.EclipseCodeStyleManager - VM: Java HotSpot(TM) Server VM
2014-05-14 18:23:18,521 [14772763] ERROR - plugin.EclipseCodeStyleManager - Vendor: Oracle Corporation
2014-05-14 18:23:18,522 [14772764] ERROR - plugin.EclipseCodeStyleManager - OS: Windows 7
2014-05-14 18:23:18,522 [14772764] ERROR - plugin.EclipseCodeStyleManager - Last Action: CheckinFiles
2014-05-14 18:23:18,523 [14772765] ERROR - plugin.EclipseCodeStyleManager - Current Command: Reformat Code Before Commit
2014-05-14 18:23:20,076 [14774318] INFO - ellij.concurrency.JobScheduler - 50 ms execution limit failed for: com.intellij.diagnostic.MessagePool$MessageGrouper@a6edd6; elapsed time was 167ms
must implement com.intellij.psi.codeStyle.CodeStyleManager#reformatTextWithContext
With the current EAP of IDEA 14 (138.1696.2) I am receiving this error:
Invalid stub element type in index:
file: [...].java
psiElement: PsiImportStatement
requiredClass: interface com.intellij.psi.PsiClass
actualClass: class com.intellij.psi.impl.source.PsiImportStatementImpl
virtualFile: size:37113; stamp:436018; modCount:1408693704658; fileType:JAVA; language:JAVA
document: size:37829; stamp:747669; committed:false; saved:false
psiFile: size:37828; stamp:747663; class:com.intellij.psi.impl.source.PsiJavaFileImpl; language:JAVA
fileAST: size:37828; parsed:true
indexing info: indexed at 1408693704658 with size 37112
java.lang.Throwable
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:114)
at com.intellij.psi.stubs.StubIndexImpl.reportStubPsiMismatch(StubIndexImpl.java:517)
at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:155)
at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:134)
at com.intellij.psi.impl.java.stubs.index.JavaFullClassNameIndex.get(JavaFullClassNameIndex.java:48)
at com.intellij.psi.impl.file.impl.JavaFileManagerImpl.a(JavaFileManagerImpl.java:144)
at com.intellij.psi.impl.file.impl.JavaFileManagerImpl.findClass(JavaFileManagerImpl.java:137)
at com.intellij.psi.impl.JavaPsiFacadeImpl$PsiElementFinderImpl.findClass(JavaPsiFacadeImpl.java:287)
at com.intellij.psi.impl.JavaPsiFacadeImpl.findClass(JavaPsiFacadeImpl.java:107)
at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl.a(PsiJavaCodeReferenceElementImpl.java:412)
at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl.access$000(PsiJavaCodeReferenceElementImpl.java:56)
at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl$OurGenericsResolver.resolve(PsiJavaCodeReferenceElementImpl.java:340)
at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl$OurGenericsResolver.resolve(PsiJavaCodeReferenceElementImpl.java:332)
at com.intellij.psi.impl.source.resolve.ResolveCache$4.compute(ResolveCache.java:193)
at com.intellij.psi.impl.source.resolve.ResolveCache$4.compute(ResolveCache.java:190)
at com.intellij.openapi.util.RecursionManager$2.doPreventingRecursion(RecursionManager.java:112)
at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:190)
at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl.a(PsiJavaCodeReferenceElementImpl.java:392)
at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl.multiResolve(PsiJavaCodeReferenceElementImpl.java:386)
at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl.advancedResolve(PsiJavaCodeReferenceElementImpl.java:360)
at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl.resolve(PsiJavaCodeReferenceElementImpl.java:329)
at com.intellij.psi.impl.source.PsiImportStatementBaseImpl.resolve(PsiImportStatementBaseImpl.java:64)
at com.intellij.psi.impl.source.PsiJavaFileBaseImpl.a(PsiJavaFileBaseImpl.java:314)
at com.intellij.psi.impl.source.PsiJavaFileBaseImpl.access$100(PsiJavaFileBaseImpl.java:58)
at com.intellij.psi.impl.source.PsiJavaFileBaseImpl$MyCacheBuilder.compute(PsiJavaFileBaseImpl.java:480)
at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:49)
at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:200)
at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:38)
at com.intellij.psi.impl.source.PsiJavaFileBaseImpl.processDeclarations(PsiJavaFileBaseImpl.java:283)
at com.intellij.psi.scope.util.PsiScopesUtil.treeWalkUp(PsiScopesUtil.java:72)
at com.intellij.psi.scope.util.PsiScopesUtil.treeWalkUp(PsiScopesUtil.java:54)
at com.intellij.psi.scope.util.PsiScopesUtil.resolveAndWalk(PsiScopesUtil.java:215)
at com.intellij.psi.scope.util.PsiScopesUtil.resolveAndWalk(PsiScopesUtil.java:146)
at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl.a(PsiJavaCodeReferenceElementImpl.java:465)
at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl.access$000(PsiJavaCodeReferenceElementImpl.java:56)
at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl$OurGenericsResolver.resolve(PsiJavaCodeReferenceElementImpl.java:340)
at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl$OurGenericsResolver.resolve(PsiJavaCodeReferenceElementImpl.java:332)
at com.intellij.psi.impl.source.resolve.ResolveCache$4.compute(ResolveCache.java:193)
at com.intellij.psi.impl.source.resolve.ResolveCache$4.compute(ResolveCache.java:190)
at com.intellij.openapi.util.RecursionManager$2.doPreventingRecursion(RecursionManager.java:112)
at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:190)
at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl.a(PsiJavaCodeReferenceElementImpl.java:392)
at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl.multiResolve(PsiJavaCodeReferenceElementImpl.java:386)
at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl.advancedResolve(PsiJavaCodeReferenceElementImpl.java:360)
at com.intellij.psi.impl.source.codeStyle.ImportHelper.a(ImportHelper.java:778)
at com.intellij.psi.impl.source.codeStyle.ImportHelper.a(ImportHelper.java:726)
at com.intellij.psi.impl.source.codeStyle.ImportHelper.a(ImportHelper.java:702)
at com.intellij.psi.impl.source.codeStyle.ImportHelper.prepareOptimizeImportsResult(ImportHelper.java:74)
at com.intellij.psi.impl.source.codeStyle.JavaCodeStyleManagerImpl.prepareOptimizeImportsResult(JavaCodeStyleManagerImpl.java:123)
at com.intellij.lang.java.JavaImportOptimizer.processFile(JavaImportOptimizer.java:45)
at krasa.formatter.plugin.EclipseImportOptimizer.optimizeImportsByIntellij(EclipseImportOptimizer.java:69)
at krasa.formatter.plugin.EclipseImportOptimizer.process(EclipseImportOptimizer.java:58)
at krasa.formatter.plugin.EclipseImportOptimizer.access$000(EclipseImportOptimizer.java:28)
at krasa.formatter.plugin.EclipseImportOptimizer$1.run(EclipseImportOptimizer.java:46)
at com.intellij.codeInsight.actions.OptimizeImportsProcessor$1.run(OptimizeImportsProcessor.java:86)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$1.call(AbstractLayoutCodeProcessor.java:206)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$1.call(AbstractLayoutCodeProcessor.java:198)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$ReformatFilesTask.a(AbstractLayoutCodeProcessor.java:511)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$ReformatFilesTask.iteration(AbstractLayoutCodeProcessor.java:502)
at com.intellij.util.SequentialModalProgressTask$1.run(SequentialModalProgressTask.java:95)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:302)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:722)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:551)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:362)
at com.intellij.ide.IdeEventQueue.pumpEventsForHierarchy(IdeEventQueue.java:817)
at com.intellij.openapi.progress.util.ProgressWindow.startBlocking(ProgressWindow.java:199)
at com.intellij.openapi.application.impl.ApplicationImpl.runProcessWithProgressSynchronously(ApplicationImpl.java:695)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.a(ProgressManagerImpl.java:279)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.run(ProgressManagerImpl.java:438)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$4.run(AbstractLayoutCodeProcessor.java:336)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$6.run(AbstractLayoutCodeProcessor.java:355)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1010)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$8$1$1.run(AbstractLayoutCodeProcessor.java:415)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:124)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:99)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:85)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$8$1.run(AbstractLayoutCodeProcessor.java:410)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:318)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:722)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:551)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:362)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:154)
at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:182)
at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:221)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:219)
at java.awt.Dialog.show(Dialog.java:1082)
at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:783)
at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:464)
at com.intellij.openapi.ui.DialogWrapper.showAndGetOk(DialogWrapper.java:1570)
at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1537)
at com.intellij.openapi.vcs.changes.ui.CommitChangeListDialog.commitChanges(CommitChangeListDialog.java:165)
at com.intellij.openapi.vcs.changes.ui.CommitChangeListDialog.commitChanges(CommitChangeListDialog.java:217)
at com.intellij.openapi.vcs.changes.ui.CommitChangeListDialog.commitChanges(CommitChangeListDialog.java:192)
at com.intellij.openapi.vcs.actions.AbstractCommonCheckinAction.performCheckIn(AbstractCommonCheckinAction.java:70)
at com.intellij.openapi.vcs.actions.AbstractCommonCheckinAction$1.run(AbstractCommonCheckinAction.java:59)
at com.intellij.openapi.vcs.changes.Waiter.onSuccess(Waiter.java:79)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.a(ProgressManagerImpl.java:296)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.run(ProgressManagerImpl.java:438)
at com.intellij.openapi.vcs.changes.CallbackData$3.run(CallbackData.java:85)
at com.intellij.openapi.vcs.changes.UpdateRequestsQueue.invokeAfterUpdate(UpdateRequestsQueue.java:218)
at com.intellij.openapi.vcs.changes.ChangeListManagerImpl.invokeAfterUpdate(ChangeListManagerImpl.java:367)
at com.intellij.openapi.vcs.actions.AbstractCommonCheckinAction.actionPerformed(AbstractCommonCheckinAction.java:57)
at com.intellij.openapi.vcs.actions.AbstractVcsAction.actionPerformed(AbstractVcsAction.java:61)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:164)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter$1.run(ActionMenuItem.java:266)
at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:926)
at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:124)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:236)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:105)
at com.intellij.ui.plaf.beg.BegMenuItemUI.a(BegMenuItemUI.java:512)
at com.intellij.ui.plaf.beg.BegMenuItemUI.access$300(BegMenuItemUI.java:44)
at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:532)
at java.awt.Component.processMouseEvent(Component.java:6516)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3311)
at java.awt.Component.processEvent(Component.java:6281)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4872)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4698)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2719)
at java.awt.Component.dispatchEvent(Component.java:4698)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:708)
at java.awt.EventQueue$4.run(EventQueue.java:706)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:705)
at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:722)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:547)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:362)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Since EAP 13, Idea supports formatter control comments (see Settings -> Code Style -> General). These allow to suppress code formatting for parts of files.
Right now if eclipse code formatter is active, these comments are ignored.
Formatting of prototype files does not work (Xyz.java failed to format with Eclipse code formatter. Probably due to syntax error or wrong configuration file.)
Prototype files usually start with a
package ${package}.xyz;
and use
import ${package}.abc.Def;
which seem to make some difficulties to the formatter.
It would be nice to have this feature, as I have to build archetypes from time to time and especially these should come with correct formatting.
The path to the settings file is stored with
Content is not allowed in prolog.: Content is not allowed in prolog.
org.xml.sax.SAXParseException; systemId: file:/C:/workspace/_projekty/Github/GrepConsole/test/formatSettings.xml; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:205)
at krasa.formatter.utils.FileUtils.getProfileNamesFromConfigXML(FileUtils.java:140)
at krasa.formatter.plugin.ProjectSettingsForm.createProfilesModel(ProjectSettingsForm.java:436)
at krasa.formatter.plugin.ProjectSettingsForm.setJavaFormatterProfileModel(ProjectSettingsForm.java:418)
at krasa.formatter.plugin.ProjectSettingsForm.access$500(ProjectSettingsForm.java:64)
at krasa.formatter.plugin.ProjectSettingsForm$7.textChanged(ProjectSettingsForm.java:252)
at com.intellij.ui.DocumentAdapter.insertUpdate(DocumentAdapter.java:27)
at javax.swing.text.AbstractDocument.fireInsertUpdate(AbstractDocument.java:202)
at javax.swing.text.AbstractDocument.handleInsertString(AbstractDocument.java:749)
at javax.swing.text.AbstractDocument.insertString(AbstractDocument.java:708)
at javax.swing.text.PlainDocument.insertString(PlainDocument.java:130)
at javax.swing.text.AbstractDocument.replace(AbstractDocument.java:670)
at javax.swing.text.JTextComponent.setText(JTextComponent.java:1718)
at krasa.formatter.plugin.ProjectSettingsForm.setData(ProjectSettingsForm.java:710)
at krasa.formatter.plugin.ProjectSettingsForm.importFromInternal(ProjectSettingsForm.java:598)
at krasa.formatter.plugin.ProjectSettingsForm.access$1400(ProjectSettingsForm.java:64)
at krasa.formatter.plugin.ProjectSettingsForm$11.actionPerformed(ProjectSettingsForm.java:337)
at javax.swing.JComboBox.fireActionEvent(JComboBox.java:1260)
at javax.swing.JComboBox.setSelectedItem(JComboBox.java:588)
at javax.swing.JComboBox.setSelectedIndex(JComboBox.java:624)
at javax.swing.plaf.basic.BasicComboPopup$Handler.mouseReleased(BasicComboPopup.java:835)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:290)
at java.awt.Component.processMouseEvent(Component.java:6505)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3320)
at javax.swing.plaf.basic.BasicComboPopup$1.processMouseEvent(BasicComboPopup.java:499)
at java.awt.Component.processEvent(Component.java:6270)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4861)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2719)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:708)
at java.awt.EventQueue$4.run(EventQueue.java:706)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:705)
at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:696)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:520)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:335)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:154)
at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:182)
at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:221)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:219)
at java.awt.Dialog.show(Dialog.java:1082)
at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:786)
at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:462)
at com.intellij.openapi.ui.DialogWrapper.showAndGetOk(DialogWrapper.java:1543)
at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1511)
at com.intellij.ide.actions.ShowSettingsUtilImpl.a(ShowSettingsUtilImpl.java:72)
at com.intellij.ide.actions.ShowSettingsUtilImpl.showSettingsDialog(ShowSettingsUtilImpl.java:54)
at com.intellij.ide.actions.ShowSettingsAction.actionPerformed(ShowSettingsAction.java:63)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$3.performAction(IdeKeyEventDispatcher.java:564)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.java:611)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.d(IdeKeyEventDispatcher.java:463)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:206)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:493)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:335)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Example with line width configured to 120 characters:
import static de.codecentric.centerdevice.document.metadata.extended.ExtendedMetadataConstants.hasValidValueForIdentifier;
is "formated" to
import static de.codecentric.centerdevice.document.metadata.extended.ExtendedMetadataConstants;
startOffset0, endOffset:5147, length of file 5147: loading of profile settings failed, selected profile is null
java.lang.IllegalStateException: loading of profile settings failed, selected profile is null
at krasa.formatter.utils.FileUtils.readXmlJavaSettingsFile(FileUtils.java:83)
at krasa.formatter.settings.provider.CachedPropertiesProvider.readXmlFile(CachedPropertiesProvider.java:34)
at krasa.formatter.settings.provider.JavaPropertiesProvider.readFile(JavaPropertiesProvider.java:54)
at krasa.formatter.settings.provider.JavaPropertiesProvider.readFile(JavaPropertiesProvider.java:13)
at krasa.formatter.settings.provider.CachedProvider.get(CachedProvider.java:26)
at krasa.formatter.eclipse.JavaCodeFormatterFacade.newCodeFormatter(JavaCodeFormatterFacade.java:40)
at krasa.formatter.eclipse.JavaCodeFormatterFacade.getCodeFormatter(JavaCodeFormatterFacade.java:33)
at krasa.formatter.eclipse.JavaCodeFormatterFacade.formatInternal(JavaCodeFormatterFacade.java:96)
at krasa.formatter.eclipse.CodeFormatterFacade.format(CodeFormatterFacade.java:17)
at krasa.formatter.plugin.EclipseCodeFormatter.reformat(EclipseCodeFormatter.java:100)
at krasa.formatter.plugin.EclipseCodeFormatter.formatWhenEditorIsOpen(EclipseCodeFormatter.java:84)
at krasa.formatter.plugin.EclipseCodeFormatter.format(EclipseCodeFormatter.java:52)
at krasa.formatter.plugin.EclipseCodeStyleManager.formatWithEclipse(EclipseCodeStyleManager.java:158)
at krasa.formatter.plugin.EclipseCodeStyleManager.format(EclipseCodeStyleManager.java:93)
at krasa.formatter.plugin.EclipseCodeStyleManager.reformatText(EclipseCodeStyleManager.java:66)
at com.intellij.codeInsight.actions.ReformatCodeProcessor$1.call(ReformatCodeProcessor.java:94)
at com.intellij.codeInsight.actions.ReformatCodeProcessor$1.call(ReformatCodeProcessor.java:83)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at com.intellij.codeInsight.actions.ReformatAndOptimizeImportsProcessor$1.call(ReformatAndOptimizeImportsProcessor.java:83)
at com.intellij.codeInsight.actions.ReformatAndOptimizeImportsProcessor$1.call(ReformatAndOptimizeImportsProcessor.java:80)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$2.run(AbstractLayoutCodeProcessor.java:210)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:997)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$9$1$1.run(AbstractLayoutCodeProcessor.java:489)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:124)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:99)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:85)
at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$9$1.run(AbstractLayoutCodeProcessor.java:484)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:346)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)
at java.awt.EventQueue.access$400(EventQueue.java:82)
at java.awt.EventQueue$2.run(EventQueue.java:676)
at java.awt.EventQueue$2.run(EventQueue.java:674)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:685)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:696)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:524)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:335)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
plz check it.
WebStorm deactivates it and now all my code is formatted ugly ;(
Is this really a functional problem or just a problem with the definition of compatible versions?
If we turn on plugin in one project and turn off in another project - everything okay! But when we close IDE and start again plugin have the same settings in all projects.
I have installed this plugin downloaded from Repository Plugin. After restarting Eclipse it is not shown in installed plugins list.
Can I provide some logs to help solve this problem?
This error happens immediately after opening up IDEA
IDEA Build: IU-139.1117
Must not change document outside command or undo-transparent action. See com.intellij.openapi.command.WriteCommandAction or com.intellij.openapi.command.CommandProcessor
The formatter stops being invoked. Instead, IntelliJ formats the code. Additionally, no notification is displayed. This only happens for a file, not the entire project.
The formatter Version 14.5.132.637.1 works fine for JavaScript in WebStorm 9.0.1 under MacOS. But after I use some LiveTemplates it seems to switching back to the intellij formatter. I tried it with check und unchecked the option Reformat according to style but the problem still exists.
Thank You!
This plugin has potential. It has been registered as available for CLion users as well. However, after installing it in CLion, it appears it only supports Java/JavaScript code style formatter. It would be great if the C/C++ code style formatter is being supported as well. Thanks.
I used an alt-enter intention action to implement an abstract class, and that failed with the following error:
Do not call commitDocument() from inside PSI change listener: Do not call commitDocument() from inside PSI change listener
java.lang.AssertionError: Do not call commitDocument() from inside PSI change listener
at com.intellij.psi.impl.PsiDocumentManagerBase.a(PsiDocumentManagerBase.java:363)
at com.intellij.psi.impl.PsiDocumentManagerBase.commitDocument(PsiDocumentManagerBase.java:276)
at com.intellij.openapi.fileEditor.impl.text.PsiAwareTextEditorProvider.getStateImpl(PsiAwareTextEditorProvider.java:111)
at com.intellij.openapi.fileEditor.impl.text.TextEditorImpl.getState(TextEditorImpl.java:95)
at com.intellij.openapi.fileEditor.impl.EditorHistoryManager.a(EditorHistoryManager.java:159)
at com.intellij.openapi.fileEditor.impl.EditorHistoryManager.a(EditorHistoryManager.java:111)
at com.intellij.openapi.fileEditor.impl.EditorHistoryManager.access$800(EditorHistoryManager.java:48)
at com.intellij.openapi.fileEditor.impl.EditorHistoryManager$MyEditorManagerListener.fileOpened(EditorHistoryManager.java:357)
at sun.reflect.GeneratedMethodAccessor59.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(MessageBusConnectionImpl.java:114)
at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:228)
at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:234)
at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:219)
at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:216)
at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(MessageBusImpl.java:209)
at com.intellij.util.messages.impl.MessageBusImpl.access$000(MessageBusImpl.java:43)
at com.intellij.util.messages.impl.MessageBusImpl$1.invoke(MessageBusImpl.java:131)
at com.sun.proxy.$Proxy87.fileOpened(Unknown Source)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl$12.run(FileEditorManagerImpl.java:909)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl$13$1.run(FileEditorManagerImpl.java:958)
at com.intellij.openapi.wm.impl.FocusManagerImpl.a(FocusManagerImpl.java:645)
at com.intellij.openapi.wm.impl.FocusManagerImpl.g(FocusManagerImpl.java:629)
at com.intellij.openapi.wm.impl.FocusManagerImpl.e(FocusManagerImpl.java:599)
at com.intellij.openapi.wm.impl.FocusManagerImpl.access$200(FocusManagerImpl.java:60)
at com.intellij.openapi.wm.impl.FocusManagerImpl$7.run(FocusManagerImpl.java:495)
at com.intellij.util.ui.UIUtil.invokeLaterIfNeeded(UIUtil.java:2017)
at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:473)
at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.doWhenFocusSettlesDown(IdeFocusManagerImpl.java:59)
at com.intellij.ui.tabs.impl.JBTabsImpl.removeDeferred(JBTabsImpl.java:957)
at com.intellij.ui.tabs.impl.JBTabsImpl.access$2000(JBTabsImpl.java:62)
at com.intellij.ui.tabs.impl.JBTabsImpl$12.run(JBTabsImpl.java:847)
at com.intellij.openapi.util.ExecutionCallback.setExecuted(ExecutionCallback.java:58)
at com.intellij.openapi.util.ActionCallback.setRejected(ActionCallback.java:88)
at com.intellij.openapi.wm.impl.FocusManagerImpl.a(FocusManagerImpl.java:408)
at com.intellij.openapi.wm.impl.FocusManagerImpl.h(FocusManagerImpl.java:672)
at com.intellij.openapi.wm.impl.FocusManagerImpl.isFocusTransferReady(FocusManagerImpl.java:657)
at com.intellij.openapi.wm.impl.FocusManagerImpl.isFocusBeingTransferred(FocusManagerImpl.java:1113)
at com.intellij.openapi.wm.impl.FocusManagerImpl.getFocusOwner(FocusManagerImpl.java:899)
at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.getFocusOwner(IdeFocusManagerImpl.java:119)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl$2.run(FileEditorManagerImpl.java:202)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.a(FileEditorManagerImpl.java:230)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.getCurrentFile(FileEditorManagerImpl.java:516)
at com.intellij.openapi.fileEditor.impl.PsiAwareFileEditorManagerImpl$MyPsiTreeChangeListener.a(PsiAwareFileEditorManagerImpl.java:160)
at com.intellij.openapi.fileEditor.impl.PsiAwareFileEditorManagerImpl$MyPsiTreeChangeListener.childReplaced(PsiAwareFileEditorManagerImpl.java:139)
at com.intellij.psi.impl.PsiManagerImpl.a(PsiManagerImpl.java:459)
at com.intellij.psi.impl.PsiManagerImpl.childReplaced(PsiManagerImpl.java:360)
at com.intellij.pom.wrappers.PsiEventWrapperAspect.a(PsiEventWrapperAspect.java:103)
at com.intellij.pom.wrappers.PsiEventWrapperAspect.update(PsiEventWrapperAspect.java:50)
at com.intellij.pom.core.impl.PomModelImpl.runTransaction(PomModelImpl.java:176)
at com.intellij.psi.impl.DocumentCommitProcessor.doActualPsiChange(DocumentCommitProcessor.java:174)
at com.intellij.psi.impl.DocumentCommitProcessor$1$1.run(DocumentCommitProcessor.java:142)
at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl$8.compute(CodeStyleManagerImpl.java:669)
at com.intellij.psi.impl.source.PostprocessReformattingAspect.disablePostprocessFormattingInside(PostprocessReformattingAspect.java:116)
at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl$10.compute(CodeStyleManagerImpl.java:704)
at com.intellij.formatting.FormatterImpl.runWithFormattingDisabled(FormatterImpl.java:812)
at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.performActionWithFormatterDisabled(CodeStyleManagerImpl.java:700)
at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.performActionWithFormatterDisabled(CodeStyleManagerImpl.java:666)
at krasa.formatter.plugin.DelegatingCodeStyleManager.performActionWithFormatterDisabled(DelegatingCodeStyleManager.java:139)
at com.intellij.psi.impl.DocumentCommitProcessor$1.process(DocumentCommitProcessor.java:138)
at com.intellij.psi.impl.DocumentCommitProcessor$1.process(DocumentCommitProcessor.java:128)
at com.intellij.psi.impl.PsiDocumentManagerBase.finishCommitInWriteAction(PsiDocumentManagerBase.java:321)
at com.intellij.psi.impl.PsiDocumentManagerImpl.finishCommitInWriteAction(PsiDocumentManagerImpl.java:141)
at com.intellij.psi.impl.PsiDocumentManagerBase$2.run(PsiDocumentManagerBase.java:289)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:984)
at com.intellij.psi.impl.PsiDocumentManagerBase.finishCommit(PsiDocumentManagerBase.java:286)
at com.intellij.psi.impl.DocumentCommitThread$4.run(DocumentCommitThread.java:477)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)
at java.awt.EventQueue.access$400(EventQueue.java:82)
at java.awt.EventQueue$2.run(EventQueue.java:676)
at java.awt.EventQueue$2.run(EventQueue.java:674)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:685)
at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:697)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:524)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:335)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Hi there - the plugin behaves strange on JSP files.
With IDEA 14.0.2 and JSPs with import statements all imports will be deleted (by the plugin I guess) when running "organize imports" command.
When disabling the plugin it's working fine.
Could reproduce it on different machines (Win7) with different settings and no plugins installed expect yours.
Thanks for help :)
Hi!
I've just installed 14.8.132.637 in intelliJ 14.1.1 and I'm not able to configure. I've already restarted the IDE and I cannot find the Settings -> Other Settings option.
Do you know if there is any problem with these versions?
Thank you!
I get this error message
11:55:08 Some.java failed to format with Eclipse code formatter. Probably due to syntax error or wrong configuration file.
Nothing in idea.log.
Wondering what is the best way to debug it. (I don't think config file has changed and file I'm trying to format is compilable, looks ok in eclipse/intellij.)
There is no way to export eclipse's JavaScript formatting preferences from eclipse that I can see. The plugin should enable export of eclipse's JavaScript formatting preferences and import them into WebStorm. That'd be jim-dandy.
When I set the cursor over an unused import and execute Alt+Enter and select Optimize Imports, Intellij does that using the build-in formatter.
For example:
This is how my EclipseFormatter is configured (the code is formatted):
Now I put an unused import and do Alt+Enter -> Optimize Imports
The result is:
As you can see the imports are reordered (Intellij configuration is used)
Plugin uses obsolete API.: schemely.formatter.SchemeIndentOptionsProvider
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.