private void addMatchHighlights() {
    if (myEditConfigOnly) return;
    ReadAction.nonBlocking(() -> {
        if (DumbService.isDumb(myProject)) {
          // Search hits in the current editor are not shown when dumb.
          return null;
        }
        final Editor editor = myEditor;
        if (editor == null) {
          return null;
        }
        final Document document = editor.getDocument();
        final PsiFile file = PsiDocumentManager.getInstance(myProject).getPsiFile(document);
        if (file == null) {
          return null;
        }
        final MatchOptions matchOptions = getConfiguration().getMatchOptions();
        matchOptions.setScope(new LocalSearchScope(file, PredefinedSearchScopeProviderImpl.getCurrentFileScopeName()));
        final CollectingMatchResultSink sink = new CollectingMatchResultSink();
        try {
          new Matcher(myProject, matchOptions).findMatches(sink);
          final List<MatchResult> matches = sink.getMatches();
          removeMatchHighlights();
          addMatchHighlights(matches, editor, file, SSRBundle.message("status.bar.text.results.found.in.current.file", matches.size()));
        }
        catch (MalformedPatternException | UnsupportedPatternException e) {
          reportMessage(e.getMessage().replace(ScriptSupport.UUID, ""), true, mySearchCriteriaEdit);
          removeMatchHighlights();
        }
        return null;
      })
      .withDocumentsCommitted(myProject)
      .expireWith(getDisposable())
      .coalesceBy(this)
      .submit(AppExecutorUtil.getAppExecutorService());
  }
private void addMatchHighlights()