有没有办法找到PsiMethod的所有替代?

时间:2018-12-19 09:16:55

标签: intellij-idea intellij-plugin

我正在为Intellij IDEA 2018.2+开发一个插件。

我需要找到给定方法的所有替代。 我尝试在各种PsiUtil类中进行搜索,以查找以下内容的替代项:

  • PsiMethod
  • PsiClass-稍后手动扫描覆盖类的方法以查找是否存在一些覆盖方法

但没有运气。

总的来说,找到给定PsiMethod的所有替代项的最简单方法是什么?

1 个答案:

答案 0 :(得分:0)

Just found an excerpt from PSI Cookbook:

How do I find the methods overriding a specific method?

OverridingMethodsSearch.search()

And for class:

How do I find all inheritors of a class?

ClassInheritorsSearch.search()

相关问题