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