[LL FIR] rename FirLazyDeclarationResolver -> LLFirModuleLazyDeclarationResolver
to avoid naming collisions with LLFirLazyDeclarationResolver
This commit is contained in:
+1
-1
@@ -20,7 +20,7 @@ internal class LLFirLazyDeclarationResolver(private val sessionInvalidator: LLFi
|
||||
if (session !is LLFirResolvableModuleSession) return
|
||||
val moduleComponents = session.moduleComponents
|
||||
try {
|
||||
moduleComponents.lazyFirDeclarationsResolver.lazyResolveDeclaration(
|
||||
moduleComponents.firModuleLazyDeclarationResolver.lazyResolveDeclaration(
|
||||
firDeclarationToResolve = fir,
|
||||
scopeSession = moduleComponents.scopeSessionProvider.getScopeSession(),
|
||||
toPhase = toPhase,
|
||||
|
||||
+2
-2
@@ -13,7 +13,7 @@ import org.jetbrains.kotlin.analysis.low.level.api.fir.file.builder.LLFirFileBui
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.file.builder.ModuleFileCache
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.file.builder.ModuleFileCacheImpl
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.file.structure.FileStructureCache
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.lazy.resolve.FirLazyDeclarationResolver
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.lazy.resolve.LLFirModuleLazyDeclarationResolver
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.sessions.LLFirResolvableModuleSession
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.util.LLFirScopeSessionProvider
|
||||
import org.jetbrains.kotlin.analysis.project.structure.KtModule
|
||||
@@ -27,7 +27,7 @@ internal class LLFirModuleResolveComponents(
|
||||
) {
|
||||
val cache: ModuleFileCache = ModuleFileCacheImpl(this)
|
||||
val firFileBuilder: LLFirFileBuilder = LLFirFileBuilder(this)
|
||||
val lazyFirDeclarationsResolver = FirLazyDeclarationResolver(this)
|
||||
val firModuleLazyDeclarationResolver = LLFirModuleLazyDeclarationResolver(this)
|
||||
|
||||
val scopeSessionProvider: LLFirScopeSessionProvider = LLFirScopeSessionProvider.create(
|
||||
globalResolveComponents.project,
|
||||
|
||||
+3
-3
@@ -131,7 +131,7 @@ object LowLevelFirApiFacadeForResolveOnAir {
|
||||
val firFile = moduleComponents.firFileBuilder.buildRawFirFileWithCaching(file)
|
||||
|
||||
val scopeSession = firResolveSession.getScopeSessionFor(session)
|
||||
moduleComponents.lazyFirDeclarationsResolver.lazyResolveFileDeclaration(
|
||||
moduleComponents.firModuleLazyDeclarationResolver.lazyResolveFileDeclaration(
|
||||
firFile = firFile,
|
||||
scopeSession = scopeSession,
|
||||
toPhase = FirResolvePhase.IMPORTS
|
||||
@@ -197,7 +197,7 @@ object LowLevelFirApiFacadeForResolveOnAir {
|
||||
?: buildErrorWithAttachment("FirFile session expected to be a resolvable session but was ${firFile.llFirSession::class.java}") {
|
||||
withEntry("firSession", firFile.llFirSession) { it.toString() }
|
||||
}
|
||||
val declarationResolver = llFirResolvableSession.moduleComponents.lazyFirDeclarationsResolver
|
||||
val declarationResolver = llFirResolvableSession.moduleComponents.firModuleLazyDeclarationResolver
|
||||
|
||||
declarationResolver.resolveFileAnnotations(
|
||||
firFile = firFile,
|
||||
@@ -270,7 +270,7 @@ object LowLevelFirApiFacadeForResolveOnAir {
|
||||
ResolveTreeBuilder.resolveEnsure(onAirDesignation.declaration, FirResolvePhase.BODY_RESOLVE) {
|
||||
val resolvableSession = onAirDesignation.declaration.llFirResolvableSession
|
||||
?: error("Expected resolvable session")
|
||||
resolvableSession.moduleComponents.lazyFirDeclarationsResolver
|
||||
resolvableSession.moduleComponents.firModuleLazyDeclarationResolver
|
||||
.runLazyDesignatedOnAirResolveToBodyWithoutLock(
|
||||
designation = onAirDesignation,
|
||||
checkPCE = true,
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ internal class FirElementBuilder(
|
||||
|
||||
private fun getOrBuildFirForKtFile(ktFile: KtFile): FirFile {
|
||||
val firFile = moduleComponents.firFileBuilder.buildRawFirFileWithCaching(ktFile)
|
||||
moduleComponents.lazyFirDeclarationsResolver.lazyResolveFileDeclaration(
|
||||
moduleComponents.firModuleLazyDeclarationResolver.lazyResolveFileDeclaration(
|
||||
firFile = firFile,
|
||||
toPhase = FirResolvePhase.BODY_RESOLVE,
|
||||
scopeSession = moduleComponents.scopeSessionProvider.getScopeSession(),
|
||||
|
||||
+2
-2
@@ -103,7 +103,7 @@ internal class FileStructure private constructor(
|
||||
firProvider,
|
||||
firFile
|
||||
)
|
||||
moduleComponents.lazyFirDeclarationsResolver.lazyResolveDeclaration(
|
||||
moduleComponents.firModuleLazyDeclarationResolver.lazyResolveDeclaration(
|
||||
firDeclarationToResolve = firDeclaration,
|
||||
scopeSession = moduleComponents.scopeSessionProvider.getScopeSession(),
|
||||
toPhase = FirResolvePhase.BODY_RESOLVE,
|
||||
@@ -120,7 +120,7 @@ internal class FileStructure private constructor(
|
||||
private fun createStructureElement(container: KtAnnotated): FileStructureElement = when (container) {
|
||||
is KtFile -> {
|
||||
val firFile = moduleComponents.firFileBuilder.buildRawFirFileWithCaching(ktFile)
|
||||
moduleComponents.lazyFirDeclarationsResolver.resolveFileAnnotations(
|
||||
moduleComponents.firModuleLazyDeclarationResolver.resolveFileAnnotations(
|
||||
firFile = firFile,
|
||||
annotations = firFile.annotations,
|
||||
scopeSession = moduleComponents.scopeSessionProvider.getScopeSession(),
|
||||
|
||||
+2
-2
@@ -125,7 +125,7 @@ internal class ReanalyzableFunctionStructureElement(
|
||||
it.replaceResolvePhase(minOf(it.resolvePhase, upgradedPhase))
|
||||
}
|
||||
|
||||
moduleComponents.lazyFirDeclarationsResolver.lazyResolveDeclaration(
|
||||
moduleComponents.firModuleLazyDeclarationResolver.lazyResolveDeclaration(
|
||||
firDeclarationToResolve = originalFunction,
|
||||
scopeSession = moduleComponents.scopeSessionProvider.getScopeSession(),
|
||||
toPhase = FirResolvePhase.BODY_RESOLVE,
|
||||
@@ -179,7 +179,7 @@ internal class ReanalyzablePropertyStructureElement(
|
||||
replaceBodyResolveState(FirPropertyBodyResolveState.NOTHING_RESOLVED)
|
||||
}
|
||||
|
||||
moduleComponents.lazyFirDeclarationsResolver.lazyResolveDeclaration(
|
||||
moduleComponents.firModuleLazyDeclarationResolver.lazyResolveDeclaration(
|
||||
firDeclarationToResolve = originalProperty,
|
||||
scopeSession = moduleComponents.scopeSessionProvider.getScopeSession(),
|
||||
toPhase = FirResolvePhase.BODY_RESOLVE,
|
||||
|
||||
+1
-3
@@ -5,7 +5,6 @@
|
||||
|
||||
package org.jetbrains.kotlin.analysis.low.level.api.fir.lazy.resolve
|
||||
|
||||
import com.intellij.openapi.diagnostic.ControlFlowException
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.LLFirModuleResolveComponents
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.api.FirDeclarationDesignationWithFile
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.api.collectDesignationWithFile
|
||||
@@ -34,9 +33,8 @@ import org.jetbrains.kotlin.psi.KtClassBody
|
||||
import org.jetbrains.kotlin.psi.KtDeclaration
|
||||
import org.jetbrains.kotlin.psi.KtEnumEntry
|
||||
import org.jetbrains.kotlin.analysis.utils.errors.buildErrorWithAttachment
|
||||
import org.jetbrains.kotlin.analysis.utils.errors.*
|
||||
|
||||
internal class FirLazyDeclarationResolver(val moduleComponents: LLFirModuleResolveComponents) {
|
||||
internal class LLFirModuleLazyDeclarationResolver(val moduleComponents: LLFirModuleResolveComponents) {
|
||||
/**
|
||||
* Fully resolve file annotations (synchronized)
|
||||
* @see resolveFileAnnotationsWithoutLock not synchronized
|
||||
+1
-1
@@ -135,7 +135,7 @@ internal abstract class LLFirResolvableResolveSession(
|
||||
val llFirResolvableModuleSession = declaration.llFirModuleData.session as? LLFirResolvableModuleSession ?: return
|
||||
|
||||
val moduleComponents = llFirResolvableModuleSession.moduleComponents
|
||||
moduleComponents.lazyFirDeclarationsResolver.lazyResolveDeclaration(
|
||||
moduleComponents.firModuleLazyDeclarationResolver.lazyResolveDeclaration(
|
||||
firDeclarationToResolve = declaration,
|
||||
scopeSession = moduleComponents.scopeSessionProvider.getScopeSession(),
|
||||
toPhase = toPhase,
|
||||
|
||||
-3
@@ -8,9 +8,6 @@ package org.jetbrains.kotlin.analysis.low.level.api.fir.state
|
||||
import com.intellij.openapi.project.Project
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.LLFirGlobalResolveComponents
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.api.DiagnosticCheckerFilter
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.diagnostics.DiagnosticsCollector
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.file.builder.LLFirFileBuilder
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.lazy.resolve.FirLazyDeclarationResolver
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.sessions.LLFirSessionProvider
|
||||
import org.jetbrains.kotlin.analysis.project.structure.KtLibraryModule
|
||||
import org.jetbrains.kotlin.analysis.project.structure.KtModule
|
||||
|
||||
+2
-2
@@ -11,7 +11,7 @@ import org.jetbrains.kotlin.analysis.low.level.api.fir.api.FirDeclarationDesigna
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.api.collectDesignation
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.file.builder.LLFirLockProvider
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.file.builder.runCustomResolveUnderLock
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.lazy.resolve.FirLazyDeclarationResolver
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.lazy.resolve.LLFirModuleLazyDeclarationResolver
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.lazy.resolve.ResolveTreeBuilder
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.sessions.llFirResolvableSession
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.transformers.LLFirLazyTransformer.Companion.updatePhaseDeep
|
||||
@@ -33,7 +33,7 @@ internal class LLFirDesignatedSupertypeResolverTransformer(
|
||||
private val designation: FirDeclarationDesignationWithFile,
|
||||
private val session: FirSession,
|
||||
private val scopeSession: ScopeSession,
|
||||
private val firLazyDeclarationResolver: FirLazyDeclarationResolver,
|
||||
private val firLazyDeclarationResolver: LLFirModuleLazyDeclarationResolver,
|
||||
private val lockProvider: LLFirLockProvider,
|
||||
private val firProviderInterceptor: FirProviderInterceptor?,
|
||||
private val checkPCE: Boolean,
|
||||
|
||||
+2
-3
@@ -10,15 +10,14 @@ import org.jetbrains.kotlin.fir.resolve.ScopeSession
|
||||
import org.jetbrains.kotlin.fir.resolve.transformers.FirProviderInterceptor
|
||||
import org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.FirTowerDataContextCollector
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.api.FirDeclarationDesignationWithFile
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.file.builder.ModuleFileCache
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.lazy.resolve.FirLazyDeclarationResolver
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.lazy.resolve.LLFirModuleLazyDeclarationResolver
|
||||
|
||||
internal object LazyTransformerFactory {
|
||||
fun createLazyTransformer(
|
||||
phase: FirResolvePhase,
|
||||
designation: FirDeclarationDesignationWithFile,
|
||||
scopeSession: ScopeSession,
|
||||
lazyDeclarationResolver: FirLazyDeclarationResolver,
|
||||
lazyDeclarationResolver: LLFirModuleLazyDeclarationResolver,
|
||||
towerDataContextCollector: FirTowerDataContextCollector?,
|
||||
firProviderInterceptor: FirProviderInterceptor?,
|
||||
checkPCE: Boolean,
|
||||
|
||||
Reference in New Issue
Block a user