[AA] KT-55098 Render context receivers in declarations & function types

- `context(...)` is a modifier that must precede annotations and other
  modifiers, so for declarations it is rendered in
  `renderAnnotationsAndModifiers`.
- Ignore `@ContextFunctionTypeParams` in the annotation list of FE10
  types, as the annotation is an implementation detail of context
  receivers in K1 and shouldn't be rendered.

^KT-55098 fixed
This commit is contained in:
Marco Pennekamp
2022-12-02 16:12:07 +01:00
committed by Space Team
parent e2804693bf
commit 2cd16f055a
33 changed files with 380 additions and 30 deletions
@@ -28,7 +28,10 @@ interface KtFe10Type : KtLifetimeOwner, KtAnnotated {
KtFe10AnnotationsList.create(
type.annotations,
token,
ignoreAnnotations = setOf(StandardClassIds.Annotations.ExtensionFunctionType)
ignoreAnnotations = setOf(
StandardClassIds.Annotations.ExtensionFunctionType,
StandardClassIds.Annotations.ContextFunctionTypeParams,
)
)
}
@@ -70,6 +70,12 @@ public class Fe10IdeNormalAnalysisSourceModuleRendererTestGenerated extends Abst
runTest("analysis/analysis-api/testData/components/symbolDeclarationRenderer/renderDeclaration/constructorOfAnonymousObject.kt");
}
@Test
@TestMetadata("contextReceiver.kt")
public void testContextReceiver() throws Exception {
runTest("analysis/analysis-api/testData/components/symbolDeclarationRenderer/renderDeclaration/contextReceiver.kt");
}
@Test
@TestMetadata("delegates.kt")
public void testDelegates() throws Exception {
@@ -228,5 +234,11 @@ public class Fe10IdeNormalAnalysisSourceModuleRendererTestGenerated extends Abst
public void testAnnotationOnTypesWithComplexExpression() throws Exception {
runTest("analysis/analysis-api/testData/components/symbolDeclarationRenderer/renderDeclaration/types/annotationOnTypesWithComplexExpression.kt");
}
@Test
@TestMetadata("contextFunctionTypes.kt")
public void testContextFunctionTypes() throws Exception {
runTest("analysis/analysis-api/testData/components/symbolDeclarationRenderer/renderDeclaration/types/contextFunctionTypes.kt");
}
}
}