Check if vFile is still valid in ScriptClassRootsUpdater#updateHighlighting
^EA-218774 Fixed
This commit is contained in:
committed by
Vladimir Dolzhenko
parent
ba027a785c
commit
02be470e91
+3
-1
@@ -237,7 +237,7 @@ abstract class ScriptClassRootsUpdater(
|
|||||||
if (!project.isOpen) return
|
if (!project.isOpen) return
|
||||||
|
|
||||||
val openFiles = FileEditorManager.getInstance(project).allEditors.mapNotNull { it.file }
|
val openFiles = FileEditorManager.getInstance(project).allEditors.mapNotNull { it.file }
|
||||||
val openedScripts = openFiles.filter { filter(it) }
|
val openedScripts = openFiles.filter(filter)
|
||||||
|
|
||||||
if (openedScripts.isEmpty()) return
|
if (openedScripts.isEmpty()) return
|
||||||
|
|
||||||
@@ -245,6 +245,8 @@ abstract class ScriptClassRootsUpdater(
|
|||||||
if (project.isDisposed) return@launch
|
if (project.isDisposed) return@launch
|
||||||
|
|
||||||
openedScripts.forEach {
|
openedScripts.forEach {
|
||||||
|
if (!it.isValid) return@forEach
|
||||||
|
|
||||||
PsiManager.getInstance(project).findFile(it)?.let { psiFile ->
|
PsiManager.getInstance(project).findFile(it)?.let { psiFile ->
|
||||||
if (psiFile is KtFile) {
|
if (psiFile is KtFile) {
|
||||||
DaemonCodeAnalyzer.getInstance(project).restart(psiFile)
|
DaemonCodeAnalyzer.getInstance(project).restart(psiFile)
|
||||||
|
|||||||
Reference in New Issue
Block a user