Search in sources :

Example 1 with NonHideableIconGutterMark

use of com.intellij.codeInsight.daemon.NonHideableIconGutterMark in project intellij-community by JetBrains.

the class EditorGutterComponentImpl method buildGutterRenderersCache.

private void buildGutterRenderersCache() {
    myLineToGutterRenderers = new TIntObjectHashMap<>();
    processRangeHighlighters(0, myEditor.getDocument().getTextLength(), highlighter -> {
        GutterMark renderer = highlighter.getGutterIconRenderer();
        if (renderer == null) {
            return;
        }
        if (!areIconsShown() && !(renderer instanceof NonHideableIconGutterMark)) {
            return;
        }
        if (!isHighlighterVisible(highlighter)) {
            return;
        }
        int lineStartOffset = EditorUtil.getNotFoldedLineStartOffset(myEditor, highlighter.getStartOffset());
        int line = myEditor.getDocument().getLineNumber(lineStartOffset);
        List<GutterMark> renderers = myLineToGutterRenderers.get(line);
        if (renderers == null) {
            renderers = new SmartList<>();
            myLineToGutterRenderers.put(line, renderers);
        }
        renderers.add(renderer);
    });
    myLineToGutterRenderers.transformValues(value -> {
        List<GutterMark> newValue = value;
        for (GutterMarkPreprocessor preprocessor : GutterMarkPreprocessor.EP_NAME.getExtensions()) {
            newValue = preprocessor.processMarkers(value);
        }
        if (newValue.size() >= 5) {
            newValue = newValue.subList(0, 4);
        }
        return newValue;
    });
}
Also used : NonHideableIconGutterMark(com.intellij.codeInsight.daemon.NonHideableIconGutterMark) NonHideableIconGutterMark(com.intellij.codeInsight.daemon.NonHideableIconGutterMark) GutterMark(com.intellij.codeInsight.daemon.GutterMark) RelativePoint(com.intellij.ui.awt.RelativePoint) HintHint(com.intellij.ui.HintHint)

Aggregations

GutterMark (com.intellij.codeInsight.daemon.GutterMark)1 NonHideableIconGutterMark (com.intellij.codeInsight.daemon.NonHideableIconGutterMark)1 HintHint (com.intellij.ui.HintHint)1 RelativePoint (com.intellij.ui.awt.RelativePoint)1