diff --git a/analysis/analysis-api/src/org/jetbrains/kotlin/analysis/api/symbols/DebugSymbolRenderer.kt b/analysis/analysis-api/src/org/jetbrains/kotlin/analysis/api/symbols/DebugSymbolRenderer.kt index 86e6bdc4b42..51b0e478f43 100644 --- a/analysis/analysis-api/src/org/jetbrains/kotlin/analysis/api/symbols/DebugSymbolRenderer.kt +++ b/analysis/analysis-api/src/org/jetbrains/kotlin/analysis/api/symbols/DebugSymbolRenderer.kt @@ -281,7 +281,7 @@ public class DebugSymbolRenderer( .renderKtContractEffectDeclaration(value, endWithNewLine = false) is KtNamedAnnotationValue -> renderNamedConstantValue(value) is KtInitializerValue -> renderKtInitializerValue(value) - is KtContextReceiver -> rendeContextReceiver(value) + is KtContextReceiver -> renderContextReceiver(value) is KtAnnotationApplication -> renderAnnotationApplication(value) is KtAnnotationsList -> renderAnnotationsList(value) is KtModule -> renderKtModule(value) @@ -325,14 +325,16 @@ public class DebugSymbolRenderer( } context(KtAnalysisSession) - private fun PrettyPrinter.rendeContextReceiver(receiver: KtContextReceiver) { - append("ContextReceiver(") - receiver.label?.let { label -> - renderValue(label, renderSymbolsFully = false) - append("@") + private fun PrettyPrinter.renderContextReceiver(receiver: KtContextReceiver) { + append("KtContextReceiver:") + withIndent { + appendLine() + append("label: ") + renderValue(receiver.label, renderSymbolsFully = false) + appendLine() + append("type: ") + renderType(receiver.type) } - renderType(receiver.type) - append(")") } context(KtAnalysisSession) diff --git a/analysis/analysis-api/testData/symbols/symbolByPsi/contextReceivers/contextReceiversOnClass.txt b/analysis/analysis-api/testData/symbols/symbolByPsi/contextReceivers/contextReceiversOnClass.txt index d10a8a93b12..719bf40c46c 100644 --- a/analysis/analysis-api/testData/symbols/symbolByPsi/contextReceivers/contextReceiversOnClass.txt +++ b/analysis/analysis-api/testData/symbols/symbolByPsi/contextReceivers/contextReceiversOnClass.txt @@ -48,14 +48,18 @@ KtNamedClassOrObjectSymbol: classKind: CLASS companionObject: null contextReceivers: [ - ContextReceiver(KtUsualClassType: - type: kotlin/Int - annotationsList: [] - ownTypeArguments: []) - ContextReceiver(s@KtUsualClassType: - type: kotlin/String - annotationsList: [] - ownTypeArguments: []) + KtContextReceiver: + label: null + type: KtUsualClassType: + type: kotlin/Int + annotationsList: [] + ownTypeArguments: [] + KtContextReceiver: + label: s + type: KtUsualClassType: + type: kotlin/String + annotationsList: [] + ownTypeArguments: [] ] isData: false isExternal: false diff --git a/analysis/analysis-api/testData/symbols/symbolByPsi/contextReceivers/contextReceiversOnFunction.txt b/analysis/analysis-api/testData/symbols/symbolByPsi/contextReceivers/contextReceiversOnFunction.txt index 034957095de..c2abe84fa4b 100644 --- a/analysis/analysis-api/testData/symbols/symbolByPsi/contextReceivers/contextReceiversOnFunction.txt +++ b/analysis/analysis-api/testData/symbols/symbolByPsi/contextReceivers/contextReceiversOnFunction.txt @@ -2,14 +2,18 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: /y contextReceivers: [ - ContextReceiver(KtUsualClassType: - type: kotlin/Int - annotationsList: [] - ownTypeArguments: []) - ContextReceiver(s@KtUsualClassType: - type: kotlin/String - annotationsList: [] - ownTypeArguments: []) + KtContextReceiver: + label: null + type: KtUsualClassType: + type: kotlin/Int + annotationsList: [] + ownTypeArguments: [] + KtContextReceiver: + label: s + type: KtUsualClassType: + type: kotlin/String + annotationsList: [] + ownTypeArguments: [] ] contractEffects: [] hasStableParameterNames: true diff --git a/analysis/analysis-api/testData/symbols/symbolByPsi/contextReceivers/contextReceiversOnProperty.txt b/analysis/analysis-api/testData/symbols/symbolByPsi/contextReceivers/contextReceiversOnProperty.txt index 130f19d3b48..34a191df23c 100644 --- a/analysis/analysis-api/testData/symbols/symbolByPsi/contextReceivers/contextReceiversOnProperty.txt +++ b/analysis/analysis-api/testData/symbols/symbolByPsi/contextReceivers/contextReceiversOnProperty.txt @@ -2,14 +2,18 @@ KtKotlinPropertySymbol: annotationsList: [] callableIdIfNonLocal: /y contextReceivers: [ - ContextReceiver(KtUsualClassType: - type: kotlin/Int - annotationsList: [] - ownTypeArguments: []) - ContextReceiver(s@KtUsualClassType: - type: kotlin/String - annotationsList: [] - ownTypeArguments: []) + KtContextReceiver: + label: null + type: KtUsualClassType: + type: kotlin/Int + annotationsList: [] + ownTypeArguments: [] + KtContextReceiver: + label: s + type: KtUsualClassType: + type: kotlin/String + annotationsList: [] + ownTypeArguments: [] ] getter: KtPropertyGetterSymbol: annotationsList: [] diff --git a/analysis/analysis-api/testData/symbols/symbolByPsi/contextReceivers/similarSignatures.txt b/analysis/analysis-api/testData/symbols/symbolByPsi/contextReceivers/similarSignatures.txt index 9685b2198a0..64fcfd18165 100644 --- a/analysis/analysis-api/testData/symbols/symbolByPsi/contextReceivers/similarSignatures.txt +++ b/analysis/analysis-api/testData/symbols/symbolByPsi/contextReceivers/similarSignatures.txt @@ -56,10 +56,12 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: /tooo contextReceivers: [ - ContextReceiver(KtUsualClassType: - type: A - annotationsList: [] - ownTypeArguments: []) + KtContextReceiver: + label: null + type: KtUsualClassType: + type: A + annotationsList: [] + ownTypeArguments: [] ] contractEffects: [] hasStableParameterNames: true @@ -91,10 +93,12 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: /tooo contextReceivers: [ - ContextReceiver(KtUsualClassType: - type: B - annotationsList: [] - ownTypeArguments: []) + KtContextReceiver: + label: null + type: KtUsualClassType: + type: B + annotationsList: [] + ownTypeArguments: [] ] contractEffects: [] hasStableParameterNames: true @@ -126,14 +130,18 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: /tooo contextReceivers: [ - ContextReceiver(KtUsualClassType: - type: A - annotationsList: [] - ownTypeArguments: []) - ContextReceiver(KtUsualClassType: - type: B - annotationsList: [] - ownTypeArguments: []) + KtContextReceiver: + label: null + type: KtUsualClassType: + type: A + annotationsList: [] + ownTypeArguments: [] + KtContextReceiver: + label: null + type: KtUsualClassType: + type: B + annotationsList: [] + ownTypeArguments: [] ] contractEffects: [] hasStableParameterNames: true @@ -165,14 +173,18 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: /tooo contextReceivers: [ - ContextReceiver(KtUsualClassType: - type: B - annotationsList: [] - ownTypeArguments: []) - ContextReceiver(KtUsualClassType: - type: A - annotationsList: [] - ownTypeArguments: []) + KtContextReceiver: + label: null + type: KtUsualClassType: + type: B + annotationsList: [] + ownTypeArguments: [] + KtContextReceiver: + label: null + type: KtUsualClassType: + type: A + annotationsList: [] + ownTypeArguments: [] ] contractEffects: [] hasStableParameterNames: true