Rename the tool to lucisv (Language Utility for Coding In SystemVerilog)
This commit is contained in:
1 parent
a284e33110
commit
eeaffafd56
188 files changed
+2825
-2802
No files matched your search
@@ -3,7 +3,7 @@
|
||||
## Goal
|
||||
|
||||
Make `` `include`` a real edge in the project graph instead of a comment the
|
||||
server walks past. M1 taught vfmt to read a filelist and recorded its
|
||||
server walks past. M1 taught lucisv to read a filelist and recorded its
|
||||
`+incdir+` directories; nothing consumed them, so an include line was dead
|
||||
text and a `` `define`` used in one file could only be answered with "here is
|
||||
every definition of that name in the workspace, good luck". This milestone
|
||||
@@ -11,7 +11,7 @@ builds the include graph once per index rebuild and spends it twice: an
|
||||
include line becomes clickable (`textDocument/documentLink` for the underline,
|
||||
`textDocument/definition` for F12 and `gd`), and hover on `` `NAME `` prefers
|
||||
the definition the hovered file actually *reaches* through its includes — the
|
||||
first thing vfmt has that can order two definitions of one macro name.
|
||||
first thing lucisv has that can order two definitions of one macro name.
|
||||
|
||||
## Assumptions
|
||||
|
||||
@@ -43,7 +43,7 @@ first thing vfmt has that can order two definitions of one macro name.
|
||||
region), and a `` `include`` that is not first on its line is missed. Both
|
||||
are rare and both fail in the harmless direction.
|
||||
- **An unresolvable include is silent.** No link, no location, no diagnostic.
|
||||
vfmt does not preprocess, and a project routinely builds with incdirs vfmt
|
||||
lucisv does not preprocess, and a project routinely builds with incdirs lucisv
|
||||
was never told about; underlining those lines in red would be wrong far
|
||||
more often than right.
|
||||
- **The graph is rebuilt whole with the index**, from the same source list, so
|
||||
@@ -76,14 +76,14 @@ first thing vfmt has that can order two definitions of one macro name.
|
||||
knows.
|
||||
- **Symlinks are not resolved.** Resolved paths are folded lexically
|
||||
(`.`/`..` removed) so they compare equal to the index's own spelling, the
|
||||
same lexical rule `vfmt_core::config::Discovery` and
|
||||
`vfmt_core::filelist` follow.
|
||||
same lexical rule `lucisv_core::config::Discovery` and
|
||||
`lucisv_core::filelist` follow.
|
||||
|
||||
## Handshakes
|
||||
|
||||
### Consumed
|
||||
|
||||
- `vfmt_core::filelist::Filelist::incdirs` — recorded since M1, used here for
|
||||
- `lucisv_core::filelist::Filelist::incdirs` — recorded since M1, used here for
|
||||
the first time. Resolved absolute and in filelist order, which is the order
|
||||
they are searched. **`state.rs` no longer drops them**: the scope ladder
|
||||
carries them alongside the file list (`Scope`/`Sources` in `state.rs`) and
|
||||
@@ -92,7 +92,7 @@ first thing vfmt has that can order two definitions of one macro name.
|
||||
- `vlog_semantic::WorkspaceIndex::find_define` — **unchanged**. It still
|
||||
returns every workspace definition, in file order, implying no resolution
|
||||
order. The include-graph precedence is an overlay applied in
|
||||
`vfmt_server::hover`, so no `vlog_semantic` change was needed at all and the
|
||||
`lucisv_server::hover`, so no `vlog_semantic` change was needed at all and the
|
||||
workspace-index contract is exactly what it was.
|
||||
- `vlog_parser` — nothing new. The line scan reads text; the lexer's
|
||||
treatment of `` `include`` (one `TokenKind::Directive` token carrying the
|
||||
@@ -101,20 +101,20 @@ first thing vfmt has that can order two definitions of one macro name.
|
||||
|
||||
### Promised
|
||||
|
||||
- `vfmt_server::includes::IncludeGraph` — `build`, `resolve` and `reachable`
|
||||
- `lucisv_server::includes::IncludeGraph` — `build`, `resolve` and `reachable`
|
||||
are the whole surface. `Workspace::includes()` hands the current one out.
|
||||
A default-constructed `Workspace` has an empty graph, which resolves
|
||||
nothing and reaches nothing; every caller must behave as it did before this
|
||||
feature when that is what it gets.
|
||||
- `vfmt_server::includes::scan` — the one include scanner. `documentLink`,
|
||||
- `lucisv_server::includes::scan` — the one include scanner. `documentLink`,
|
||||
`definition` and the graph build all go through it, so the three can never
|
||||
disagree about what an include line is.
|
||||
- **A third lexical `normalize`.** `includes.rs` carries its own copy of the
|
||||
`.`/`..` folding that `vfmt_core::filelist::Reader::normalize` and
|
||||
`vfmt_core::config::Discovery::absolute` already have (both private, both
|
||||
`.`/`..` folding that `lucisv_core::filelist::Reader::normalize` and
|
||||
`lucisv_core::config::Discovery::absolute` already have (both private, both
|
||||
on stateful structs). Two copies were deliberate duplication (filelist work
|
||||
log, 2026-08-24); three is the point at which extracting a
|
||||
`vfmt_core::path::normalize` and pointing all three at it becomes worth
|
||||
`lucisv_core::path::normalize` and pointing all three at it becomes worth
|
||||
doing. **Request for the lead**, not done here: it touches two modules
|
||||
outside this feature's scope.
|
||||
|
||||
@@ -132,14 +132,14 @@ The graph build is what this feature adds to every index rebuild. Measured
|
||||
|
||||
So roughly 2% of a rebuild that was already happening — a line scan per file
|
||||
plus one `is_file` per include. Pinned by an `#[ignore]`d probe
|
||||
(`cargo test --release -p vfmt_server --bin vfmt-server includes::tests::perf
|
||||
(`cargo test --release -p lucisv_server --bin lucisv-server includes::tests::perf
|
||||
-- --ignored --nocapture`), the same shape as `inlay.rs`'s: timing assertions
|
||||
in a shared runner are flaky, so it prints and asserts nothing but the
|
||||
corpus's presence.
|
||||
|
||||
## Status / TODO
|
||||
|
||||
- [x] `crates/vfmt_server/src/includes.rs`: `scan`, `Include`, `IncludeGraph`
|
||||
- [x] `crates/lucisv_server/src/includes.rs`: `scan`, `Include`, `IncludeGraph`
|
||||
(`build`/`resolve`/`reachable`), the two capability entry points.
|
||||
- [x] `+incdir+` plumbed from the filelist through `state.rs` to the graph,
|
||||
nested `-f` incdirs included and in order.
|
||||
@@ -164,7 +164,7 @@ corpus's presence.
|
||||
invisible.
|
||||
- [ ] **Not done, deliberately:** no completion of include paths, and no
|
||||
diagnostic for an include that resolves to nothing. Both are their own
|
||||
features, and the second one needs vfmt to be sure it knows every
|
||||
features, and the second one needs lucisv to be sure it knows every
|
||||
incdir — which it is not.
|
||||
|
||||
## Work log
|
||||
@@ -217,7 +217,7 @@ test), `hover.rs` (the narrowing overlay, six tests).
|
||||
**Verification.** `cargo fmt --all -- --check` clean; `cargo clippy
|
||||
--all-targets` silent; `cargo test --workspace` green — 1420 tests, 28 of them
|
||||
new (16 `includes`, 6 `hover`, 3 `state`, 1 `nav`, 1 `main`, 1 e2e session).
|
||||
`node editors/vscode/smoke.js target/debug/vfmt-server` OK. Perf measured as
|
||||
`node editors/vscode/smoke.js target/debug/lucisv-server` OK. Perf measured as
|
||||
above. No new dependency; no version bump.
|
||||
|
||||
### 2026-08-25 — dev agent, QA round 1 fixes
|
||||
@@ -227,7 +227,7 @@ reachable definition.** `IncludeGraph` now carries the in-scope file list it
|
||||
was built from — `known` (exact spellings) and `folded` (lower-cased spelling
|
||||
→ the one file that has it, or `None` when several do) — and every path
|
||||
`resolve` returns goes through `as_the_index_spells_it`
|
||||
(`crates/vfmt_server/src/includes.rs`). Exact match: unchanged. Exactly one
|
||||
(`crates/lucisv_server/src/includes.rs`). Exact match: unchanged. Exactly one
|
||||
case-insensitive match: the index's spelling is adopted, so the graph edge,
|
||||
the reachability comparison in `hover.rs` and the URI go-to-definition hands
|
||||
the editor all name the same file. Zero or several matches: the path as
|
||||
@@ -275,7 +275,7 @@ covering both delimiters and both keyword-prefix cases. Assumptions updated.
|
||||
--all-targets` silent, `cargo test --workspace` green — 1426 tests on macOS
|
||||
(1425 QA left, plus the one new test above; no test was removed, QA's two
|
||||
pinned ones were rewritten in place). `node
|
||||
editors/vscode/smoke.js target/debug/vfmt-server` OK. Perf probe re-run after
|
||||
editors/vscode/smoke.js target/debug/lucisv-server` OK. Perf probe re-run after
|
||||
the fix: ~6ms over the 860-file corpus.
|
||||
|
||||
## QA log
|
||||
@@ -285,8 +285,8 @@ the fix: ~6ms over the 860-file corpus.
|
||||
**Gates.** `cargo fmt --all -- --check` clean. `cargo clippy --all-targets`
|
||||
silent. `cargo test --workspace` green — re-ran repeatedly while adding the
|
||||
tests below; **1425** tests at the end (1420 the dev shipped + 5 added here).
|
||||
`node editors/vscode/smoke.js target/debug/vfmt-server` OK. Perf probe re-run:
|
||||
`cargo test --release -p vfmt_server --bin vfmt-server includes::tests::perf
|
||||
`node editors/vscode/smoke.js target/debug/lucisv-server` OK. Perf probe re-run:
|
||||
`cargo test --release -p lucisv_server --bin lucisv-server includes::tests::perf
|
||||
-- --ignored --nocapture` → **6.5ms** over the 860-file corpus (dev measured
|
||||
~6ms) — confirmed, order of magnitude and absolute number both hold.
|
||||
|
||||
@@ -332,7 +332,7 @@ there, just under the wrong-case key), leaving exactly one candidate. The
|
||||
overlay then does precisely what it is built to do with one candidate: shows
|
||||
it alone, with full confidence, never mentioning the other one exists.
|
||||
Reproduced and pinned as `hover::qa_findings::qa_a_case_mismatched_include_silently_drops_a_reachable_define`
|
||||
(`crates/vfmt_server/src/hover.rs`, gated `cfg(any(target_os = "macos",
|
||||
(`crates/lucisv_server/src/hover.rs`, gated `cfg(any(target_os = "macos",
|
||||
target_os = "windows"))` since the premise needs a case-insensitive default
|
||||
FS). The test asserts *today's* wrong output rather than the correct one, so
|
||||
the suite stays green — a fix must touch this test.
|
||||
@@ -387,7 +387,7 @@ No action required.
|
||||
- `hover::qa_findings::an_angled_include_narrows_hover_same_as_a_quoted_one` —
|
||||
the six hover narrowing tests the dev shipped only ever use the quoted
|
||||
form; the angled (`<sys>`) form narrows correctly too, now pinned.
|
||||
- `crates/vfmt_server/tests/e2e.rs::include_nav_round_trips_in_a_workspace_whose_directory_has_a_space` —
|
||||
- `crates/lucisv_server/tests/e2e.rs::include_nav_round_trips_in_a_workspace_whose_directory_has_a_space` —
|
||||
the one e2e session for this feature used a plain temp dir; every other
|
||||
e2e test in the file hand-rolls unencoded `file://` URIs, so a directory
|
||||
with a space had never gone over the wire for any feature, this one
|
||||
@@ -428,7 +428,7 @@ violation of the feature's central documented promise ("narrows, never
|
||||
widens, and only when it is sure") on the platform this shipped from, using
|
||||
an unremarkable real-world input (one file whose include-site spelling
|
||||
doesn't match its own filename's case — common when headers come from a
|
||||
vendor IP or a different OS's checkout). It should not corrupt anything vfmt
|
||||
vendor IP or a different OS's checkout). It should not corrupt anything lucisv
|
||||
formats (out of scope for the hard invariants in `CLAUDE.md`, which are about
|
||||
formatter output), but it is a silently-wrong LSP answer, not a
|
||||
conservatively-declined one, and that is exactly the failure mode this
|
||||
@@ -458,7 +458,7 @@ flipped to `includes::tests::a_missing_space_before_the_delimiter_is_still_an_in
|
||||
1426 the dev's rework landed at, plus 3 added in this round (below). Perf
|
||||
probe re-run: **6.3ms** over the 860-file corpus (dev claimed ~7ms; this
|
||||
machine has consistently measured 6-6.5ms across both rounds — same order of
|
||||
magnitude, no regression). `node editors/vscode/smoke.js target/debug/vfmt-server`
|
||||
magnitude, no regression). `node editors/vscode/smoke.js target/debug/lucisv-server`
|
||||
OK.
|
||||
|
||||
**Mechanism-level re-verification of Finding 1's fix.** Read
|
||||
@@ -497,13 +497,13 @@ round-1 writeup:**
|
||||
(`includes::qa_round2::a_case_mismatch_on_a_file_outside_the_graphs_scope_is_unchanged`).
|
||||
3. **The real binary, once, on a case-mismatched fixture.** Unit tests calling
|
||||
`resolve`/`hover` directly can't settle what URI an editor actually
|
||||
receives, so this drives `vfmt-server` over real stdio JSON-RPC — the same
|
||||
receives, so this drives `lucisv-server` over real stdio JSON-RPC — the same
|
||||
harness `e2e.rs` uses for every other capability. `top.sv` writes
|
||||
`` `include "defs.svh"``; the real (and indexed) file is `Defs.svh`.
|
||||
Confirmed both `documentLink`'s `target` and F12's `Location.uri` carry
|
||||
the capital-D URI, not the as-written lowercase one
|
||||
(`go_to_definition_lands_on_the_indexs_own_spelling_not_the_includes`,
|
||||
`crates/vfmt_server/tests/e2e.rs`, case-gated). This is the one check none
|
||||
`crates/lucisv_server/tests/e2e.rs`, case-gated). This is the one check none
|
||||
of the unit-level tests — the dev's or mine — could have caught a
|
||||
regression in: it is the only test that round-trips the URI through the
|
||||
actual wire encoding (`path_to_uri`) with a real spawned process on the
|
||||
@@ -521,7 +521,7 @@ round-1 writeup:**
|
||||
new test since it exercises the same `trim_start` call the dev's
|
||||
spaced-form tests already cover and no distinct code path is at risk.
|
||||
6. **Mutation check.** Temporarily reverted `as_the_index_spells_it` to
|
||||
`{ path }` (identity) in a scratch copy, re-ran the full `vfmt_server`
|
||||
`{ path }` (identity) in a scratch copy, re-ran the full `lucisv_server`
|
||||
unit suite: exactly two tests failed —
|
||||
`includes::tests::a_resolved_path_is_re_spelled_the_way_the_index_spells_it`
|
||||
and `hover::qa_findings::a_case_mismatched_include_still_counts_as_reachable`
|
||||
|
||||
Reference in new issue
Block a user