public static List<AnnotationDocGenerator> getAnnotationsToShow(@NotNull PsiAnnotationOwner owner, @NotNull PsiElement context) {
    if (owner instanceof PsiModifierList modifierList) {
      return getAnnotationsToShow(((PsiModifierListOwner)modifierList.getParent()));
    }
    Set<String> shownAnnotations = new HashSet<>();
    List<AnnotationDocGenerator> generators = ContainerUtil.mapNotNull(
      owner.getAnnotations(), annotation -> forAnnotation(context, shownAnnotations, annotation));
    if (owner instanceof PsiArrayType type) {
      PsiType contextType = getContextType(context);
      if (type.equals(contextType)) {
        return StreamEx.of(getAnnotationsToShow((PsiModifierListOwner)context)).filter(anno -> anno.isNonCodeTypeUseAnnotation())
          .append(generators).toList();
      }
    }
    return generators;
  }
public static List<AnnotationDocGenerator> getAnnotationsToShow(@NotNull PsiAnnotationOwner owner, @NotNull PsiElement context)