File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
ki-shell/src/main/kotlin/org/jetbrains/kotlinx/ki/shell/plugins Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,6 @@ class KotlinHighlighter(private val styles: SyntaxPlugin.HighlightStyles): BaseH
35
35
try {
36
36
with (KotlinParserForHighlighting (code)) {
37
37
addParseListener(listener)
38
- removeErrorListeners()
39
38
script()
40
39
}
41
40
} catch (e: Throwable ) {
@@ -68,10 +67,17 @@ class KotlinHighlighter(private val styles: SyntaxPlugin.HighlightStyles): BaseH
68
67
override fun setErrorIndex (p0 : Int ) {}
69
68
70
69
private class KotlinParserForHighlighting (code : String ) :
71
- KotlinParser (CommonTokenStream (KotlinLexer (CharStreams .fromString(code))))
70
+ KotlinParser (
71
+ CommonTokenStream (
72
+ KotlinLexer (CharStreams .fromString(code)).also {
73
+ it.removeErrorListeners()
74
+ }
75
+ )
76
+ )
72
77
{
73
78
init {
74
79
_buildParseTrees = false
80
+ removeErrorListeners()
75
81
}
76
82
}
77
83
}
You can’t perform that action at this time.
0 commit comments