Check that project is open before starting highlighting
This may be false when user opens Kotlin Scripting Settings, so default project is passed to ScriptDefinitionsManager ^KT-30206 Fixed
This commit is contained in:
+4
-2
@@ -102,7 +102,9 @@ class ScriptConfigurationManagerImpl internal constructor(private val project: P
|
||||
override fun clearConfigurationCachesAndRehighlight() {
|
||||
ScriptDependenciesModificationTracker.getInstance(project).incModificationCount()
|
||||
|
||||
clearAndRehighlight()
|
||||
if (project.isOpen) {
|
||||
rehighlightOpenedScripts()
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated("Use getScriptClasspath(KtFile) instead")
|
||||
@@ -322,7 +324,7 @@ class ScriptConfigurationManagerImpl internal constructor(private val project: P
|
||||
return isConfigurationCached(file) && memoryCache.isConfigurationUpToDate(file)
|
||||
}
|
||||
|
||||
private fun clearAndRehighlight() {
|
||||
private fun rehighlightOpenedScripts() {
|
||||
val openedScripts = FileEditorManager.getInstance(project).openFiles.filterNot { it.isNonScript() }
|
||||
updateHighlighting(openedScripts)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user