0

I want to perform a structural search from IntelliJ IDEA. My research is made up of two criteria:

  1. Find all classes with custom @CustomAnnotate annotation
  • This annotation is placed exclusively on Repository springs; the result of this research will exclusively cite Repositories
  1. Find a text corresponding to the name of an org.springframework.data.repository.CrudRepository method; for example findById
  • The result of this research will cite services calling for Repositories

I can't combine the two searches at the same time. i.e. the Repositories called to perform a findById (search 2) must have the annotation @CustomAnnotate (search 1).

I tried this: $REPO$.$METHOD$($VARS$)

With:

  • $REPO$ = a reference filter on the first reference search which has been recorded.
  • $METHOD$ = a type filter with "findById"
  • $VAR$ = [0, ∞]

The two criteria do not work together into my research, but they work independently.

What solution is possible? With a script?

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Eliot
  • 1
  • 1
  • You may use reference filter (https://www.jetbrains.com/help/idea/search-templates.html#reference_filter). But ot's not possible to set annotation type. – y.bedrov Jan 09 '20 at 11:14
  • Precisely, I am using a reference filter in $REPO$ but that does not work by coupling it with '$METHOD$' = a type filter with "findById". Any ideas ? – Eliot Jan 10 '20 at 13:06

0 Answers0