private static @Nullable TextRange getAnnotationRange(@NotNull PsiElement startElement) {
    return startElement instanceof ExternallyAnnotated
           ? ((ExternallyAnnotated)startElement).getAnnotationRegion()
           : startElement.getTextRange();
  }
private static @Nullable TextRange getAnnotationRange(@NotNull PsiElement startElement)