Search API?

Hello,

Is it posible to open API for perform search by IDEA in plugins?

Thanks!
--
Alexey Efimov - Java Developer
Tops BI
http://www.topsbi.com


0
9 comments


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

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


0

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

Sweet! When did that happen?

--Dave Griffith

0

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

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

Ok. I found the solution.

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

1

Please sign in to leave a comment.