mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
diagnostics for EA-48865
This commit is contained in:
+7
-3
@@ -113,7 +113,6 @@ public class LexerEditorHighlighter implements EditorHighlighter, PrioritizedDoc
|
||||
((DocumentEx)document).setInBulkUpdate(false); // bulk mode failed
|
||||
}
|
||||
doSetText(document.getCharsSequence());
|
||||
assert isInSyncWithDocument() : "Lexer produced no tokens for non-empty document: " + myLexer;
|
||||
}
|
||||
|
||||
final int latestValidOffset = mySegments.getLastValidOffset();
|
||||
@@ -315,7 +314,8 @@ public class LexerEditorHighlighter implements EditorHighlighter, PrioritizedDoc
|
||||
|
||||
private void doSetText(final CharSequence text) {
|
||||
final TokenProcessor processor = createTokenProcessor(0);
|
||||
myLexer.start(text, 0, text.length(),myInitialState);
|
||||
final int textLength = text.length();
|
||||
myLexer.start(text, 0, textLength, myInitialState);
|
||||
mySegments.removeAll();
|
||||
int i = 0;
|
||||
while (true) {
|
||||
@@ -328,12 +328,16 @@ public class LexerEditorHighlighter implements EditorHighlighter, PrioritizedDoc
|
||||
myLexer.advance();
|
||||
}
|
||||
processor.finish();
|
||||
|
||||
if (textLength > 0 && (mySegments.mySegmentCount == 0 || mySegments.myEnds[mySegments.mySegmentCount - 1] != textLength)) {
|
||||
throw new IllegalStateException("Unexpected termination offset for lexer " + myLexer);
|
||||
}
|
||||
|
||||
if(myEditor != null && !ApplicationManager.getApplication().isHeadlessEnvironment()) {
|
||||
UIUtil.invokeLaterIfNeeded(new DumbAwareRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
myEditor.repaint(0, text.length());
|
||||
myEditor.repaint(0, textLength);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user