User report: accepted ghost text left `end` deeper than its opener.
Root cause proven from VS Code source: SnippetSession.adjustWhitespace
(default on, no opt-out on the inline-accept path) prepends the trigger
line's indent to snippet lines 2+, and the server baked it in too —
double indent. Fix is asymmetric because the protocols differ: ghost
bodies now emit relative indentation (one \t per step, editor settings
place it); the completion popup — latently double-indented since 0.4.0 —
keeps its absolute layout and sends insertTextMode: asIs, the opt-out
only that path has. QA modeled the normalization independently from the
same source; closer-lands-level is pinned per trigger, depth and
tab/space config.
Trigger table grows to the RTL set: case/casez/casex -> endcase (paren+
scope gate), for ( dialect-split, while (, always_ff @( (SV), always @(
offering posedge then *) as two cycleable items, fork -> join,
generate -> endgenerate, module -> named endmodule. Openers are token
sequences now; hygiene tests generalized (accepted-text-parses models
the editor's insertion; scope-balance and gate-matches-body derived
tests). 1644 tests green.
Co-Authored-By: Claude Fable 5 <[email protected]>
A template tier between index names and keywords: if / if-else / else-if
(gated on the line head, so it appears after end but not after an
identifier), case and casez with default, loops, always_ff (plain and
reset variants), always_comb, always @(...), initial, and declaration
templates - logic/localparam/parameter in .sv, wire/reg/integer twins in
.v; pathless buffers get the conservative Verilog set. One renderer
spells each body as snippet and plain text so the two cannot drift, and a
registry-wide test parses every untouched expansion. Nine overlapping
static VS Code snippets moved server-side; file-level ones stay static.
Co-Authored-By: Claude Fable 5 <[email protected]>