private static boolean externalAnnotatorsDefined(@NotNull PsiFile file) {
    for (Language language : file.getViewProvider().getLanguages()) {
      List<ExternalAnnotator<?,?>> externalAnnotators = ExternalLanguageAnnotators.allForFile(language, file);
      if (!externalAnnotators.isEmpty()) {
        return true;
      }
    }
    return false;
  }
private static boolean externalAnnotatorsDefined(@NotNull PsiFile file)