LookupElement (@NotNull LookupElement element, @NotNull Condition<? super String> matcher, @NotNull String prefix, @NotNull CompletionType completionType) { if (matcher.value(element.getLookupString())) { return null; } String lookupString = element.getLookupString(); PsiElement psiElement = element.getPsiElement(); if (!(psiElement instanceof PsiMember psiMember)) { return null; } PsiClass psiClass = psiMember.getContainingClass(); Set<String> tags = tags(lookupString).stream() .filter(t -> matcher.value(t.name()) && t.matcher().test(psiClass)) .map(t -> t.name()) .collect(Collectors.toSet()); if (tags.isEmpty()) { return null; } return new TagLookupElementDecorator(element, tags, prefix, completionType == CompletionType.SMART); }