Skip to main content

decls_as_stmts_block

Function decls_as_stmts_block 

Source
pub fn decls_as_stmts_block(decls: Vec<TsDecl>) -> Vec<TsStmt>
Expand description

As decls_as_stmts, plus one extra forced trailing blank TsStmt when anything was collected — the shared if emitted_any { ... } trailer every emit_helpers_for_owner/[emit_helpers_for_owner_ qualified] caller needs. Under the pre-#1486 flat-print regime this trailer’s own blank stacked on top of decls_as_stmts’s own per-decl blank (one TsStmt::blank after every decl, including the last), giving this group’s own tail two blank lines total — a genuine, stronger “owner group” section break (confirmed against 118_workers_target_with_consume’s own real fixture output: the local_boundary helpers group and the following by_commons re-export group are separated by two blank lines, not one), not a redundant duplicate of the ordinary one-blank-between-decls spacing decls_as_stmts now gets for free from the printer’s automatic policy. no_blank_before on the extra blank itself suppresses its own automatic lead-in (which would otherwise stack with the ordinary one the policy already supplies between the last real decl and this blank), leaving exactly one blank line from this statement’s own render plus the policy’s own ordinary blank before whatever follows — two lines total, matching the pre-#1486 text exactly.