ElementFilter () { return new ElementFilter() { @Override public boolean isAcceptable(Object element, PsiElement context) { final PsiElement grandParent = ((PsiElement)element).getParent().getParent(); if (grandParent instanceof XmlTag tag) { if (!tag.getNamespacePrefix().isEmpty()) { return true; } } return false; } @Override public boolean isClassAcceptable(Class hintClass) { return true; } }; }