SimpleTextAttributes (@NotNull final SimpleTextAttributes attrs, @Nullable HighlightDisplayLevel level) { if (level == null) { return attrs; } Map<SimpleTextAttributes, SimpleTextAttributes> highlightMap = myHighlightAttributes.get(level.getSeverity()); if (highlightMap == null) { highlightMap = new HashMap<>(); myHighlightAttributes.put(level.getSeverity(), highlightMap); } SimpleTextAttributes result = highlightMap.get(attrs); if (result == null) { final TextAttributesKey attrKey = SeverityRegistrar.getSeverityRegistrar(myProject).getHighlightInfoTypeBySeverity(level.getSeverity()).getAttributesKey(); TextAttributes textAttrs = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(attrKey); textAttrs = TextAttributes.merge(attrs.toTextAttributes(), textAttrs); result = SimpleTextAttributes.fromTextAttributes(textAttrs); highlightMap.put(attrs, result); } return result; }