Rewrite scripting related API to PsiFile instead of VirtualFile

There were several places where we converted virtualFile to PsiFile. This operation need a read access and may throw ProcessCanceledException,
so we want to minimize its usages in IDE
This commit is contained in:
Natalia Selezneva
2019-08-08 13:47:39 +03:00
parent 5b48dcca4f
commit dc46f73ecf
30 changed files with 278 additions and 211 deletions
@@ -48,7 +48,7 @@ class GradleBuildFileHighlightingTest : GradleImportingTestCase() {
val psiFile = PsiManager.getInstance(myProject).findFile(file) as? KtFile
?: error("Couldn't find psiFile for virtual file: ${file.canonicalPath}")
ScriptDependenciesManager.updateScriptDependenciesSynchronously(file, myProject)
ScriptDependenciesManager.updateScriptDependenciesSynchronously(psiFile, myProject)
val bindingContext = psiFile.analyzeWithContent()