From c597ee0e344a0538d4f4521989dc2477d76c3116 Mon Sep 17 00:00:00 2001 From: Jinseong Jeon Date: Tue, 27 Jul 2021 15:12:49 -0700 Subject: [PATCH] FIR IDE: fix kotlin origin of annotation call --- .../symbols/annotations/KtFirAnnotationCall.kt | 2 +- .../testData/symbols/symbolByPsi/annotations.kt | 4 ++-- .../testData/symbols/symbolByPsi/annotations.txt | 4 ++-- .../symbols/symbolByPsi/typeAnnotations.kt | 12 ++++++------ .../symbols/symbolByPsi/typeAnnotations.txt | 16 ++++++++-------- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/annotations/KtFirAnnotationCall.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/annotations/KtFirAnnotationCall.kt index 180a7eb8b50..0738e51aa51 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/annotations/KtFirAnnotationCall.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/symbols/annotations/KtFirAnnotationCall.kt @@ -27,7 +27,7 @@ internal class KtFirAnnotationCall( override val token: ValidityToken get() = containingDeclaration.token override val psi: KtCallElement? by containingDeclaration.withFirAndCache { fir -> - fir.findPsi(fir.moduleData.session) as? KtCallElement + annotationCallRef.findPsi(fir.moduleData.session) as? KtCallElement } override val classId: ClassId? by cached { diff --git a/idea/idea-frontend-fir/testData/symbols/symbolByPsi/annotations.kt b/idea/idea-frontend-fir/testData/symbols/symbolByPsi/annotations.kt index 63b5b3e1b26..690201b2f8c 100644 --- a/idea/idea-frontend-fir/testData/symbols/symbolByPsi/annotations.kt +++ b/idea/idea-frontend-fir/testData/symbols/symbolByPsi/annotations.kt @@ -84,7 +84,7 @@ KtFirFunctionSymbol: ] annotations: [ Anno(param1 = funparam, param2 = 3) - psi: null + psi: KtAnnotationEntry ] callableIdIfNonLocal: /X.x dispatchType: X @@ -112,7 +112,7 @@ KtFirNamedClassOrObjectSymbol: ] annotations: [ Anno(param1 = param, param2 = 2) - psi: null + psi: KtAnnotationEntry ] classIdIfNonLocal: X classKind: CLASS diff --git a/idea/idea-frontend-fir/testData/symbols/symbolByPsi/annotations.txt b/idea/idea-frontend-fir/testData/symbols/symbolByPsi/annotations.txt index ee7469479a3..195eef2ff28 100644 --- a/idea/idea-frontend-fir/testData/symbols/symbolByPsi/annotations.txt +++ b/idea/idea-frontend-fir/testData/symbols/symbolByPsi/annotations.txt @@ -72,7 +72,7 @@ KtFirFunctionSymbol: ] annotations: [ Anno(param1 = funparam, param2 = 3) - psi: null + psi: KtAnnotationEntry ] callableIdIfNonLocal: /X.x dispatchType: X @@ -100,7 +100,7 @@ KtFirNamedClassOrObjectSymbol: ] annotations: [ Anno(param1 = param, param2 = 2) - psi: null + psi: KtAnnotationEntry ] classIdIfNonLocal: X classKind: CLASS diff --git a/idea/idea-frontend-fir/testData/symbols/symbolByPsi/typeAnnotations.kt b/idea/idea-frontend-fir/testData/symbols/symbolByPsi/typeAnnotations.kt index 55f5c1bd64c..0377b950a49 100644 --- a/idea/idea-frontend-fir/testData/symbols/symbolByPsi/typeAnnotations.kt +++ b/idea/idea-frontend-fir/testData/symbols/symbolByPsi/typeAnnotations.kt @@ -22,7 +22,7 @@ KtFirNamedClassOrObjectSymbol: ] annotations: [ kotlin/annotation/Target(allowedTargets = KtUnsupportedConstantValue) - psi: null + psi: KtAnnotationEntry ] classIdIfNonLocal: Anno1 classKind: ANNOTATION_CLASS @@ -48,7 +48,7 @@ KtFirNamedClassOrObjectSymbol: ] annotations: [ kotlin/annotation/Target(allowedTargets = KtUnsupportedConstantValue) - psi: null + psi: KtAnnotationEntry ] classIdIfNonLocal: Anno2 classKind: ANNOTATION_CLASS @@ -74,7 +74,7 @@ KtFirNamedClassOrObjectSymbol: ] annotations: [ kotlin/annotation/Target(allowedTargets = KtUnsupportedConstantValue) - psi: null + psi: KtAnnotationEntry ] classIdIfNonLocal: Anno3 classKind: ANNOTATION_CLASS @@ -100,7 +100,7 @@ KtFirNamedClassOrObjectSymbol: ] annotations: [ kotlin/annotation/Target(allowedTargets = KtUnsupportedConstantValue) - psi: null + psi: KtAnnotationEntry ] classIdIfNonLocal: Anno4 classKind: ANNOTATION_CLASS @@ -144,7 +144,7 @@ KtFirNamedClassOrObjectSymbol: KtFirValueParameterSymbol: annotatedType: [ Anno2() - psi: null + psi: KtAnnotationEntry ] @R|Anno2|() I annotationClassIds: [] annotations: [] @@ -231,7 +231,7 @@ KtFirNamedClassOrObjectSymbol: superTypes: [ [ Anno1() - psi: null + psi: KtAnnotationEntry ] @R|Anno2|() I ] symbolKind: TOP_LEVEL diff --git a/idea/idea-frontend-fir/testData/symbols/symbolByPsi/typeAnnotations.txt b/idea/idea-frontend-fir/testData/symbols/symbolByPsi/typeAnnotations.txt index 1fc5a56a8c7..e1aeb3a875c 100644 --- a/idea/idea-frontend-fir/testData/symbols/symbolByPsi/typeAnnotations.txt +++ b/idea/idea-frontend-fir/testData/symbols/symbolByPsi/typeAnnotations.txt @@ -4,7 +4,7 @@ KtFirNamedClassOrObjectSymbol: ] annotations: [ kotlin/annotation/Target(allowedTargets = KtUnsupportedConstantValue) - psi: null + psi: KtAnnotationEntry ] classIdIfNonLocal: Anno1 classKind: ANNOTATION_CLASS @@ -30,7 +30,7 @@ KtFirNamedClassOrObjectSymbol: ] annotations: [ kotlin/annotation/Target(allowedTargets = KtUnsupportedConstantValue) - psi: null + psi: KtAnnotationEntry ] classIdIfNonLocal: Anno2 classKind: ANNOTATION_CLASS @@ -56,7 +56,7 @@ KtFirNamedClassOrObjectSymbol: ] annotations: [ kotlin/annotation/Target(allowedTargets = KtUnsupportedConstantValue) - psi: null + psi: KtAnnotationEntry ] classIdIfNonLocal: Anno3 classKind: ANNOTATION_CLASS @@ -82,7 +82,7 @@ KtFirNamedClassOrObjectSymbol: ] annotations: [ kotlin/annotation/Target(allowedTargets = KtUnsupportedConstantValue) - psi: null + psi: KtAnnotationEntry ] classIdIfNonLocal: Anno4 classKind: ANNOTATION_CLASS @@ -126,7 +126,7 @@ KtFirNamedClassOrObjectSymbol: KtFirValueParameterSymbol: annotatedType: [ Anno2() - psi: null + psi: KtAnnotationEntry ] @R|Anno2|() I annotationClassIds: [] annotations: [] @@ -142,7 +142,7 @@ KtFirValueParameterSymbol: KtFirFunctionSymbol: annotatedType: [ Anno3() - psi: null + psi: KtAnnotationEntry ] @R|Anno2|() I annotationClassIds: [] annotations: [] @@ -171,7 +171,7 @@ KtFirFunctionSymbol: KtFirKotlinPropertySymbol: annotatedType: [ Anno4() - psi: null + psi: KtAnnotationEntry ] @R|Anno2|() I annotationClassIds: [] annotations: [] @@ -213,7 +213,7 @@ KtFirNamedClassOrObjectSymbol: superTypes: [ [ Anno1() - psi: null + psi: KtAnnotationEntry ] @R|Anno2|() I ] symbolKind: TOP_LEVEL