void () { TextAttributes attributes; if (myType == ValueHintType.MOUSE_ALT_OVER_HINT) { attributes = myEditor.getColorsScheme().getAttributes(EditorColors.REFERENCE_HYPERLINK_COLOR); attributes = NavigationUtil.patchAttributesColor(attributes, myCurrentRange, myEditor); } else { attributes = new TextAttributes(); // real attributes will be stored in user data } disposeHighlighter(); myHighlighter = myEditor.getMarkupModel().addRangeHighlighter(myCurrentRange.getStartOffset(), myCurrentRange.getEndOffset(), HighlighterLayer.SELECTION, attributes, HighlighterTargetArea.EXACT_RANGE); if (myType == ValueHintType.MOUSE_ALT_OVER_HINT) { myEditor.getContentComponent().addKeyListener(myEditorKeyListener); if (myEditor instanceof EditorEx) ((EditorEx)myEditor).setCustomCursor(AbstractValueHint.class, hintCursor()); if (LOG.isDebugEnabled()) { LOG.debug("set hint cursor to editor"); } myCursorSet = true; } else { TextAttributesKey attributesKey = DebuggerColors.EVALUATED_EXPRESSION_ATTRIBUTES; MarkupModel model = DocumentMarkupModel.forDocument(myEditor.getDocument(), myProject, false); if (model != null && !((MarkupModelEx)model).processRangeHighlightersOverlappingWith( myCurrentRange.getStartOffset(), myCurrentRange.getEndOffset(), h -> !ExecutionPointHighlighter.EXECUTION_POINT_HIGHLIGHTER_TOP_FRAME_KEY.get(h, false))) { attributesKey = DebuggerColors.EVALUATED_EXPRESSION_EXECUTION_LINE_ATTRIBUTES; } myHighlighter.putUserData(HINT_TEXT_ATTRIBUTES, myEditor.getColorsScheme().getAttributes(attributesKey)); } }