[AA] Register library and builtins session factories in Standalone AA Builder
This commit is contained in:
+1
@@ -25,6 +25,7 @@ import org.jetbrains.kotlin.analysis.decompiled.light.classes.ClsJavaStubByVirtu
|
|||||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.api.services.FirSealedClassInheritorsProcessorFactory
|
import org.jetbrains.kotlin.analysis.low.level.api.fir.api.services.FirSealedClassInheritorsProcessorFactory
|
||||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.api.services.PackagePartProviderFactory
|
import org.jetbrains.kotlin.analysis.low.level.api.fir.api.services.PackagePartProviderFactory
|
||||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.project.structure.LLFirBuiltinsSessionFactory
|
import org.jetbrains.kotlin.analysis.low.level.api.fir.project.structure.LLFirBuiltinsSessionFactory
|
||||||
|
import org.jetbrains.kotlin.analysis.low.level.api.fir.project.structure.LLFirLibrarySessionFactory
|
||||||
import org.jetbrains.kotlin.analysis.project.structure.KtModuleScopeProvider
|
import org.jetbrains.kotlin.analysis.project.structure.KtModuleScopeProvider
|
||||||
import org.jetbrains.kotlin.analysis.project.structure.KtModuleScopeProviderImpl
|
import org.jetbrains.kotlin.analysis.project.structure.KtModuleScopeProviderImpl
|
||||||
import org.jetbrains.kotlin.analysis.project.structure.ProjectStructureProvider
|
import org.jetbrains.kotlin.analysis.project.structure.ProjectStructureProvider
|
||||||
|
|||||||
+2
-2
@@ -33,7 +33,7 @@ import org.jetbrains.kotlin.platform.jvm.isJvm
|
|||||||
import org.jetbrains.kotlin.resolve.jvm.platform.JvmPlatformAnalyzerServices
|
import org.jetbrains.kotlin.resolve.jvm.platform.JvmPlatformAnalyzerServices
|
||||||
|
|
||||||
@OptIn(PrivateSessionConstructor::class, SessionConfiguration::class)
|
@OptIn(PrivateSessionConstructor::class, SessionConfiguration::class)
|
||||||
class LLFirBuiltinsSessionFactory(
|
class LLFirBuiltinsSessionFactory(
|
||||||
private val project: Project,
|
private val project: Project,
|
||||||
) {
|
) {
|
||||||
private val builtInTypes = BuiltinTypes() // TODO should be platform-specific
|
private val builtInTypes = BuiltinTypes() // TODO should be platform-specific
|
||||||
@@ -79,4 +79,4 @@ private fun TargetPlatform.getAnalyzerServices() = when {
|
|||||||
// isNative() -> NativePlatformAnalyzerServices
|
// isNative() -> NativePlatformAnalyzerServices
|
||||||
isCommon() -> CommonPlatformAnalyzerServices
|
isCommon() -> CommonPlatformAnalyzerServices
|
||||||
else -> JvmPlatformAnalyzerServices/*TODO*/
|
else -> JvmPlatformAnalyzerServices/*TODO*/
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -30,11 +30,11 @@ import org.jetbrains.kotlin.fir.symbols.FirLazyDeclarationResolver
|
|||||||
import org.jetbrains.kotlin.resolve.jvm.modules.JavaModuleResolver
|
import org.jetbrains.kotlin.resolve.jvm.modules.JavaModuleResolver
|
||||||
|
|
||||||
@OptIn(PrivateSessionConstructor::class, SessionConfiguration::class)
|
@OptIn(PrivateSessionConstructor::class, SessionConfiguration::class)
|
||||||
internal class LLFirLibrarySessionFactory(
|
class LLFirLibrarySessionFactory(
|
||||||
private val project: Project,
|
private val project: Project,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
fun getLibrarySession(ktBinaryModule: KtBinaryModule, sessionsCache: MutableMap<KtModule, LLFirSession>): LLFirLibrarySession {
|
internal fun getLibrarySession(ktBinaryModule: KtBinaryModule, sessionsCache: MutableMap<KtModule, LLFirSession>): LLFirLibrarySession {
|
||||||
return sessionsCache.getOrPut(ktBinaryModule) { createModuleLibrariesSession(ktBinaryModule) } as LLFirLibrarySession
|
return sessionsCache.getOrPut(ktBinaryModule) { createModuleLibrariesSession(ktBinaryModule) } as LLFirLibrarySession
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,4 +81,4 @@ internal class LLFirLibrarySessionFactory(
|
|||||||
project.getService(LLFirLibrarySessionFactory::class.java)
|
project.getService(LLFirLibrarySessionFactory::class.java)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user