@Override
  synchronized void psiElementVisited(@NotNull Object toolId,
                                      @NotNull PsiElement visitedPsiElement,
                                      @NotNull List<? extends HighlightInfo> newInfos,
                                      @NotNull Document hostDocument,
                                      @NotNull PsiFile psiFile,
                                      @NotNull Project project,
                                      @NotNull HighlightingSession session) {
    Map<Object, ToolHighlights> data = getData(psiFile, hostDocument);
    ToolHighlights toolHighlights = newInfos.isEmpty() ? data.get(toolId) : data.computeIfAbsent(toolId, __ -> new ToolHighlights());
    List<? extends HighlightInfo> oldInfos = toolHighlights == null ? null : toolHighlights.elementHighlights.get(visitedPsiElement);
    List<? extends HighlightInfo> newInfosToStore;
    if (oldInfos != null || !newInfos.isEmpty()) {
      newInfosToStore = List.copyOf(newInfos);
      if (LOG.isDebugEnabled()) {
        //noinspection removal
        LOG.debug("psiElementVisited: " + visitedPsiElement + " in " + visitedPsiElement.getTextRange() +
                  (psiFile.getViewProvider() instanceof InjectedFileViewProvider ?
                   " injected in " + InjectedLanguageManager.getInstance(project).injectedToHost(psiFile, psiFile.getTextRange()) : "") +
                  "; tool:" + toolId + "; infos:" + newInfosToStore + "; oldInfos:" + oldInfos + "; session:" + System.identityHashCode(session.getProgressIndicator()));
      }
      MarkupModelEx markup = (MarkupModelEx)DocumentMarkupModel.forDocument(hostDocument, project, true);
      setHighlightersInRange(newInfosToStore, oldInfos, markup, session);
    }
    else {
      newInfosToStore = List.of();
    }
    // store back only after markup model changes are applied to avoid PCE thrown in the middle leaving corrupted data behind
    putInfosForVisitedPsi(data, toolId, visitedPsiElement, newInfosToStore, toolHighlights);
  }
@Override
  synchronized void psiElementVisited(@NotNull Object toolId,
                                      @NotNull PsiElement visitedPsiElement,
                                      @NotNull List<? extends HighlightInfo> newInfos,
                                      @NotNull Document hostDocument,
                                      @NotNull PsiFile psiFile,
                                      @NotNull Project project,
                                      @NotNull HighlightingSession session)