void () { configure(""" class C { /** * comment */ void m() {} }""", true); FoldRegion foldRegion = getEditor().getFoldingModel().getCollapsedRegionAtOffset(10); assertInstanceOf(foldRegion, CustomFoldRegion.class); CustomFoldRegion cfr = (CustomFoldRegion)foldRegion; Point location = cfr.getLocation(); assertNotNull(location); Rectangle rendererBounds = new Rectangle(location, new Dimension(cfr.getWidthInPixels(), cfr.getHeightInPixels())); assertFalse(rendererBounds.isEmpty()); @NotNull Pair<@NotNull Interval, @Nullable Interval> p = EditorUtil.logicalLineToYRange(getEditor(), 2); assertEquals(rendererBounds.y, p.first.intervalStart()); assertEquals(rendererBounds.y + rendererBounds.height, p.first.intervalEnd()); assertNull(p.second); Interval lineRange = EditorUtil.yToLogicalLineRange(getEditor(), rendererBounds.y + rendererBounds.height / 2); assertEquals(1, lineRange.intervalStart()); assertEquals(3, lineRange.intervalEnd()); }