Find in path

Hi,
How can I "find in path" string literals from plugin code?

I've tried PsiSearchHelper.processAllFilesWithWord, but it only search whole words, and excludes java clases.
Thanks

0
4 comments

Yes, I'm also interesting in this theme.

0

Ok. I found the solution.

MyTextOccurenceProcessor textOccurenceProcessor = new MyTextOccurenceProcessor();
psiManager.getSearchHelper().processElementsWithWord(textOccurenceProcessor, project.getAllScope(), SOME_TEXT , UsageSearchContext.IN_STRINGS, true);

0

Is this functionality accessible in the 12x version too?

0

Yes. Instead of PsiManager.getSearchHelper(), you need to use PsiSearchHelper.SERVICE.getInstance().

0

Please sign in to leave a comment.