[FIR] Type "top-level classifier names in package" as Name

- This is more consistent with "top-level callable names in package" and
  simplifies the set construction quite a bit, as we can avoid a lot of
  `asString` conversions.
This commit is contained in:
Marco Pennekamp
2023-10-19 19:21:45 +02:00
committed by Space Team
parent 8034d522b9
commit efe587691b
16 changed files with 43 additions and 41 deletions
@@ -79,9 +79,9 @@ class FirCloneableSymbolProvider(
}
override val symbolNamesProvider: FirSymbolNamesProvider = object : FirSymbolNamesProviderWithoutCallables() {
override fun getTopLevelClassifierNamesInPackage(packageFqName: FqName): Set<String> =
override fun getTopLevelClassifierNamesInPackage(packageFqName: FqName): Set<Name> =
if (packageFqName == StandardClassIds.Cloneable.packageFqName) {
setOf(StandardClassIds.Cloneable.shortClassName.asString())
setOf(StandardClassIds.Cloneable.shortClassName)
} else emptySet()
}
@@ -85,8 +85,8 @@ class FirProviderImpl(val session: FirSession, val kotlinScopeProvider: FirKotli
override fun getPackageNamesWithTopLevelCallables(): Set<String> =
state.allSubPackages.mapTo(mutableSetOf()) { it.asString() }
override fun getTopLevelClassifierNamesInPackage(packageFqName: FqName): Set<String> =
state.classifierInPackage[packageFqName].orEmpty().mapTo(mutableSetOf()) { it.asString() }
override fun getTopLevelClassifierNamesInPackage(packageFqName: FqName): Set<Name> =
state.classifierInPackage[packageFqName].orEmpty()
override fun getTopLevelCallableNamesInPackage(packageFqName: FqName): Set<Name> = buildSet {
for (key in state.functionMap.keys) {