9 comments
Comment actions Permalink

Ok. I found the solution.

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

1
Comment actions Permalink


Are you asking for textual search, or find usages? Either way I'm pretty sure there isn't. I was about to beg for opening up the Find Usages API, is why I ask.

--Dave Griffith

0
Comment actions Permalink

Will be nice to have text searching per project files.
And especialy will be nice to have Find Usages ability :)


0
Comment actions Permalink

FindUsages API opened as I'm see(PsiSearchHelper), but textual not(may be implementation of PsiNonJavaFileReferenceProcessor will help but it absent, or if we'll get something like findInNonJavaFiles with String parameters in PsiSearchHelper class).

TIA,
Dmitry

0
Comment actions Permalink

Sweet! When did that happen?

--Dave Griffith

0
Comment actions Permalink

Month or to ago right before release it opened with Psi.
For me Psi opening is one of major improvements in 4.0.

TIA,
Dmitry

0
Comment actions Permalink

I'm sorry for raising this topic again, but since 4 years, as I see, this issue wasn't discussed and solved.

My question is: how can I search for strings (not only single words!) in Java-files of project, using Open-API?

Thank you.

0

Please sign in to leave a comment.