LookupElement () { final CastingLookupElementDecorator casting = myQualifier.as(CastingLookupElementDecorator.CLASS_CONDITION_KEY); LookupElement qualifier = casting == null ? myQualifier : casting.getDelegate(); if (qualifier.getObject() instanceof PsiClass) return null; return qualifier; }