[FIR IDE] Treat enum entry members as local in AAPI/FE10

This commit partially fixes KtFe10SymbolByPsiTestGenerated.testEnumValueMember().
This commit is contained in:
Yan Zhulanow
2021-10-29 17:06:56 +09:00
parent 944ec7ba5a
commit b8682f04f3
2 changed files with 15 additions and 5 deletions
@@ -303,7 +303,17 @@ internal fun CallableMemberDescriptor.calculateCallableId(allowLocal: Boolean):
pathToLocal = if (localName.isNotEmpty()) FqName.fromSegments(localName.asReversed()) else null pathToLocal = if (localName.isNotEmpty()) FqName.fromSegments(localName.asReversed()) else null
) )
} }
is ClassDescriptor -> className += current.name.asString() is ClassDescriptor -> {
if (current.kind == ClassKind.ENUM_ENTRY) {
if (!allowLocal) {
return null
}
localName += current.name.asString()
} else {
className += current.name.asString()
}
}
is PropertyAccessorDescriptor -> {} // Filter out property accessors is PropertyAccessorDescriptor -> {} // Filter out property accessors
is CallableDescriptor -> { is CallableDescriptor -> {
if (!allowLocal) { if (!allowLocal) {
@@ -92,18 +92,18 @@ internal fun KtDeclaration.calculateCallableId(allowLocal: Boolean): CallableId?
while (current != null) { while (current != null) {
when (current) { when (current) {
is KtClassOrObject -> {
className += current.name ?: return null
}
is KtPropertyAccessor -> { is KtPropertyAccessor -> {
// Filter out property accessors // Filter out property accessors
} }
is KtCallableDeclaration -> { is KtCallableDeclaration, is KtEnumEntry -> {
if (!allowLocal) { if (!allowLocal) {
return null return null
} }
localName += current.name ?: return null localName += current.name ?: return null
} }
is KtClassOrObject -> {
className += current.name ?: return null
}
} }
current = current.getElementParentDeclaration() current = current.getElementParentDeclaration()