private void runMainPasses(@NotNull VirtualFile file,
                             @NotNull Map<? super Document, ? super List<HighlightInfo>> result,
                             @NotNull DaemonProgressIndicator daemonIndicator,
                             @Nullable HighlightSeverity minimumSeverity) {
    ApplicationManager.getApplication().assertIsNonDispatchThread();
    daemonIndicator.checkCanceled();
    PsiFile psiFile = ReadAction.compute(() -> PsiManager.getInstance(myProject).findFile(file));
    Document document = ReadAction.compute(() -> FileDocumentManager.getInstance().getDocument(file));
    if (psiFile == null || document == null || !ReadAction.compute(() -> ProblemHighlightFilter.shouldProcessFileInBatch(psiFile))) {
      return;
    }
    ProperTextRange range = ProperTextRange.create(0, document.getTextLength());
    ProgressManager.getInstance().runProcess(() ->
      HighlightingSessionImpl.runInsideHighlightingSession(psiFile, null, range, false, session -> {
        ((HighlightingSessionImpl)session).setMinimumSeverity(minimumSeverity);
        runMainPasses(daemonIndicator, result, psiFile, document);
      }), daemonIndicator);
  }
private void runMainPasses(@NotNull VirtualFile file,
                             @NotNull Map<? super Document, ? super List<HighlightInfo>> result,
                             @NotNull DaemonProgressIndicator daemonIndicator,
                             @Nullable HighlightSeverity minimumSeverity)