diff --git a/platform/lang-impl/src/com/intellij/ide/actions/SearchEverywhereAction.java b/platform/lang-impl/src/com/intellij/ide/actions/SearchEverywhereAction.java index 9924625c86f5..6ce52a5ab56e 100644 --- a/platform/lang-impl/src/com/intellij/ide/actions/SearchEverywhereAction.java +++ b/platform/lang-impl/src/com/intellij/ide/actions/SearchEverywhereAction.java @@ -1682,7 +1682,7 @@ public class SearchEverywhereAction extends AnAction implements CustomComponentA myProgressIndicator, new Processor() { @Override public boolean process(Object o) { - if (o instanceof PsiElement && !(((PsiElement)o).getParent() instanceof PsiFile)) { + if (isSymbol(o)) { final PsiElement element = (PsiElement)o; final PsiFile file = element.getContainingFile(); if (!myListModel.contains(o) && !symbols.contains(o) && @@ -1698,6 +1698,16 @@ public class SearchEverywhereAction extends AnAction implements CustomComponentA return symbols; } + protected boolean isSymbol(Object o) { + if (o instanceof PsiElement) { + final PsiElement e = (PsiElement)o; + //todo[kb] need a better way to avoid mixing java classes with symbols. Same to other languages where + //todo[kb] symbol provider returns classes. We need kind of suppressor API & EP here. + return !e.getLanguage().is(Language.findLanguageByID("JAVA")) || !(e.getParent() instanceof PsiFile); + } + return false; + } + private SearchResult getClasses(String pattern, boolean includeLibs, final int max, ChooseByNamePopup chooseByNamePopup) { final SearchResult classes = new SearchResult(); if (chooseByNamePopup == null) {