[AA FIR] support symbol pointers for static properties
^KT-55487
This commit is contained in:
committed by
Space Team
parent
e39dc9b768
commit
643b74fa28
+6
@@ -64,6 +64,12 @@ public class Fe10IdeNormalAnalysisSourceModuleSymbolByReferenceTestGenerated ext
|
|||||||
runTest("analysis/analysis-api/testData/symbols/symbolByReference/constructorViaTypeAlias.kt");
|
runTest("analysis/analysis-api/testData/symbols/symbolByReference/constructorViaTypeAlias.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("enumEntries.kt")
|
||||||
|
public void testEnumEntries() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/symbols/symbolByReference/enumEntries.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("enumValueOf.kt")
|
@TestMetadata("enumValueOf.kt")
|
||||||
public void testEnumValueOf() throws Exception {
|
public void testEnumValueOf() throws Exception {
|
||||||
|
|||||||
+4
-3
@@ -145,9 +145,10 @@ internal class KtFirKotlinPropertySymbol(
|
|||||||
|
|
||||||
KtSymbolKind.CLASS_MEMBER ->
|
KtSymbolKind.CLASS_MEMBER ->
|
||||||
KtFirMemberPropertySymbolPointer(
|
KtFirMemberPropertySymbolPointer(
|
||||||
requireOwnerPointer(),
|
ownerPointer = requireOwnerPointer(),
|
||||||
firSymbol.name,
|
name = firSymbol.name,
|
||||||
FirCallableSignature.createSignature(firSymbol),
|
signature = FirCallableSignature.createSignature(firSymbol),
|
||||||
|
isStatic = firSymbol.isStatic,
|
||||||
)
|
)
|
||||||
|
|
||||||
else -> throw UnsupportedSymbolKind(this::class, kind)
|
else -> throw UnsupportedSymbolKind(this::class, kind)
|
||||||
|
|||||||
+3
-2
@@ -17,8 +17,9 @@ import org.jetbrains.kotlin.name.Name
|
|||||||
internal class KtFirMemberPropertySymbolPointer(
|
internal class KtFirMemberPropertySymbolPointer(
|
||||||
ownerPointer: KtSymbolPointer<KtSymbolWithMembers>,
|
ownerPointer: KtSymbolPointer<KtSymbolWithMembers>,
|
||||||
private val name: Name,
|
private val name: Name,
|
||||||
private val signature: FirCallableSignature
|
private val signature: FirCallableSignature,
|
||||||
) : KtFirMemberSymbolPointer<KtKotlinPropertySymbol>(ownerPointer) {
|
isStatic: Boolean,
|
||||||
|
) : KtFirMemberSymbolPointer<KtKotlinPropertySymbol>(ownerPointer, isStatic) {
|
||||||
override fun KtFirAnalysisSession.chooseCandidateAndCreateSymbol(
|
override fun KtFirAnalysisSession.chooseCandidateAndCreateSymbol(
|
||||||
candidates: FirScope,
|
candidates: FirScope,
|
||||||
firSession: FirSession
|
firSession: FirSession
|
||||||
|
|||||||
+6
@@ -64,6 +64,12 @@ public class FirIdeNormalAnalysisSourceModuleSymbolByReferenceTestGenerated exte
|
|||||||
runTest("analysis/analysis-api/testData/symbols/symbolByReference/constructorViaTypeAlias.kt");
|
runTest("analysis/analysis-api/testData/symbols/symbolByReference/constructorViaTypeAlias.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("enumEntries.kt")
|
||||||
|
public void testEnumEntries() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/symbols/symbolByReference/enumEntries.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("enumValueOf.kt")
|
@TestMetadata("enumValueOf.kt")
|
||||||
public void testEnumValueOf() throws Exception {
|
public void testEnumValueOf() throws Exception {
|
||||||
|
|||||||
+6
@@ -64,6 +64,12 @@ public class FirStandaloneNormalAnalysisSourceModuleSymbolByReferenceTestGenerat
|
|||||||
runTest("analysis/analysis-api/testData/symbols/symbolByReference/constructorViaTypeAlias.kt");
|
runTest("analysis/analysis-api/testData/symbols/symbolByReference/constructorViaTypeAlias.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("enumEntries.kt")
|
||||||
|
public void testEnumEntries() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/symbols/symbolByReference/enumEntries.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("enumValueOf.kt")
|
@TestMetadata("enumValueOf.kt")
|
||||||
public void testEnumValueOf() throws Exception {
|
public void testEnumValueOf() throws Exception {
|
||||||
|
|||||||
Vendored
+2
@@ -0,0 +1,2 @@
|
|||||||
|
val entries: kotlin.enums.EnumEntries<MyKotlinEnum>
|
||||||
|
get()
|
||||||
+51
@@ -0,0 +1,51 @@
|
|||||||
|
KtKotlinPropertySymbol:
|
||||||
|
annotationsList: []
|
||||||
|
callableIdIfNonLocal: /MyKotlinEnum.entries
|
||||||
|
contextReceivers: []
|
||||||
|
getter: KtPropertyGetterSymbol:
|
||||||
|
annotationsList: []
|
||||||
|
callableIdIfNonLocal: null
|
||||||
|
contextReceivers: []
|
||||||
|
hasBody: false
|
||||||
|
hasStableParameterNames: true
|
||||||
|
isDefault: false
|
||||||
|
isExtension: false
|
||||||
|
isInline: false
|
||||||
|
isOverride: false
|
||||||
|
modality: FINAL
|
||||||
|
origin: SOURCE_MEMBER_GENERATED
|
||||||
|
receiverParameter: null
|
||||||
|
returnType: kotlin/enums/EnumEntries<MyKotlinEnum>
|
||||||
|
symbolKind: ACCESSOR
|
||||||
|
typeParameters: []
|
||||||
|
valueParameters: []
|
||||||
|
visibility: Public
|
||||||
|
getContainingModule: KtSourceModule "Sources of main"
|
||||||
|
deprecationStatus: null
|
||||||
|
hasBackingField: false
|
||||||
|
hasGetter: true
|
||||||
|
hasSetter: false
|
||||||
|
initializer: null
|
||||||
|
isConst: false
|
||||||
|
isDelegatedProperty: false
|
||||||
|
isExtension: false
|
||||||
|
isFromPrimaryConstructor: false
|
||||||
|
isLateInit: false
|
||||||
|
isOverride: false
|
||||||
|
isStatic: false
|
||||||
|
isVal: true
|
||||||
|
modality: FINAL
|
||||||
|
name: entries
|
||||||
|
origin: SOURCE_MEMBER_GENERATED
|
||||||
|
receiverParameter: null
|
||||||
|
returnType: kotlin/enums/EnumEntries<MyKotlinEnum>
|
||||||
|
setter: null
|
||||||
|
symbolKind: CLASS_MEMBER
|
||||||
|
typeParameters: []
|
||||||
|
visibility: Public
|
||||||
|
getContainingModule: KtSourceModule "Sources of main"
|
||||||
|
deprecationStatus: null
|
||||||
|
getterDeprecationStatus: null
|
||||||
|
javaGetterName: getEntries
|
||||||
|
javaSetterName: null
|
||||||
|
setterDeprecationStatus: null
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
// DO_NOT_CHECK_SYMBOL_RESTORE_K1
|
||||||
|
// !LANGUAGE: +EnumEntries
|
||||||
|
// WITH_STDLIB
|
||||||
|
|
||||||
|
enum class MyKotlinEnum {
|
||||||
|
FirstEntry, SecondEntry;
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test() {
|
||||||
|
MyKotlinEnum.entr<caret>ies
|
||||||
|
}
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
val entries: kotlin.enums.EnumEntries<MyKotlinEnum>
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
KtKotlinPropertySymbol:
|
||||||
|
annotationsList: []
|
||||||
|
callableIdIfNonLocal: /MyKotlinEnum.entries
|
||||||
|
contextReceivers: []
|
||||||
|
getter: KtPropertyGetterSymbol:
|
||||||
|
annotationsList: []
|
||||||
|
callableIdIfNonLocal: null
|
||||||
|
contextReceivers: []
|
||||||
|
hasBody: false
|
||||||
|
hasStableParameterNames: true
|
||||||
|
isDefault: true
|
||||||
|
isExtension: false
|
||||||
|
isInline: false
|
||||||
|
isOverride: false
|
||||||
|
modality: FINAL
|
||||||
|
origin: SOURCE_MEMBER_GENERATED
|
||||||
|
receiverParameter: null
|
||||||
|
returnType: kotlin/enums/EnumEntries<MyKotlinEnum>
|
||||||
|
symbolKind: ACCESSOR
|
||||||
|
typeParameters: []
|
||||||
|
valueParameters: []
|
||||||
|
visibility: Public
|
||||||
|
getContainingModule: KtSourceModule "Sources of main"
|
||||||
|
deprecationStatus: null
|
||||||
|
hasBackingField: false
|
||||||
|
hasGetter: true
|
||||||
|
hasSetter: false
|
||||||
|
initializer: null
|
||||||
|
isConst: false
|
||||||
|
isDelegatedProperty: false
|
||||||
|
isExtension: false
|
||||||
|
isFromPrimaryConstructor: false
|
||||||
|
isLateInit: false
|
||||||
|
isOverride: false
|
||||||
|
isStatic: true
|
||||||
|
isVal: true
|
||||||
|
modality: FINAL
|
||||||
|
name: entries
|
||||||
|
origin: SOURCE_MEMBER_GENERATED
|
||||||
|
receiverParameter: null
|
||||||
|
returnType: kotlin/enums/EnumEntries<MyKotlinEnum>
|
||||||
|
setter: null
|
||||||
|
symbolKind: CLASS_MEMBER
|
||||||
|
typeParameters: []
|
||||||
|
visibility: Public
|
||||||
|
getContainingModule: KtSourceModule "Sources of main"
|
||||||
|
deprecationStatus: null
|
||||||
|
getterDeprecationStatus: null
|
||||||
|
javaGetterName: getEntries
|
||||||
|
javaSetterName: null
|
||||||
|
setterDeprecationStatus: null
|
||||||
Reference in New Issue
Block a user