void () { if (myCodeBlockMarkerRanges.size() < 2 || !(myEditor instanceof EditorEx editorEx)) { return; } List<TextRange> markers = new ArrayList<>(myCodeBlockMarkerRanges); markers.sort(Segment.BY_START_OFFSET_THEN_END_OFFSET); TextRange leftBraceRange = markers.get(0); TextRange rightBraceRange = markers.get(markers.size() - 1); int startLine = editorEx.offsetToLogicalPosition(leftBraceRange.getStartOffset()).line; int endLine = editorEx.offsetToLogicalPosition(rightBraceRange.getEndOffset()).line; if (endLine - startLine > 0) { BraceHighlightingHandler.lineMarkFragment(editorEx, editorEx.getDocument(), startLine, endLine, true); } BraceHighlightingHandler.showScopeHint(editorEx, myFile, leftBraceRange.getStartOffset(), leftBraceRange.getEndOffset()); }