Files
lucisv/docs/features/editor-packaging/README.md
T

928 lines
59 KiB
Markdown

# editor-packaging
## Goal
`lucisv-server` has been a running binary since round 11, but a binary nobody can
launch from an editor is a demo. This round closes TODO.md §6's last
non-deferred item: a **minimal VS Code extension** that registers the
Verilog/SystemVerilog file types and starts the server, and **documented
Vim/Neovim configuration** that does the same with no plugin at all. The
governing constraint is TODO.md §6's own sentence — *"no editor-specific logic
below the protocol layer"* — read in the other direction: no *language* logic
above it either. Every feature a user sees comes from the server, so this
feature ships one 41-line JavaScript file, one setting, two markdown guides,
and a dependency-free smoke test that proves the extension's spawn contract
matches the binary's reality without opening an editor. (One later exception:
static snippet templates, which LSP has no channel for — see
`docs/features/editor-snippets/README.md`.)
## Assumptions
- **VS Code has no built-in generic LSP client.** `vscode.lsp` does not exist;
the editor's own extensions (and ruff's, and rust-analyzer's) all use
`vscode-languageclient`. Writing a client by hand means re-implementing
`Content-Length` framing, document sync, capability negotiation and edit
application inside a JavaScript file — strictly more code and strictly more
bugs than the dependency. Justification for the dependency is its own section
below, per CLAUDE.md.
- **JavaScript, not TypeScript**, so there is no build step: what is in
`editors/vscode/` is what runs. At 41 lines the type checking buys nothing
that reading the file does not.
- **The server takes no arguments and no environment.** `main.rs` parses no
argv; the entire contract is "spawn it, speak LSP on stdin/stdout". If that
ever changes, `smoke.js` and `extension.js` must change together — that is
exactly the pairing `smoke.js` exists to police.
- **`.v`/`.vh` are `verilog`, `.sv`/`.svh` are `systemverilog`.** These are the
language ids the Verilog ecosystem already uses (and the ones the server's
own e2e test sends). Files whose extension VS Code has given to another
extension keep that extension's language id; the setup note in
`editors/vscode/README.md` covers the collision.
- **The user builds the binary.** No download, no bundled executable, no
version check between extension and server. `cargo build --release` and a
`PATH` entry, or an absolute `lucisv.serverPath`. A version handshake would be
worth adding the day a released extension can meet an older server; today
they come out of the same working tree.
- **Marketplace publishing is out of scope**, as is CI packaging. `publisher`
is the literal string `REPLACE-ME`: packaging a `.vsix` and installing it
locally works with a placeholder, `vsce publish` does not, and inventing a
publisher id nobody owns would be worse than an obvious placeholder.
## What was deliberately left out
Each of these is a thing a VS Code extension usually has. Each was considered
and dropped, because the brief and CLAUDE.md's "simplicity first" both point
the same way:
| Not shipped | Why |
|---|---|
| ~~TextMate grammar~~ — **ships since 0.4.1** | The original reasoning (below) was right about the *buffer* and wrong about *markdown*, which semantic tokens cannot reach at all. See "The TextMate grammar" below. Struck through rather than deleted, because the reason it was cut is still the reason it is deliberately small. *(Original: "The server ships `semanticTokens` (14 types, `docs/features/lucisv-server/README.md`). A grammar would be a second, worse highlighter to keep in sync.")* |
| `language-configuration.json` | Comment/bracket rules are the smallest useful thing here, and still a judgement call about Verilog syntax living in the editor layer. The brief says "declare the language only"; if `Ctrl+/` proves painful, this is the first thing to add back — 12 lines, no dependency. |
| Commands (restart server, show logs) | The language client already contributes a restart command and an output channel. |
| Status bar item | State the user can already see in the Output panel. |
| Settings beyond `serverPath` | Formatter options belong in `lucisv.toml`, one source of truth for the CLI and the editor. (The caveat that once lived here — "the server does not read it yet" — was closed by lucisv-core-lift; lead trued up all three doc locations at review.) |
| Bundling (esbuild/webpack) | `vsce` warns about the 166 JavaScript files in the dependency; bundling would add a build step to a repo whose extension has none. 460 KB is not a problem worth a toolchain. |
| A Neovim plugin | The configuration *is* the integration. A plugin would only wrap `vim.lsp.config`. |
## The TextMate grammar (0.4.1)
### Why the no-grammar stance was wrong
Semantic tokens colour *buffers*. The server's richest output is not a buffer:
it is **markdown** — hover cards carrying a declaration snippet or a
`` `define`` expansion (`crates/lucisv_server/src/hover.rs:89,131`) and a
completion template's documentation panel
(`crates/lucisv_server/src/completion.rs:423`). All three have always been fenced
```` ```systemverilog ````, which was correct and did nothing: VS Code colours a
fenced block by looking the fence's info string up in the **language registry**
and tokenizing with the TextMate grammar registered for that language id.
No grammar, no colour — and there is no LSP channel that could supply one,
because the hover's markdown is rendered by the editor, not by the server.
So the cards rendered as flat grey text.
The fix is a grammar, and the original objection ("a second, worse
highlighter") survives as a *design constraint* rather than a veto: this
grammar is deliberately the smallest thing that makes a code fence readable.
In a live buffer the server's 14 semantic token types still win — VS Code
layers semantic tokens over TextMate tokens — so the grammar mostly fills gaps
there. It is the *only* highlighter in a hover card, in a file opened before
the server starts, and in the previews VS Code renders with no language server
attached (diffs, git blame, walkthrough panes).
### One file, two language ids
`editors/vscode/syntaxes/systemverilog.tmLanguage.json` is registered **twice**
in `contributes.grammars`, once for `verilog` and once for `systemverilog`,
with the same `scopeName` (`source.systemverilog`) and the same `path`. That is
the boring option, and it is honest: lucisv's own lexer has a single `KEYWORDS`
list serving both dialects, so a second grammar would be a copy that can only
drift.
Two alternatives were considered and dropped. Two scope names with a stub
grammar that `include`s the other by scope adds a file and an indirection for
no behavioural difference. Two full grammars re-litigate the dialect split that
the lexer already decided not to make.
The one risk of the chosen shape — a re-registered scope name — was checked
against VS Code's own shipped code rather than assumed. In
`TMScopeRegistry.register` (VS Code 1.123.0,
`out/vs/workbench/…/textMateTokenizationWorker.workerMain.js`) a second
registration for a scope warns **only when the two locations differ**:
`isEqual(old.location, new.location) || console.warn('Overwriting grammar scope
name to file mapping…')`. Same file, no warning; the language-to-scope map
takes both ids. `crates/lucisv_server/tests/grammar.rs` asserts both entries keep
naming the same path, so that stays true.
### Pattern inventory
| Rule | Scope | Notes |
|---|---|---|
| line comment | `comment.line.double-slash` | |
| block comment | `comment.block` | non-nesting, which is what the language says |
| string | `string.quoted.double` | `\\.` escapes; ends at the closing quote **or end of line**, so an unterminated string cannot bleed down a hover card |
| directives | `keyword.control.directive` | `` `define ``, `` `ifdef ``, `` `include ``, `` `timescale ``, `` `__LINE__ ``… |
| macro use | `entity.name.function.preprocessor` | any other `` `NAME ``; listed after the directives so the directive wins the tie |
| system tasks | `support.function.system` | `\$[a-zA-Z_][a-zA-Z0-9_$]*` — `$display`, `$clog2` |
| based literals | `constant.numeric.based` | `8'hFF`, `4'b10xz`, `32'sd10`, unsized `'h1F`, `_` separators, `x`/`z`/`?` digits |
| fill literals | `constant.numeric.fill` | `'0`, `'1`, `'x`, `'z` |
| decimal / real / time | `constant.numeric` | `42`, `1.5e-3`, `10ns` |
| keywords | `keyword.other` | all 181, generated — see below |
Scope naming is deliberately flat, and the choice was made against this
machine's copy of VS Code's default themes rather than from memory
(`theme-defaults/themes/*.json`, 1.123.0): bare **`keyword`** is coloured
(`#569cd6` dark, `#0000ff` light), so `keyword.other.systemverilog` inherits a
real colour in every theme built on those. `constant.numeric`, `comment`,
`string`, `support.function` and `entity.name.function.preprocessor` are all
coloured there too. The alternative — splitting the keywords into
`storage.type` (`logic`, `wire`) and `keyword.control` (`if`, `always`) — would
look marginally better and would require hand-categorising 181 words, which is
exactly the hand-maintained list the drift test exists to forbid. Colour beats
taxonomy here.
### Deliberate omissions
- **Operators.** Noise in a hover card, and `keyword.operator` is theme-coloured
the same as plain text in Dark+/Light+ anyway — the work would buy nothing.
- **`(* attributes *)`.** Considered, rejected as *not cheap*: the obvious
`begin: "\\(\\*"` / `end: "\\*\\)"` swallows the extremely common
`always @(*)` — the begin matches `(*`, the end never does, and the rest of
the file becomes an attribute. Excluding it needs a negative lookahead
(`\(\*(?!\))`), which is the only Oniguruma-only construct the grammar would
have contained. An unhighlighted attribute costs nothing; a runaway one costs
the whole file. Skipped, and the "no lookaround" rule is now asserted by the
tests.
- **Whitespace inside a based literal** (`8 'h FF`, legal but never written).
- **`1step`**, and other literals whose unit is not a time unit.
- **Nested `/* */`**, which the language does not have either.
- **Embedded languages / injections** (SVA, DPI C blocks, `` `pragma `` bodies).
- **A `$` inside an identifier** (`x$y`, legal in SystemVerilog): the
system-task pattern has no left boundary — a lookbehind, the construct
this grammar bans — so the `$y` half colors as a system task. Cosmetic,
QA-found, accepted (lead, 2026-08-24).
- **An unterminated `/*`** colors as comment to the end of the fenced block.
Strings are hardened against this (they close at end of line) because an
unterminated string is a common mid-typing state; an unterminated block
comment in a hover card — which shows *saved declarations* — is not.
QA-found, accepted (lead, 2026-08-24).
### The drift test, and why there is no regex-compile test
`crates/lucisv_server/tests/grammar.rs`, three tests:
1. `the_grammars_keywords_are_exactly_the_lexers` parses the JSON, strips the
`\b(` … `)\b` around `repository.keywords.match`, and asserts the
alternation is exactly `vlog_parser::KEYWORDS` as a set, with no duplicates,
naming the missing and the extra words on failure. The M5 single-source rule
(`token.rs`'s `keywords!` macro) now reaches the editor too: add a keyword to
the lexer and forget the grammar, and `cargo test` says so. Precedent: the
`$`-escape checker in `docs/features/editor-snippets/README.md`.
2. `every_pattern_is_a_plain_regex` walks every `match`/`begin`/`end` in the
file and asserts each is non-empty, has balanced groups and character
classes, and uses no lookaround, backreference, atomic group or `\G`.
**It does not compile them**, because there is no regex engine in this
workspace's dependency tree and CLAUDE.md's "adding a dependency requires a
written justification" is not satisfiable by "a test would be tidier".
What it checks instead is stronger in one way and weaker in another: weaker,
because a subtly wrong (but valid) regex still passes; stronger, because the
no-lookaround assertion pins the grammar inside the subset *every* engine
accepts, Oniguruma included, so the patterns can be checked with any tool at
hand. They were: all 13 were compiled and run against a sample buffer with
Python's `re` while the grammar was written — see the work log.
3. `both_language_ids_are_registered_for_the_grammar` reads `package.json` and
asserts both ids are registered, both name the same scope and the same file,
and both are ids the extension actually declares — the
silently-never-highlights failure mode, and the same class of check QA
already runs by hand for `activationEvents`.
## The one dependency, and the justification CLAUDE.md asks for
| package | version | why not std, why not hand-rolled |
|---|---|---|
| `vscode-languageclient` | `9.0.1` (exact, no `^`) | Microsoft's own client library, maintained alongside the protocol spec and used by essentially every language extension including ruff's. It is the exact analog of `lsp-server`/`lsp-types` on the Rust side, and the reasoning is the same one `docs/features/lucisv-server/README.md` records for those: the alternative is hand-writing the wire format. Requires VS Code `^1.82.0`, which is `package.json`'s `engines.vscode`. |
Transitive cost, measured on this machine (`npm ls --all`): **8 packages
total** — `vscode-languageclient` plus `vscode-languageserver-protocol`,
`vscode-languageserver-types`, `vscode-jsonrpc` (the protocol proper, all four
from Microsoft), and `semver`, `minimatch`, `brace-expansion`,
`balanced-match`. No native modules, no install scripts. Packaged `.vsix`: 320
files, 462 KB.
Pinned exactly rather than with `^`, matching the workspace's Rust
dependencies: an extension that silently picks up a new client minor on the
next `npm install` is an extension whose bug reports cannot be reproduced.
## `smoke.js` — the validation that does not need an editor
The highest-value automated check here is not "does the extension render", it
is **does the extension's spawn contract match the binary's reality**. That
question is answerable in plain node:
`editors/vscode/smoke.js` spawns the server the way `extension.js` does — same
program, empty argument list, inherited `env`, the working directory as `cwd`,
stdio pipes — then writes a whole `initialize` → `initialized` → `didOpen` →
`shutdown` → `exit` session with hand-rolled `Content-Length` framing, reads
stdout, and asserts: the process exits 0, `initialize` returned capabilities,
four named capabilities are present, diagnostics were pushed for the opened
document, and `shutdown` was acknowledged without an error.
Three deliberate choices, all inherited from `crates/lucisv_server/tests/e2e.rs`:
- **The framing is hand-rolled.** A check that reused `vscode-jsonrpc` could
not catch a framing bug, and could not run before `npm install`.
- **The whole session is written before a byte is read.** The rationale is the
one in `tests/e2e.rs`'s own header, reinforced by the lucisv-server QA log's
hang investigation: interleaving reads and writes against a subprocess is how
a smoke test becomes an intermittent hang. The session is under 4 KB, well
inside a pipe buffer, and the server closes stdout on `exit`, so the read
terminates on its own. No timeouts, no reader thread, no deadlock.
- **`rootUri: null`, no `workspaceFolders`.** That is the single-file mode the
Neovim `single_file_support = true` claim depends on, so the smoke test
proves that claim as a side effect.
It is not a duplicate of `tests/e2e.rs`. That test proves the *server* works
and runs under `cargo test`; this one proves the *extension's launch
configuration* works, runs with zero dependencies at any point in the install
sequence, and is the thing to run when a user reports "nothing happens".
## Handshakes
**Consumed from `lucisv_server`** — and this is the whole interface, exactly as
that feature's README promised ("the editor packaging round will consume the
binary's name and its stdio contract, nothing else"):
1. Binary name `lucisv-server`, resolved on `PATH` by default.
2. No command-line arguments, no required environment.
3. LSP over stdin/stdout, `Content-Length` framing.
4. `initialize` succeeds with neither `workspaceFolders` nor `rootUri`
(single-file mode) — relied on by `single_file_support` in the Neovim config
and asserted by `smoke.js`.
5. The advertised capability set, which both editor guides describe and neither
editor extends: nothing is advertised client-side that the server does not
implement.
6. **(0.4.1) The fence tag `systemverilog`.** Every code block the server puts
in markdown — `hover.rs:89` (`` `define`` expansion), `hover.rs:131`
(declaration snippet), `completion.rs:423` (template documentation) — opens
```` ```systemverilog ````, unconditionally, including for a `.v` buffer.
The extension's grammar is registered for that language id, which is why the
card renders highlighted; VS Code resolves a fence's info string against the
language registry, not against the document the hover came from, so the `.v`
case needs nothing extra beyond `verilog` also being registered (it is).
**If the server ever changes that tag, or fences a new surface with a
different one, the highlighting silently goes away.** The three call sites
now pin the exact fenced string in their own unit tests, and
`tests/grammar.rs` pins the registration.
**Consumed from `vlog_parser`:** `KEYWORDS` — the grammar's keyword alternation
is generated from it and `crates/lucisv_server/tests/grammar.rs` fails if the two
diverge. Adding a keyword to `token.rs`'s `keywords!` macro is now also an edit
to `editors/vscode/syntaxes/systemverilog.tmLanguage.json`; the test names the
missing word.
**Promised to `lucisv_server`:** the spawn contract above. If the server ever
grows a required flag, a subcommand, or a stdio mode switch, `extension.js` and
`smoke.js` change in the same round.
**Requested of other modules** — none blocking, none done here:
1. **`crates/lucisv`: lift `config.rs` into a library** (already filed by
`docs/features/lucisv-server/README.md`). Restated because it is now
*user-visible*: formatting from an editor ignores `lucisv.toml`, so a project
that sets `line-length = 120` gets 100-column formatting on save and
120-column formatting from the CLI — the two disagreeing on the same file.
Both editor guides state this caveat out loud rather than hide it, but the
fix is that lift.
2. **Repo root: no `LICENSE` file exists.** The root `Cargo.toml` and the
extension's `package.json` both declare MIT, but `vsce package` wants the
file and needs `--skip-license` without it. Adding one is a one-line repo
decision that is not this feature's to make; the flag is documented, with a
note to drop it once the file lands.
## Status / TODO
- [x] `editors/vscode/package.json` — language declarations, activation,
`lucisv.serverPath`, pinned `vscode-languageclient`.
- [x] `editors/vscode/extension.js` — 41 lines, plain JS, no build step.
- [x] `editors/vscode/smoke.js` — zero-dependency spawn-contract check.
- [x] `editors/vscode/README.md` — build, smoke, package, install,
troubleshooting.
- [x] `editors/vscode/.vscodeignore` / `.gitignore` — keep `smoke.js` out of
the `.vsix`, keep `node_modules/` and `*.vsix` out of git.
- [x] `editors/nvim/README.md` — `vim.lsp.config` (0.11+), `nvim-lspconfig`
(0.9/0.10), Vim 9 `vim-lsp` one-liner, coc.nvim.
- [x] Top-level `README.md` "Editor setup" section.
- [x] TODO.md §6 editor-packaging checkbox.
- [x] `smoke.js` run green against a release build.
- [x] `npm install` and `vsce package` run green on this machine.
- [x] **0.4.1** — `editors/vscode/syntaxes/systemverilog.tmLanguage.json`,
registered for both language ids in `contributes.grammars`.
- [x] **0.4.1** — `crates/lucisv_server/tests/grammar.rs`: keyword drift,
pattern validity, registration.
- [x] **0.4.1** — fence audit of every markdown surface the server emits;
the three code-carrying ones pin their fence tag in unit tests.
- [x] **0.4.1** — version bump, changelog, `editors/vscode/README.md`
"Syntax highlighting", `tools/RELEASING.md` packaging check.
- [ ] **Not done (0.4.1), same reason as everything else in this list:** the
grammar has never been *tokenized* by vscode-textmate. `vscode-textmate`
is not in `node_modules` and adding it is a new dev dependency, which
CLAUDE.md forbids without a written justification a highlighting test
does not earn. Verified instead: the patterns compile and behave under
Python's `re` on a sample buffer, the JSON loads, the scopes are ones
this machine's default themes actually colour, and `vsce ls` ships the
file. See the Work log for the exact output.
- [ ] **Not done, and honestly untestable here:** the extension has never run
inside VS Code. `require('vscode')` resolves only in the extension host,
so the `activate` path cannot be exercised outside the editor and was not
claimed to be. See the Work log for exactly what *was* proven instead.
- [ ] **Not done:** the Neovim/Vim snippets were not executed — no `nvim` on
this machine (`vim` 9.1 is present but without `vim-lsp`). The server-side
assumptions they rest on were verified independently; see the Work log.
- [ ] **Not done, out of scope:** CI packaging, Marketplace publishing, a
version handshake between extension and server, bundling.
- [ ] **Follow-up, blocked on a concurrent round:** a `crates/lucisv_core` lift
(config + walk out of the `lucisv` binary) landed in the tree *while this
round was being written*, and `crates/lucisv_server` already depends on it.
If that closes the "the server does not read `lucisv.toml`" gap, the caveat
must be deleted from **three** places: `README.md`'s Editor setup
section, `editors/vscode/README.md` (Settings), and
`editors/nvim/README.md` ("What you get"). Left in place here because it
was true of the binary this round tested and I do not claim behavior I
have not run.
## Work log
### 2026-08-24 — dev agent (0.4.1, the TextMate grammar)
- **The bug was in this README, not in the server.** The owner asked for
highlighted hover cards; `hover.rs` was already emitting
```` ```systemverilog ```` fences and had been since it was written. What was
missing was the grammar those fences resolve against — the thing this
document had argued against on the grounds that semantic tokens cover the
buffer, which is true and irrelevant to markdown. The stance is updated in
place with the reasoning, not quietly deleted: see "The TextMate grammar".
- **No server code changed.** The whole fix is `editors/vscode/`. Everything in
`crates/` is either a test or a test assertion.
- **Fence audit — every markdown surface the server emits, checked, three
changes, all of them assertions.** The surfaces are:
| Surface | Contains code? | Fenced? | Action |
|---|---|---|---|
| `hover.rs:89` `` `define`` expansion | yes, a block | ```` ```systemverilog ```` | pinned the exact fenced string in `hovering_a_macro_usage_shows_its_body` |
| `hover.rs:131` declaration snippet | yes, a block | ```` ```systemverilog ```` | pinned in `hovering_a_use_shows_its_declaration` |
| `completion.rs:423` template documentation (M6) | yes, a block | ```` ```systemverilog ```` | pinned in `a_templates_documentation_shows_what_it_expands_to` |
| `completion.rs:615` instantiation documentation (M4) | **no block** — a `**Parameters**`/`**Ports**` bullet list whose port signatures are *inline* spans | n/a | **no change**: markdown has no info string for an inline span, so there is nothing to tag. Fencing the list would be a restructure, which the brief ruled out |
| `signature.rs:85` signature help | no | n/a | **no change**: `label` is not markdown (the client renders it itself) and `documentation` is `Documentation::String(warnings)` — prose |
| `hover.rs:41,120` "no definition found" / "declared in `x.sv:12`" | no | n/a | no change |
So the audit's outcome is "already correct everywhere it mattered", and the
three assertions exist so it stays that way — a fence tag is now a
cross-module contract (Handshake 6) and silently breaking it costs the
feature the owner just asked for.
- **The `.v` question, answered rather than assumed.** The fences say
`systemverilog` unconditionally, including in a hover shown from a `.v`
buffer. That resolves, because VS Code looks a fence's info string up in the
global language registry — the hovered document's own language id plays no
part. The `.v` buffer's *own* colouring comes from the `verilog`
registration, which is why the grammar is registered for both ids;
`both_language_ids_are_registered_for_the_grammar` asserts it.
- **Keywords are generated, never typed.** The alternation was produced
mechanically from `token.rs`'s `keywords!` macro (181 words) and is checked
against `vlog_parser::KEYWORDS` by a test, per the brief. Both tests were
**negative-controlled** rather than assumed to work: deleting `genvar` from
the alternation fails with `missing: ["genvar"]`, and corrupting `"//.*"`
into `"//(.*"` fails with
`.repository.comments.patterns[0].match has unbalanced ( or []`. Restored,
re-run green.
- **No regex engine, so no compile test — and the gap was closed by hand.**
`regex` is not in the workspace and a test does not justify adding it. All 13
`match`/`begin`/`end` patterns were compiled and *run* with Python's `re`
(equivalent to Oniguruma over the subset the grammar uses) against a sample
buffer. Verified tokenizations, including the ones that would have been bugs:
`8'hFF`/`4'b10xz`/`32'sd10`/`'b1` take the based-literal rule and not the
decimal one (same start offset, so rule *order* decides — based is listed
first); `'0`/`'1`/`'x` are fill literals; `1.5e-3` and `10ns` are numeric;
`int'(x)` gives `int` the keyword and leaves `'(` alone; `` `define `` beats
the generic macro rule; `a = "s // not a comment"; // real` puts the `//`
inside the string and still finds the trailing comment; `s = "unterminated`
stops at the end of its line. `always @(*)` survives — which is the whole
reason `(* attributes *)` is not in the grammar.
- **Scope names were chosen from this machine's themes, not from convention.**
Grepped `theme-defaults/themes/{dark,light}_{vs,plus}.json` in VS Code
1.123.0 for what is actually coloured; bare `keyword` is, which is what makes
a flat `keyword.other.systemverilog` viable and lets the keyword list stay
generated. Recorded in the section above.
- **The duplicate-scope risk was checked against VS Code's shipped source**
(`TMScopeRegistry.register`): the warning fires only when the two
registrations point at *different* files. Same path, no warning. A test keeps
the paths identical.
- **Version 0.4.1** across `Cargo.toml`, `Cargo.lock` (regenerated by
`cargo check --workspace`, 8 crate entries), `editors/vscode/package.json`,
`package-lock.json` (both places), the two `.vsix` install examples in
`README.md` and `editors/vscode/README.md`, and the eleven version strings in
`tools/RELEASING.md`; `CHANGELOG.md` gains a `0.4.1 — 2026-08-24` section.
`editors/vscode/README.md:159`'s "since 0.4.0" is history and was left alone.
`target/debug/lucisv --version` → `lucisv 0.4.1`.
- **`RELEASING.md` grew one line**, because a `.vscodeignore` that swallowed
`syntaxes/` would ship an extension whose hovers are grey again with nothing
failing: the packaging step now checks the grammar is *in* the `.vsix`, next
to the existing check that `smoke.js` is out of it.
- Did not run `git commit` / `git push`. Did not touch `TODO.md` or the
umbrella README beyond its one `.vsix` version string.
**What was validated on this machine, precisely:**
| Check | Result |
|---|---|
| `cargo fmt --all --check` | clean |
| `cargo clippy --all-targets` | clean, no new warnings, no `#[allow]` added |
| `cargo test --workspace` | **34 test binaries, all green** (`lucisv_server`: 308 unit + 17 e2e + **3 new** grammar) |
| Negative control: keyword removed from the alternation | drift test fails, names `genvar` |
| Negative control: `"//.*"` → `"//(.*"` | validity test fails, names the pattern and the file path |
| `node --check extension.js` / `smoke.js` | both parse |
| `package.json`, `package-lock.json`, the grammar as JSON | all three load |
| `npx @vscode/vsce ls` | accepts the manifest — 324 files; `syntaxes/systemverilog.tmLanguage.json` listed, `smoke.js` still excluded |
| `node smoke.js ../../target/debug/lucisv-server` | `smoke: OK`, 8 messages, exit 0 |
| `target/debug/lucisv --version` | `lucisv 0.4.1` |
| Grammar patterns under Python `re` on a sample buffer | 13/13 compile; tokenization as listed above |
**Not run, and why:** no tokenization through `vscode-textmate` (not in
`node_modules`; adding it is a new dev dependency), and the extension still has
never run inside VS Code — `require('vscode')` resolves only in the extension
host, unchanged since 2026-08-19. What a human should look at once, in an
editor: a hover over a `` `define`` and over a `wire` declaration, in a `.sv`
file **and** a `.v` file, and the Developer Tools console for the absence of an
"Overwriting grammar scope name" warning.
### 2026-08-19 — dev agent
- Read `CLAUDE.md`, `README.md`, TODO.md §6 and
`docs/features/lucisv-server/README.md` (all of it, including the QA log) before
writing anything. Two things from that reading changed the work: the server's
**staleness model** and its **`lucisv.toml` blindness** are user-visible
behaviors, so both editor guides state them plainly instead of letting a user
discover them as bugs; and the QA log's hang investigation settled `smoke.js`'s
I/O shape before I wrote a line of it.
- **Did not touch `crates/`.** The one thing this feature wanted from another
module — config discovery — was already an open Handshake from the
lucisv-server round, so it is restated here with its now-visible user
consequence rather than fixed.
- **`vscode-languageclient` was taken, and the reasoning is written down.** The
brief floated a zero-dependency client; VS Code has no built-in generic LSP
API, so that would mean hand-writing framing, sync and capability handling in
JavaScript — the thing CLAUDE.md's `lsp-server` justification already
rejected on the Rust side. Pinned exactly (`9.0.1`, not `^9.0.1`) to match
the workspace's `=`-pinned Rust deps. Cost measured, not assumed: 8 packages,
no native modules, no install scripts.
- **Cut everything that was not "launch the server and register the file
types"**: no grammar, no `language-configuration.json`, no commands, no
status bar, no bundler, one setting. The table above records each cut and its
reason so the next person does not re-litigate them silently. The
`language-configuration.json` cut is the one I'd expect to be revisited — it
costs `Ctrl+/` comment toggling — and it is flagged as such rather than
hidden.
- **`smoke.js` is the round's real deliverable.** Everything else here is
configuration that can only be proven inside an editor; the spawn contract
can be proven in a shell, so it is. It mirrors `tests/e2e.rs` deliberately —
same write-everything-then-read shape, same hand-rolled framing, same reason
— but it is not a copy: it asserts what the *extension* depends on
(`rootUri: null` works, the four capabilities the guides promise are present,
the process exits 0), not what the server's internals do.
- **Verified `smoke.js` actually fails when it should**, which is the part
people skip. Two negative controls: a nonexistent binary → `FAIL … ENOENT`,
exit 1; `/bin/cat` as the "server" (echoes the frames straight back, so the
parse succeeds and the *content* is wrong) → `FAIL — initialize response
carries no capabilities`, exit 1. A smoke test that only ever passes is a
smoke test nobody has tested.
- **The Neovim guide's `vim.filetype.add` line was going to be boilerplate
until I checked.** In vim 9.1's `filetype.vim` (the tables Neovim's descend
from) `*.sv`/`*.svh` map to `systemverilog` outright, but `*.v` runs a
*content heuristic*, `dist#ft#FTv()`, that chooses between Verilog, Coq and
V, and **`*.vh` is not mapped at all**. So the line is load-bearing for
`.vh` headers and for short `.v` files, and the guide now says why, with the
Coq/V caveat.
- **Did not install the extension into the user's VS Code.** `code` is on this
machine and `code --install-extension` would have worked, but installing into
someone's editor is a change to their environment, not a validation step I
was asked for. The `.vsix` was built, inspected and deleted; the install
command is documented, unrun.
- **Concurrency note.** Midway through this round another agent's `lucisv_core`
round landed in the same tree — `crates/lucisv/src/{config,walk}.rs` moved to a
new `crates/lucisv_core`, and `crates/lucisv_server/Cargo.toml` gained a
dependency on it. That is exactly the Handshake `docs/features/lucisv-server`
filed and this feature restated, so the `lucisv.toml` caveat in the three
editor docs is likely to become false very soon. I left it as written: it was
true of the binary I built and smoke-tested, and the follow-up is recorded in
Status/TODO with the exact three places to edit. Nothing under `crates/` was
touched by me.
- Did not run `git commit` / `git push`. Did not modify any file under
`crates/`.
**What was actually validated on this machine, precisely:**
| Check | Result |
|---|---|
| `cargo build --release -p lucisv_server` | exit 0, `target/release/lucisv-server` |
| `node smoke.js target/release/lucisv-server` | **`smoke: OK` — 3 messages, exit 0** |
| `smoke.js` negative control: missing binary | FAIL, exit 1 (as designed) |
| `smoke.js` negative control: `/bin/cat` | FAIL on capabilities, exit 1 (as designed) |
| `package.json` parses as JSON | yes (`JSON.parse`) |
| `node --check extension.js` / `smoke.js` | both parse |
| `npm install` | 8 packages, `vscode-languageclient@9.0.1` resolved exactly, `engines.vscode ^1.82.0` matches ours |
| `npx @vscode/vsce package --skip-license` | **`.vsix` built** — 320 files, 462 KB, `smoke.js` correctly excluded by `.vscodeignore` |
**Authored but not run here, and why:**
- **The extension inside VS Code.** `require('vscode')` resolves only in the
extension host — confirmed by trying: requiring `vscode-languageclient/node`
outside VS Code throws `Cannot find module 'vscode'`. So `activate()` is
unexercised. What *is* proven: the file parses, the dependency resolves and
matches the declared engine, the package builds into an installable `.vsix`,
and the spawn contract the `activate` path uses works against the real
binary.
- **Every Vim/Neovim snippet.** No `nvim` on this machine (`command -v nvim`:
nothing; `vim` 9.1 exists, without `vim-lsp`). Expected behavior on a machine
that has it: `:checkhealth vim.lsp` shows one client `lucisv` attached to the
buffer with `documentFormattingProvider`, `hoverProvider`,
`definitionProvider`, `referencesProvider`, `documentSymbolProvider`,
`workspaceSymbolProvider` and `semanticTokensProvider` set and
`positionEncoding` `utf-16`; `K` on a `` `MACRO `` shows its definition; `gd`
on a signal jumps to its declaration. The two server-side facts those
snippets rest on were checked independently rather than assumed: the
no-root/single-file `initialize` (asserted by `smoke.js`) and the filetype
mapping (read out of vim 9.1's `filetype.vim`, above).
- **`code --install-extension`** — deliberate, see above.
### 2026-08-24 — lead (0.4.2): default colour decorators off for our languages
Owner report: `#200 $finish;` (clkdivider_tb.v:24) showed an RGB colour
swatch. Diagnosis, verified on the owner's machine: no installed extension
provides document colours, `lucisv-server` advertises no colour capability,
and the owner's settings carry no override — the swatch is VS Code's
built-in default colour provider (`editor.defaultColorDecorators`,
default `auto` since 1.78, owner runs 1.134), which pattern-matches
CSS-style hex like `#200` in languages where no real provider exists.
Fix: `contributes.configurationDefaults` sets
`"editor.defaultColorDecorators": "never"` scoped to `[verilog]` and
`[systemverilog]` only — a default, user-overridable, and invisible to
every other language. Lead-authored directly (ten manifest lines; the
dev/QA loop would have added latency, not safety); verification run:
JSON parses, `vsce ls` accepts, smoke OK, full workspace suite green.
## QA log
### 2026-08-24 — QA agent (0.4.1, the TextMate grammar)
Scope: the grammar, its two new tests, the fence audit, and the version bump.
Did not re-verify the 0.4.0 extension surface (`extension.js`, `smoke.js`,
`vscode-languageclient`) beyond confirming it is unchanged — see the diff
check below. No source was edited beyond the mutation-check round-trip (grammar
JSON temporarily mutated, then restored and md5-verified — see below); this
entry is the only lasting write.
**Gates — all green, matching the dev's numbers exactly.**
| Check | Result |
|---|---|
| `cargo fmt --all --check` | clean |
| `cargo clippy --all-targets` | clean, 0 warnings |
| `cargo test --workspace` | all green |
| `cargo test -p lucisv_server` | **308 unit + 17 e2e + 3 grammar**, all passing — matches the claim exactly |
| `node --check extension.js` / `smoke.js` | both parse |
| `npx @vscode/vsce ls` | **324 files**, `syntaxes/systemverilog.tmLanguage.json` listed (line 7), `smoke.js` absent — matches the claimed count exactly |
| `cargo metadata` | all 8 workspace crates report `0.4.1` |
**Drift-test mutation check (`the_grammars_keywords_are_exactly_the_lexers`),
independently re-run.** Removed `|genvar|` from
`editors/vscode/syntaxes/systemverilog.tmLanguage.json`'s keyword alternation
via a small Python script, re-ran the test: failed exactly as claimed —
`missing: ["genvar"]`. Restored from a backup copy taken before the mutation;
`md5 -q` before and after the restore both report
`3aa7799b07a19cd52cf07713812b7054`; `git diff --stat` on the file is empty
after restore; all three grammar tests green again. The dev's second negative
control (`"//.*"` → `"//(.*"` on `every_pattern_is_a_plain_regex`) was not
independently re-run — the assertion it exercises (`balanced()`) was read and
is straightforward enough to trust by inspection.
**Fence audit — `git diff` on the three touched crate files, read in full.**
`hover.rs` and `completion.rs` diffs are assertion-only, exactly as claimed:
each new line either pins the `` ```systemverilog\n `` fence prefix in an
existing test or is a comment explaining why. No non-test line changed in
either file. `signature.rs` has no diff at all (`git status --short` shows
nothing for it). Matches the Work log's audit table.
**Registration claim (package.json).** Both `contributes.grammars` entries
name `scopeName: "source.systemverilog"` and
`path: "./syntaxes/systemverilog.tmLanguage.json"` — identical, as required
for the "same file, no warning" claim to hold. `contributes.languages` declares
exactly `verilog` and `systemverilog`, matching the two grammar entries'
`language` fields. `engines.vscode` is `^1.82.0`. The "checked against VS
Code's own shipped source" claim (`TMScopeRegistry.register`, quoted with a
real file path and version 1.123.0) reads as genuinely verified-against-source
rather than invented — it names a specific function and a specific
warn-only-on-mismatch condition, not a paraphrase. **One gap worth recording,
not blocking:** the source was read on VS Code 1.123.0, and the extension
declares compatibility down to `^1.82.0` — roughly three years and 40+ minor
versions earlier. Nothing here suggests `TMScopeRegistry.register`'s
warn-on-mismatch behavior changed in that span, but the doc doesn't say the gap
was considered, and "checked on this machine" is not the same claim as
"checked across the declared engine range." Low priority: even in the worst
case (a console warning on old VS Code versions), the grammar still registers
and still colors correctly — the risk is a log line, not a highlighting
failure.
**Tokenization — regexes run for real, two engines, no vscode-textmate
added.** Wrote a throwaway Node script
(`scratchpad/tokenize.js`, not committed) that (1) compiles every
`match`/`begin`/`end` string with `new RegExp` — all 13 compile — and (2)
hand-implements the TextMate first-match-wins scan (per-line, block-comment
state carried across lines, string end resolved per-line) using the grammar's
own pattern order, and ran it against the requested adversarial lines. Cross-
checked the one finding below against Python's `re` too (the dev's own stated
methodology), not just Node's engine.
Confirmed correct, matching the doc's claims exactly: `8'hFF_AB`, `4'b10xz`,
`'0`, `32'sd10`, `'h1F` (based/fill win over the decimal rule); `1.5e-3`,
`10ns` (decimal/time rule); `always @(*)` (`always` is the only token colored,
`@(*)` stays plain — the attribute pattern was correctly left out); `(* full_case
*)` (entirely plain, does not disturb the trailing statement — the omission is
safe as designed); `"s // not a comment"` (the whole thing is one string token,
`//` does not start a comment inside it); `// comment with "quote` (the whole
line is one comment token, the quote does not start a string); two `/* */
... /* */` on one line (two independent block-comment tokens, code between
them plain); `` `define X 8'hFF `` (directive then based-literal, cleanly
split); `` `MY_MACRO(a,b) `` (macro token stops at the identifier, `(a,b)`
plain); backtick inside a `//` comment (stays comment, no directive/macro
token generated); `$display`, `$clog2` (system-task token, correct); `logic_t
foo;` and `xor_gate bar;` (entirely plain — the keyword rule's `\b...\b`
correctly refuses to match a keyword that is only a prefix of a longer
identifier); `1step` (matches nothing — not a number, not a keyword; sits as
plain text, which is a fair reading of "deliberately omitted", though the doc
only says the omission exists and doesn't say what it renders as).
**Finding A (confirmed, not blocking, but real and reproducible) — `x$y`
splits into `x` (plain) + `$y` (`support.function.system`).** The
system-tasks pattern is `\$[a-zA-Z_][a-zA-Z0-9_$]*`
(`editors/vscode/syntaxes/systemverilog.tmLanguage.json:53`) with no boundary
check on what precedes the `$`. SystemVerilog identifiers may legally contain
`$` after the first character (`[a-zA-Z_][a-zA-Z0-9_$]*`), so `x$y` is a valid
identifier, not `x` followed by a system task — but the grammar colors the
`$y` tail as if it were one. Reproduced identically in Node (the hand-written
scanner) and in Python's `re` (`pat.search("x$y = 1;")` → `('$y', 1)`, run
independently of the scanner). This is exactly the risk the brief asked to
check ("does the regex have a boundary?") — it does not.
Severity assessment: cosmetic, not a corruption risk under CLAUDE.md's
invariant #1 — this grammar colors a hover-card fence or a buffer, never the
formatter's output, so no code is ever rewritten because of it. A genuine fix
needs a negative lookbehind (`` (?<![a-zA-Z0-9_$])\$... ``), which is the exact
class of Oniguruma-only construct `every_pattern_is_a_plain_regex` forbids —
so this may be the same kind of accepted trade-off the README already made
explicitly for `(* attributes *)`. The difference: the attribute trade-off is
written down with its reasoning in "Deliberate omissions"; this one is not
mentioned anywhere, so a reader of the pattern-inventory table (`` `$display`,
`$clog2` ``) would not learn that a `$`-containing identifier can mis-color.
Recommend adding one line to "Deliberate omissions" naming this, the same way
the attribute trade-off is named — not fixing the regex, since fixing it
trades one forbidden construct for another and `$`-in-the-middle identifiers
are rare in practice. Not fixed here: it's a documentation gap and a
judgment call about the grammar's design, not a typo.
**Finding B (confirmed, not blocking, minor) — an unterminated block comment
bleeds to the end of the buffer, and only the string rule was hardened against
the analogous failure.** `strings.end` is `` "\"|$" `` specifically so "an
unterminated string cannot bleed down a hover card" (the README says so in the
pattern inventory). `comments.block` has no such fallback: `begin: "/\\*"`,
`end: "\\*/"`, and if `\*/` never appears, the block-comment state carries
across every remaining line — verified in the scanner with a 3-line buffer
(`code /* oops` / `more code` / `last line`): all three lines end up entirely
`comment.block` from the point of `/*` onward. Blast radius is bounded to the
current hover card's fenced snippet (hover fences are the declaration/macro
text, not the whole document), not "the whole file" the README worried about
for the attribute case, so this is meaningfully smaller than that risk — but
it is the same shape of risk, and the doc discusses the mitigation it *did*
add (strings) without mentioning the one it didn't (comments). Plausible
trigger: a macro body captured verbatim by `` `define`` that itself contains
an unclosed `/*` (a real authoring mistake, not a contrived case) would render
the rest of that hover card dimmed as a comment. Not fixed here, same reasoning
as Finding A — a doc note, not a code change, is the right-sized response.
**No BLOCKING findings.** Gates green, counts exact, mutation controls behave
exactly as claimed, fence audit clean, registration correct. Findings A and B
are both display-only, bounded in scope, and already structurally similar to a
trade-off the README makes explicitly elsewhere — recommend documenting both
in "Deliberate omissions" before the next version bump, but neither blocks
this one shipping.
**Verdict: ship.** The core claim — hover cards and completion documentation
render highlighted, via a grammar registered for both language ids, verified
by a drift test that actually catches drift — holds up under adversarial
tokenization testing, not just the happy-path patterns the dev's own Python
session checked.
### 2026-08-19 — QA agent
**Build tested:** `HEAD` at `c8b936a7` plus the working tree exactly as it
stood (20 changed/untracked paths, `git status --short`), rebuilt twice
(`cargo build --release -p lucisv_server`, both times "Finished ... in 0.02s" —
already up to date, so one stable binary throughout this pass:
`target/release/lucisv-server`, 1,996,608 bytes, md5 `ed84f61d8c414e34d840571`
`f8696191e`, mtime 09:26). This build **includes the concurrent
`lucisv_core` config/walk lift** (`crates/lucisv_core/src/{config,walk}.rs`,
`crates/lucisv_server` depends on it) — see the Finding below. Did not touch
anything under `crates/`; rebuilt only to confirm the binary was settled
before each spawn-based check, per the lead's note that the lucisv_core-lift
agent was doing its own final gate runs concurrently.
**Validation matrix — all green, re-run to completion:**
| Check | Result |
|---|---|
| `cargo build --release -p lucisv_server` (x2, bracketing the session) | exit 0 both times, binary unchanged between runs |
| `node smoke.js ../../target/release/lucisv-server` | `smoke: OK` — 3 messages, exit 0 (re-run at session end too) |
| Negative control: `node smoke.js /nonexistent/lucisv-server` | `FAIL — could not spawn ... ENOENT`, exit 1 |
| Negative control: `node smoke.js /bin/cat` | `FAIL — initialize response carries no capabilities`, exit 1 |
| `node --check extension.js` / `smoke.js` | both parse clean |
| `python3 -c json.load` on `package.json` | valid JSON |
| `wc -l extension.js` / `smoke.js` | 41 / 93 — both claims exact |
| `npm ci` in a scratch copy (not `node_modules`, the real one untouched) | 8 packages, `vscode-languageclient@9.0.1` resolved exactly (`npm ls --all` tree matches the README's dependency table verbatim) |
| `npx @vscode/vsce package --skip-license` | **see Finding 2 below — required relocating the copy out of the scratchpad path** |
| `.vsix` contents (`unzip -l`) | 320 files, 462.22 KB (dev's numbers exact); `smoke.js`, `.gitignore`, `.vscodeignore` all absent, `extension.js`/`package.json`/`readme.md`/`node_modules/*` present |
**Finding 1 (confirmed, significant, not blocking function) — the
`lucisv.toml`-blindness caveat is now false against the tested binary.**
The `lucisv_core` lift landed in the working tree (uncommitted) and
`crates/lucisv_server` already consumes it: `cargo test -p lucisv_server --release
format::` passes `a_config_file_beats_the_editors_tab_size` and
`a_lucisv_toml_governs_the_buffer_it_sits_above`, both asserting `lucisv.toml`
wins over the client's tab size. I additionally drove a live LSP round-trip
against the built binary (scratch dir with `lucisv.toml` containing
`indent = 4`, `.git` marker, `rootUri` pointing at it) and requested
`textDocument/formatting` with `tabSize: 2`: the response's `newText` used
4-space indent, i.e. the config file won over the client, over the wire, on
this exact binary. This means the caveat "the server does **not** read
`lucisv.toml` yet" is no longer true of the binary these docs describe. It
appears verbatim in all three places `docs/features/editor-packaging/README.md`'s
own Status/TODO already flagged: top-level `README.md` (Editor setup
section), `editors/vscode/README.md` (Settings section), and
`editors/nvim/README.md` ("What you get, and what you don't" section) — plus
it's echoed in this feature's own Assumptions/Handshakes/Status-TODO/Work-log
prose. Per the lead's instruction this cleanup belongs to the lead / the
lucisv-server docs owner, not to this QA pass, so I have not edited any of
those five locations — reporting precisely instead, as asked. Locations,
for the fix: `README.md` (top-level, "Editor setup"), `editors/vscode/README.md`
(Settings), `editors/nvim/README.md` ("What you get"), plus (not previously
flagged by the dev, since it's this feature's own doc) this file's Assumptions,
Handshakes and Status/TODO sections restate the same now-false claim and
should get the same pass when the caveat is retired.
**Finding 2 (environment artifact, not a defect in the feature) — `vsce
package` fails inside the assigned scratchpad path.** Copying
`editors/vscode` (minus `node_modules`) into
`.../9ecac3b9-8a0e-4065-85de-23cc2a396bad/scratchpad/vscode_copy` and running
`npm ci` + `npx @vscode/vsce package --skip-license` there fails every time
with `ERROR Extension entrypoint(s) missing ... extension/extension.js`, and
`vsce ls` silently lists zero files. Reproduced with a *minimal* two-file
extension (bare `package.json` + `extension.js`, no `.vscodeignore`) in the
same scratchpad tree — same failure — and confirmed it packages fine when
the identical minimal extension sits in a plain path (`/tmp/vsce_plain_test`,
no UUID segment). Root cause traced into `@vscode/vsce`'s `collectAllFiles`
(`out/package.js`): it shells out to `npm list --production --parseable
--depth=99999` to get the directories to glob, and on this machine
(`node v26.7.0`, `npm 11.19.0`) that command's own captured output for a
cwd under the scratchpad's UUID-bearing path came back with the UUID
segment replaced by `***` when written to a file — i.e. something in this
sandbox rewrites that specific path shape somewhere in the child-process
output pipeline, and `vsce` then globs a path that doesn't exist, silently
getting zero files. This is **not** a defect in `editors/vscode` — it
reproduces identically for a trivial unrelated extension — so I re-ran the
`npm ci` + `vsce package` step in a copy under plain `/tmp` (deleted
immediately after, along with the scratchpad copy) to get a real result; see
the validation matrix above. Flagging so nobody mistakes "vsce fails" for a
packaging regression if they hit this same scratchpad-path issue later.
**Claims verified, no issues found:**
1. **`package.json`** — languages `verilog` (`.v`/`.vh`) and `systemverilog`
(`.sv`/`.svh`) exactly as claimed; `activationEvents` is
`["onLanguage:verilog", "onLanguage:systemverilog"]`, matching the
language ids character-for-character (no typo — this was checked
specifically, since a mismatch here is the "silently never activates"
failure mode); one setting `lucisv.serverPath` default `"lucisv-server"`;
`vscode-languageclient` pinned `"9.0.1"` (no `^`), confirmed both in
`package.json` and resolved exactly in `package-lock.json`
(`lockfileVersion: 3`) and in a fresh `npm ci`; `engines.vscode` is
`^1.82.0` on both `package.json` and matches the feature README's prose;
`publisher` is the literal string `REPLACE-ME`; `.vscodeignore` excludes
`smoke.js` (plus `.vscode/**`, `.gitignore`) — confirmed absent from the
built `.vsix`.
2. **`extension.js`** — read every line, 41 total (`wc -l` exact). Spawns
`serverPath` read from `lucisv.getConfiguration('lucisv').get('serverPath')`
with fallback `'lucisv-server'`; `serverOptions = {command, args: [],
transport: TransportKind.stdio}` matches `vscode-languageclient@9.0.1`'s
`Executable` interface (`lib/node/main.d.ts`: `command`, `transport?`,
`args?`, `options?`) exactly; `documentSelector: [{language: 'verilog'},
{language: 'systemverilog'}]` matches the contributed language ids
exactly; `new LanguageClient('lucisv', 'lucisv', serverOptions,
clientOptions)` matches the 4-arg `(id, name, serverOptions,
clientOptions, forceDebug?)` overload in `main.d.ts`; `deactivate()`
returns `client.stop()` so VS Code awaits shutdown. No other features
present. **Spawn-failure behavior traced through the library source**
(`lib/common/client.js`, `lib/node/main.js`): on ENOENT, `cp.spawn`
yields no pid, `handleChildProcessStartError` rejects, the client's own
`createConnection` catch calls `this.error(..., 'force')`, which *always*
shows a `window.showErrorMessage` popup (with a "Go to output" button)
and appends to the `lucisv` output channel regardless of
`revealOutputChannelOn` — `extension.js` itself doesn't need a `.catch()`
on `client.start()` because the library never lets a spawn failure go
unsurfaced. This matches the README's troubleshooting text ("See what the
server is saying... View → Output → the lucisv channel"); the README could
additionally mention the error popup explicitly but doesn't claim silence,
so nothing here is inaccurate, just slightly less complete than it could be.
3. **`smoke.js`** — zero-dep (`require('child_process')` only), 93 lines
exact. Ran clean against the release binary and both negative controls
(missing binary, `/bin/cat`) exactly as claimed — see validation matrix.
4. **`editors/nvim/README.md`** — all four client variants present
(`vim.lsp.config` 0.11+, `nvim-lspconfig` 0.9/0.10, Vim 9 `vim-lsp`
one-liner, coc.nvim `coc-settings.json`); root markers
`lucisv.toml`/`.lucisv.toml`/`.git` consistent across all four; the
`vim.filetype.add` line's load-bearing claim was checked directly against
`/usr/share/vim/vim91/filetype.vim` on this machine (vim 9.1, matches
what the dev cited): `*.sv,*.svh` map straight to `systemverilog`
(line 2828), `*.v` runs through `dist#ft#FTv()` (line 2822, defined in
`/usr/share/vim/vim91/autoload/dist/ft.vim:1523`, which sniffs buffer
content), and `grep '\.vh\b' filetype.vim` finds nothing — `.vh` is
genuinely unmapped. The doc's description of all three is accurate.
Single-file-mode claim (`single_file_support = true`) is backed by the
server accepting `initialize` with `rootUri: null` — confirmed live both
by `smoke.js` and by my own `probe.js` round trip.
5. **Honesty of the authored-vs-validated split** — confirmed on this
machine: `command -v nvim` → not found; `vim --version` → 9.1 present;
searched `~`, `~/.vim`, `~/.vimrc`, `~/.config/nvim`, and
`find / -maxdepth 6 -iname '*vim-lsp*'` → nothing, so "vim without
vim-lsp" is accurate and unchanged from the dev's own check. The "extension
never run inside VS Code" claim is consistent with reality: `require`ing
`vscode-languageclient/node` outside the extension host throws
(`Cannot find module 'vscode'`), so `activate()` genuinely cannot be
exercised from a shell. TODO.md §6's "Editor packaging" item is `[x]`
and its one-line summary (extension shape, dependency, filetype mapping,
manual-install scope) matches what's actually in `editors/`. All seven
required feature-README sections (Goal, Assumptions, Handshakes,
Status/TODO, Work log, QA log, Review) are present in this file.
**Overall: PASS**, with Finding 1 (stale `lucisv.toml` caveat, now confirmed
false, not this feature's docs to fix) as the one substantive issue,
recorded for the lead. No language-id/activation mismatch, no smoke
failure against the current binary — the two conditions the brief called
BLOCKING did not occur. Finding 2 is an environment note, not a shipped-code
defect. No files under `editors/` or `crates/` were modified by this QA pass;
this entry is the only edit made.
## Review
**2026-08-19 — lead. Verdict: accepted; commits with round 12. TODO §6 —
the owner's editor requirement — closes with this feature.**
Points reviewed and accepted:
1. **The authored-vs-validated split is the feature's backbone** and it
was kept honest on both sides: everything validatable headless was
actually run (the .vsix built and inspected, smoke passed with
negative controls proving it can fail, npm ci reproducibility), and
what can't run here (the extension host, the editor snippets) is
labeled as such with the exact expected behavior stated. QA then
re-ran the whole matrix independently and cross-checked the client
API shapes against the library's own type definitions — the
language-id consistency check (the silent-killer class for VS Code
extensions) came back clean.
2. **`vscode-languageclient` taken, not avoided**: VS Code has no
built-in generic LSP client; hand-rolling one is the same trade
CLAUDE.md already rejected for `lsp-server`. Justified, pinned,
cost-measured (8 packages, no native modules).
3. **The `vim.filetype.add` discovery** — `*.v` goes through Vim's
content heuristic and `*.vh` is unmapped natively, so the snippet
line is load-bearing — is exactly the kind of verified-against-
runtime fact these READMEs exist to hold; QA confirmed it
byte-for-byte against this machine's filetype.vim.
4. QA's Finding 1 (the "server doesn't read lucisv.toml" caveat went
stale mid-round when lucisv-core-lift landed under it) was the lead's
to fix and is now fixed in all flagged locations, including the
lucisv-server README's superseded Assumptions. Finding 2 (vsce's path
resolution breaking inside the session scratchpad) is an
environment artifact, correctly diagnosed by reproducing it on an
unrelated minimal extension.
Remaining editor work is deliberately out of scope and stays visible:
publishing (a real publisher id, marketplace/OpenVSX), extension-host
integration testing, and lint diagnostics reaching the editor once the
server wires vlog_linter in.
### 2026-08-24 — lead review of the grammar (hover highlighting)
Approved after QA's ship verdict; gates run independently (1295 tests, 0
failures, clippy silent). The server was already fencing hover markdown as
`systemverilog` — the whole feature is the missing TextMate grammar, and
the shape is right: keywords generated from `vlog_parser::KEYWORDS` with a
mutation-checked drift test, a lookaround-free pattern set QA exercised
under real first-match-wins semantics, and the double-registration trick
verified against VS Code's own source. Dev's deliberate omissions all
approved; QA's two cosmetic finds (`x$y`, unterminated `/*`) are accepted
trade-offs I have added to "Deliberate omissions" above rather than fix —
each fix needs a lookbehind or buys nothing. Ships as 0.4.1.