@NotNull
  public Map<Document, List<HighlightInfo>> runMainPasses(@NotNull List<? extends VirtualFile> filesToCheck, @Nullable HighlightSeverity minimumSeverity) {
    Map<Document, List<HighlightInfo>> result = new ConcurrentHashMap<>();
    if (ApplicationManager.getApplication().isDispatchThread()) {
      PsiDocumentManager.getInstance(myProject).commitAllDocuments();
      if (ApplicationManager.getApplication().isWriteAccessAllowed()) {
        throw new RuntimeException("Must not run under write action");
      }
      Ref<Exception> exception = Ref.create();
      ProgressManager.getInstance().run(new Task.Modal(myProject, myTitle, true) {
        @Override
        public void run(@NotNull ProgressIndicator progress) {
          try {
            runMainPasses(filesToCheck, result, (ProgressIndicatorEx)progress, minimumSeverity);
          }
          catch (ProcessCanceledException e) {
            LOG.info("Code analysis canceled", e);
            exception.set(e);
          }
          catch (Exception e) {
            LOG.error(e);
            exception.set(e);
          }
        }
      });
      if (!exception.isNull()) {
        ExceptionUtil.rethrowAllAsUnchecked(exception.get());
      }
    }
    else if (ProgressManager.getInstance().getProgressIndicator() instanceof ProgressIndicatorEx indicator) {
      runMainPasses(filesToCheck, result, indicator, minimumSeverity);
    }
    else {
      throw new RuntimeException("Must run from Event Dispatch Thread or with a progress indicator");
    }

    return result;
  }
@NotNull
  public Map<Document, List<HighlightInfo>> runMainPasses(@NotNull List<? extends VirtualFile> filesToCheck, @Nullable HighlightSeverity minimumSeverity)