[Analysis API] optimize KotlinPackageProvider.getSubPackageFqNames
Previously, we queried heavy kotlin package provider two times which affected performance Now it's being queries only a single time Also, the commit introduces separation for KotlinPackageProvider between kotlin and platform-specific packages ^KTIJ-24640
This commit is contained in:
committed by
Space Team
parent
c940eb25b0
commit
4944b454c5
+2
-2
@@ -79,11 +79,11 @@ class SymbolKotlinAsJavaSupport(project: Project) : KotlinAsJavaSupportBase<KtMo
|
||||
.toSet()
|
||||
|
||||
override fun packageExists(fqName: FqName, scope: GlobalSearchScope): Boolean =
|
||||
project.createPackageProvider(scope).doKotlinPackageExists(fqName)
|
||||
project.createPackageProvider(scope).doesKotlinOnlyPackageExist(fqName)
|
||||
|
||||
override fun getSubPackages(fqn: FqName, scope: GlobalSearchScope): Collection<FqName> =
|
||||
project.createPackageProvider(scope)
|
||||
.getKotlinSubPackageFqNames(fqn)
|
||||
.getKotlinOnlySubPackagesFqNames(fqn, nameFilter = { true })
|
||||
.map { fqn.child(it) }
|
||||
|
||||
override fun createInstanceOfLightScript(script: KtScript): KtLightClass? = error("Should not be called")
|
||||
|
||||
Reference in New Issue
Block a user