[FIR IDE] Fix invalid partial resolve of file annotations
This commit is contained in:
+21
-17
@@ -42,7 +42,7 @@ internal class FirLazyDeclarationResolver(private val firFileBuilder: FirFileBui
|
|||||||
checkPCE: Boolean,
|
checkPCE: Boolean,
|
||||||
collector: FirTowerDataContextCollector? = null,
|
collector: FirTowerDataContextCollector? = null,
|
||||||
) {
|
) {
|
||||||
if (firFile.resolvePhase >= FirResolvePhase.IMPORTS) return
|
if (firFile.resolvePhase >= FirResolvePhase.IMPORTS && annotations.all { it.resolveStatus == FirAnnotationResolveStatus.Resolved }) return
|
||||||
moduleFileCache.firFileLockProvider.runCustomResolveUnderLock(firFile, checkPCE) {
|
moduleFileCache.firFileLockProvider.runCustomResolveUnderLock(firFile, checkPCE) {
|
||||||
resolveFileAnnotationsWithoutLock(
|
resolveFileAnnotationsWithoutLock(
|
||||||
firFile = firFile,
|
firFile = firFile,
|
||||||
@@ -65,23 +65,27 @@ internal class FirLazyDeclarationResolver(private val firFileBuilder: FirFileBui
|
|||||||
scopeSession: ScopeSession,
|
scopeSession: ScopeSession,
|
||||||
collector: FirTowerDataContextCollector? = null,
|
collector: FirTowerDataContextCollector? = null,
|
||||||
) {
|
) {
|
||||||
if (firFile.resolvePhase >= FirResolvePhase.IMPORTS) return
|
if (firFile.resolvePhase < FirResolvePhase.IMPORTS) {
|
||||||
lazyResolveFileDeclarationWithoutLock(
|
lazyResolveFileDeclarationWithoutLock(
|
||||||
firFile = firFile,
|
firFile = firFile,
|
||||||
moduleFileCache = moduleFileCache,
|
moduleFileCache = moduleFileCache,
|
||||||
toPhase = FirResolvePhase.IMPORTS,
|
toPhase = FirResolvePhase.IMPORTS,
|
||||||
scopeSession = scopeSession,
|
scopeSession = scopeSession,
|
||||||
checkPCE = false,
|
checkPCE = false,
|
||||||
collector = collector
|
collector = collector
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!annotations.all { it.resolveStatus == FirAnnotationResolveStatus.Resolved }) {
|
||||||
|
FirFileAnnotationsResolveTransformer(
|
||||||
|
firFile = firFile,
|
||||||
|
annotations = annotations,
|
||||||
|
session = firFile.moduleData.session,
|
||||||
|
scopeSession = scopeSession,
|
||||||
|
firTowerDataContextCollector = collector,
|
||||||
|
).transformDeclaration(firFileBuilder.firPhaseRunner)
|
||||||
|
}
|
||||||
|
|
||||||
FirFileAnnotationsResolveTransformer(
|
|
||||||
firFile = firFile,
|
|
||||||
annotations = annotations,
|
|
||||||
session = firFile.moduleData.session,
|
|
||||||
scopeSession = scopeSession,
|
|
||||||
firTowerDataContextCollector = collector,
|
|
||||||
).transformDeclaration(firFileBuilder.firPhaseRunner)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun FirDeclaration.isValidForResolve(): Boolean = when (origin) {
|
private fun FirDeclaration.isValidForResolve(): Boolean = when (origin) {
|
||||||
|
|||||||
Reference in New Issue
Block a user