[FIR] Introduce separate getTopLevelFunction/PropertySymbols
This commit is contained in:
+15
@@ -237,6 +237,17 @@ class FirBuiltinSymbolProvider(session: FirSession, val kotlinScopeProvider: Kot
|
||||
}
|
||||
}
|
||||
|
||||
@FirSymbolProviderInternals
|
||||
override fun getTopLevelFunctionSymbolsTo(destination: MutableList<FirNamedFunctionSymbol>, packageFqName: FqName, name: Name) {
|
||||
allPackageFragments[packageFqName]?.flatMapTo(destination) {
|
||||
it.getTopLevelFunctionSymbols(name)
|
||||
}
|
||||
}
|
||||
|
||||
@FirSymbolProviderInternals
|
||||
override fun getTopLevelPropertySymbolsTo(destination: MutableList<FirPropertySymbol>, packageFqName: FqName, name: Name) {
|
||||
}
|
||||
|
||||
private class BuiltInsPackageFragment(
|
||||
stream: InputStream, val fqName: FqName, val session: FirSession,
|
||||
val kotlinScopeProvider: KotlinScopeProvider,
|
||||
@@ -297,6 +308,10 @@ class FirBuiltinSymbolProvider(session: FirSession, val kotlinScopeProvider: Kot
|
||||
}
|
||||
|
||||
fun getTopLevelCallableSymbols(name: Name): List<FirCallableSymbol<*>> {
|
||||
return getTopLevelFunctionSymbols(name)
|
||||
}
|
||||
|
||||
fun getTopLevelFunctionSymbols(name: Name): List<FirNamedFunctionSymbol> {
|
||||
return packageProto.`package`.functionList.filter { nameResolver.getName(it.name) == name }.map {
|
||||
memberDeserializer.loadFunction(it).symbol
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user