Rename: Fix processing of functions without light methods
#KT-22461 Fixed
This commit is contained in:
+6
-3
@@ -198,14 +198,17 @@ fun PsiClass.forEachDeclaredMemberOverride(processor: (superMember: PsiElement,
|
||||
forEachKotlinOverride(ktClass, members, scope, processor)
|
||||
}
|
||||
|
||||
fun findDeepestSuperMethodsKotlinAware(method: PsiElement): List<PsiMethod> {
|
||||
fun findDeepestSuperMethodsNoWrapping(method: PsiElement): List<PsiElement> {
|
||||
val element = method.unwrapped
|
||||
return when (element) {
|
||||
is PsiMethod -> element.findDeepestSuperMethods().toList()
|
||||
is KtCallableDeclaration -> {
|
||||
val descriptor = element.resolveToDescriptorIfAny() as? CallableMemberDescriptor ?: return emptyList()
|
||||
descriptor.getDeepestSuperDeclarations(false).mapNotNull { it.source.getPsi()?.getRepresentativeLightMethod() }
|
||||
descriptor.getDeepestSuperDeclarations(false).mapNotNull { it.source.getPsi() }
|
||||
}
|
||||
else -> emptyList()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun findDeepestSuperMethodsKotlinAware(method: PsiElement) =
|
||||
findDeepestSuperMethodsNoWrapping(method).mapNotNull { it.getRepresentativeLightMethod() }
|
||||
Reference in New Issue
Block a user