IntelliJ Stopped Editor Working

已回答

So, everything has been working great for years. I've been using the batch plugin for batch scripts, no issues. Today I attempted to insert a comment, which in batch requires 2 colons followed by the comment. I pressed a key weird or something, I think while my cursor was over the line numbers, and everything in the editor broke.

Now when I try to enter a colon colon comment, the keyboard locks up after the second colon and I cannot type. Additionally all the syntax highlighting after the colons is removed and all the text is black. The only way to get the syntax highlighting back is to restart. It's so strange, I can type in some areas but often only like 1 letter; if I type anywhere in the batch file the syntax highlighting disappears thereafter.

I don't know what to do. I never installed the vim plugin which I heard can cause this, I appear to have no macros, I reset the default keymappings, I uninstalled and reinstalled the batch support plugin. I'm out of ideas, please help.

Update: When I press colon just once, everything below it is highlighted red. Press it again and and the syntax highlighting is gone... I don't know vim well, but this feels like vim, which I never installed.

Looking at the IntelliJ logs I see tons of errors like this: com.intellij.openapi.editor.ex.util.LexerEditorHighlighter$InvalidStateException: com.intellij.openapi.editor.ex.util.LexerEditorHighlighter(org.intellij.lang.batch.lexer.BatchHighlighterLexer): Error updating after DocumentEventImpl[myOffset=5143, myOldLength=1, myNewLength=0, myOldString=''', myNewString=''].

This seems to be were it started in the logs:

2019-07-02 09:42:32,415 [84811753] INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 126 ms
2019-07-02 09:42:44,965 [84824303] INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 157 ms
2019-07-02 09:43:41,544 [84880882] INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 120 ms
2019-07-02 09:44:03,068 [84902406] INFO - rationStore.ComponentStoreImpl - Saving Project 'C:\Users\winthrop.polk\IdeaProjects\mdds' mddsRunManager took 17 ms
2019-07-02 09:44:03,069 [84902407] INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 101 ms
2019-07-02 09:44:33,392 [84932730] INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 85 ms
2019-07-02 09:44:42,079 [84941417] INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 84 ms
2019-07-02 09:45:28,085 [84987423] WARN - com.intellij.lexer.FlexAdapter - org.intellij.lang.batch.lexer._BatchLexer
java.lang.Error: Error: could not match input
at org.intellij.lang.batch.lexer._BatchLexer.zzScanError(_BatchLexer.java:542)
at org.intellij.lang.batch.lexer._BatchLexer.advance(_BatchLexer.java:983)
at com.intellij.lexer.FlexAdapter.locateToken(FlexAdapter.java:110)
at com.intellij.lexer.FlexAdapter.getTokenType(FlexAdapter.java:69)
at com.intellij.lexer.DelegateLexer.getTokenType(DelegateLexer.java:50)
at com.intellij.lexer.LayeredLexer.activateLayerIfNecessary(LayeredLexer.java:71)
at com.intellij.lexer.LayeredLexer.advance(LayeredLexer.java:164)
at com.intellij.openapi.editor.ex.util.LexerEditorHighlighter.documentChanged(LexerEditorHighlighter.java:275)
at com.intellij.openapi.editor.impl.DocumentImpl.changedUpdate(DocumentImpl.java:891)
at com.intellij.openapi.editor.impl.DocumentImpl.updateText(DocumentImpl.java:796)
at com.intellij.openapi.editor.impl.DocumentImpl.insertString(DocumentImpl.java:551)
at com.intellij.openapi.editor.EditorModificationUtil.insertStringAtCaretNoScrolling(EditorModificationUtil.java:102)
at com.intellij.openapi.editor.EditorModificationUtil.insertStringAtCaret(EditorModificationUtil.java:78)
at com.intellij.openapi.editor.EditorModificationUtil.insertStringAtCaret(EditorModificationUtil.java:70)
at com.intellij.codeInsight.editorActions.TypedHandler.type(TypedHandler.java:263)
at com.intellij.codeInsight.editorActions.TypedHandler.lambda$execute$0(TypedHandler.java:224)
at com.intellij.openapi.editor.impl.CaretModelImpl.lambda$runForEachCaret$3(CaretModelImpl.java:354)
at com.intellij.openapi.editor.impl.CaretModelImpl.doWithCaretMerging(CaretModelImpl.java:453)
at com.intellij.openapi.editor.impl.CaretModelImpl.runForEachCaret(CaretModelImpl.java:346)
at com.intellij.openapi.editor.impl.CaretModelImpl.runForEachCaret(CaretModelImpl.java:336)
at com.intellij.codeInsight.editorActions.TypedHandler.execute(TypedHandler.java:158)
at com.intellij.codeInsight.lookup.impl.LookupTypedHandler.execute(LookupTypedHandler.java:74)
at com.intellij.codeInsight.template.emmet.EmmetPreviewTypedHandler.execute(EmmetPreviewTypedHandler.java:39)
at com.intellij.codeInsight.editorActions.AutoFormatTypedHandler.executeOriginalHandler(AutoFormatTypedHandler.java:167)
at com.intellij.codeInsight.editorActions.AutoFormatTypedHandler.execute(AutoFormatTypedHandler.java:94)
at com.intellij.execution.impl.ConsoleViewImpl$MyTypedHandler.execute(ConsoleViewImpl.java:1226)
at com.intellij.openapi.editor.impl.DefaultRawTypedHandler$1.run(DefaultRawTypedHandler.java:55)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1054)
at com.intellij.openapi.editor.impl.DefaultRawTypedHandler.execute(DefaultRawTypedHandler.java:49)
at com.intellij.openapi.editor.impl.EditorFactoryImpl$MyRawTypedHandler.execute(EditorFactoryImpl.java:287)
at com.intellij.openapi.editor.actionSystem.TypedAction.lambda$actionPerformed$0(TypedAction.java:130)
at com.intellij.reporting.FreezeLoggerImpl.runUnderPerformanceMonitor(FreezeLoggerImpl.java:42)
at com.intellij.openapi.editor.actionSystem.TypedAction.actionPerformed(TypedAction.java:130)
at com.intellij.openapi.editor.impl.EditorImpl.processKeyTypedNormally(EditorImpl.java:1298)
at com.intellij.openapi.editor.impl.EditorImpl.processKeyTyped(EditorImpl.java:1283)
at com.intellij.openapi.editor.impl.EditorImpl.processKeyTyped(EditorImpl.java:3375)
at com.intellij.openapi.editor.impl.EditorImpl$7.keyTyped(EditorImpl.java:1113)
at java.awt.Component.processKeyEvent(Component.java:6505)
at javax.swing.JComponent.processKeyEvent(JComponent.java:2833)
at java.awt.Component.processEvent(Component.java:6327)
at java.awt.Container.processEvent(Container.java:2239)
at java.awt.Component.dispatchEventImpl(Component.java:4899)
at java.awt.Container.dispatchEventImpl(Container.java:2297)
at java.awt.Component.dispatchEvent(Component.java:4721)
at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1954)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:835)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1103)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:974)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:800)
at com.intellij.ide.IdeKeyboardFocusManager.dispatchEvent(IdeKeyboardFocusManager.java:27)
at java.awt.Component.dispatchEventImpl(Component.java:4770)
at java.awt.Container.dispatchEventImpl(Container.java:2297)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4721)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:766)
at java.awt.EventQueue.access$500(EventQueue.java:98)
at java.awt.EventQueue$3.run(EventQueue.java:715)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
at java.awt.EventQueue$4.run(EventQueue.java:739)
at java.awt.EventQueue$4.run(EventQueue.java:737)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:736)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:729)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:656)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:373)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
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)

1

It's a third-party plug-in, you can report an issue at https://github.com/aefimov/idea-batch/issues.

0

For Others:

Use the CMD plugin in IntelliJ, works just as well.

0

请先登录再写评论。