How do I find PsiElements of any type conditionally in a project?


I tried to find any utilities like Searchers of Finders, but no luck.

Here are some examples:

  • find all psi literals -> condition: literal in a specific psi method call parameter
  • find all psi methods -> condition: annotated with specific psi annotation
  • find all psi fields -> condition: of specific type

I have found a search solution for methods:

.searchPsiMethods(annotationClass, myElement.getResolveScope())

But for other cases no utils found.

Comment actions Permalink

Hi Serhii,

Not all search cases are implemented. You can browse what is implemented by checking subclasses of

Comment actions Permalink

Looked into it - yes that is for sure no enough for my edge cases. Nevermind, I will look for other solutions.


Please sign in to leave a comment.