Add AST-guided semantic token overrides in lucisv_server/src/tokens/instantiation.rs
and cross-file overlay lookup in tokens.rs without changing the 14-type wire legend:
- module/interface/extends names -> class (pkg:: prefixes -> namespace)
- parameter-list # (never delays), .PARAM overrides and parameter values -> parameter
- instance names (declarations, gate instances, bind lists, hierarchical uses) -> function
- named port connections (.port, implicit .port, .*) -> property
- port connection signals -> variable
Enable editor.semanticHighlighting.enabled by default for [verilog] and
[systemverilog] in editors/vscode/package.json and contribute semanticTokenScopes
so every role renders with a distinct, non-white colour across VS Code themes.
Add editors/vscode/semanticTokens_test.js (75 checks, passing under node --test).
Rust tests/fmt/clippy deferred to Gitea CI (no cargo toolchain on this Windows host).
vlog_refactor: a rename used to cut a `.name` shorthand or a `.*` wildcard binding — port d → din of leaf left `leaf u (.*)` binding nothing and turned `.d` into `.din` against a parent with no net din; renaming the parent's net cut both — and verified clean, because the semantic layer records the port half of `.name` and nothing of `.*` (M3 QA finding 1; the LSP shared it). rename/{connections,sites,layout}.rs: an AST walk over every named connection list finds the implicit bindings and looks each name up the way the language does (nearest declaration outward; a bind's target module; a bare instance name resolved through the instantiation table with the bind's enclosing module's own instances winning, §23.11); `.p` becomes `.q(p)`, a `.*` that bound the name gains `.q(p)` / `.n(m)` appended in the list's own layout (comma before a trailing // comment, CRLF kept); every rewrite listed in warnings; refused by name: a `.*` into a module lucisv cannot read or finds declared twice, a list split by ifdefs or holding unparsed text, a hierarchical bind target, a `.*` that would start binding the new name, a package variable an import might hand to a `.*`. check/implicit.rs: the verifier learns the shape — a file with insertions passes only if every replacement is the old name becoming the new and every insertion is one of four connection templates at the exact slot the rewrite writes (a shorthand's name end; between a `.*` list's last element and its `)`), the comma and its `.X(Y)` only as a pair in one list, no slot at all in a list holding an error element — and every implicit binding (port half and net half) is printed before and after and must match. lucisv_server: rename_sources_traced hands the engine one more hop — the declaring files of every module a handed-over file instantiates (module_select::instantiated_by, index edges only) — so a `.*` into a module declaring neither name is read, not refused. lucisv_mcp: the rename tool's known-limit sentence replaced; the M3 QA finding-1 test un-ignored.
Three QA rounds (Opus) attacked the widened verifier and found, in order, position-blind insertions, a lone trailing comma, and a slot after an error element — each fixed (the last by the lead) and pinned by 40+ qa_* tests incl. masked-corruption pairs; opentitan copies: prim_count err_o/clr_i, aes_core clk_i, entropy_src clk_i, prim_packer_fifo wready_o rename cleanly with their .* cov binds written out; prim_fifo_sync clr_i refused over the FPV binds that really target fifo instances. Accepted gap: a bind onto an instance that exists only inside a generate block of the enclosing module. Filed to vlog_parser: trailing `,` / `{d,, d}` / `type(x)'(y)` in a connection list parse without a diagnostic. Gates through tools/guard.sh: fmt, clippy, workspace 4 762 passed.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
vscode-languageclient appends --stdio for TransportKind.stdio — the
spawn the shipped extension actually makes — and the --verbose round's
strict argument parser refused it: exit 2, five crashes, the client
gives up. Nothing in the loop caught it because smoke.js and the
restart harness spawn the binary directly, never through the library.
--stdio now parses as the statement of fact it is (stdio is the only
transport), in every combination, changing nothing; near misses and
genuinely unknown args still exit 2 with the usage line, which now
names both flags. smoke.js spawns with --stdio so the library's real
spawn shape stays covered from here on.
Found live by the owner installing the hierarchy preview build.
Co-Authored-By: Claude Fable 5 <[email protected]>
The hand-patched diagnostic build becomes a feature: --verbose gates
the timing lines (request answered / notification handled / HELD
behind a rescan / scan and widen lifecycle / flush / reindex_one, the
exact wordings of the two diagnostic builds) as LOG messages into the
client's output channel; without the flag not one line is sent and
the cost is one branch, measured unmeasurable against HEAD. Unknown
args exit 2 with usage before the transport opens. The extension
gains lucisv.verbose (default off) and its first restart-on-settings
machinery: restart.js, one serialized chain reconciling to the last
toggle, no client transition outside it — activation and deactivate
included — after QA twice caught the alternatives (a mid-start toggle
silently rejoining the stale start; deactivate's out-of-chain stop
orphaning a spawn). Headless node harness restart_test.js, 44 checks,
five mutations caught. Spawn contract amended everywhere it is
written: no args required, --verbose optional.
Co-Authored-By: Claude Fable 5 <[email protected]>
A request sent right after initialized waited out the whole startup
scan — 780 ms cold, 287 ms warm over 200 files, against 26-64 us once
the scan was done. The scan is now a value (Scan: begin/step/publish/
finish; rebuild_index_with is the same three-line loop, so one-shot
and interleaved are structurally the same code and fingerprint
identically), fed to the live index with one WorkspaceIndex::absorb
per drain — per-file merging measured quadratic, 11.7 s over 800
files — and the message queue drains between files: the first hover of
a session answers in 15.5 ms cold / 12.8 ms warm against the index so
far, open file first, scan totals inside noise. Order contract kept:
only the startup scan answers mid-way (must_wait holds requests queued
behind any rescan), scans under 64 files stay one-shot (a count, not a
clock), mid-scan rescan requests coalesce into exactly one follow-up,
shutdown stops the scan where it stands. All three tables publish
together. QA pinned the INTERLEAVE_ABOVE boundary, the absorb
duplicate-path edge and the mid-scan didOpen double-publish; the whole
pre-existing suite passes unmodified, stable over repeated runs.
Co-Authored-By: Claude Fable 5 <[email protected]>
The owner's first-level cache, realized on the carrier the index
already had: DeclLines (name line + detail line) on every Decl/Def,
computed at index time from the LineIndex the analysis already holds —
tens of KB for 20k modules, FACTS_FORMAT 3->4, old stores discarded
whole. A closed file's hover heading now costs zero I/O (it survives
the file being deleted), and the snippet's one remaining read is
served from a bounded FileView LRU (4 entries / 8 MiB, newest kept,
dropped on set_document/close/update_one/rebuild): repeat hovers into
a 12 MB file go 5.8 ms -> ~1 us, cross-file hover means 40/157 us ->
4.7/12.9 us. Ports ride the same member entries, so their lines came
free. Stale-disk edits leave heading and snippet stale together, the
spells_exactly guard still omits rather than lies, and QA pinned the
pair. Measured and filed, not fixed here: the first request of a
session waits 287-780 ms behind the startup scan (handshake for the
next round).
Co-Authored-By: Claude Fable 5 <[email protected]>
Three new feature READMEs — change-debounce, port-detail-spans,
interactive-latency — each with the mandated sections, dev work logs,
QA findings and their dispositions, and the lead's review. Plus
`docs/perf/README.md`, the record of what was measured, on what, on
which machine, and with which command, so a later round can say
whether it made something faster or only different.
`topo.md` is added to the tree: the dependency topology the round was
planned against, with this round's new edges — the `detail_span` and
`symbols_named` handshake between the server and `vlog_semantic`, and
the facts-format edge to index persistence.
The perf record keeps its losses as well as its wins. A keystroke
followed by nothing now publishes at 164 ms rather than one
reanalysis, because it waits out the quiet period; a perf document
that only records improvements is not a perf document.
Co-Authored-By: Claude Opus 5 <[email protected]>
The Definition::External card now renders the declaration's source
line(s) fenced under the "declared in file:line" heading — direction,
type and width for a port, the header line for a module, the
declaration line for package members. No facts change: snippets are
fetched at hover time, from the live buffer via nav's logical matcher
when the target is open, from disk (what the index was built from)
otherwise. A boundary-checking guard (spells_exactly) drops the
snippet rather than ever showing a wrong line — QA's attack proved
prefix matching alone was forgivable (addr vs addr2) and the fix is
pinned. Caps at 5 lines / 400 chars with notes. 18 new tests.
Co-Authored-By: Claude Fable 5 <[email protected]>
textDocument/references now reads declaration-to-occurrence postings
merged in WorkspaceIndex from compact per-file reference facts, with
open buffers overlaying live semantics — 0.062 ms/request over 820
files vs 21.7 ms for the old Workspace::sources() walk (~350x). The
walk stays as rename's engine and the equivalence oracle in tests.
FACTS_FORMAT 1->2 discards v1 caches whole. Cursor lookups
(symbol_at/reference_at/token_at) and macro-define lookup move to
binary-searched sorted tables; include definition inspects only the
cursor's line. Ambiguity refusals preserved throughout.
External dev: codex. Lead-reviewed, gates re-run, probe reproduced.
Co-Authored-By: Claude Fable 5 <[email protected]>
Owner-requested round, the last of the large-workarea wave. Above
lucisv.largeFile.threshold (4 MiB default, 0 disables) a buffer opens
as a line index and nothing else — no lex, no parse, no semantics, and
its path removed from the index sources so nothing describes it by
stale disk bytes. Viewport highlighting lexes only the requested
window (snap to a line boundary, budget-bounded backward comment scan,
imperfection documented); semanticTokens/full answers the spec's
cancellation errors because the shipped VS Code binary marks tokens
complete on ANY non-error answer and never asks for ranges again —
settled by reading the bundle, verified independently by QA, pinned
with the client-library citations. Same-file definition/references
shipped on measurement (worst 37 ms vs the 150 ms budget); every
other handler answers as the empty file by construction; formatting
alone says why aloud. Two client facts recorded: VS Code never syncs
files over 50 MB, and above 20 MB our viewport tokens are the only
color.
QA rejected the first cut on the round's true shape — thousands of
tokens on one long line went quadratic through per-call UTF-16
conversion (7.86 s to color one 269 KB line). The fix adds a monotonic
PositionWalker to convert.rs (restart-on-backwards proven load-bearing
by the out-of-order tail-comment shape), adopted at three sites for
546x/759x on the probes — and it fixed ordinary files' semantic
tokens too (2.06 s to 232 ms on a one-line buffer), a cost the normal
path had always paid. Probes are now normally-running gates with 4.5x
margins, walker-vs-per-call equivalence swept over gnarly fixtures
and adversarial ping-pong.
51 tests added across both rounds (dev 43+5, QA 6+3, minus overlaps),
2 ignored probes. Completes the owner's large-workarea requests.
docs/features/large-file-mode/README.md
Co-Authored-By: Claude Fable 5 <[email protected]>
Owner-requested round. Every parsed file's FileFacts record is written
through to an index-cache store (append per file, atomic compaction at
scan end — a crash loses at most the file in flight), keyed by a
content hash that is the whole key: no mtime fast path, by measured
argument (6 ms of a 181 ms warm scan, and unsound against save-time
write-through). On reopen, hits skip parsing and the resume is
visible — cached: vs indexing: log lines, the bar counting through
hits, and an end message saying how many came from cache. Warm rescan
322 to 179 ms release, 1.5 s to 0.76 s debug; 910 KB store for the
860-file corpus. Location: lucisv.index.cachePath > the extension's
context.storageUri via initializationOptions (the one extension.js
change) > the OS cache dir keyed by workspace identity > nowhere;
lucisv.index.persist (default on) gates both directions immediately.
The cache is a performance artifact, never a correctness input, and
after the fix round that promise is total against everything but
intentional forgery — which the threat model now formally excludes
(same-user disk; a keyed MAC would be theater): a per-record checksum
drops every corrupt-but-parseable line (poisoned and reforged shapes
both pinned so the checksum is never mistaken for a MAC), first-writer
initialization is a create_new claim with structural 100/100 survival,
and a torn multi-byte tail costs exactly the torn record (0 of 583
offsets lose more). Old-format stores discard wholesale. Load==fresh
fingerprint equality swept over the corpus.
45 tests added across the main and fix rounds (dev 33+2, QA 9+3, one
QA test-construction bug self-caught), 2 ignored probes.
docs/features/index-persistence/README.md
Co-Authored-By: Claude Fable 5 <[email protected]>
Owner-requested round. WorkspaceIndex::update_file/remove_file replace
one file's contribution without reading or parsing anything else;
Server::reindex_one takes the fast path for a didSave of one held file
or a one-file watcher event (33 ms vs 1.5 s on the corpus, 45x), with
everything else — settings, scope, filelist, multi-file events —
keeping the full rebuild, pinned by a trigger-table test. FileIds stay
sorted positions by deliberate deviation: renumbering through the one
merge both finish and update_file end in makes build(W) byte-identical
to build(W minus F).update_file(F) — fingerprint equality, attacked by
QA across long interleaved sequences, disambiguation flips, define
shadowing and the ghost hunt (the affected-keys union reads old and
new records both). The per-file FileFacts the index retains are the
documented memory cost (~1.4 MB on the corpus).
The two oldest filed Handshakes land: instantiation and inheritance
edge tables, built by the byte-for-byte moved census walks, turn
codeLens counts (92 ms to 0.26 ms), incomingCalls and typeHierarchy
subtypes into lookups — census policies pinned unchanged at both the
consumers and now the source. Counts are as of the index, not of
unsaved keystrokes: the freshness delta is documented and pinned from
both sides. Saves no longer raise a progress bar; generation and lens
refresh still ride. Round 18's three inherited scope obligations are
pinned permanent.
36 tests added (dev 27 + QA 9). Left open, filed: wholesale republish,
Candidates re-derivation cost, incremental removal vs include
re-resolution.
docs/features/incremental-index/README.md
Co-Authored-By: Claude Fable 5 <[email protected]>
Owner-requested round. The scope ladder: a filelist still defines the
whole project and outranks everything; lucisv.index.scope=workspace
restores the walk-the-roots behavior (the same function, not an
equal-output one — pinned); the new default walks only the union of
folders a buffer has been opened from, each raised
lucisv.index.scopeDepth ancestor levels (default 0), clamped at the
deepest containing root. Opening a file outside the scope widens it
and reindexes through the existing progress/generation machinery;
scope grows only along the open axis within a session. Cross-file
answers are scope-relative and the docs say so loudly, with the
one-line migration in the setting description.
The round also closes indexing-ux QA's MEDIUM builder footgun:
IndexBuilder::finish now sorts and dedups before assigning FileIds, so
no insertion order can reach the result — pinned by a permanent
three-order fingerprint test — which makes feeding open files first
provably a progress nicety. 151 existing tests swept mechanically
(QA sampled 40+ sites: constructor swaps only); lead fixed the one
vacuous tail QA found plus two premise/comment hygiene items.
19 tests added. Known deltas documented: a root's .gitignore does not
reach a walk starting below it (filed against lucisv_core); rootless
depth-0 keeps its flat read; startup index is empty until the first
didOpen.
docs/features/index-scope/README.md
Co-Authored-By: Claude Fable 5 <[email protected]>
Owner-requested round. lucisv.index.maxFileSize (default 1 MiB, 0
disables, junk values fall back to the default — misparse must never
un-cap) skips walked files at one fs::metadata call before any read;
open buffers are always served uncapped, a cap change rescans like
exclude does, and the cap reads consistently through every sources()
consumer — documented per consumer, with the write-path warning gap
(a rename silently leaving a capped file stale) filed as a follow-up.
The indexing bar now counts: $/progress reports '137/860 path' with a
monotonic percentage over the post-exclude post-cap denominator,
throttled to ≤1000 reports per rescan with the last file always
reporting. Enabled by vlog_semantic's new IndexBuilder (add_file/
finish) with build() redefined as the loop over the newly-exported
index_order — the FileId ordering rule is now a call, not a comment.
QA proved both production callers order correctly; hardening the
builder against out-of-order future callers is round 18's acceptance
test. lucisv.index.logFiles (default on) streams 'indexing: path' and
cap-skip lines to the editor's Output panel at LOG level; the skip
count survives in the end message when logging is off. Measured
overhead ≈2.6% on the 860-file corpus; 0 corpus files exceed 1 MiB
and the default-capped index is pinned identical to uncapped.
21 tests added + QA's attack set + the lead's human_size boundary fix
('1024.0 KiB' can no longer be printed for a byte short of a MiB).
docs/features/indexing-ux/README.md
Co-Authored-By: Claude Fable 5 <[email protected]>
textDocument/rangesFormatting: the engine took multi-range LineRanges
natively (this is literally the CLI's --lines a-b,c-d call), so the
server adapter is map(lines_of) around it and the verified
all-or-nothing contract rides through whole. range_formatting is now
DEFINED as the one-element case, making refusal equality structural;
lines_of extracted with its own test, plus a latent debug-overflow fix
(end.line + 1 at u32::MAX -> saturating, proven by deliberate
breakage). The capability widens documentRangeFormattingProvider from
true to {rangesSupport: true} only for clients that asked (read from
the raw initialize params; lsp-types 0.97 spells neither half) — every
pre-round client sees a byte-identical initialize result, proven on
the wire. The round's discovery: vscode-languageclient 9.0.1 has been
sending rangesSupport and gating its multi-range provider on our
answer all along — the bare boolean was turning the feature off.
SnippetTextEdit and workspace/textDocumentContent are parked with
evidence: absent from lsp-types 0.97 and from the pinned client's
node_modules (a snippet edit sent today would write literal ${1:...}
into the buffer), and the thin extension deliberately has no content
provider. Each parking carries a one-grep re-check trigger. The
whole-document reply shape is kept: splitting per-range would claim
byte ownership the engine never verified.
24 tests added; QA re-ran every evidence grep, verified the client
citations against formatting.js, and closed with zero findings. This
completes TODO.md §9c and the LSP 3.18 audit's feature work.
docs/features/lsp-318-extras/README.md
Co-Authored-By: Claude Fable 5 <[email protected]>
Folders: workspace.workspaceFolders advertised with change
notifications; added/removed folders adjust the root set through one
8-line Workspace::change_roots (removals first, dedup, did-it-move
bool) and one reindex per moving notification — progress bar, code-
lens refresh and diagnostics generation all ride along, pinned. Open
buffers in a removed folder keep today's rootless conventions with no
new code. The source watcher's base-less glob needs no re-
registration; the absolute-path filelist watcher re-registers through
the same before/after comparison the settings push already ran.
Configuration: clients advertising workspace.configuration get one
pull at startup and one per empty didChangeConfiguration; the answer
funnels through the same parser and applier as the push, so the two
doors cannot drift, and every malformed answer shape lands on
defaults, silently. The outstanding-request routing refactored to one
Pending enum map — applyEdit's shipped behavior re-proven under
three-way out-of-order interleaving. Push-with-payload stays the
unchanged legacy path.
38 tests added (dev 27 + QA 11, closing every claim that lacked one:
roots.first() reordering, last-root-removed totality, double pulls,
stale answers, the pull-answer-moves-the-filelist chain, rootless-
gains-first-folder). QA's F1 — a subfolder added as its own root is
its own root, outside the parent's exclude — accepted as the per-root
model and documented in Assumptions.
docs/features/folders-and-config/README.md
Co-Authored-By: Claude Fable 5 <[email protected]>
workspace/willRenameFiles rewrites every `include whose RESOLVED
target is a renamed file — never a name match — sweeping sources() so
unopened files count and open buffers contribute unsaved text.
Rewrites preserve the include's form where the new location allows
(bare stays bare in-dir; otherwise the shortest suffix that resolves
under the rungs that form uses; ../ last; absolute stays absolute), a
still-resolving include gets no edit, and an unrewritable one is left
untouched with a warning rather than given an invented path.
Directory renames ride the same prefix mapping for free, and the
mirror case — the including file itself moving breaks its own-dir
rung — ships with the same machinery. didRenameFiles/didDeleteFiles
nudge the index through the watcher's own predicate.
Three checks guard the write path: the edit range is the path token
minus delimiters by construction; the rewritten line re-scans and
re-lexes to exactly one include of the same form; and the rewritten
path must resolve_as_if to exactly the new location against the
post-rename filesystem — with every edit addressed to the PRE-rename
uri, the spec detail a client silently drops edits over, pinned on
the wire by QA. QA's corpus probe (a real ibex header, 87 real
includers) caught the round's one real bug — unnormalized includer
paths turning same-directory renames into false warnings — fixed with
one normalize. Batch renames do not compound; recorded as a
documented choice bounded by the safety net.
42 tests added (dev 33 + QA 9). verify.rs untouched.
docs/features/file-operations/README.md
Co-Authored-By: Claude Fable 5 <[email protected]>
textDocument/prepareTypeHierarchy + typeHierarchy/supertypes/subtypes
for SystemVerilog classes. Supertypes is one computed offset into the
existing resolution machinery — the overlay promotion made cross-file
bare class names answerable, and the offset is the LAST byte of the
extends name span so pkg::base lands in the tail's reference, never
the package's. Subtypes is a workspace census on the callers_of_each
pattern (one sources() pass, prefilter, deterministic sort), matching
the base name as written — 0 of the corpus's 270 extends clauses are
qualified, and the asymmetry with supertypes is documented and pinned
from both directions, including the same-name/different-file
consequence. Ambiguous bases answer every declaration, like
definition. Modules stay on callHierarchy by scope ruling.
lsp-types 0.97 has no server-side typeHierarchyProvider field, so
initialize_value() inserts the one key into the serialized result —
QA's strip-and-compare test proves every other key survives with
identical values. QA also traced the parser to show the degenerate
extends spans the code guards against cannot be constructed, corrected
two README figures the lead applied (the 309 extends count did not
reproduce; 270 does), and pinned the generate-block walk gap as a
scoped choice. Interface classes stay blocked on the parser, pinned.
45 tests added (dev 33 + QA 12), including the real ibex UVM chain
and a 10-deep expansion. The inheritance-edge index want is filed
beside the instantiation-edge Handshake as one future round.
docs/features/type-hierarchy/README.md
Co-Authored-By: Claude Fable 5 <[email protected]>
';' range-formats exactly the finished statement's line through the
existing verified all-or-nothing engine — no new formatting authority,
gated on one lexer fact (the token ending at the offset is a real ';',
so string/comment/macro semicolons decline). '\n' re-indents only the
line the newline opened, via a token-stream nesting model whose edit is
confined by construction to that line's leading whitespace — a model
bug can be a wrong indent, never a moved byte. The path never speaks:
no popups on refusal (it fires per keystroke), and the config warning
is deliberately not raised here — its dedup re-arms on the didChange
every keystroke produces, so it would fire per character; pinned in
both directions (silent on keystrokes, still warning on requests).
The nesting model was derived against the formatter itself: a corpus
anchor test (77,528 lines answered, 67.9% coverage floor, 0
disagreements) forced nine of its ten rules and caught a real
unconditional-pop bug mid-round. The anchor stays a normally-running
test by lead ruling — it is the correctness gate over the one piece of
formatting logic outside the verified engine.
49 tests added (dev 43 + QA 6: CRLF confinement, mixed tab/space,
macro-body and EOF semicolons, format-off fence riding through,
whole-file ifdef). verify.rs untouched; formatter suites untouched and
green.
docs/features/on-type-formatting/README.md
Co-Authored-By: Claude Fable 5 <[email protected]>
One lens per module and interface declaration: 'no/1/N instantiations',
counting instantiation sites workspace-wide through the one census the
server has — hierarchy.rs's walk, refactored so the batch is the
primitive (callers_of_each over one sources() pass; incoming is now a
one-element batch, behavior byte-identical, amortization pinned by a
corpus ratio test that fails if it goes linear). Clicking runs
lucisv.showInstantiations through the existing executeCommand path,
answering the site locations and pushing window/showDocument (first
site, takeFocus, selection) when the client can take it; the zero-count
lens is display-only. workspace/codeLens/refresh rides each reindex
after the progress bar comes down, capability-gated, once per rescan.
42 tests added (dev 33 + QA 9): count agreement with incomingCalls,
the absolute census policies pinned at the lens layer (multi-instance
statements are one site, textual recursion, both ifdef arms, name
collisions), one-sources()-read-per-request, showDocument/applyEdit
response independence, and grep-derived ground truth on a real corpus
file. The instantiation-edge-table request is now a concrete
vlog_semantic Handshake — two features pay the walk it would delete.
docs/features/code-lens/README.md
Co-Authored-By: Claude Fable 5 <[email protected]>
SystemVerilog's closing labels now edit as one: module/interface,
package, class, function, task, clocking, generate and statement
blocks, fork/join, and the prefix-labeled b : begin ... end : b form —
every pair read off the AST's own end_label_span fields (the parser
already recorded both halves on one node; no parser change). A pair is
offered only when both halves exist and hold identical plain-identifier
text: mismatched labels, absent labels, and escaped identifiers all
answer null rather than link something a keystroke would corrupt. The
response carries the SV word pattern (with $), whose anchoring QA
verified against VS Code's linked-editing source — full-string
validation, anchors correct.
33 tests added (dev 25 + QA 8): exact-range decoding through the
server's own position converter (never the colon), the both-labels and
stray-second-end tolerant-parse shapes, identically-named nested
blocks pinned by exact ranges, and an 83k-offset corpus sweep
asserting totality and the identical-text/non-overlap invariants over
real labeled RTL. program/property/sequence/covergroup are filed as
parser Handshake wants.
docs/features/linked-editing/README.md
Co-Authored-By: Claude Fable 5 <[email protected]>
From a name to its type's declaration: variable to typedef/enum/struct,
handle to class, instance name to module, interface signal to
interface. The whole feature is one redirection — find where the
declaration wrote its type name (the same window vlog_semantic's binder
searched), then run nav::definition there — so cross-file resolution,
ambiguity, and position conversion are F12's, unchanged. One hop on
typedef aliases, never a chain; built-ins answer empty.
One stopgap with a three-condition fence: vlog_semantic reports an
unqualified lexical miss as NotFound — or InheritedCandidate inside any
extending class, the UVM norm — without consulting the workspace
overlay, so indexed_type asks the index directly for file-scope
Module/Class/Typedef declarations only, never for a qualified member
(the lead-added guard: a pkg:: qualifier must not be discarded into a
bare-name sweep — proven by deliberate breakage). The Handshake filed
in the README covers promoting both miss spellings so the whole
fallback deletes when vlog_semantic lands it. Also filed: the parser
gap where an ANSI header's direction-less first port fails to parse.
QA rejected the first cut — the corpus sweep found the
InheritedCandidate miss live on ibex DV files — and the fix round
answered with a one-pattern widening whose safety was derived from
three independent vlog_semantic citations. 45 unit tests + 1 e2e; the
corpus spot-check now asserts two real UVM-shaped jumps positively.
docs/features/type-definition/README.md
Co-Authored-By: Claude Fable 5 <[email protected]>
run() now reads in bursts: one blocking receive plus everything already
queued behind it, processed strictly in arrival order. A request whose
$/cancelRequest sits in the same burst is answered RequestCancelled
(-32800) without being dispatched; cancels naming anything else — an
already-answered request, one never received, a server-initiated id —
are dropped on the spot, so cancellation holds no state that can leak
or misfire. shutdown is honoured before the cancel set is consulted,
and a didChange queued ahead of a request is still applied first.
The enabling change: lsp-server 0.10's stdio transport uses rendezvous
channels, so a client's backlog never queues on connection.receiver —
it sits invisible in the OS pipe (dev measured 0/5 cancels honoured
under the original drain design). A single forwarder thread moves
messages onto an unbounded queue, stopping at shutdown because
handle_shutdown reads the following exit off the connection itself.
First thread in this server; QA re-derived the hand-off from the
vendored lsp-server source and found no steal or deadlock window.
15 tests added (dev 11 + QA 4), covering the full cancel matrix (both
id types, double cancel, orphan drop with id-reuse proof, malformed
params), the forwarder against a real Connection, and an e2e flood of
20 requests with cancels asserting schedule-independent properties —
green across twelve consecutive runs. Completes TODO.md §9b.
docs/features/cancel-request/README.md
Co-Authored-By: Claude Fable 5 <[email protected]>
Every index rescan — the startup build included — now puts up a real
progress bar for clients that advertise window.workDoneProgress:
window/workDoneProgress/create with a fresh lucisv-index-N token, a
Begin titled 'Indexing Verilog workspace' (cancellable: false — nothing
in a single-threaded server can cancel; no percentage — the rescan is
one opaque call and an invented number would be a lie), the scan, then
End naming the indexed file count. The Option<ProgressToken> returned
by begin_indexing IS the capability gate, so an unpaired or uninvited
bar is structurally impossible; create answers ride the existing
ignored-response path with no risk to applyEdit routing (one shared id
counter). The startup build got the bar because initialize_finish
completes before Server::new — the same fact watcher registration
already relied on.
14 tests added (dev 10 + QA 4: watcher-after-bar ordering, both
response-interleaving directions, capability-off on the watcher/config
paths, rootless zero-count startup), all decoding real wire JSON for
the sequence, token type, title, and message.
docs/features/work-done-progress/README.md
Co-Authored-By: Claude Fable 5 <[email protected]>
tokens.rs is now one tokenizer behind three pure steps — absolute()
classifies and splits, within() filters by overlap, encode() delta-
encodes — so textDocument/semanticTokens/range and /full share one
implementation and cannot drift; QA proved the refactor byte-identical
to the old encoder over a 41k-token corpus file against the pre-change
binary. Range answers are self-contained (overlapping tokens kept
whole, re-encoded from the document start) and carry no resultId — a
delta never diffs against a partial view.
/full/delta remembers each open buffer's last answer under a per-answer
id (dropped on didClose; stale or foreign ids answer full) and diffs by
common-prefix/suffix trim to a single edit, the suffix counted over
what the prefix left — the classic overlap trap, deliberately broken by
dev and QA separately and caught by the suite both times. Edit indices
are wire-array u32 positions (5 per token), pinned. No token request
touches the pull-diagnostics generation.
38 tests added (dev 29 + QA 9), including two independently written
edit appliers cross-checked over 200 random pairs and two differently
seeded randomized sweeps through the real tokenizer.
docs/features/semantic-tokens-delta/README.md
Co-Authored-By: Claude Fable 5 <[email protected]>
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]>
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]>
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]>