Temporary workaround for ProcessCanceledException that may happen during dependencies update
This happens during finding script definition (especially during virtual file to psi file search) In this case dependencies may be already saved to cache, so makeRootChangeEvent should be generated, otherwise indexes aren't updated and highlighting in the script can be broken
This commit is contained in:
+7
-2
@@ -68,8 +68,13 @@ class ScriptsCompilationConfigurationUpdater(
|
||||
fun getCurrentCompilationConfiguration(file: VirtualFile): ScriptCompilationConfigurationResult? {
|
||||
cache[file]?.let { return it }
|
||||
|
||||
updateDependencies(file)
|
||||
makeRootsChangeIfNeeded()
|
||||
// Try-catch block is a temporary workaround for ProcessCanceledException
|
||||
// that may happen during VirtualFile to PsiFile transformation
|
||||
try {
|
||||
updateDependencies(file)
|
||||
} finally {
|
||||
makeRootsChangeIfNeeded()
|
||||
}
|
||||
|
||||
return cache[file]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user