LookupElement[] (Expression @NotNull [] params, ExpressionContext context) { final Query<PsiMember> query = findAnnotated(context, params); if (query != null) { Set<LookupElement> set = new LinkedHashSet<>(); final String secondParamValue = params.length > 1 ? params[1].calculateResult(context).toString() : null; final boolean isShortName = secondParamValue != null && !Boolean.parseBoolean(secondParamValue); final Project project = context.getProject(); final PsiClass findInClass = secondParamValue != null ? JavaPsiFacade.getInstance(project).findClass(secondParamValue, GlobalSearchScope.allScope(project)) : null; for (PsiMember object : query.findAll()) { if (findInClass != null && !object.getContainingClass().equals(findInClass)) continue; boolean isClazz = object instanceof PsiClass; final String name = isShortName || !isClazz ? object.getName() : ((PsiClass) object).getQualifiedName(); set.add(LookupElementBuilder.create(name)); } return set.toArray(LookupElement.EMPTY_ARRAY); } return LookupElement.EMPTY_ARRAY; }