boolean (PsiElement element) { if (element instanceof GrEnumConstant) return true; if (!(element instanceof GrReferenceElement)) return false; PsiElement parent = element.getParent(); if (parent instanceof GrCall) { return true; } else if (parent instanceof GrAnonymousClassDefinition) { return element.equals(((GrAnonymousClassDefinition)parent).getBaseClassReferenceGroovy()); } return false; }