My plugin (own dsl language parser) doesn't work under Ultimate version of IDEA 12

My plugin works fine under CommunityEdition. But when I install it under Ultimate edition and open associated with my dsl file, it craches with following exception in log:

At the same time file my dsl is opened but everything in it is blurry (even scrollbar), references in text don't work and I can not edit text in window.

2013-09-17 15:59:08,043 [  60798]  ERROR - com.intellij.ide.IdeEventQueue - IntelliJ IDEA 12.1.1  Build #IU-129.239
2013-09-17 15:59:08,043 [  60798]  ERROR - com.intellij.ide.IdeEventQueue - JDK: 1.7.0_17
2013-09-17 15:59:08,043 [  60798]  ERROR - com.intellij.ide.IdeEventQueue - VM: Java HotSpot(TM) 64-Bit Server VM
2013-09-17 15:59:08,043 [  60798]  ERROR - com.intellij.ide.IdeEventQueue - Vendor: Oracle Corporation
2013-09-17 15:59:08,043 [  60798]  ERROR - com.intellij.ide.IdeEventQueue - OS: Windows 7
2013-09-17 15:59:08,043 [  60798]  ERROR - com.intellij.ide.IdeEventQueue - Last Action: GotoDeclaration
2013-09-17 15:59:08,756 [  61511]  ERROR - com.intellij.ide.IdeEventQueue - Error during dispatching of java.awt.event.InvocationEvent[INVOCATION_DEFAULT,runnable=javax.swing.RepaintManager$ProcessingRunnable@7efc393c,notifier=null,catchExceptions=false,when=1379419148756] on
java.lang.AssertionError: 19
    at com.intellij.openapi.editor.ex.util.SegmentArray.findSegmentIndex(
    at com.intellij.openapi.editor.ex.util.LexerEditorHighlighter$HighlighterIteratorImpl.<init>(
    at com.intellij.openapi.editor.ex.util.LexerEditorHighlighter.createIterator(
    at com.intellij.openapi.editor.impl.IterationState.<init>(
    at com.intellij.openapi.editor.impl.EditorImpl.xyToVisualPosition(
    at com.intellij.openapi.editor.impl.EditorImpl.xyToLogicalPosition(
    at com.intellij.openapi.editor.impl.EditorGutterComponentImpl.paint(
    at javax.swing.JComponent.paintToOffscreen(
    at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(
    at javax.swing.RepaintManager$PaintManager.paint(
    at javax.swing.RepaintManager.paint(
    at javax.swing.JComponent._paintImmediately(
    at javax.swing.JComponent.paintImmediately(
    at javax.swing.RepaintManager$
    at javax.swing.RepaintManager$
    at Method)
    at javax.swing.RepaintManager.paintDirtyRegions(
    at javax.swing.RepaintManager.paintDirtyRegions(
    at javax.swing.RepaintManager.prePaintDirtyRegions(
    at javax.swing.RepaintManager.access$1000(
    at javax.swing.RepaintManager$
    at java.awt.event.InvocationEvent.dispatch(
    at java.awt.EventQueue.dispatchEventImpl(
    at java.awt.EventQueue.access$200(
    at java.awt.EventQueue$
    at java.awt.EventQueue$
    at Method)
    at java.awt.EventQueue.dispatchEvent(
    at com.intellij.ide.IdeEventQueue.d(
    at com.intellij.ide.IdeEventQueue._dispatchEvent(
    at com.intellij.ide.IdeEventQueue.dispatchEvent(
    at java.awt.EventDispatchThread.pumpOneEventForFilters(
    at java.awt.EventDispatchThread.pumpEventsForFilter(
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(
    at java.awt.EventDispatchThread.pumpEvents(
    at java.awt.EventDispatchThread.pumpEvents(


This exception has nothing to do with IntelliJ IDEA Ultimate. It's caused by a bug in your lexer: the sequence of tokens that you return has a gap (the end offset of the previous token is smaller than the start of the next token). Tokens returned from the lexer must always cover the entirety of the file.


Dmitry, thanks for reply. But I totally do not understand what do you mean. Whe does my lexer work excellent when I run my plugin from IDEA, and it doesn't work when it was installed as plugin "install from disk..."?
Can it be somehow related with patched jflex, which is using in OpenAPI?


Well, thanks again for your answer, Dmitry.
It was true, I really had gaps in my lexer. It may be helpful for others: I had missed token types for white-space characters, something like that:

  {CRLF}                         { yybegin(YYINITIAL); r }
  {WHITE_SPACE}                  { yybegin(YYINITIAL); }

- and it is incorrect, it must be:

  {CRLF}                         { yybegin(YYINITIAL); return TokenType.WHITE_SPACE; }
  {WHITE_SPACE}                  { yybegin(YYINITIAL); return TokenType.WHITE_SPACE; }

But in any case, this is still strange, that when running such sick lexer under IDEA ("Run plugin...") - it works perfectly.


Please sign in to leave a comment.