How to tell if a method is overridden?
Anybody know how to tell if a concrete method is overridden, or where an abstract method is implemented, using Psi?
(One of the Last Things To Do before releasing the code rearrangement plugin.)
-Dave
Please sign in to leave a comment.
PsiSearchHelper has method
PsiMethod[] findOverridingMethods(PsiMethod method, SearchScope
searchScope, boolean checkDeep);
--
Valentin Kipiatkov
JetBrains, Inc
http://www.intellij.com
"Develop with pleasure!"
"Dave Kriewall" <no_mail@jetbrains.com> wrote in message
news:10368983.1066136114380.JavaMail.itn@is.intellij.net...
abstract method is implemented, using Psi?
>
plugin.)
>
Perfect!
I presume that getAccessScope returns the right type (local or global) of search scope. Is this based on whether the method is private or not?
Does the boolean argument 'deep' controls whether methods deeper than one subclass level are considered?
Regardless, the code works! Thanks, Valentin.
-Dave
search scope. Is this based on whether the method is private or not?
Yes, the access scope considers method access scope but you don't need to
use it. Just use
SearchScope ss = createAllScope(project);
and the rest will be handled by PsiSearchHelper.
PsiSearchHelper will anyway not search usages in places where they cannot
exist. So the search scope parameter is needed only when you need to
restrict the scope of the search.
subclass level are considered?
Exactly.
--
Valentin Kipiatkov
JetBrains, Inc
http://www.intellij.com
"Develop with pleasure!"
>
subclass level are considered?
"Dave Kriewall" <no_mail@jetbrains.com> wrote in message
news:16768670.1066658988003.JavaMail.itn@is.intellij.net...
>
>
search scope. Is this based on whether the method is private or not?
>
subclass level are considered?
>
>
>