[Analysis API] fix missing names in KtFirStarImportingScope

The missing name types were: java classifier names, callable/classifier names generated by plugins
This commit is contained in:
Ilya Kirillov
2023-05-15 16:18:42 +02:00
committed by Space Team
parent 546191d1b3
commit d1da3b8acd
3 changed files with 126 additions and 126 deletions
@@ -35,7 +35,7 @@ internal class KtFirStarImportingScope(
override fun getPossibleCallableNames(): Set<Name> = withValidityAssertion {
imports.flatMapTo(hashSetOf()) { import: Import ->
if (import.relativeClassName == null) { // top level callable
analysisSession.useSiteScopeDeclarationProvider.getTopLevelCallableNamesInPackage(import.packageFqName)
DeclarationsInPackageProvider.getTopLevelCallableNamesInPackageProvider(import.packageFqName, analysisSession)
} else { //member
val classId = import.resolvedClassId ?: error("Class id should not be null as relativeClassName is not null")
firScope.getStaticsScope(classId)?.getCallableNames().orEmpty()
@@ -50,7 +50,7 @@ internal class KtFirStarImportingScope(
override fun getPossibleClassifierNames(): Set<Name> = withValidityAssertion {
imports.flatMapTo(hashSetOf()) { import ->
if (import.relativeClassName == null) {
analysisSession.useSiteScopeDeclarationProvider.getTopLevelKotlinClassLikeDeclarationNamesInPackage(import.packageFqName)
DeclarationsInPackageProvider.getTopLevelClassifierNamesInPackageProvider(import.packageFqName, analysisSession)
} else {
val classId = import.resolvedClassId ?: error("Class id should not be null as relativeClassName is not null")
firScope.getStaticsScope(classId)?.getClassifierNames().orEmpty()