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
@@ -23,7 +23,7 @@ ranked between what the code declares and the bare keywords, and gated by two
|
||||
questions the server can already answer from the token stream — *may a
|
||||
statement be written here?* and *may a module item?* Nothing is offered that
|
||||
the buffer's own dialect would reject, and every template's untouched expansion
|
||||
is fed to vfmt's own parser by the test suite, because a template that hands
|
||||
is fed to lucisv's own parser by the test suite, because a template that hands
|
||||
the user a red squiggle from our own server is worse than no template.
|
||||
|
||||
Because this lives in the server, Vim gets it too — which is the reason it is
|
||||
@@ -56,9 +56,9 @@ templates used to live. Those are gone; see *Reconciliation* below.
|
||||
invisibly. No system task appears in any body today, and
|
||||
`every_hole_is_a_tabstop_the_snippet_grammar_reads` fails the build if one is
|
||||
added without an escape.
|
||||
- **`vfmt.indent` (default 2) is the indent step**, and the line's own leading
|
||||
- **`lucisv.indent` (default 2) is the indent step**, and the line's own leading
|
||||
whitespace is the base — the same `Layout` M4's skeletons use, resolved the
|
||||
same way and with the same deviation from `vfmt.toml` recorded there. Because
|
||||
same way and with the same deviation from `lucisv.toml` recorded there. Because
|
||||
the base is baked in, the item must tell the client not to indent it again:
|
||||
see *The indentation contract* below.
|
||||
- **A template is offered on prefix, not on fuzzy match.** The server filters
|
||||
@@ -69,13 +69,13 @@ templates used to live. Those are gone; see *Reconciliation* below.
|
||||
|
||||
## Handshakes
|
||||
|
||||
- **New module `crates/vfmt_server/src/templates.rs`** — the registry, the
|
||||
- **New module `crates/lucisv_server/src/templates.rs`** — the registry, the
|
||||
dialect rule and the renderer. It is data plus one function; nothing in it
|
||||
knows about LSP. `completion.rs` owns the tier, the gates and the items.
|
||||
- **Consumes `vlog_refactor::Layout`** — M4's `{ base, step }`, reused rather
|
||||
than re-declared, so a skeleton and a template are indented by the same type.
|
||||
Nothing in `vlog_refactor` was touched.
|
||||
- **Consumes `vfmt_server::pairs`** through `completion::enclosing_scopes`,
|
||||
- **Consumes `lucisv_server::pairs`** through `completion::enclosing_scopes`,
|
||||
exactly as M4 does. No change to `pairs.rs`.
|
||||
- **Changed inside `completion.rs`, for other tiers to know about:**
|
||||
- **The tier digits moved.** Templates are tier `3`; keywords are now `4`
|
||||
@@ -140,7 +140,7 @@ every block template.
|
||||
Sixteen templates in a `.sv` file, eighteen in a `.v` one.
|
||||
|
||||
Two deliberate details in that table. **The parameter templates name a type**
|
||||
(`int` / `integer`) because vfmt's own `explicit-parameter-storage-type` rule
|
||||
(`int` / `integer`) because lucisv's own `explicit-parameter-storage-type` rule
|
||||
flags `localparam NAME = 0;` — a template that trips our own linter on insert
|
||||
is not a template worth shipping, and it was the untouched-expansion check that
|
||||
surfaced it. **`casez` but not `casex`**: `casez` costs one registry entry and
|
||||
@@ -332,13 +332,13 @@ Every place `tools/RELEASING.md` names, plus the install examples it does not:
|
||||
- [x] `Cargo.lock` regenerated by `cargo check --workspace` — eight entries
|
||||
- [x] `editors/vscode/package.json` `"version"`
|
||||
- [x] `editors/vscode/package-lock.json` `"version"` in **both** places
|
||||
- [x] `README.md` — the `dist/vfmt-0.4.0.vsix` install example
|
||||
- [x] `README.md` — the `dist/lucisv-0.4.0.vsix` install example
|
||||
- [x] `editors/vscode/README.md` — both install examples
|
||||
- [x] `tools/RELEASING.md` — the `dist/` listing, the install commands, the
|
||||
`git tag v0.4.0` example and the appendix's publish commands
|
||||
- [x] `CHANGELOG.md` — a `0.4.0 — 2026-08-24` section in the existing voice
|
||||
- [x] Verified: `target/debug/vfmt --version` → `vfmt 0.4.0`
|
||||
- [x] Verified: `node editors/vscode/smoke.js target/debug/vfmt-server` →
|
||||
- [x] Verified: `target/debug/lucisv --version` → `lucisv 0.4.0`
|
||||
- [x] Verified: `node editors/vscode/smoke.js target/debug/lucisv-server` →
|
||||
`smoke: OK`
|
||||
|
||||
Deliberately not touched: the historical `0.3.x` mentions in `CHANGELOG.md` and
|
||||
@@ -377,7 +377,7 @@ in the feature READMEs that record what happened at those versions.
|
||||
|
||||
- **2026-08-24 (dev)** — implemented.
|
||||
|
||||
**Registry (`crates/vfmt_server/src/templates.rs`, new).** A `Template` is
|
||||
**Registry (`crates/lucisv_server/src/templates.rs`, new).** A `Template` is
|
||||
five fields: label, prefix, gate, detail, and a body written as
|
||||
`(indent level, text)` lines. `for_dialect` chains the eight shared templates
|
||||
onto the dialect's own, so the statement set cannot drift between `.sv` and
|
||||
@@ -413,9 +413,9 @@ in the feature READMEs that record what happened at those versions.
|
||||
completes. Three strings, an explicit list, and the test that pins it also
|
||||
pins that `x = if` is not one.
|
||||
4. **The parameter templates name a type** (`int`/`integer`) so that the
|
||||
untouched expansion does not trip vfmt's own
|
||||
untouched expansion does not trip lucisv's own
|
||||
`explicit-parameter-storage-type` rule. Found by running the expansions
|
||||
through `vfmt check` while choosing the bodies.
|
||||
through `lucisv check` while choosing the bodies.
|
||||
5. **`alwayscomb` was removed from `verilog.json`** although its prefix does
|
||||
not collide with anything the server offers. It is a subsequence match on
|
||||
`always` with a body identical to the server's `always @(*)`, so it would
|
||||
@@ -432,7 +432,7 @@ in the feature READMEs that record what happened at those versions.
|
||||
**Suite**: 1 268 → 1 292 workspace tests (24 new: 9 in `templates.rs`, 14 in
|
||||
`completion.rs`, 1 e2e), all green. `cargo fmt --all -- --check` and
|
||||
`cargo clippy --all-targets` clean; `node --check` on `extension.js` and
|
||||
`smoke.js`; `node editors/vscode/smoke.js target/debug/vfmt-server` →
|
||||
`smoke.js`; `node editors/vscode/smoke.js target/debug/lucisv-server` →
|
||||
`smoke: OK`; `npx --no-install @vscode/vsce ls` still lists both snippet
|
||||
files. No new dependency.
|
||||
|
||||
@@ -467,15 +467,15 @@ in the feature READMEs that record what happened at those versions.
|
||||
rather than trusting the total: **1292**, matching the Work log's
|
||||
`1268 → 1292` claim exactly.
|
||||
- `node --check` on `extension.js` and `smoke.js` — clean.
|
||||
- `node editors/vscode/smoke.js target/debug/vfmt-server` — `smoke: OK`.
|
||||
- `node editors/vscode/smoke.js target/debug/lucisv-server` — `smoke: OK`.
|
||||
- `cd editors/vscode && npx --no-install @vscode/vsce ls` — accepts the
|
||||
manifest; filtering the `node_modules/**` noise out of the listing (as the
|
||||
M1 QA pass for editor-snippets also did — `.vscodeignore` does not touch
|
||||
`node_modules`, so `vsce ls` prints it regardless) leaves exactly
|
||||
`package.json`, `extension.js`, `README.md`, `LICENSE`,
|
||||
`snippets/verilog.json`, `snippets/systemverilog.json`.
|
||||
- `cargo build -p vfmt` → `target/debug/vfmt --version` → `vfmt 0.4.0`.
|
||||
- `cargo test --release -p vfmt_server a_keystroke_over_the_whole_corpus_stays_in_budget -- --nocapture`
|
||||
- `cargo build -p lucisv` → `target/debug/lucisv --version` → `lucisv 0.4.0`.
|
||||
- `cargo test --release -p lucisv_server a_keystroke_over_the_whole_corpus_stays_in_budget -- --nocapture`
|
||||
— `worst request 225.875µs typed / 182.792µs empty` against the claimed
|
||||
284µs/242µs; faster, inside run-to-run noise. Budget test passes.
|
||||
|
||||
@@ -484,8 +484,8 @@ All gates: **pass, claims confirmed.**
|
||||
### Priority — the real UX, driven live over stdio
|
||||
|
||||
Not trusting the e2e test alone: wrote a standalone Python LSP-stdio client
|
||||
(`/tmp/vfmt_qa/driver.py`, `ux_check.py`, `edge_check.py`, `untitled_check.py`
|
||||
— scratch, not committed) and drove `target/debug/vfmt-server` directly,
|
||||
(`/tmp/lucisv_qa/driver.py`, `ux_check.py`, `edge_check.py`, `untitled_check.py`
|
||||
— scratch, not committed) and drove `target/debug/lucisv-server` directly,
|
||||
independent of the test suite.
|
||||
|
||||
- `.sv` buffer, `if` typed inside an `always_comb` body: `if begin/end`
|
||||
@@ -554,8 +554,8 @@ text with a standalone regex parser (not importing or calling
|
||||
`Defaults::substitute`), wrote a **second, independent** tabstop-stripping
|
||||
implementation in Python, planted each stripped body in the same probe shapes
|
||||
the registry's own test uses, and fed every probe to a throwaway Rust binary
|
||||
(`/tmp/vfmt_qa/probe_checker`, a 10-line `main.rs` depending on `vlog_parser`
|
||||
by path) that calls `vlog_parser::parse_source_tolerant` directly — no vfmt
|
||||
(`/tmp/lucisv_qa/probe_checker`, a 10-line `main.rs` depending on `vlog_parser`
|
||||
by path) that calls `vlog_parser::parse_source_tolerant` directly — no lucisv
|
||||
code from this feature involved in the check at all.
|
||||
|
||||
Result: **26/26 parse clean**, independently. Count matches the claim (8
|
||||
@@ -569,9 +569,9 @@ dialects; dialect-specific rejection (e.g. `always_ff` being illegal in a
|
||||
`.v` file) is enforced only by *this feature's own gate* (`templates::
|
||||
dialect`), never by the parser. So the registry test is exactly as strong as
|
||||
it can be — there is no stricter parsing mode to test `.v` templates against
|
||||
anywhere in vfmt today. Worth recording, not a finding: a reader could
|
||||
anywhere in lucisv today. Worth recording, not a finding: a reader could
|
||||
otherwise assume "parses" implies "parses under Verilog-2001 rules
|
||||
specifically", which nothing in vfmt currently checks for *any* file.
|
||||
specifically", which nothing in lucisv currently checks for *any* file.
|
||||
|
||||
`$`-escaping: grepped the body text for `$` followed by a letter
|
||||
(`grep -oE '"\$[a-zA-Z_]+' templates.rs`) — zero hits; every `$NAME`/`$n` in
|
||||
@@ -667,28 +667,28 @@ needs dev rework.
|
||||
This feature's only change in round 2 is the four-line diff in
|
||||
*The indentation contract* above (`completion.rs`): `insert_text_mode:
|
||||
Some(KEEP_MY_INDENTATION)` on `Items::template`
|
||||
(`crates/vfmt_server/src/completion.rs:459`) and on `item`, the
|
||||
(`crates/lucisv_server/src/completion.rs:459`) and on `item`, the
|
||||
module-instantiation skeleton (`:612`); `layout_at`
|
||||
(`crates/vfmt_server/src/completion.rs:326-329`) re-privatized because
|
||||
(`crates/lucisv_server/src/completion.rs:326-329`) re-privatized because
|
||||
`inline.rs` no longer names it. `templates.rs` is untouched, confirmed by
|
||||
`git diff --stat` (absent from the diff entirely). Full attack and gate
|
||||
detail — the trigger-table work is this round's real surface — is in
|
||||
`docs/features/inline-templates/README.md`'s 2026-08-25 round-2 QA entry;
|
||||
this entry covers only what round 2 touched here.
|
||||
|
||||
- **The wire value.** `crates/vfmt_server/src/completion.rs:156` in
|
||||
- **The wire value.** `crates/lucisv_server/src/completion.rs:156` in
|
||||
`lsp-types` 0.97.0 (registry source, read directly):
|
||||
`pub const AS_IS: InsertTextMode = InsertTextMode(1)`;
|
||||
`ADJUST_INDENTATION = InsertTextMode(2)`. So `KEEP_MY_INDENTATION` is `1`,
|
||||
matching LSP 3.17's `InsertTextMode` enum (`asIs = 1`). Both pins in
|
||||
`tests/e2e.rs` assert `insertTextMode == 1` — the template item at
|
||||
`crates/vfmt_server/tests/e2e.rs:1258` and the module skeleton at
|
||||
`crates/lucisv_server/tests/e2e.rs:1258` and the module skeleton at
|
||||
`:1625` — and both are correct. (The QA brief itself floated "`asIs` (2)"
|
||||
as a parenthetical; that would have been `AdjustIndentation`, not `AsIs`
|
||||
— checked against the source rather than trusted, and the shipped code is
|
||||
right.)
|
||||
- **No leak onto single-line items.** `grep -n "insert_text_mode"
|
||||
crates/vfmt_server/src/completion.rs` returns exactly the two call sites
|
||||
crates/lucisv_server/src/completion.rs` returns exactly the two call sites
|
||||
above. `Items::simple` (`completion.rs:412-430`, the keyword/word/index
|
||||
tiers' single-line items) builds its `CompletionItem` with
|
||||
`..Default::default()`, which leaves `insert_text_mode: None` — confirmed
|
||||
@@ -708,7 +708,7 @@ this entry covers only what round 2 touched here.
|
||||
`cargo clippy --all-targets --workspace` zero warnings; `cargo test
|
||||
--workspace` 1644 passed / 0 failed / 4 ignored (up from the round-2 dev's
|
||||
1633 — 11 new tests, all in `inline.rs`, none in this feature's own
|
||||
files); `node editors/vscode/smoke.js target/debug/vfmt-server` →
|
||||
files); `node editors/vscode/smoke.js target/debug/lucisv-server` →
|
||||
`smoke: OK`; `node --check` on `smoke.js` and a `JSON.parse` of
|
||||
`package.json` both clean.
|
||||
|
||||
@@ -738,5 +738,5 @@ root cause as inline-templates round 2, different fix because the
|
||||
completion protocol has the opt-out the inline one lacks:
|
||||
`insertTextMode: asIs` (verified = 1 on the wire against lsp-types
|
||||
source, by QA) on the two multi-line tiers only. `templates.rs` and the
|
||||
plain-text fallback untouched, `vfmt.indent` still meaningful here.
|
||||
plain-text fallback untouched, `lucisv.indent` still meaningful here.
|
||||
Approved; ships as 0.7.0.
|
||||
Reference in new issue
Block a user