From 02301e7219ea02e08b37455c9f93baca80fb9d5f Mon Sep 17 00:00:00 2001 From: Eugene Vigdorchik Date: Wed, 19 Jan 2005 16:54:43 +0300 Subject: [PATCH] (no message) --- .../psi/impl/search/PsiSearchHelperImpl.java | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/source/com/intellij/psi/impl/search/PsiSearchHelperImpl.java b/source/com/intellij/psi/impl/search/PsiSearchHelperImpl.java index 47398ca6af76..be9c5a37c9eb 100644 --- a/source/com/intellij/psi/impl/search/PsiSearchHelperImpl.java +++ b/source/com/intellij/psi/impl/search/PsiSearchHelperImpl.java @@ -62,6 +62,9 @@ public class PsiSearchHelperImpl implements PsiSearchHelper { private final JoinPointSearchHelper myJoinPointSearchHelper; private static final TokenSet XML_ATTRIBUTE_VALUE_TOKEN_BIT_SET = TokenSet.create(new IElementType[]{ElementType.XML_ATTRIBUTE_VALUE_TOKEN}); private static final TodoItem[] EMPTY_TODO_ITEMS = new TodoItem[0]; + private static final short DEFAULT_OCCURENCE_MASK = WordInfo.IN_CODE | + WordInfo.JSP_ATTRIBUTE_VALUE | + WordInfo.IN_COMMENTS; public interface CustomSearchHelper { short getOccurenceMask(); @@ -114,12 +117,22 @@ public class PsiSearchHelperImpl implements PsiSearchHelper { } } + static class JspxCustomSearchHelper extends XHtmlCustomSearchHelper { + public TokenSet getElementTokenSet() { + return TokenSet.orSet(super.getElementTokenSet(), IDENTIFIER_OR_DOC_VALUE_OR_JSP_ATTRIBUTE_VALUE_BIT_SET); + } + + public short getOccurenceMask() { + return (short)(super.getOccurenceMask() | DEFAULT_OCCURENCE_MASK); + } + } + private static final HashMap CUSTOM_SEARCH_HELPERS = new HashMap(); static { registerCustomSearchHelper(StdFileTypes.HTML,new HtmlCustomSearchHelper()); registerCustomSearchHelper(StdFileTypes.XHTML,new XHtmlCustomSearchHelper()); - registerCustomSearchHelper(StdFileTypes.JSPX,new XHtmlCustomSearchHelper()); + registerCustomSearchHelper(StdFileTypes.JSPX,new JspxCustomSearchHelper()); XmlCustomSearchHelper searchHelper = new XmlCustomSearchHelper(); registerCustomSearchHelper(StdFileTypes.XML,searchHelper); @@ -288,9 +301,7 @@ public class PsiSearchHelperImpl implements PsiSearchHelper { occurrenceMask = WordInfo.PLAIN_TEXT; } else { - occurrenceMask = WordInfo.IN_CODE | - WordInfo.JSP_ATTRIBUTE_VALUE | - WordInfo.IN_COMMENTS; + occurrenceMask = DEFAULT_OCCURENCE_MASK; } final TokenSet elementTypes;