Analysis API: use FirSession from star importing scope for resolving classifiers
Resolve should happen from the use-site of the file to which importing scope belongs to
This commit is contained in:
+1
-1
@@ -182,7 +182,7 @@ internal class KtFirScopeProvider(
|
||||
|
||||
private fun convertToKtScope(firScope: FirScope): KtScope {
|
||||
return when (firScope) {
|
||||
is FirAbstractSimpleImportingScope -> KtFirNonStarImportingScope(firScope, builder, token, analysisSession.rootModuleSession)
|
||||
is FirAbstractSimpleImportingScope -> KtFirNonStarImportingScope(firScope, builder, token)
|
||||
is FirAbstractStarImportingScope -> KtFirStarImportingScope(firScope, builder, project, token)
|
||||
is FirPackageMemberScope -> KtFirPackageScope(
|
||||
firScope.fqName,
|
||||
|
||||
+1
-2
@@ -27,7 +27,6 @@ internal class KtFirNonStarImportingScope(
|
||||
private val firScope: FirAbstractSimpleImportingScope,
|
||||
private val builder: KtSymbolByFirBuilder,
|
||||
override val token: ValidityToken,
|
||||
private val firSession: FirSession
|
||||
) : KtNonStarImportingScope, ValidityTokenOwner {
|
||||
|
||||
@OptIn(ExperimentalStdlibApi::class)
|
||||
@@ -38,7 +37,7 @@ internal class KtFirNonStarImportingScope(
|
||||
val importedClassId = import.importedName?.let { importedName ->
|
||||
val importedClassId =
|
||||
import.resolvedParentClassId?.createNestedClassId(importedName) ?: ClassId(import.packageFqName, importedName)
|
||||
importedClassId.takeIf { firSession.symbolProvider.getClassLikeSymbolByClassId(it) != null }
|
||||
importedClassId.takeIf { firScope.session.symbolProvider.getClassLikeSymbolByClassId(it) != null }
|
||||
}
|
||||
NonStarImport(
|
||||
import.packageFqName,
|
||||
|
||||
Reference in New Issue
Block a user