@Override
  public @NotNull List<@NotNull TextEditorHighlightingPass> instantiatePasses(@NotNull PsiFile psiFile,
                                                                              @NotNull Editor editor,
                                                                              int @NotNull [] passesToIgnore) {
    ApplicationManager.getApplication().assertIsNonDispatchThread();
    PsiDocumentManager documentManager = PsiDocumentManager.getInstance(myProject);
    Document document = editor.getDocument();
    PsiFile fileFromDoc = documentManager.getPsiFile(document);
    if (!(fileFromDoc instanceof PsiCompiledElement)) {
      assert fileFromDoc == psiFile : "Files are different: " + psiFile + ";" + fileFromDoc;
      Document documentFromFile = documentManager.getDocument(psiFile);
      assert documentFromFile == document : "Documents are different. Doc: " + document + "; Doc from file: " + documentFromFile +"; File: "+psiFile +"; Virtual file: "+
                                            PsiUtilCore.getVirtualFile(psiFile);
    }
    PassConfig[] frozenPassConfigs = freezeRegisteredPassFactories();
    List<TextEditorHighlightingPass> result = new ArrayList<>(frozenPassConfigs.length);
    IntList passesRefusedToCreate = new IntArrayList();
    try (AccessToken ignored = ClientId.withClientId(ClientEditorManager.Companion.getClientId(editor))) {
      for (int passId = 1; passId < frozenPassConfigs.length; passId++) {
        PassConfig passConfig = frozenPassConfigs[passId];
        if (passConfig == null) continue;
        if (ArrayUtil.find(passesToIgnore, passId) != -1) {
          continue;
        }
        TextEditorHighlightingPassFactory factory = passConfig.passFactory;
        TextEditorHighlightingPass pass = DumbService.getInstance(myProject).isUsableInCurrentContext(factory)
          && ProblemHighlightFilter.shouldHighlightFile(psiFile) ? factory.createHighlightingPass(psiFile, editor) : null;
        if (pass == null || !DumbService.getInstance(myProject).isUsableInCurrentContext(pass)) {
          passesRefusedToCreate.add(passId);
        }
        else {
          // init with editor's color scheme
          pass.setColorsScheme(editor.getColorsScheme());

          IntList ids = passConfig.completionPredecessorIds.length == 0 ? IntList.of() : new IntArrayList(passConfig.completionPredecessorIds.length);
          for (int id : passConfig.completionPredecessorIds) {
            if (id < frozenPassConfigs.length && frozenPassConfigs[id] != null) {
              ids.add(id);
            }
          }
          pass.setCompletionPredecessorIds(ids.isEmpty() ? ArrayUtilRt.EMPTY_INT_ARRAY : ids.toIntArray());
          ids = passConfig.startingPredecessorIds.length == 0 ? IntList.of() : new IntArrayList(passConfig.startingPredecessorIds.length);
          for (int id : passConfig.startingPredecessorIds) {
            if (id < frozenPassConfigs.length && frozenPassConfigs[id] != null) {
              ids.add(id);
            }
          }
          pass.setStartingPredecessorIds(ids.isEmpty() ? ArrayUtilRt.EMPTY_INT_ARRAY : ids.toIntArray());
          pass.setId(passId);
          result.add(pass);
        }
      }
    }

    DaemonCodeAnalyzerEx daemonCodeAnalyzer = DaemonCodeAnalyzerEx.getInstanceEx(myProject);
    FileStatusMap statusMap = daemonCodeAnalyzer.getFileStatusMap();
    for (IntListIterator iterator = passesRefusedToCreate.iterator(); iterator.hasNext(); ) {
      statusMap.markFileUpToDate(document, iterator.nextInt());
    }
    return result;
  }
@Override
  public @NotNull List<@NotNull TextEditorHighlightingPass> instantiatePasses(@NotNull PsiFile psiFile,
                                                                              @NotNull Editor editor,
                                                                              int @NotNull [] passesToIgnore)