void (@NotNull PsiElement element, @NotNull HighlightInfoHolder inside, @NotNull HighlightInfoHolder outside, @NotNull ProperTextRange priorityRange) { EditorColorsScheme scheme = ObjectUtils.notNull(getColorsScheme(), EditorColorsManager.getInstance().getGlobalScheme()); Language language = ILazyParseableElementType.LANGUAGE_KEY.get(element.getNode()); if (language == null) return; SyntaxHighlighter syntaxHighlighter = SyntaxHighlighterFactory.getSyntaxHighlighter(language, myProject, myFile.getVirtualFile()); for (PsiElement token : SyntaxTraverser.psiTraverser(element).traverse(TreeTraversal.LEAVES_DFS)) { TextRange tokenRange = token.getTextRange(); if (tokenRange.isEmpty()) continue; IElementType type = PsiUtilCore.getElementType(token); @NotNull HighlightInfoHolder holder = priorityRange.contains(tokenRange) ? inside : outside; TextAttributesKey[] keys = syntaxHighlighter.getTokenHighlights(type); InjectedGeneralHighlightingPass.addSyntaxInjectedFragmentInfo(scheme, tokenRange, keys, info -> holder.add(info)); } }