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:
Natalia Selezneva
2019-06-03 11:42:07 +03:00
parent 233c37db57
commit 20d19ee66f
@@ -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]
}