Fix NPE starting IDE Repl Console
consoleView field is initialized in initAndRun inside invokeLaterIfNeeded call. This may cause NPE in setupGutters if consoleView isn't initialized yet ^KT-29400 Fixed
This commit is contained in:
@@ -48,8 +48,6 @@ class KotlinConsoleKeeper(val project: Project) {
|
|||||||
|
|
||||||
val consoleRunner = KotlinConsoleRunner(module, cmdLine, previousCompilationFailed, project, REPL_TITLE, path)
|
val consoleRunner = KotlinConsoleRunner(module, cmdLine, previousCompilationFailed, project, REPL_TITLE, path)
|
||||||
consoleRunner.initAndRun()
|
consoleRunner.initAndRun()
|
||||||
consoleRunner.setupGutters()
|
|
||||||
|
|
||||||
return consoleRunner
|
return consoleRunner
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -168,6 +168,8 @@ class KotlinConsoleRunner(
|
|||||||
|
|
||||||
enableCompletion(consoleView)
|
enableCompletion(consoleView)
|
||||||
|
|
||||||
|
setupGutters(consoleView)
|
||||||
|
|
||||||
return consoleView
|
return consoleView
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -228,7 +230,7 @@ class KotlinConsoleRunner(
|
|||||||
editor.setPlaceholderAttributes(placeholderAttrs)
|
editor.setPlaceholderAttributes(placeholderAttrs)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setupGutters() {
|
fun setupGutters(consoleView: LanguageConsoleView) {
|
||||||
fun configureEditorGutter(editor: EditorEx, color: Color, iconWithTooltip: IconWithTooltip): RangeHighlighter {
|
fun configureEditorGutter(editor: EditorEx, color: Color, iconWithTooltip: IconWithTooltip): RangeHighlighter {
|
||||||
editor.settings.isLineMarkerAreaShown = true // hack to show gutter
|
editor.settings.isLineMarkerAreaShown = true // hack to show gutter
|
||||||
editor.settings.isFoldingOutlineShown = true
|
editor.settings.isFoldingOutlineShown = true
|
||||||
|
|||||||
Reference in New Issue
Block a user