5 Commits
Author SHA1 Message Date
lucioandClaude Fable 5 03a4958294 Inline instantiation round 2: the space is the commitment, and every indexed module answers
Two owner rulings from live use. The ghost now fires only after
'name<space>' — aes alone may still be growing into aes_dft, so the
typed space is what says the name is finished; an Ident ending at the
cursor offers nothing at all. And a module declared in more than one
file no longer declines: completion::nearest_definition picks the copy
sharing the most leading path components with the asking buffer (a
top_earlgrey buffer gets top_earlgrey's ast_dft), then the shallowest,
then the lexicographically smallest — the depth term is QA's catch,
fixed at review, so a direct sibling beats a deeper subdirectory copy
that ties on the prefix. vlog_refactor::module_definition keeps its
ambiguity refusal for its own callers.

The refusal residue is now the enumerable inline::NoGhost, and QA's
sweep proves the ruling: 1131/1131 opentitan module names ghost, zero
declines (199 multiply-declared, tb 61 ways), ast_dft and io_osc
verified from both tops over the wire, 0.05-0.08 ms per non-matching
keystroke.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-30 17:15:42 -07:00
lucioandClaude Fable 5 cadb4319e4 Inline instantiation: the popup names the module, the ghost writes the rest
ci / checks (push) Successful in 45s
ci / corpus (push) Successful in 19s
Two levels, sized for opentitan. Tier 0 of the completion popup stops
planning skeletons (up to 64 file reads + header parses per keystroke)
and offers module names alone; once the identifier at the cursor exactly
matches an indexed module, textDocument/inlineCompletion ghosts the full
instantiation — every parameter, every port, each a tabstop, in-scope
signals auto-connected — planned once through the existing header-slice
path and the FileView cache. Candidates::has_module is the per-keystroke
probe: a case-sensitive binary search whose str-order premise is pinned.
lucisv.inlineInstantiation (default on) gates it, independent of
inlineTemplates.

Measured on opentitan: non-matching keystroke 0.10-0.17 ms warm, ghost
0.6-1.1 ms for aes (14 params/16 ports), 2.5 ms cold for the
112-parameter top_earlgrey; popup module tier reads no files at all.

Lead corrections at merge: four doc references to a lucisv/instantiate
command that never existed, replaced by the honest gap (topo 2.9-19: no
skeleton path for clients without inlineCompletion); extension and nvim
README docs delivered.

docs/features/inline-instantiation/README.md; TODO.md section 12.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-30 14:17:16 -07:00
lucio eeaffafd56 Rename the tool to lucisv (Language Utility for Coding In SystemVerilog) 2026-08-25 23:36:00 -07:00
lucioandClaude Fable 5 765cd010c2 Inline templates round 2: aligned snippets, the designer trigger set
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]>
2026-08-25 16:13:19 -07:00
lucioandClaude Fable 5 9d47b6d02b Inline templates M15: ghost text finishes the block you open
textDocument/inlineCompletion (LSP 3.18): typing `if (` offers grey
`) begin … end` and a line-ending `begin` offers its `end`; Tab accepts
as a snippet, cursor in the condition first, indented body second.
Token-based triggers (comments/strings/identifiers never fire), offered
only while the construct is really unclosed (paren stack, pairs.rs for
begin/end). Response types hand-rolled: lsp-types 0.97's item is the old
draft, and vscode-languageclient 9 only makes a SnippetString from
insertText {kind:"snippet"} — shape pinned in unit, e2e and smoke tests.
vfmt.inlineTemplates (default on) turns it off; VS Code extension opts
into the proposed client feature. QA: Eof-sentinel fix so a trigger at
the true end of file still offers.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-25 13:30:43 -07:00