void (@NotNull EditorColorsScheme scheme, @NotNull TextRange hostRange, TextAttributesKey @NotNull [] keys, @NotNull Consumer<? super HighlightInfo> outInfos) { if (hostRange.isEmpty()) { return; } // erase marker to override hosts colors HighlightInfo info = HighlightInfo.newHighlightInfo(HighlightInfoType.INJECTED_LANGUAGE_FRAGMENT) .range(hostRange) .textAttributes(TextAttributes.ERASE_MARKER) .createUnconditionally(); outInfos.accept(info); LayeredTextAttributes injectedAttributes = LayeredTextAttributes.create(scheme, keys); if (injectedAttributes.isEmpty() || keys.length == 1 && keys[0] == HighlighterColors.TEXT) { // nothing to add return; } HighlightInfo injectedInfo = HighlightInfo.newHighlightInfo(HighlightInfoType.INJECTED_LANGUAGE_FRAGMENT) .range(hostRange) .textAttributes(injectedAttributes) .createUnconditionally(); outInfos.accept(injectedInfo); }