Result (Expression @NotNull [] params, final ExpressionContext context) { PsiElement place = context.getPsiElementAtStartOffset(); while(place != null){ if (place instanceof PsiClass psiClass && !(place instanceof PsiAnonymousClass) && !(place instanceof PsiTypeParameter)){ return new TextResult(psiClass.getQualifiedName()); } place = place.getParent(); } return null; }