"Undoable actions allowed inside commands only" - where's the undoable action?

I get this exception and I don't know what action I did that was considered undoable. I just called addAfter - does every call to addAfter need to be run with commandprocessor? I don't remember this being a requirement.


Assertion failed: Undoable actions allowed inside commands only (see com.intellij.openapi.command.CommandProcessor.executeCommand())
java.lang.Throwable
at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:78)
at com.intellij.openapi.command.impl.DocumentEditingUndoProvider$MyEditorDocumentListener.documentChanged(DocumentEditingUndoProvider.java:19)
at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.intellij.util.EventDispatcher.a(EventDispatcher.java:60)
at com.intellij.util.EventDispatcher.a(EventDispatcher.java:27)
at com.intellij.util.EventDispatcher.access$100(EventDispatcher.java:44)
at com.intellij.util.EventDispatcher$1.invoke(EventDispatcher.java:8)
at $Proxy5.documentChanged(Unknown Source)
at com.intellij.openapi.editor.impl.DocumentImpl.a(DocumentImpl.java:7)
at com.intellij.openapi.editor.impl.DocumentImpl.access$300(DocumentImpl.java:27)
at com.intellij.openapi.editor.impl.DocumentImpl$3.afterChangedUpdate(DocumentImpl.java)
at com.intellij.openapi.editor.impl.CharArray.insert(CharArray.java:47)
at com.intellij.openapi.editor.impl.DocumentImpl.insertString(DocumentImpl.java:37)
at com.intellij.psi.impl.PsiToDocumentSynchronizer.a(PsiToDocumentSynchronizer.java:46)
at com.intellij.psi.impl.PsiToDocumentSynchronizer.access$000(PsiToDocumentSynchronizer.java:31)
at com.intellij.psi.impl.PsiToDocumentSynchronizer$5.syncDocument(PsiToDocumentSynchronizer.java:2)
at com.intellij.psi.impl.PsiToDocumentSynchronizer.a(PsiToDocumentSynchronizer.java:17)
at com.intellij.psi.impl.PsiToDocumentSynchronizer.commitTransaction(PsiToDocumentSynchronizer.java:57)
at com.intellij.pom.core.impl.PomModelImpl.a(PomModelImpl.java:91)
at com.intellij.pom.core.impl.PomModelImpl.runTransaction(PomModelImpl.java:63)
at com.intellij.psi.impl.source.xml.XmlTagImpl.a(XmlTagImpl.java:109)
at com.intellij.psi.impl.source.xml.XmlTagImpl.addInternal(XmlTagImpl.java:154)
at com.intellij.psi.impl.source.tree.CompositePsiElement.addAfter(CompositePsiElement.java:88)

at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:279)

at com.intellij.ui.ListPopup.closePopup(ListPopup.java:42)
at com.intellij.ui.ListPopup$4.keyTyped(ListPopup.java:6)
at java.awt.AWTEventMulticaster.keyTyped(AWTEventMulticaster.java:182)
at java.awt.Component.processKeyEvent(Component.java:5443)
at javax.swing.JComponent.processKeyEvent(JComponent.java:2713)
at java.awt.Component.processEvent(Component.java:5265)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1810)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:672)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:920)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:798)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:636)
at java.awt.Component.dispatchEventImpl(Component.java:3841)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Window.dispatchEventImpl(Window.java:1774)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:54)
at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:10)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:112)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

1 comment

Yep, all write psi and write document operations are undoable, so a command is needed.

0

Please sign in to leave a comment.