[Analysis API] fix common code resolution which requires getting symbols from builtin session

A common platform builtin session before were created with `::wrapScopeWithJvmMapped`.
This required some other JVM session components to be registered.
We cannot register all JVM components in builtin session;
it would lead to problems like KT-62777.

So we use `::wrapScopeWithJvmMapped` only for true JVM sessions.

This commit fixes a test added in the previous commit for KT-62768.

^KT-62768 fixed
This commit is contained in:
Ilya Kirillov
2023-10-20 12:39:27 +02:00
committed by Space Team
parent 80fda25c58
commit 649bbcf35f
@@ -83,7 +83,10 @@ class LLFirBuiltinsSessionFactory(private val project: Project) {
registerJavaComponents(JavaModuleResolver.getInstance(project))
}
val kotlinScopeProvider = FirKotlinScopeProvider(::wrapScopeWithJvmMapped)
val kotlinScopeProvider = when {
platform.isJvm() -> FirKotlinScopeProvider(::wrapScopeWithJvmMapped)
else -> FirKotlinScopeProvider()
}
register(FirKotlinScopeProvider::class, kotlinScopeProvider)
val symbolProvider = createCompositeSymbolProvider(this) {