void (@NotNull InjectedLanguageManager injectedLanguageManager, @NotNull PsiFile injectedPsi, @NotNull List<? extends PsiLanguageInjectionHost.Shred> places, @Nullable TextAttributesKey attributesKey, @NotNull Consumer<? super HighlightInfo> outInfos) { DocumentWindow documentWindow = (DocumentWindow)PsiDocumentManager.getInstance(myProject).getCachedDocument(injectedPsi); if (documentWindow == null) return; boolean addTooltips = places.size() < 100; for (PsiLanguageInjectionHost.Shred place : places) { PsiLanguageInjectionHost host = place.getHost(); if (host == null) continue; TextRange textRange = place.getRangeInsideHost().shiftRight(host.getTextRange().getStartOffset()); if (textRange.isEmpty()) continue; HighlightInfo.Builder builder = HighlightInfo.newHighlightInfo(HighlightInfoType.INJECTED_LANGUAGE_BACKGROUND).range(textRange); if (attributesKey != null && InjectedLanguageUtil.isHighlightInjectionBackground(host)) { builder.textAttributes(attributesKey); } if (addTooltips) { String desc = injectedPsi.getLanguage().getDisplayName() + ": " + injectedPsi.getText(); builder.unescapedToolTip(desc); } HighlightInfo info = builder.createUnconditionally(); info.markFromInjection(); outInfos.accept(info); } HighlightInfoHolder holder = createInfoHolder(injectedPsi, documentWindow, injectedLanguageManager, outInfos); runHighlightVisitorsForInjected(injectedPsi, holder); highlightInjectedSyntax(injectedPsi, places, outInfos); if (!isDumbMode()) { List<HighlightInfo> todos = new ArrayList<>(); highlightTodos(injectedPsi, injectedPsi.getText(), 0, injectedPsi.getTextLength(), myPriorityRange, todos, todos); for (HighlightInfo info : todos) { addPatchedInfos(info, injectedPsi, documentWindow, injectedLanguageManager, outInfos); } } }