void (@NotNull Consumer<LookupElement> consumer, @NotNull PrefixMatcher matcher) { GrCodeReferenceElement ref = myAnnotation.getClassReference(); PsiElement resolved = ref.resolve(); if (resolved instanceof PsiClass) { final PsiAnnotation annotationCollector = GrAnnotationCollector.findAnnotationCollector((PsiClass)resolved); if (annotationCollector != null) { final ArrayList<GrAnnotation> annotations = new ArrayList<>(); GrAnnotationCollector.collectAnnotations(annotations, myAnnotation, annotationCollector); Set<String> usedNames = new HashSet<>(); for (GrAnnotation annotation : annotations) { final PsiElement resolvedAliased = annotation.getClassReference().resolve(); if (resolvedAliased instanceof PsiClass && ((PsiClass)resolvedAliased).isAnnotationType()) { for (PsiMethod method : ((PsiClass)resolvedAliased).getMethods()) { if (usedNames.add(method.getName())) { for (LookupElement element : GroovyCompletionUtil .createLookupElements(new ElementResolveResult<>(method), false, matcher, null)) { consumer.consume(element); } } } } } } else if (((PsiClass)resolved).isAnnotationType()) { for (PsiMethod method : ((PsiClass)resolved).getMethods()) { for (LookupElement element : GroovyCompletionUtil .createLookupElements(new ElementResolveResult<>(method), false, matcher, null)) { consumer.consume(element); } } } } }