FIR: Add collecting top-level scopes of the file

It will be useful in the completion when we need to dicide if we
need to import FQN or not
This commit is contained in:
Roman Golyshev
2021-03-03 18:34:05 +03:00
parent 3427e0aebb
commit 76ff106458
4 changed files with 18 additions and 0 deletions
@@ -49,6 +49,8 @@ open class FirBodyResolveTransformer(
override fun transformFile(file: FirFile, data: ResolutionMode): CompositeTransformResult<FirFile> {
checkSessionConsistency(file)
return context.withFile(file, components) {
onBeforeFileContentResolution(file)
file.replaceResolvePhase(transformerPhase)
@Suppress("UNCHECKED_CAST")
transformDeclarationContent(file, data) as CompositeTransformResult<FirFile>
@@ -73,6 +75,8 @@ open class FirBodyResolveTransformer(
return data.expectedTypeRef.compose()
}
open fun onBeforeFileContentResolution(file: FirFile) {}
open fun onBeforeStatementResolution(statement: FirStatement) {}
open fun onBeforeDeclarationContentResolve(declaration: FirDeclaration) {}