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

4 comments
Comment actions Permalink

Yes, I'm also interesting in this theme.

0
Comment actions Permalink

Ok. I found the solution.

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

0
Comment actions Permalink

Is this functionality accessible in the 12x version too?

0
Comment actions Permalink

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

0

Please sign in to leave a comment.