static void commitDocumentsIfNeeded(@NotNull AnAction action, @NotNull AnActionEvent event) {
    if (!isPerformWithDocumentsCommitted(action)) return;
    Project project = event.getProject();
    if (project == null) return;
    try (AccessToken ignore = SlowOperations.startSection(SlowOperations.ACTION_PERFORM)) {
      PsiDocumentManager.getInstance(project).commitAllDocuments();
    }
  }
static void commitDocumentsIfNeeded(@NotNull AnAction action, @NotNull AnActionEvent event)