void highlightHyperlinks(@NotNull Project project,
                           @NotNull Filter customFilter,
                           int startLine,
                           int endLine,
                           @NotNull Expirable token) {
    if (endLine < 0) return;

    Document document = myEditor.getDocument();
    long startStamp = document.getModificationStamp();
    myQueue.offer(new HighlighterJob(project, customFilter, startLine, endLine, document, token));
    if (ApplicationManager.getApplication().isWriteAccessAllowed()) {
      runTasks();
      highlightAvailableResults();
      return;
    }

    Promise<?> promise = ReadAction.nonBlocking(this::runTasks).expireWhen(() -> document.getModificationStamp() != startStamp).submit(ourExecutor);

    if (isQuick(promise)) {
      highlightAvailableResults();
    }
    else {
      promise.onSuccess(__ -> {
        if (hasResults()) {
          ApplicationManager.getApplication().invokeLater(this::highlightAvailableResults, ModalityState.any());
        }
      });
    }
  }
void highlightHyperlinks(@NotNull Project project,
                           @NotNull Filter customFilter,
                           int startLine,
                           int endLine,
                           @NotNull Expirable token)