Commit Graph
93 Commits
Author SHA1 Message Date
lucioandClaude Fable 5 80b9afdfe3 LSP §9b: willSaveWaitUntil — protocol-native format-on-save
textDocument/willSaveWaitUntil is advertised and served, gated on a new
lucisv.formatOnSave setting that defaults to off (a server that formats
uninvited fights the editor's own format-on-save and doubles up); the
decline is one comparison, before any buffer lookup. When on, the hook
is textDocument/formatting with a different trigger: the same engine,
the same all-or-nothing verified-output contract, settings resolved by
the new format::settings_without_editor_options — the ladder minus the
tabSize rung the protocol simply does not carry here, with the honest
consequence (save-format can differ from manual format without a
lucisv.toml) documented in the README, the VS Code setting description
and the nvim README. Every save reason formats; refusals are shown per
save, on purpose.

18 tests added across settings/format/server/e2e, including QA's
executable proofs of the tab-size gap and its lucisv.toml resolution, a
no-reindex/no-generation-bump guard for the new setting, and an
idempotency round-trip through a real didChange. QA also fixed the
stale 'not advertised' feature list in editors/nvim/README.md and
sharpened the config-warning dedup claim to what the code does (once
per buffer state) — reworded in the README, pinned by test.

docs/features/will-save-wait-until/README.md

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-26 12:21:00 -07:00
lucioandClaude Fable 5 c2ea1a11f6 LSP §9b: incremental text sync
textDocument/didChange now applies ranged content changes instead of
requiring the whole buffer per keystroke. New pure sync::apply_changes
applies each change against the document as the previous ones left it
(fresh line table per change), clamping inherited from convert.rs and a
backwards range read as a pure insertion — the one rule that cannot lose
text. One notification stays one reparse / one generation bump / one
publish. Full-sync clients (rangeless changes) keep byte-identical
behavior; save advertises includeText: false and didSave still honours
text when sent.

35 tests added (28 unit incl. a 400-sequence randomized cross-check
against an independent reference model and QA's surrogate/CRLF/final-
newline attacks, 6 server-level, 1 e2e pinning the wire capability
shape). QA's one finding — CRLF split across two same-position inserts
in one batch lands \n\r — is pre-existing convert.rs behavior, pinned
by test, unreachable by real clients; see the feature README.

docs/features/incremental-sync/README.md

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-26 11:49:58 -07:00
lucioandClaude Fable 5 aa303ce9ae LSP §9a: applyEdit compliance, pull diagnostics, expand selection; v0.8.0
release / build-and-publish (push) Successful in 3m29s
The three top findings of the LSP 3.18 audit (TODO.md §9), one round of
dev (Opus) + QA (Sonnet) + lead review:

- executeCommand now pushes its WorkspaceEdit as workspace/applyEdit and
  reads the client's verdict; the old return-the-edit behavior stays as
  the documented fallback for clients without the capability. This fixes
  the three port commands doing nothing in stock clients — the returned
  edit was dropped by vscode-languageclient and Neovim alike.
  docs/features/apply-edit/README.md
- textDocument/diagnostic + workspace/diagnostic (LSP 3.17), served from
  the same parse+lint pass the push model publishes, with resultId /
  unchanged caching on one generation counter; a pulling client is pushed
  nothing, a pushing client is unchanged. QA's exhaustive input trace
  found no stale-unchanged path. docs/features/pull-diagnostics/README.md
- textDocument/selectionRange: chains from token spans, the tolerant
  parse's item/statement spans and the scope-pair matcher, filtered to
  strict nesting; the invariant swept over all 860 corpus files (6,880
  positions, held everywhere). docs/features/selection-range/README.md

43 tests added across unit/e2e (server 557 -> 594+ unit, 29 -> 32 e2e);
fmt/clippy/test/smoke all clean, re-verified independently by QA and by
the lead.

Co-Authored-By: Claude Fable 5 <[email protected]>
v0.8.0
2026-08-26 11:06:51 -07:00
lucioandClaude Fable 5 d3081d6aaf TODO: LSP 3.18 protocol audit — full gap list as §9, round 1 scoped
Compared lucisv_server against the LSP 3.18 spec. §9a is the round-1
scope (applyEdit compliance, pull diagnostics, selectionRange), §9b/9c
the ranked backlog, §9d the documented skips.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-26 10:26:03 -07:00
lucioandClaude Fable 5 c556a13857 CI: corpus score is a gate, releases audit their artifacts; v0.7.2
ci / checks (push) Successful in 36s
ci / corpus (push) Successful in 26s
release / build-and-publish (push) Successful in 3m7s
The corpus job scores the pinned-rev corpus (cached at
~/.cache/lucisv-corpus on the runner, fetched once on a miss) on every
push and fails below scripts/corpus-baseline (813) or on any
verification error / crash. The release workflow now runs
tools/audit_artifacts.sh before publishing: musl must be fully static,
linux-gnu's glibc ceiling must stay <= 2.28 (RHEL 8), every file must be
the object format its name claims — verified against the 10 real v0.7.1
release binaries. Linux execution under Docker was considered and
declined: no container runtime on the runner. Version 0.7.2 with a
changelog covering this, the printer column fix and the README truth
pass.

Co-Authored-By: Claude Fable 5 <[email protected]>
v0.7.2
2026-08-26 02:13:04 -07:00
lucioandClaude Fable 5 b560909a76 README truth pass: releases exist now, and the server reads lucisv.toml
The v0.7.1 release made three claims false: 'there are no prebuilt
downloads' (the releases page now has five platforms + the .vsix per
tag), 'the script builds for the host triple only' (--cross has existed
since 0.7.0's cross-platform release), and the hardcoded
lucisv-0.5.0.vsix example. The bigger correction: the 'server does not
read lucisv.toml yet' caveat has been stale since the config ladder
landed in lucisv_server/src/format.rs -- replaced with the actual
precedence (lucisv.toml > lucisv.* settings > tab size > default). Also
states plainly that Linux/Windows artifacts are audited, not executed.
.DS_Store untracked and gitignored.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-26 02:10:54 -07:00
lucioandClaude Fable 5 53f226981f printer: multi-line raw text keeps the column honest
Raw text carrying a string literal across a line break, and the #( ... )
of a parameterized type, were emitted as a single Doc::Text with embedded
newlines -- violating that variant's contract and leaving the printer's
column tracker stale, so every later fits() on the line broke
conservatively. Both now emit Doc::Inline, whose printer arm resumes
measuring from the text's own last line. Output bytes are identical
except where the stale column forced a spurious break: one corpus file
(id_queue_tb.sv) improves, pass set unchanged at 813/820, verify.rs
untouched. Found by QA in the directive-split round; pinned by a printer
test and a classes.cases entry.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-26 02:10:10 -07:00
lucioandClaude Fable 5 19253c105b CI on Gitea Actions: checks on push, full cross-platform release on tag; v0.7.1
ci / checks (push) Successful in 41s
release / build-and-publish (push) Successful in 3m12s
.gitea/workflows/ci.yml runs fmt/clippy/test on every master push and PR
on the self-hosted mac-arm64 runner (host mode, brew-serviced act_runner).
.gitea/workflows/release.yml turns a vX.Y.Z tag into a Gitea release:
tools/release.sh --cross (Apple Silicon + x86_64 macOS, musl and RHEL 8
linux-gnu, Windows; both binaries; .vsix; SHA256SUMS), a tag-vs-version
check, tools/release_notes.sh (the CHANGELOG section becomes the notes;
missing section fails the release) and tools/publish_release.sh
(get-or-create + attach, re-run safe). Version bumped to 0.7.1 with a
changelog covering directive-split and this flow.

Co-Authored-By: Claude Fable 5 <[email protected]>
v0.7.1
2026-08-26 01:51:45 -07:00
lucioandClaude Fable 5 033e53b381 README/ROADMAP: directive-split round 3 — 99.1%, loop log and review
Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-26 01:26:28 -07:00
lucioandClaude Fable 5 b77b61e7de directive-split: recover conditional-split constructs as verbatim items
An `ifdef/`else region whose arms are each an incomplete fragment of one
declaration (alternative heads sharing a body; alternative struct bodies
sharing a closing) no longer refuses: the strict parser recovers the whole
construct as a verbatim item, exact source bytes, the constraint/covergroup
precedent. The trigger requires an unmatched open bracket inside a region
genuinely open at item scope — `Parser::open_conds` counts only at the
single ItemKind::Directive producer, so opaque verbatim walks cannot
perturb it, and a recovered block hands back the nesting it swallows.

Corpus: 800 -> 813 / 820 (97.6% -> 99.1%), +13 files (12x
riscv_core_setting.sv, riscv_instr_pkg.sv), pass set a strict superset.
verify.rs untouched. Three dev passes, two adversarial QA rejections
(stray-`endif laundering; open_conds pollution via opaque bodies), QA
round 5 PASS. 26+12 new tests; workspace 1672 passed / 0 failed.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-26 01:26:28 -07:00
lucioandClaude Fable 5 22cfa91732 ROADMAP: re-verified 800/820 (97.6%) at v0.7.0 HEAD; loop stays stopped
Requested loop restart re-scored before dispatching: score and the 20
failing files are identical to the round-2 final state, cargo test is
1644/0. No fixable headroom exists outside the architecturally-blocked
categories, so the plateau rule is met before round 1.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-25 23:43:39 -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 a284e33110 v0.7.0: aligned ghost text, designer trigger set
Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-25 16:13:42 -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 df53ecea2c v0.6.0: the ghost-text release
Inline templates (M15) and the linear pairs::analyze fix, released
together. Version bumped across workspace, extension and docs; changelog
entry; dist/ rebuilt for all five targets plus the vsix.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-25 14:55:53 -07:00
lucioandClaude Fable 5 83eb908f54 pairs::analyze is linear in nesting depth
QA find from the inline-templates round: the per-push rainbow-depth scan
made analyze O(depth^2), and the ghost-text gate calls it on every
keystroke — 8000 nested begins cost 629ms per request (24s at 50k). A
second quadratic hid in close(): a never-matching closer rescanned the
whole stack. Both fixed by a Stack type owning the frames plus running
counts (rainbow depth, per-rule frames), decremented through the
mismatch recovery's middle-of-stack drain — the exact hazard the old
comment cited for scanning. 8000 deep: 629ms -> 2.3ms; stray-closer
shape: 1.9s -> 12ms. Output is bit-identical: corpus fingerprint (859
files) plus two independent old-algorithm oracles (dev depth oracle, QA
field-for-field differential with fuzz sweep) now pinned as regression
tests alongside a wall-clock scaling test. Stale quadratic comment in
inline.rs's deep-nesting test updated to record the fix.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-25 14:47:34 -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
lucioandClaude Fable 5 382c114492 RHEL 8-compatible linux-gnu build in --cross
x86_64-unknown-linux-gnu joins the cross set, linked with the messense
toolchain whose sysroot caps the highest referenced symbol at
GLIBC_2.28 - RHEL 8's own glibc, audited on both binaries - with every
NEEDED library in a base install. The static musl build runs on RHEL 8
too; the gnu build exists for shops that require a native glibc link.
Setup and the symbol-audit command are in RELEASING.md.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-25 10:56:55 -07:00
lucioandClaude Fable 5 a9d73913f5 Cross-platform release: x86_64 macOS, Linux, Windows; author metadata
tools/release.sh --cross builds, next to the host Apple Silicon pair,
x86_64-apple-darwin (runs under Rosetta here, full smoke passed),
x86_64-unknown-linux-musl (static, no glibc dependency) and
x86_64-pc-windows-gnu (.exe depending only on DLLs Windows 10+ ships,
audited). The rustup stable toolchain is addressed by absolute path so
the Homebrew rust on PATH keeps owning day-to-day builds; the musl link
needs DYLD_FALLBACK_LIBRARY_PATH for rust-lld's libLLVM, the Windows
link needs mingw-w64's import libraries - both encoded in the script and
RELEASING.md so nobody rediscovers them. Author metadata: Cargo.toml
authors, package.json publisher guoliangchen + author, LICENSE holder -
all Guoliang Chen.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-25 10:33:15 -07:00
lucioandClaude Fable 5 d26f08335b Macro expansion M14: hover shows the one-step expansion; v0.5.0
Hovering `NAME(args) now appends an expands-to section: the definition
the card already chose (single_step is blind to lookup, so they cannot
disagree) with parameters substituted by the call's arguments - one
step, so nested macro names stay as written. Strings, `" markers and
escaped identifiers are never substituted into; count mismatches,
unnarrowed multiple candidates and paren-less function-like uses get no
section rather than a guess; an empty argument takes the parameter's
declared default. 2000-char cap with a note. Version 0.5.0 closes the
M7-M14 navigation run with a CHANGELOG entry covering all eight.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-25 03:14:49 -07:00
lucioandClaude Fable 5 36ddabac6c CLI filelist M13: vfmt -f files.f
The -f flag (repeatable) feeds M1's filelist parser to format, check,
--check and --diff: listed paths are exact like positional args (never
excluded or gitignored), warnings go to stderr without touching the
frozen exit-code contract, an unreadable filelist is exit 2 with nothing
written, and inputs from every source dedup by lexical absolute path -
which also closes the old vfmt rtl/ rtl/a.sv double-processing. --lines
and stdin reject -f at parse time. vfmt.toml's filelist key stays
server-only, deliberately. QA's exit-code matrix confirmed all eight
cells; its pre-existing torn-write find is filed in TODO §1.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-25 02:44:38 -07:00
lucioandClaude Fable 5 80978f324f Semantic lints M12: unused-signal, undriven-net, multiply-driven
The first rules that use vlog_semantic, crossing TODO §7's threshold the
careful way: a read/write/unknown classification layer in vlog_linter
(vlog_semantic untouched - driver semantics is a lint concept), whole-
word mention guards so ifdef arms and macro bodies never produce a false
unused, connections treated as unknown direction, and force/release with
their own driver kind so a test override is neither a second driver nor
the only one. All three default off, decided from data: 55 corpus hits,
zero wrong on reading, but single-file scanning cannot see cross-file
readers. Default vfmt check output is byte-identical to before,
worktree-diffed. ~45ms per 860 files when enabled; three rules cost one.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-25 02:24:37 -07:00
lucioandClaude Fable 5 a96c908a3e Hierarchy M11: who instantiates X, what X instantiates
LSP callHierarchy with modules as the nodes: prepare on a declaration or
any instantiation, incoming grouped by instantiating module with every
site as a fromRange, outgoing one call per distinct instantiated module.
The instantiation walk moved out of inlay hints into a shared module
with the owning module threaded through - inlay's 34 untouched tests
prove the factoring changed nothing. A substring prefilter skips 834 of
860 corpus files before parsing (56ms incoming on a real module;
the prefilter-defeating worst case is documented at ~206ms). ifdef arms
both count, disclosed; incoming/outgoing consistency QA-verified.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-25 01:15:38 -07:00
lucioandClaude Fable 5 e546d86677 Include navigation M10: clickable includes, incdir-aware defines
One line scanner feeds three consumers that can never disagree:
documentLink underlines every include path, definition lands on the
resolved file, and hover's define lookup narrows to definitions
reachable through the hovered file's include graph (narrow, never
widen; local defines always win). Resolution is own-directory then the
filelist's +incdir+s in order - M1 recorded them, M10 finally spends
them; angled includes skip the own-directory rung. Resolved paths are
re-spelled the way the index spells them so a case-insensitive
filesystem cannot make hover silently drop a reachable define (QA HIGH,
fixed with a pure lookup that latches to ambiguity on collisions).
Graph build: ~7ms over the 860-file corpus.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-25 00:39:45 -07:00
lucioandClaude Fable 5 ab7beb1e54 File watching M9: the index notices the world changing
workspace/didChangeWatchedFiles via dynamic registration (globs for the
four source extensions plus the configured filelist's own path), one
rebuild per notification with the same warning surfacing as save, and
re-registration when vfmt.filelist moves. Registration happens in
Server::new because lsp-server's initialize_finish consumes the
initialized notification - the protocol-suggested handler would be dead
code (verified against the vendored source). Open-buffer overlays
survive rebuilds; malformed and out-of-scope events rebuild nothing.
git pull, external editors and filelist edits now land without a save.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-24 23:51:39 -07:00
lucioandClaude Fable 5 fa38fd9dec Inlay hints M8: port and parameter names on ordered lists
textDocument/inlayHint draws ghost portname:/PARAM: labels on positional
connection lists and all-positional #(...) overrides, from the same plan
extraction M4 uses — walked off the parse tree, so nested-call commas
cannot shift positions. Range filtering runs before any definition is
parsed; plans are cached per request (O(distinct modules)); every
uncertainty is silent, including QA's find: an ifdef-carrying port list
unions its arms in the plan, which is right for an editable skeleton and
wrong for a read-only label, so such plans now hint nothing.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-24 23:24:01 -07:00
lucioandClaude Fable 5 3c55783e09 References-nav M7: cross-file references, folding, document highlight
textDocument/references now answers across files by reusing rename's
occurrence walk (collect_occurrences factored out of collect_edits,
behavior-identical) — a module, port or package member lists every use
the index scope can see; the cross-file gate asks the workspace index,
never re-derives exportedness, and an ambiguous name degrades to the
in-file answer. foldingRange is the fourth consumer of pairs::analyze
(end line stays visible, unmatched openers fold nothing, block comments
included); documentHighlight lights a symbol's in-file occurrences with
the begin/end pair highlighting preserved. M7-M14 queue added to TODO §8.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-24 22:53:38 -07:00
lucioandClaude Fable 5 6036a62784 Backlog triage: nine LSP-parity and plumbing gaps added to the plan
Cross-file references (rename can edit what references cannot list),
folding from the rainbow's own pair data, document highlight, inlay hints
for ordered connections, didChangeWatchedFiles, include/incdir
consumption, module hierarchy, semantic lint rules, CLI -f, hover macro
expansion. Milestone numbering fixed; triage checked off.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-24 21:01:21 -07:00
lucioandClaude Fable 5 04be0cfb37 Color decorators 0.4.2: #200 is a delay, not a colour
VS Code's built-in default colour provider (editor.defaultColorDecorators,
default auto since 1.78) pattern-matches CSS-style hex in languages where
no extension provides document colours - so delay controls like #200 grew
RGB swatches. The extension now ships the language-scoped configuration
default "never" for [verilog] and [systemverilog]; user-overridable,
invisible to every other language. Diagnosis verified on the reporting
machine: no colour-provider extension installed, no server capability, no
user override.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-24 20:51:06 -07:00
lucioandClaude Fable 5 302b3ed443 Hover highlighting 0.4.1: ship a TextMate grammar
Hover cards fence their declaration snippets as systemverilog markdown,
but VS Code colors fences with a TextMate grammar and the extension
deliberately shipped none - so hovers rendered plain. One compact
lookaround-free grammar (comments, strings closing at end of line, based
and fill and real and time literals, directives then macro uses, system
tasks, all 181 keywords generated from vlog_parser::KEYWORDS with a
mutation-checked drift test) registered for both language ids. Buffers
also gain colors before the server starts; semantic tokens still win once
it does. Fence tags are pinned as a contract in hover and completion.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-24 20:15:47 -07:00
lucioandClaude Fable 5 e9b7510ca4 Templates 0.4.0: context-gated statement/item snippet completion
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]>
2026-08-24 17:28:31 -07:00
lucioandClaude Fable 5 ab89152264 Rainbow 0.3.1: never paint begin/end invisible; unmatched go red
The rainbow painted depth 3-5 pairs with editorBracketHighlight
.foreground4..6, whose VS Code defaults are fully transparent — a begin
typed three levels deep vanished with its end. The extension now uses
contributed vfmt.rainbow1..6 colors with opaque defaults in every theme
variant (dark/light/HC/HC-light), and vfmt/scopePairs additionally
reports genuinely unmatched begin/end/fork/join tokens, painted
vfmt.rainbowUnmatched bright red — file characters are never hidden.
Matched pairs, depths and 78eeef6's counting are unchanged.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-24 15:45:54 -07:00
lucioandClaude Fable 5 d8e37086df Refactoring M5: keyword + project-wide identifier completion; v0.3.0
Five completion tiers in one response: module skeletons (M4, unchanged
gate), scope-visible symbols with real kinds, workspace-index names and
`define macros (backtick-aware, never inventing punctuation), Verilog/SV
keywords (single-source KEYWORDS list factored from the lexer's table,
lexing unchanged), and token-harvested project words — comments and
strings contribute nothing and get no completions. Candidate tables build
with the index over the M1 scope ladder (94 ms / 860 files, ~1.4 MiB);
a keystroke answers in ~300 µs, budget-tested. Version 0.3.0 across the
workspace and extension, CHANGELOG covers the M1-M5 refactoring layer.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-24 15:07:57 -07:00
lucioandClaude Fable 5 78ba0b8ba6 Refactoring M4: module hinting — instantiation completion + signature help
vlog_refactor instantiate engine: InstantiationPlan read from the
definition (params with parse-probed defaults, ports with direction/type,
auto-connect by the same scope lookup ports.rs uses), one renderer for the
plain and snippet spellings. Server ships textDocument/completion (module
skeletons as snippets, plain-text fallback when the client lacks snippet
support or the plan carries escaped identifiers) and signatureHelp
(named-by-name, ordered-by-comma-count, wildcard-aware). Corpus property
test: all 454 corpus modules' skeletons re-parse.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-24 07:21:32 -07:00
lucioandClaude Fable 5 e338524f63 Refactoring M3: add/remove/propagate module ports
vlog_refactor ports engine: add_port (ANSI + non-ANSI, named/ordered/.*
sites, .p(p) vs TODO placeholder by real scope lookup), remove_port
(refuses positional connections and live body uses, lists dropped
expressions), propagate_ports, all through a new splice verifier (piece
equality, comments never deleted, no new parse diagnostics, resolution
identity) plus a per-feature shape check. A new port can never silently
land inside an `ifdef arm (nesting-aware refusal, both insertion paths);
macro-argument/define-body occurrences of a removed port warn. Server:
code actions + vfmt.addPort/removePort/propagatePorts executeCommands.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-24 06:25:41 -07:00
lucioandClaude Fable 5 33f58196e3 Refactoring M2: vlog_refactor crate + LSP rename
New crate vlog_refactor: rename any symbol vlog_semantic resolves, in-file
and cross-file, with whole-edit-or-nothing verification (token identity +
before/after resolution print over every file spelling either name).
End labels rename too via a new vlog_semantic Target::Declaration bound at
declaration time. Server ships prepareRename/rename; refusals are LSP
request errors, define-body/macro-argument/hierarchical-tail occurrences
warn instead of guessing. QA round 1 found two silent HIGHs (third-file
collision, macro-argument silence) — both closed with regression tests.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-24 05:12:53 -07:00
lucioandClaude Fable 5 315bbf23ab Refactoring M1: EDA filelist (.f) defines the index scope
Rope-port umbrella plan (docs/features/refactor) + TODO.md §8; M1 ships
vfmt_core::filelist (-f nesting with cycle + 256-depth guard, +incdir+/
+define+ recorded, env vars, warnings not errors), the vfmt.toml filelist
key, the server scope ladder (filelist > workspace walk > open file's
directory when rootless) and the vfmt.filelist VS Code setting.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-24 04:11:45 -07:00
lucioandClaude Fable 5 78eeef6050 Rainbow depth counts only the pairs the rainbow shows
User-reported: a begin inside a case (or any scope the rainbow filters
off the wire) painted one level deeper than its siblings — the hidden
scope read as an invisible begin/end layer. Depth now counts only
enclosing RAINBOW_KEYWORDS frames, one const shared by the counter and
the wire filter. Corpus: same 8,146 wire pairs, max depth 13 -> 7;
depth-0 bucket goes from near-empty to 2,881 (the palette was rotated).

Also closes M4 QA's e2e gap: the exclude test now asserts the republish
half of reindex(), and that a no-op settings push publishes nothing.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-24 03:34:37 -07:00
lucioandClaude Fable 5 9a3a92cabb Expose vfmt.toml settings in VS Code: vfmt.lineLength, vfmt.indent, vfmt.exclude
All three vfmt.toml keys, pushed over workspace/didChangeConfiguration
(initial push verified against the real vscode-languageclient 9.0.1).
Precedence: vfmt.toml > vfmt.* settings > editor tabSize > built-in
default — a checked-in config stays authoritative so format-on-save never
diverges from CI. Invalid values are ignored, never clamped or coerced;
exclude is appended to the config's excludes and re-indexes the workspace
on change. Untitled buffers and toml-less projects gain an editor-set
line length, previously impossible over LSP.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-24 03:15:54 -07:00
lucioandClaude Fable 5 aa26e5e427 Rainbow begin/end: vfmt/scopePairs request + themed depth decorations
Server: custom vfmt/scopePairs request returning every begin/end and
fork/join* pair with its nesting depth (UTF-16 ranges); wire shape pinned
by a literal-JSON test and by smoke.js over a real spawned server.

Extension: paints each depth with the theme's own bracket palette
(editorBracketHighlight.foreground1..6), debounced 250 ms, with a
document.version staleness guard; vfmt.rainbowBeginEnd setting (default
on) honored immediately in both directions.

Corpus sweep: 8,146 block pairs across 859 files, max depth 13, worst
request 2.1 ms (picorv32.v).

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-24 02:23:22 -07:00
lucioandClaude Fable 5 f280e51169 vfmt-server: begin/end pair engine, documentHighlight, missing-end warnings
New pairs.rs: a stack matcher over the token stream for begin/end and 16
relative pairs, with guards for every no-body construct that spells an
opener keyword (extern/DPI prototypes, typedef class, virtual interface,
assert property, covergroup with function sample, ...). Non-cascading
mismatch recovery makes one missing end point at the exact unclosed begin.

Feeds textDocument/documentHighlight (cursor on begin highlights its
matching end) and WARNING diagnostics for unmatched openers/closers —
gated on the parse already failing, so macro/ifdef keyword imbalance in
working code can never warn.

Corpus sweep: 840 clean-parsing files, 11,062 matched pairs, 0 false
positives (reproduced independently by QA).

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-24 02:08:00 -07:00
lucioandClaude Fable 5 de8a307e00 VS Code: snippet templates for common Verilog/SV constructs
30 snippets across both language ids: module, always/always_ff/always_comb
with reset, case-with-default, FSM skeleton, interface with modports,
package, class, assert property, testbench, include guard, and more.
All 30 rendered bodies parse with vfmt itself; $-escaping verified by
round-tripping through the VS Code snippet grammar.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-24 01:42:48 -07:00
lucioandClaude Fable 5 fda6d20d9f case-missing-default: underline the case header, not the whole block
The violation span now runs from the statement's first token through the
parenthesis closing the subject, so a missing default no longer paints
every branch red in the editor.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-24 01:30:17 -07:00
lucioandClaude Fable 5 5ffafc505e ROADMAP: round-2 log, final state, loop stopped at 97.6%
Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-21 02:41:25 -07:00
lucioandClaude Fable 5 71a300d901 QA round 2: review logs and two macro/multi-line-string attack tests
Nothing blocking over mop-up-2 and the round-1 fix commit: corpus
idempotency sweeps at default, --line-length 40 and --indent 4 clean
(800/820), 3038 mutation trials clean, printer fits() change isolated
to zero output differences on the corpus.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-21 02:39:55 -07:00
lucioandClaude Fable 5 3591f0c317 ROADMAP: round-1 log, deviations and open questions
Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-21 02:15:06 -07:00
lucioandClaude Fable 5 a4f8476894 Fix round-1 QA findings: Inline width in fits(), action-block nesting, comment gaps
printer::fits() now measures from a multi-line Doc::Inline's last line and
keeps measuring the rest of the group (a with {...} block no longer hides
an overflow). skip_action_stmt tracks begin/end, fork/join, case/endcase
nesting so a concurrent assertion's action block is captured whole.
Comments between bind/target/module and around randomize(...) with are
attached and reprinted instead of being refused by the safety net.
All 800 passing corpus files format byte-identically before and after.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-21 02:11:59 -07:00
lucioandClaude Fable 5 e35da292bd Add mop-up-2: macro items ending their line, new shallow copy, 32'h`MACRO
A macro invocation that ends its line is a complete item whatever opens
the next line; new <expr> shallow-copy constructor; a based number whose
digits come from a macro (32'h`BOOT_ADDR) lexes as a base-only number
joined with the macro in the parser. verify.rs untouched, attack tests added.

Coverage loop round 2: 796 -> 800 / 820 (97.1% -> 97.6%).
Feature README: docs/features/mop-up-2/README.md

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-21 01:42:53 -07:00
lucioandClaude Fable 5 0557933994 QA round 1: adversarial review logs and a with-block attack test
No blocking findings over the 8 round-1 clusters: whole-corpus idempotency
and comment-preservation sweep clean (796/820), 476-run mutation fuzz clean,
no swallowed errors in the diff. Adds
reindented_string_inside_a_with_block_is_rejected. Findings (non-blocking)
are in each feature README's QA log; the printer fits() / Doc::Inline gap
is fixed separately.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-21 01:37:33 -07:00
lucioandClaude Fable 5 f1db1e5746 Add dv-statements: with clauses, foreach targets, randcase, let, labels
randomize()/std::randomize() with { ... } (block verbatim), array-method
with (expr), foreach over scoped/hierarchical/indexed arrays, randcase,
wait fork, import as a statement, let declarations, empty call arguments,
general statement labels, and endtask: name; (stray semicolon kept).
Also fixes a pre-existing verification failure for a comment between a
then-branch and its else.

Coverage loop round 1, cluster 8: 772 -> 796 / 820 (94.1% -> 97.1%).
Feature README: docs/features/dv-statements/README.md

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-21 01:19:49 -07:00