diff --git a/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionLookupArranger.java b/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionLookupArranger.java index f24840e75740..67df7129725b 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionLookupArranger.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionLookupArranger.java @@ -288,7 +288,13 @@ public class CompletionLookupArranger extends LookupArranger { final List> byClassifier = ContainerUtil.newArrayList(); for (CompletionSorterImpl sorter : myClassifiers.keySet()) { ProcessingContext context = createContext(false); - byClassifier.add(myClassifiers.get(sorter).classify(inputBySorter.get(sorter), context)); + List validElements = ContainerUtil.filter(inputBySorter.get(sorter), new Condition() { + @Override + public boolean value(LookupElement element) { + return element.isValid(); + } + }); + byClassifier.add(myClassifiers.get(sorter).classify(validElements, context)); } //noinspection unchecked return ContainerUtil.concat(byClassifier.toArray(new Iterable[byClassifier.size()]));