Is there any way to search for a string in the project?

Hi Community,

I want to search a string in the project. The string comes from a annotation value.
This annotation value is used as a field in a specific class and I need to find this class which uses the string as a field value.

For example:

@Path("/foo/bar")
public class RestClass {
...
}

public class RestClassTest {
     private static final String PATH = "/foo/bar";
...
}


I think the Find in Path dialog uses this functionality but I just can't find how this can be done.

Markus

3 comments
Comment actions Permalink

PsiSearchHelper.processAllFilesWithWordInLiterals() is one possible way to do this.

0
Comment actions Permalink

Is it possible to use this the other way around to search for an annotation value?

0
Comment actions Permalink

Thank you Dmitry I use the StubIndex for searching the annotations and this works.

0

Please sign in to leave a comment.