Remove optimization in KotlinScriptDependenciesClassFinder

Scope can contains only classes for one script,
but allScriptDependenciesScope contains classes for all scripts
This commit is contained in:
Natalia Selezneva
2020-07-20 17:56:04 +03:00
parent be8374a1a8
commit be371c9294
10 changed files with 140 additions and 28 deletions
@@ -24,12 +24,6 @@ class KotlinScriptDependenciesClassFinder(
.getAllScriptsDependenciesClassFiles().filter { it.isValid }.toList()
override fun findClass(qualifiedName: String, scope: GlobalSearchScope): PsiClass? {
val scriptDependencies =
ScriptConfigurationManager.getInstance(project).getAllScriptsDependenciesClassFiles()
val firstJarInDependencies = scriptDependencies.firstOrNull() ?: return null
if (!scope.contains(firstJarInDependencies)) return null
val classByFileName = super.findClass(qualifiedName, scope)
if (classByFileName != null) {
return classByFileName.isInScope(scope)