String (Editor topEditor, boolean withCollapseStatus) { return getTagsFromSegments(topEditor.getDocument().getText(), Arrays.asList(topEditor.getFoldingModel().getAllFoldRegions()), FOLD, foldRegion -> "text='" + foldRegion.getPlaceholderText() + "'" + (withCollapseStatus ? " expand='" + foldRegion.isExpanded() + "'" : "")); }