[FIR] FirRenderer: render annotation resolve phase as well
^KT-56543
This commit is contained in:
committed by
Space Team
parent
210e8750f4
commit
03eab387c0
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
@@ -38,10 +38,13 @@ open class FirAnnotationRenderer {
|
||||
|
||||
annotation.annotationTypeRef.accept(visitor)
|
||||
when (annotation) {
|
||||
is FirAnnotationCall -> if (annotation.calleeReference.let { it is FirResolvedNamedReference || it is FirErrorNamedReference }) {
|
||||
callArgumentsRenderer?.renderArgumentMapping(annotation.argumentMapping)
|
||||
} else {
|
||||
visitor.visitCall(annotation)
|
||||
is FirAnnotationCall -> {
|
||||
components.resolvePhaseRenderer?.render(annotation)
|
||||
if (annotation.calleeReference.let { it is FirResolvedNamedReference || it is FirErrorNamedReference }) {
|
||||
callArgumentsRenderer?.renderArgumentMapping(annotation.argumentMapping)
|
||||
} else {
|
||||
visitor.visitCall(annotation)
|
||||
}
|
||||
}
|
||||
|
||||
else -> callArgumentsRenderer?.renderArgumentMapping(annotation.argumentMapping)
|
||||
|
||||
@@ -7,6 +7,7 @@ package org.jetbrains.kotlin.fir.renderer
|
||||
|
||||
import org.jetbrains.kotlin.fir.FirElementWithResolveState
|
||||
import org.jetbrains.kotlin.fir.declarations.ResolveStateAccess
|
||||
import org.jetbrains.kotlin.fir.expressions.FirAnnotationCall
|
||||
|
||||
class FirResolvePhaseRenderer {
|
||||
internal lateinit var components: FirRendererComponents
|
||||
@@ -16,4 +17,8 @@ class FirResolvePhaseRenderer {
|
||||
@OptIn(ResolveStateAccess::class)
|
||||
printer.print("[${element.resolveState}] ")
|
||||
}
|
||||
|
||||
fun render(element: FirAnnotationCall) {
|
||||
printer.print("[${element.annotationResolvePhase}]")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user