private void runAnnotatorsAndVisitorsOnInjectedPsi(@NotNull InjectedLanguageManager injectedLanguageManager,
                                                     @NotNull PsiFile injectedPsi,
                                                     @NotNull List<? extends PsiLanguageInjectionHost.Shred> places,
                                                     @Nullable TextAttributesKey attributesKey,
                                                     @NotNull TriConsumer<Object, ? super PsiElement, ? super List<? extends HighlightInfo>> resultSink) {
    DocumentWindow documentWindow = (DocumentWindow)PsiDocumentManager.getInstance(myProject).getCachedDocument(injectedPsi);
    if (documentWindow == null) return;
    highlightInjectedBackground(injectedPsi, places, attributesKey, resultSink);

    AnnotationSession session = AnnotationSessionImpl.create(injectedPsi);
    GeneralHighlightingPass.setupAnnotationSession(session, myPriorityRange, myRestrictRange,
                                                   ((HighlightingSessionImpl)getHighlightingSession()).getMinimumSeverity());

    AnnotatorRunner annotatorRunner = myRunAnnotators ? new AnnotatorRunner(injectedPsi, false, session) : null;
    Divider.divideInsideAndOutsideAllRoots(injectedPsi, injectedPsi.getTextRange(), injectedPsi.getTextRange(), GeneralHighlightingPass.SHOULD_HIGHLIGHT_FILTER, dividedElements -> {
      List<? extends @NotNull PsiElement> inside = dividedElements.inside();
      LongList insideRanges = dividedElements.insideRanges();
      BooleanSupplier runnable = () -> {
        HighlightVisitorRunner highlightVisitorRunner = new HighlightVisitorRunner(injectedPsi, myGlobalScheme, myRunVisitors, myHighlightErrorElements);

        highlightVisitorRunner.createHighlightVisitorsFor(visitors -> {
          int chunkSize = Math.max(1, inside.size() / 100); // one percent precision is enough
          highlightVisitorRunner.runVisitors(injectedPsi, injectedPsi.getTextRange(), inside,
                                               insideRanges, List.of(), LongList.of(), visitors, false, chunkSize, true,
                                               () -> createInfoHolder(injectedPsi), (toolId, psiElement, infos) -> {
              // convert injected infos to host
              List<? extends HighlightInfo> hostInfos = infos.isEmpty()
                                                        ? infos
                                                        : ContainerUtil.flatMap(infos, info -> createPatchedInfos(info, injectedPsi,
                                                                                                                  documentWindow,
                                                                                                                  injectedLanguageManager));
              resultSink.accept(toolId, psiElement, hostInfos);
            });
        });
        highlightInjectedSyntax(injectedPsi, places, resultSink);
        return true;
      };
      if (annotatorRunner == null) {
        runnable.getAsBoolean();
      }
      else {
        annotatorRunner.runAnnotatorsAsync(inside, List.of(), runnable, resultSink);
      }
      return true;
    });
  }
private void runAnnotatorsAndVisitorsOnInjectedPsi(@NotNull InjectedLanguageManager injectedLanguageManager,
                                                     @NotNull PsiFile injectedPsi,
                                                     @NotNull List<? extends PsiLanguageInjectionHost.Shred> places,
                                                     @Nullable TextAttributesKey attributesKey,
                                                     @NotNull TriConsumer<Object, ? super PsiElement, ? super List<? extends HighlightInfo>> resultSink)