[kotlin] [fir] enable search by base method (KTIJ-21662)

GitOrigin-RevId: 255219d64d4ad7d13d079ddd858336a047430ef4
This commit is contained in:
Anna Kozlova
2022-11-29 16:50:55 +00:00
committed by intellij-monorepo-bot
parent 4f76e4d54b
commit a1c599bdce
2 changed files with 5 additions and 2 deletions
@@ -15,3 +15,4 @@ fun test() {
c()
c.invoke()
}
// FIR_COMPARISON
@@ -113,8 +113,10 @@ internal class KotlinK2FindUsagesSupport : KotlinFindUsagesSupport {
}
override fun getSuperMethods(declaration: KtDeclaration, ignore: Collection<PsiElement>?): List<PsiElement> {
// TODO: implement this
return emptyList()
if (!declaration.hasModifier(KtTokens.OVERRIDE_KEYWORD)) return emptyList()
return analyzeInModalWindow(declaration, KotlinBundle.message("find.usages.progress.text.declaration.superMethods")) {
(declaration.getSymbol() as? KtCallableSymbol)?.getAllOverriddenSymbols()?.mapNotNull { it.psi }?.toList().orEmpty()
}
}
override fun checkSuperMethods(