Why is findFilesWithPlainTextWords not working?

Hi Community,

I would like to know why PsiSearchHelper.findFilesWithPlainTextWords(text) is not working for text = "#{Bean$BeanID}" ?

Markus

4 comments

This string doesn't look like a word to me. findFilesWithPlainTextWords() will not break the 'word' parameter into words; instead, it will use the word index to search for the exact string you've passed in, which will not find anything because the word index contains text already broken into words with whitespace and punctuation removed.

0

I would like to find all xhtml files containing the value BEAN$BeanID in jsp tags like this:

<c:set var="viewBean" value="#{BEAN$BeanID}"/>


What would be the correct call for it?

0

There is no direct API to perform a fast (optimized via indices) search of a string which consists of multiple words. I would simply use PsiSearchHelper to search for BeanID and then check manually whether the occurrences match the pattern you expect.

0

Thank you very much Dmitry.

That's exactly what I wanted to know.

0

Please sign in to leave a comment.