void () { int[] valuePlaceholder = new int[] {0}; runWithCustomFoldingBuilder(new TestFoldingBuilder() { @NotNull @Override public String getPlaceholderText(@NotNull ASTNode node) { return Integer.toString(valuePlaceholder[0]); } @Override public boolean isCollapsedByDefault(@NotNull ASTNode node) { return true; } }, () -> { openEditor("<caret>\nvalue", PlainTextFileType.INSTANCE); checkFoldingState("[FoldRegion +(1:6), placeholder='0']"); valuePlaceholder[0] = 1; runFoldingPass(); checkFoldingState("[FoldRegion +(1:6), placeholder='1']"); }); }