[FIR] Don't cache importing scopes while resolving plugin's annotations
This commit is contained in:
+1
-1
@@ -30,7 +30,7 @@ internal abstract class FirAbstractAnnotationResolveTransformer<D, S>(
|
|||||||
|
|
||||||
override fun transformFile(file: FirFile, data: D): CompositeTransformResult<FirDeclaration> {
|
override fun transformFile(file: FirFile, data: D): CompositeTransformResult<FirDeclaration> {
|
||||||
return withScopeCleanup(towerScope.scopes) {
|
return withScopeCleanup(towerScope.scopes) {
|
||||||
towerScope.addScopes(createImportingScopes(file, session, scopeSession))
|
towerScope.addScopes(createImportingScopes(file, session, scopeSession, useCaching = false))
|
||||||
val state = beforeChildren(file)
|
val state = beforeChildren(file)
|
||||||
file.transformDeclarations(this, data)
|
file.transformDeclarations(this, data)
|
||||||
afterChildren(state)
|
afterChildren(state)
|
||||||
|
|||||||
@@ -22,10 +22,15 @@ private class ListStorageFirScope(val result: List<FirScope>) : FirScope()
|
|||||||
fun createImportingScopes(
|
fun createImportingScopes(
|
||||||
file: FirFile,
|
file: FirFile,
|
||||||
session: FirSession,
|
session: FirSession,
|
||||||
scopeSession: ScopeSession
|
scopeSession: ScopeSession,
|
||||||
): List<FirScope> = scopeSession.getOrBuild(file, FileImportingScopeKey) {
|
useCaching: Boolean = true
|
||||||
ListStorageFirScope(doCreateImportingScopes(file, session, scopeSession))
|
): List<FirScope> = if (useCaching) {
|
||||||
}.result
|
scopeSession.getOrBuild(file, FileImportingScopeKey) {
|
||||||
|
ListStorageFirScope(doCreateImportingScopes(file, session, scopeSession))
|
||||||
|
}.result
|
||||||
|
} else {
|
||||||
|
doCreateImportingScopes(file, session, scopeSession)
|
||||||
|
}
|
||||||
|
|
||||||
private fun doCreateImportingScopes(
|
private fun doCreateImportingScopes(
|
||||||
file: FirFile,
|
file: FirFile,
|
||||||
|
|||||||
Reference in New Issue
Block a user