diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..8435edf Binary files /dev/null and b/.DS_Store differ diff --git a/.gitignore b/.gitignore index f62fcd8..d87ba8a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,5 @@ /corpus /corpus-check-results.tsv /dist -/.vfmt_cache +/.lucisv_cache /.score-results.tsv diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e6ab97..a381596 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -All notable changes to vfmt are recorded here. Versions follow +All notable changes to lucisv are recorded here. Versions follow [semantic versioning](https://semver.org/); until 1.0 the CLI's exit codes (see `README.md`) are the only frozen contract. @@ -16,7 +16,7 @@ than its opener: VS Code re-indents every snippet line after the first with the trigger line's own indentation, and the server was baking that indentation in as well. Ghost bodies are now indented *relative* to the trigger line — the editor's own `tabSize`/`insertSpaces` place them, so -`begin` and `end` align in any indent style (`vfmt.indent` no longer sizes +`begin` and `end` align in any indent style (`lucisv.indent` no longer sizes them). The completion popup's multi-line skeletons had the same latent double indent since 0.4.0; they keep their layout and now tell the editor `insertTextMode: asIs` instead. @@ -42,7 +42,7 @@ at the end of a line and its `end` does. Tab accepts as a snippet — the cursor lands in the condition first and on the indented body line second. This is LSP 3.18 `textDocument/inlineCompletion`: token-based triggers (a comment, a string or `my_if` never fire), offered only while the construct -is genuinely unclosed, indented to the site. `vfmt.inlineTemplates: false` +is genuinely unclosed, indented to the site. `lucisv.inlineTemplates: false` turns it off. The VS Code extension opts into the still-proposed client feature; Neovim's built-in client does not speak it yet, and those users keep the same skeletons in the completion list. Details: @@ -60,7 +60,7 @@ independent old-algorithm oracles kept as regression tests. ## 0.5.0 — 2026-08-25 -The navigation release. `0.3.0` taught vfmt to *change* a project and `0.4.0` +The navigation release. `0.3.0` taught lucisv to *change* a project and `0.4.0` to complete what you are typing; this one is about reading one you did not write — who instantiates this module, which file defines this macro, what does this ordered connection actually connect, and what does this macro call turn @@ -109,7 +109,7 @@ quoted path and `textDocument/definition` jumps to the file, resolved through the including file's own directory and then each `+incdir+` of the configured filelist in order (the `` form skips the first rung). The same graph makes hover on `` `NAME`` prefer the definition the hovered file actually -*reaches* through its includes — the first thing vfmt has that can order two +*reaches* through its includes — the first thing lucisv has that can order two definitions of one macro name. Where the graph orders nothing, the honest all-candidates list from before still stands. Details: [include-nav](docs/features/include-nav/README.md). @@ -134,13 +134,13 @@ a name refers to. **All three are off by default** and are opted into with `--select`: they are diagnose-only, they see one file at a time (a signal driven by a cross-module connection is not yet visible to them), and a semantic rule that cries wolf costs an engineer a debugging session and their trust in -the tool. A default `vfmt check` is byte-for-byte what it was, and pays nothing +the tool. A default `lucisv check` is byte-for-byte what it was, and pays nothing for the analysis it does not run. Details: [semantic-lints](docs/features/semantic-lints/README.md). -### `vfmt -f project.f` +### `lucisv -f project.f` -The CLI gets the front door the language server got in `0.3.0`: `vfmt -f +The CLI gets the front door the language server got in `0.3.0`: `lucisv -f project.f` formats or checks exactly the files an EDA filelist names, nested `-f` and `$VAR` expansion included. The flag is repeatable and combines with positional paths; a path the filelist names is a named path, so `--exclude` @@ -157,7 +157,7 @@ and the card says so; `` `"`` and ```` `` ```` pass through as written; string literals and escaped identifiers are not substituted into. An argument count that does not match the parameter list expands nothing at all rather than guessing, and where hover lists several candidate definitions there is no -winner to expand. vfmt still does not preprocess — this is bookkeeping shown in +winner to expand. lucisv still does not preprocess — this is bookkeeping shown in a tooltip, and the formatter cannot see it. Details: [macro-expansion](docs/features/macro-expansion/README.md). @@ -218,7 +218,7 @@ position, a declaration at both — and **by dialect**: a `.sv` file is offered so nothing on the list is code the buffer's own compiler would reject. A client that does not understand snippets gets the same skeleton with its defaults filled in rather than a buffer full of `${1:…}`. Every template's untouched -expansion is parsed by vfmt's own parser in the test suite, which is what keeps +expansion is parsed by lucisv's own parser in the test suite, which is what keeps the list honest. Details: [completion-templates](docs/features/completion-templates/README.md). @@ -240,17 +240,17 @@ only the first three of those have a visible default: `foreground4`, `5` and `6` default to fully transparent and are left for themes to define, which most themes never do. Any `begin`/`end` at nesting depth 3, 4 or 5 was therefore painted transparent, and the keyword vanished from the screen. The rainbow now -uses its own colours, `vfmt.rainbow1` … `vfmt.rainbow6`, contributed by the +uses its own colours, `lucisv.rainbow1` … `lucisv.rainbow6`, contributed by the extension with an opaque default for dark, light and both high-contrast themes; they appear under Workbench → Appearance → Color Customizations like any other theme colour, so a theme or a `workbench.colorCustomizations` entry can still override them. Levels 1–3 keep VS Code's familiar bracket hues so nothing changes for the depths that already worked. -The same round makes the other half of the story visible: `vfmt/scopePairs` now +The same round makes the other half of the story visible: `lucisv/scopePairs` now also reports **unmatched** block delimiters — a `begin` whose `end` never arrived, an `end` that closes nothing — and the extension paints them in a -bright error red (`vfmt.rainbowUnmatched`) instead of leaving them as ordinary +bright error red (`lucisv.rainbowUnmatched`) instead of leaving them as ordinary uncoloured text. Typing a fresh `begin` now shows red until its `end` exists, rather than showing nothing at all. Matched pairs, their nesting depths and the missing-`end` warnings are unchanged. Details: @@ -266,10 +266,10 @@ you are typing. ### Project scope: filelists -vfmt now accepts a standard EDA **filelist** (`-f` style: one path per line, +lucisv now accepts a standard EDA **filelist** (`-f` style: one path per line, nested `-f`, `+incdir+`/`+define+`, `#` and `//` comments, `$VAR`/`${VAR}` expansion, unknown `+args`/`-flags` skipped with a warning). When one is -configured — `vfmt.filelist` in the editor, or a `filelist` key in `vfmt.toml` +configured — `lucisv.filelist` in the editor, or a `filelist` key in `lucisv.toml` — it defines *exactly* the set of files the language server indexes, which is what a project with a build already says out loud. Without one the scope ladder falls back to the workspace-folder walk, and, when no folder was opened at all, @@ -290,7 +290,7 @@ collision with an existing name in any affected scope, on an invalid identifier, and whenever any touched file would no longer parse — whole-edit- or-nothing, the same contract the formatter has always had. Occurrences inside a `` `define`` body or an `` `ifdef``-excluded arm are reported as a warning and -left alone, because vfmt does not preprocess. Details: +left alone, because lucisv does not preprocess. Details: [rename](docs/features/refactor-rename/README.md). ### Module signature changes @@ -341,19 +341,19 @@ files answer a request in about 300 µs. Details: ### Editors -One new setting, `vfmt.filelist`, forwarded like the rest of `vfmt.*`. +One new setting, `lucisv.filelist`, forwarded like the rest of `lucisv.*`. Everything else in this release arrives through the server, so no editor configuration changes. ## 0.2.0 — 2026-08-19 The first released version. `0.1.0` was the workspace's initial version number -and was never tagged or published, so these notes describe vfmt as it stands +and was never tagged or published, so these notes describe lucisv as it stands rather than a delta against a shipped predecessor. -vfmt is a formatter, a linter and a language server for Verilog-2001 and the +lucisv is a formatter, a linter and a language server for Verilog-2001 and the synthesizable SystemVerilog subset — one parser and one style engine behind a -CLI (`vfmt`) and an LSP binary (`vfmt-server`). +CLI (`lucisv`) and an LSP binary (`lucisv-server`). ### Formatter and the safety net @@ -366,7 +366,7 @@ and trailing trivia and are never dropped. **Every format is verified at runtime**: the output is re-lexed and its token stream (comments included) compared against the input, then formatted a second time and checked for a fixed point; if either check fails the output is discarded and the file is -left byte-for-byte untouched. `// verilog_format: off` / `// vfmt: off` fences +left byte-for-byte untouched. `// verilog_format: off` / `// lucisv: off` fences return the enclosed items as their exact source bytes, indentation included. Deep nesting is a normal parse error with a position rather than a stack overflow. Details: [formatter](docs/features/formatter-bug-fixes/README.md), @@ -380,13 +380,13 @@ overflow. Details: [formatter](docs/features/formatter-bug-fixes/README.md), ### Command line -`vfmt ` formats files and directories in place. `--check` and `--diff` +`lucisv ` formats files and directories in place. `--check` and `--diff` are the CI modes (exit 1 if anything would change, nothing written); `-` reads stdin, with `--stdin-filename` naming the buffer. Directory walks honor `.gitignore` (a documented subset) and repeatable `--exclude` patterns, and run on all cores — `--threads N` pins the worker count without changing a single output byte, since results are collected in input order. Settings live in a -`vfmt.toml` / `.vfmt.toml` discovered upward from each input, ruff-style, with +`lucisv.toml` / `.lucisv.toml` discovered upward from each input, ruff-style, with CLI flags taking precedence per setting; an unknown key or a bad value is a hard error naming the file and line. The exit-code contract (0 / 1 / 2) is frozen and documented. A panic on one file cannot take down the run. Details: @@ -396,14 +396,14 @@ frozen and documented. A panic on one file cannot take down the run. Details: ### Linter -`vfmt check` is a ruff-shaped linter over the same files, the same walk and the +`lucisv check` is a ruff-shaped linter over the same files, the same walk and the same config discovery as the formatter: a rule registry, `--select` / `--ignore`, `--output-format json`, and fixes classified safe or unsafe with `--fix` applying only the safe ones. Eight syntactic rules ship — `no-tabs`, `no-trailing-whitespace`, `case-missing-default`, `always-ff-non-blocking`, `always-comb-blocking`, `explicit-parameter-storage-type`, `module-filename` and `unused-waiver`. Inline waivers use Verible's spelling -(`// vfmt: waive `, `waive-start` / `waive-stop`, with `verilog_lint:` +(`// lucisv: waive `, `waive-start` / `waive-stop`, with `verilog_lint:` accepted as an alias), so code already annotated for Verible lints unedited. `check` runs on the error-tolerant parser, so a file the formatter refuses is still linted for what can be read. Violations inside a format fence are @@ -414,30 +414,30 @@ uses. Details: [linter](docs/features/linter-core/README.md), ### Language server -`vfmt-server` speaks LSP over stdio from a single binary and serves every +`lucisv-server` speaks LSP over stdio from a single binary and serves every editor the same answers: `textDocument/formatting` (honoring the file's own -`vfmt.toml`, which wins over the editor's tab size), parse **errors** and lint +`lucisv.toml`, which wins over the editor's tab size), parse **errors** and lint **warnings** in one diagnostic publish per change, `codeAction` quick fixes -plus `source.fixAll.vfmt` for fix-on-save, `semanticTokens/full`, hover +plus `source.fixAll.lucisv` for fix-on-save, `semanticTokens/full`, hover (declaration snippets and `` `define`` expansion, in-file and across the workspace), go-to-definition, in-file references, and document and workspace symbols. Underneath it are a single-file semantic model (scopes, symbols, references) and a workspace index that resolves names arriving through package imports and module instantiations across files. Not yet advertised, and said so out loud: range formatting, cross-file references, completion, rename and -signature help. Details: [server](docs/features/vfmt-server/README.md), +signature help. Details: [server](docs/features/lucisv-server/README.md), [lint wiring](docs/features/server-lint/README.md), [semantic model](docs/features/vlog-semantic/README.md), [workspace index](docs/features/workspace-index/README.md), [define table](docs/features/define-table/README.md), [name spans](docs/features/name-spans/README.md), -[shared core](docs/features/vfmt-core-lift/README.md). +[shared core](docs/features/lucisv-core-lift/README.md). ### Editors A thin VS Code extension in `editors/vscode/` registers the file types (`.v`/`.vh` → `verilog`, `.sv`/`.svh` → `systemverilog`) and starts the server; -it has one setting, `vfmt.serverPath`, and no language logic of its own — +it has one setting, `lucisv.serverPath`, and no language logic of its own — everything a user sees comes from the server. Install it by building the `.vsix` and sideloading it (`tools/release.sh`, then `code --install-extension`); publishing to a marketplace is optional and @@ -450,10 +450,10 @@ Details: [editor packaging](docs/features/editor-packaging/README.md). ### Real-world corpus -vfmt is measured against an 820-file corpus of open-source RTL +lucisv is measured against an 820-file corpus of open-source RTL (picorv32, ibex, common_cells, OpenTitan) rather than against its own fixtures alone. At this release **476 of 820 files (58.0%) parse and format cleanly, -with zero verification errors and zero crashes** — every file vfmt cannot +with zero verification errors and zero crashes** — every file lucisv cannot handle is a documented parse error, never a corrupted output. The remaining gap is unsupported syntax, ranked by measured impact in `README.md`'s roadmap: classes/constraints (the largest block, and mostly DV rather than RTL), `bind`, diff --git a/CLAUDE.md b/CLAUDE.md index b0b7957..648d096 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,6 +1,6 @@ -# CLAUDE.md — rules for all agents working on vfmt +# CLAUDE.md — rules for all agents working on lucisv -vfmt is a ruff-style Verilog/SystemVerilog formatter/linter in Rust. +lucisv is a ruff-style Verilog/SystemVerilog formatter/linter in Rust. Read `README.md` for architecture and `TODO.md` for the backlog before doing anything. @@ -15,7 +15,7 @@ doing anything. ships WITH masked-corruption attack tests (crafted (input, corrupted output) pairs the normalization could plausibly forgive, asserted rejected) — written by the dev, re-attacked by QA. History: the one - real corruption vfmt ever produced (macro-items, 2026-08-19) slipped + real corruption lucisv ever produced (macro-items, 2026-08-19) slipped through a normalization added without such tests. ## Simplicity first diff --git a/Cargo.lock b/Cargo.lock index 0cc5b07..072f9e4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -95,6 +95,37 @@ dependencies = [ "serde_repr", ] +[[package]] +name = "lucisv" +version = "0.7.0" +dependencies = [ + "lucisv_core", + "rayon", + "vlog_formatter", + "vlog_linter", + "vlog_parser", +] + +[[package]] +name = "lucisv_core" +version = "0.7.0" + +[[package]] +name = "lucisv_server" +version = "0.7.0" +dependencies = [ + "lsp-server", + "lsp-types", + "lucisv_core", + "serde", + "serde_json", + "vlog_formatter", + "vlog_linter", + "vlog_parser", + "vlog_refactor", + "vlog_semantic", +] + [[package]] name = "memchr" version = "2.8.3" @@ -215,37 +246,6 @@ version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" -[[package]] -name = "vfmt" -version = "0.7.0" -dependencies = [ - "rayon", - "vfmt_core", - "vlog_formatter", - "vlog_linter", - "vlog_parser", -] - -[[package]] -name = "vfmt_core" -version = "0.7.0" - -[[package]] -name = "vfmt_server" -version = "0.7.0" -dependencies = [ - "lsp-server", - "lsp-types", - "serde", - "serde_json", - "vfmt_core", - "vlog_formatter", - "vlog_linter", - "vlog_parser", - "vlog_refactor", - "vlog_semantic", -] - [[package]] name = "vlog_formatter" version = "0.7.0" diff --git a/Cargo.toml b/Cargo.toml index 536d0c5..1c57d20 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,9 +6,9 @@ members = [ "crates/vlog_refactor", "crates/vlog_formatter", "crates/vlog_linter", - "crates/vfmt_core", - "crates/vfmt", - "crates/vfmt_server", + "crates/lucisv_core", + "crates/lucisv", + "crates/lucisv_server", ] [workspace.package] @@ -18,19 +18,19 @@ edition = "2021" license = "MIT" # `rayon` is sanctioned by TODO.md §3 (parallel file processing) and used by -# `vfmt` only. Pinned exactly, because a work-stealing scheduler is exactly +# `lucisv` only. Pinned exactly, because a work-stealing scheduler is exactly # the kind of dependency whose minor releases can change thread behavior; # justification in docs/features/parallel-files/README.md. [workspace.dependencies] rayon = "=1.12.0" # The LSP stack, sanctioned by TODO.md §6 ("`tower-lsp` or `lsp-server`"), used -# by `vfmt_server` only. `lsp-server` is rust-analyzer's synchronous transport +# by `lucisv_server` only. `lsp-server` is rust-analyzer's synchronous transport # (no async runtime); `lsp-types` is the protocol's data model, which is not # something to hand-roll. All pinned exactly for the same reason `rayon` is: a # wire protocol's Rust bindings change shape between minor releases. Transitive # count, build scripts and the versions considered are audited in -# docs/features/vfmt-server/README.md. +# docs/features/lucisv-server/README.md. lsp-server = "=0.10.0" # `proposed` is what carries LSP 3.18's `textDocument/inlineCompletion` — the # params, the client/server capability. Nothing else in the feature is used, diff --git a/README.md b/README.md index 2dd0c81..a885b86 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -# vfmt — a Verilog/SystemVerilog formatter and linter in Rust +# lucisv — Language Utility for Coding In SystemVerilog + +A Verilog/SystemVerilog formatter and linter in Rust. An opinionated, fast formatter and linter for Verilog-2001 and SystemVerilog RTL, built in the image of [ruff](https://github.com/astral-sh/ruff), with @@ -7,48 +9,48 @@ layout conventions and lint ergonomics borrowed from ```bash # format files / directories in place (like `ruff format`) -vfmt rtl/ tb/top_tb.sv +lucisv rtl/ tb/top_tb.sv -# lint (like `ruff check`); `vfmt format ...` is the explicit spelling of the above -vfmt check rtl/ +# lint (like `ruff check`); `lucisv format ...` is the explicit spelling of the above +lucisv check rtl/ # check mode for CI (exit 1 if anything would change) -vfmt --check rtl/ +lucisv --check rtl/ # print a unified diff instead of rewriting (also exit 1 if anything would change) -vfmt --diff rtl/ +lucisv --diff rtl/ # format exactly what an EDA `.f` filelist names (repeatable, adds to the rest) -vfmt -f project.f -vfmt check -f project.f -f tb/tb.f rtl/extra.sv +lucisv -f project.f +lucisv check -f project.f -f tb/tb.f rtl/extra.sv # skip generated files while walking directories (repeatable) -vfmt --exclude '*_gen.sv' --exclude build rtl/ +lucisv --exclude '*_gen.sv' --exclude build rtl/ # .gitignore is honored while walking; --no-gitignore turns that off -vfmt --no-gitignore rtl/ +lucisv --no-gitignore rtl/ # files are formatted on all cores; pin the worker count for reproducible CI -vfmt --threads 1 rtl/ +lucisv --threads 1 rtl/ # repeat runs skip files that are already formatted; --no-cache turns that off -vfmt --check rtl/ -vfmt --no-cache --check rtl/ +lucisv --check rtl/ +lucisv --no-cache --check rtl/ # format only the lines you edited, leaving the rest of the file byte-for-byte -vfmt --lines 120-134 rtl/alu.sv -vfmt --lines 3-9,40 --check rtl/alu.sv +lucisv --lines 120-134 rtl/alu.sv +lucisv --lines 3-9,40 --check rtl/alu.sv # ...or derive the ranges from git, so only your patch gets formatted -tools/vfmt-changed.sh # everything not yet committed -tools/vfmt-changed.sh --check origin/main +tools/lucisv-changed.sh # everything not yet committed +tools/lucisv-changed.sh --check origin/main -# ignore any vfmt.toml found next to the input -vfmt --no-config rtl/ +# ignore any lucisv.toml found next to the input +lucisv --no-config rtl/ # pipe through stdin/stdout; --stdin-filename names the buffer in messages -cat foo.sv | vfmt - -cat foo.sv | vfmt --stdin-filename rtl/foo.sv - +cat foo.sv | lucisv - +cat foo.sv | lucisv --stdin-filename rtl/foo.sv - ``` ### Exit codes (frozen contract — CI may depend on it) @@ -68,21 +70,21 @@ Files are formatted on a worker pool, one thread per logical CPU by default. matters for reproducible CI timing and for bisecting; it never changes what is produced. **The thread count does not affect output**: results are collected and reported in input order, so stdout, stderr and the exit code are -byte-identical at any `N`, and `vfmt --diff` stays one clean patch in input +byte-identical at any `N`, and `lucisv --diff` stays one clean patch in input order. stdin mode is single-threaded. ### Cache -vfmt remembers which files it has already verified are formatted, so a repeat +lucisv remembers which files it has already verified are formatted, so a repeat run over an unchanged tree skips them: the summary says `N files from cache`, and on one core the corpus check goes from 396 ms to 51 ms (2.3× at the default thread count, where parallelism has already taken the easy win). -An entry is keyed on **(content hash, `line-length`, `indent`, vfmt version)** +An entry is keyed on **(content hash, `line-length`, `indent`, lucisv version)** per file, and only ever records the *already formatted* verdict — a file that would be reformatted, or that failed, is re-checked on every run, so `--check`'s exit codes and `--diff`'s output never go stale. The store is one -text file in `.vfmt_cache/` (self-ignoring, like cargo's `target/`); deleting +text file in `.lucisv_cache/` (self-ignoring, like cargo's `target/`); deleting it, or a corrupted one, costs one slow run and nothing else. `--no-cache` neither reads nor writes it, and `--cache-dir ` puts it elsewhere (the default is relative to the current directory). Content hashing is 64-bit @@ -91,7 +93,7 @@ states the collision posture, the semantics table and the concurrency story. ### Ignore files -While walking a directory, vfmt reads a `.gitignore` in every directory it +While walking a directory, lucisv reads a `.gitignore` in every directory it enters and skips what those rules name. A deeper `.gitignore` is applied after (and so overrides) a shallower one, and within one file the last matching line wins — git's own precedence. `--no-gitignore` switches this off. A path named @@ -106,11 +108,11 @@ git's "already-tracked files are never ignored" rule. See ## Configuration -Settings live in a `vfmt.toml` (or `.vfmt.toml`) file, ruff-style. For each -input, vfmt searches **upward from that path's directory** for one: +Settings live in a `lucisv.toml` (or `.lucisv.toml`) file, ruff-style. For each +input, lucisv searches **upward from that path's directory** for one: -1. `vfmt.toml` in the directory — used if present; -2. else `.vfmt.toml` in the directory; +1. `lucisv.toml` in the directory — used if present; +2. else `.lucisv.toml` in the directory; 3. else, if the directory contains `.git`, stop: no config (the `.git` check comes *after* 1–2, so a config file in the repo root is still found); 4. else repeat in the parent directory, up to the filesystem root. @@ -121,7 +123,7 @@ one run. For stdin, the search starts at `--stdin-filename`'s directory, or the current directory if that flag is absent. `--no-config` skips all of this. ```toml -# vfmt.toml — every key is optional +# lucisv.toml — every key is optional line-length = 100 # 40..400, same as --line-length indent = 2 # 1..8, same as --indent exclude = [ "*_gen.sv", "build" ] # added to --exclude patterns @@ -131,20 +133,20 @@ filelist = "rtl/files.f" # an EDA `.f` filelist, relative to this file `filelist` names the project's sources the way the rest of the EDA world already does — one path per line, `-f` to nest another filelist, `+incdir+`, `+define+`, `#`/`//` comments, `$VAR` expansion, paths relative to the -filelist that names them. This **key** is read by `vfmt-server` only, where it +filelist that names them. This **key** is read by `lucisv-server` only, where it defines exactly which files are indexed ([Editor setup](#editor-setup)): a -`vfmt rtl/` that quietly formatted a filelist's files instead of `rtl/`'s would +`lucisv rtl/` that quietly formatted a filelist's files instead of `rtl/`'s would be a surprise. On the command line a filelist is named explicitly, with `-f`: ```bash -vfmt -f project.f # format exactly the files it names -vfmt check -f project.f rtl/ # ...added to whatever else is named +lucisv -f project.f # format exactly the files it names +lucisv check -f project.f rtl/ # ...added to whatever else is named ``` The listed paths are taken exactly as written — neither `--exclude` nor `.gitignore` filters them, just as neither filters a file named on the command line — and a file named twice over is processed once. A listed file that has -gone missing, an option vfmt does not know and an unset `$VAR` are warnings on +gone missing, an option lucisv does not know and an unset `$VAR` are warnings on stderr that change no exit code; a filelist that cannot be read at all is an error (exit 2) and nothing is processed. Details: `docs/features/filelist/README.md` and `docs/features/cli-filelist/README.md`. @@ -160,21 +162,21 @@ a silently ignored `line_length` typo costs more than a strict parser does. ## Linting -`vfmt check` runs a set of lint rules over the same files `vfmt` +`lucisv check` runs a set of lint rules over the same files `lucisv` would format — same walk, same `--exclude`, same `.gitignore` handling, same -`vfmt.toml` discovery. +`lucisv.toml` discovery. ```bash -vfmt check rtl/ # FILE:LINE:COL: message [rule-name] -vfmt check --output-format json rtl/ # one JSON array, for editors and CI -vfmt check --select no-tabs rtl/ # only these rules (comma-separated) -vfmt check --ignore module-filename rtl/ # everything but these -vfmt check --fix rtl/ # apply the safe fixes, write files back +lucisv check rtl/ # FILE:LINE:COL: message [rule-name] +lucisv check --output-format json rtl/ # one JSON array, for editors and CI +lucisv check --select no-tabs rtl/ # only these rules (comma-separated) +lucisv check --ignore module-filename rtl/ # everything but these +lucisv check --fix rtl/ # apply the safe fixes, write files back ``` Exit codes are the frozen contract above: 0 clean (or everything fixed), 1 violations remain, 2 error. Unlike the formatter, `check` uses the -error-tolerant parser, so a file vfmt cannot fully parse is still linted for +error-tolerant parser, so a file lucisv cannot fully parse is still linted for what it can see. | Rule | Fix | What it wants | @@ -209,15 +211,15 @@ so `--fix` leaves every byte of a fenced region exactly as written. ### Waivers ```systemverilog -wire a; // vfmt: waive no-tabs suppresses that rule on this line -// vfmt: waive no-tabs alone on a line: suppresses the next line -// vfmt: waive-start no-tabs ... and everything through -// vfmt: waive-stop no-tabs ... this line +wire a; // lucisv: waive no-tabs suppresses that rule on this line +// lucisv: waive no-tabs alone on a line: suppresses the next line +// lucisv: waive-start no-tabs ... and everything through +// lucisv: waive-stop no-tabs ... this line ``` -`verilog_lint:` is accepted in place of `vfmt:`, so code annotated for Verible -works unedited — including waivers naming Verible rules vfmt has not -implemented, which are ignored rather than reported. A waiver of vfmt's own +`verilog_lint:` is accepted in place of `lucisv:`, so code annotated for Verible +works unedited — including waivers naming Verible rules lucisv has not +implemented, which are ignored rather than reported. A waiver of lucisv's own that suppresses nothing, names an unknown rule or is malformed is reported under `unused-waiver`. External waiver files are not supported. Full rules: `docs/features/linter-core/README.md`. @@ -233,7 +235,7 @@ generic pretty-printing IR, language formatting rules, and a thin CLI: | `crates/vlog_formatter/src/{doc,printer}.rs` | `ruff_formatter` | Wadler/prettier-style document IR (`Text`/`Line`/`Group`/`Indent`) + width-aware printer | | `crates/vlog_formatter/src/format.rs` | `ruff_python_formatter` | Per-node formatting rules | | `crates/vlog_linter` | `ruff_linter` | Rule registry, violations, fix applicability, waivers | -| `crates/vfmt` | the `ruff` CLI | File discovery, in-place rewriting, `--check`, `check`, stdin mode | +| `crates/lucisv` | the `ruff` CLI | File discovery, in-place rewriting, `--check`, `check`, stdin mode | Key ideas carried over from ruff/prettier: @@ -252,7 +254,7 @@ Key ideas carried over from ruff/prettier: ## Style Defaults follow Verible: **2-space indent**, **100-column lines** (both -configurable via `--indent` / `--line-length` or a `vfmt.toml`, see +configurable via `--indent` / `--line-length` or a `lucisv.toml`, see [Configuration](#configuration)). - One port / parameter / connection per line once a header doesn't fit @@ -264,7 +266,7 @@ configurable via `--indent` / `--line-length` or a `vfmt.toml`, see ### Alignment is inferred, not imposed -Hand-aligned columns are how RTL is read, so vfmt reads the spacing you +Hand-aligned columns are how RTL is read, so lucisv reads the spacing you already wrote and keeps your intent — Verible's rule, without the knobs. Within a run of adjacent ANSI **port declarations**, **named connections** (`.clk (clk)`) or **`parameter`/`localparam` declarations**, four or more @@ -274,7 +276,7 @@ element per line. Anything else formats flush-left with a single separator, exactly as it always has, so a file written without alignment never grows any. ```systemverilog -// written with aligned columns, so vfmt leaves them aligned — at the width +// written with aligned columns, so lucisv leaves them aligned — at the width // the group actually needs, which is what makes two people's tables agree module m ( input wire clk, @@ -298,7 +300,7 @@ both layouts are fixed points of re-formatting: Items between a `// verilog_format: off` and a `// verilog_format: on` comment are emitted as the exact source bytes they were written with, indentation included — the escape hatch for hand-aligned tables and the -like. `// vfmt: off` / `// vfmt: on` is an accepted alias. +like. `// lucisv: off` / `// lucisv: on` is an accepted alias. ```systemverilog module m; @@ -311,7 +313,7 @@ endmodule ``` The fence must be a line comment on its own line, and its text must match -exactly — `// vfmt: off for now` is an ordinary comment, not a fence. An +exactly — `// lucisv: off for now` is an ordinary comment, not a fence. An `off` with no matching `on` runs to the end of the enclosing item list (module body, package body, generate block, or the file). Fences select whole items; one written between two *statements* has no effect yet. Full @@ -325,9 +327,9 @@ adoption path for a legacy tree: your patch comes out formatted and nothing else moves, so review sees the change rather than a reflow. ```bash -vfmt --lines 120-134 rtl/alu.sv # one range -vfmt --lines 3-9,40 rtl/alu.sv # several, comma-separated -vfmt --lines 3-9 --lines 40 rtl/alu.sv # the same, repeated +lucisv --lines 120-134 rtl/alu.sv # one range +lucisv --lines 3-9,40 rtl/alu.sv # several, comma-separated +lucisv --lines 3-9 --lines 40 rtl/alu.sv # the same, repeated ``` The unit is one **item**. An item whose lines meet a range — a declaration, an @@ -342,7 +344,7 @@ wins over any range. `--lines` needs explicit file arguments (or `-`), never a directory, and neither reads nor writes the cache: a partly-formatted file is not the "already formatted" verdict the cache stores. It combines with `--check`, -`--diff`, `--stdout` and stdin. `tools/vfmt-changed.sh` turns `git diff` hunks +`--diff`, `--stdout` and stdin. `tools/lucisv-changed.sh` turns `git diff` hunks into ranges. Full semantics, including what happens at a range boundary: `docs/features/range-formatting/README.md`. @@ -581,37 +583,37 @@ corpus baseline this ordering comes from: files and moved the parse rate from 97.1% to 97.6%. Every file still failing is in a deliberately unsupported category, except `compare_helper.sv`, whose `` `X_EACH_CSR 1 `` needs a macro body from - another file — vfmt does not preprocess, so it stays a parse error + another file — lucisv does not preprocess, so it stays a parse error -Like ruff, `vfmt` refuses to output anything for a file it cannot fully +Like ruff, `lucisv` refuses to output anything for a file it cannot fully parse, so it can never corrupt code. ## Editor setup -`vfmt-server` is a language server: one binary, LSP over stdio, the same +`lucisv-server` is a language server: one binary, LSP over stdio, the same answers in every editor. It ships formatting, diagnostics as you type, semantic highlighting, hover (including single-step `` `define`` expansion), go-to-definition, references and document/workspace symbols — the full list, and what is deliberately *not* advertised yet, is in -`docs/features/vfmt-server/README.md`. +`docs/features/lucisv-server/README.md`. **The binary comes from the same build as the CLI**, and nothing downloads it for you: ```bash -cargo build --release # target/release/vfmt-server (and target/release/vfmt) -cp target/release/vfmt-server ~/.local/bin/ # anywhere on PATH +cargo build --release # target/release/lucisv-server (and target/release/lucisv) +cp target/release/lucisv-server ~/.local/bin/ # anywhere on PATH ``` -Every editor below defaults to finding `vfmt-server` on `PATH`; each also +Every editor below defaults to finding `lucisv-server` on `PATH`; each also accepts an absolute path if you would rather leave the binary in `target/`. **VS Code** — a thin extension in `editors/vscode/` whose entire job is registering the file types and starting the server: ```bash -tools/release.sh # builds dist/vfmt-.vsix -code --install-extension dist/vfmt-0.5.0.vsix +tools/release.sh # builds dist/lucisv-.vsix +code --install-extension dist/lucisv-0.5.0.vsix ``` Sideloading that `.vsix` is the supported install; the extension is not on any @@ -625,19 +627,19 @@ the F5 development flow and troubleshooting. ```lua vim.filetype.add({ extension = { v = 'verilog', vh = 'verilog', sv = 'systemverilog', svh = 'systemverilog' } }) -vim.lsp.config('vfmt', { - cmd = { 'vfmt-server' }, +vim.lsp.config('lucisv', { + cmd = { 'lucisv-server' }, filetypes = { 'verilog', 'systemverilog' }, - root_markers = { 'vfmt.toml', '.vfmt.toml', '.git' }, + root_markers = { 'lucisv.toml', '.lucisv.toml', '.git' }, }) -vim.lsp.enable('vfmt') +vim.lsp.enable('lucisv') ``` `nvim-lspconfig`, Vim 9 (`vim-lsp`) and coc.nvim equivalents: `editors/nvim/README.md`. **Which files the server indexes.** A filelist if the project has one — the -`filelist` key of its `vfmt.toml`, or the editor setting `vfmt.filelist` +`filelist` key of its `lucisv.toml`, or the editor setting `lucisv.filelist` (a path, absolute or relative to the workspace folder) — and then exactly the files it names. Otherwise the workspace folder, walked as the CLI walks it; and with no folder open at all, the current file's own directory. Open buffers @@ -650,9 +652,9 @@ to the folder walk, so the index is never silently empty. the handshake and the advertised capabilities are intact — which tells you whether a failure is the server or your editor config. -One caveat, stated up front: the server does **not** read `vfmt.toml` yet, so +One caveat, stated up front: the server does **not** read `lucisv.toml` yet, so formatting through an editor uses the defaults (100 columns, 2-space indent) -with the editor's tab size overriding the indent. `vfmt` on the command line +with the editor's tab size overriding the indent. `lucisv` on the command line does read it. ## Contributing / workflow @@ -663,7 +665,7 @@ expected; no PRs or review required. ## Building ```bash -cargo build --release # binaries at target/release/{vfmt,vfmt-server} +cargo build --release # binaries at target/release/{lucisv,lucisv-server} cargo test # unit + snapshot + idempotency tests ``` @@ -679,8 +681,8 @@ them for your platform and hands you the files. tools/release.sh # release binaries + the .vsix + SHA256SUMS, into dist/ ``` -`dist/` then holds `vfmt--`, -`vfmt-server--`, `vfmt-.vsix` and `SHA256SUMS` +`dist/` then holds `lucisv--`, +`lucisv-server--`, `lucisv-.vsix` and `SHA256SUMS` (verify with `cd dist && shasum -a 256 -c SHA256SUMS`). Copy the two binaries onto your `PATH` and sideload the extension with `code --install-extension`. The script builds for the host triple only and publishes nothing anywhere. @@ -688,5 +690,5 @@ The script builds for the host triple only and publishes nothing anywhere. Release notes are in [`CHANGELOG.md`](CHANGELOG.md); the full checklist — where the version number lives, how the `.vsix` is packaged, and what marketplace publishing would take if it ever happens — is in -[`tools/RELEASING.md`](tools/RELEASING.md). vfmt is MIT licensed +[`tools/RELEASING.md`](tools/RELEASING.md). lucisv is MIT licensed ([`LICENSE`](LICENSE)). diff --git a/ROADMAP.md b/ROADMAP.md index 4e163ca..2698e11 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -71,7 +71,7 @@ Theoretical ceiling with every cluster done: ~797/820 (97.2%). trailing comma in a connection list) — not valid standalone Verilog; will never pass and should not. - `compare_helper.sv` (`assign x = `MACRO 1;`) — needs the macro's - expansion; vfmt deliberately does not read `` `define`` bodies for + expansion; lucisv deliberately does not read `` `define`` bodies for parsing. Confirmed by the expressions-2 dev, being re-confirmed by the round-2 mop-up. diff --git a/TODO.md b/TODO.md index 8ebcd97..0a8bfa8 100644 --- a/TODO.md +++ b/TODO.md @@ -1,6 +1,6 @@ # TODO — best practices adopted from ruff and Verible -Curated backlog for vfmt, drawn from `astral-sh/ruff` (architecture, CLI/UX, +Curated backlog for lucisv, drawn from `astral-sh/ruff` (architecture, CLI/UX, fix model) and `chipsalliance/verible` (formatter safety, alignment, waivers, and especially test methodology). Items reference the current draft's files. Roughly ordered by priority within each section. @@ -29,13 +29,13 @@ Legend: **[V]** = practice from Verible, **[R]** = from ruff, **[V+R]** = both. (README notes it); extend the same contract to the two checks above. - [x] **[R] Panic containment.** ruff catches panics per-file and reports them as errors instead of killing the whole run. Wrap per-file work in - `crates/vfmt/src/main.rs` with `std::panic::catch_unwind`. + `crates/lucisv/src/main.rs` with `std::panic::catch_unwind`. - [x] **`@(* )` fails to lex** (bug-fix QA find): `(*` followed by anything but `)` is unconditionally lexed as an attribute (`lexer.rs`), so a bare space inside `@( * )`-style spellings errors out. Make the attribute scan back off when the contents are just `*`. → `docs/features/lexer-cleanup/README.md`, with the BOM and non-ASCII - message fixes and the `vfmt check` lex-error silence fix. + message fixes and the `lucisv check` lex-error silence fix. - [x] **Recursion-depth limit in the parser.** Found by cli-polish QA: ~150 levels of expression nesting overflow the stack and abort the whole process — uncatchable by `catch_unwind`, so mid-batch files after the @@ -54,7 +54,7 @@ Legend: **[V]** = practice from Verible, **[R]** = from ruff, **[V+R]** = both. ## 2. Formatter features - [x] **[V] Format-off fences.** Support `// verilog_format: off` / - `// verilog_format: on` (accept a `vfmt: off/on` alias). Verible + `// verilog_format: on` (accept a `lucisv: off/on` alias). Verible implements this as "emit the original byte range verbatim" — the trivia in `Meta` already carries comments, so detect fences during formatting in `format.rs` and splice source text by span. Requires nodes to carry @@ -66,12 +66,12 @@ Legend: **[V]** = practice from Verible, **[R]** = from ruff, **[V+R]** = both. constructs intersecting the given line ranges; emit everything else verbatim. This is what makes adoption in dirty legacy codebases possible (Verible ships `git-verible-verilog-format.sh` on top of it). Follow-up: - a `vfmt --diff-base ` or contrib script that derives ranges from + a `lucisv --diff-base ` or contrib script that derives ranges from `git diff`. → `crates/vlog_formatter/src/range.rs` (`format_range`, `LineRanges`), the CLI's `--lines`, the server's `documentRangeFormattingProvider`, and - `tools/vfmt-changed.sh` for the `git diff` half of the follow-up (a - `--diff-base` flag inside vfmt is still open). The unit is one item; + `tools/lucisv-changed.sh` for the `git diff` half of the follow-up (a + `--diff-base` flag inside lucisv is still open). The unit is one item; modules and packages are descended into so a three-line edit does not reflow a two-thousand-line body; statements and generate regions are deliberately atomic. Fences outrank ranges, the cache is bypassed, and the @@ -140,24 +140,24 @@ Legend: **[V]** = practice from Verible, **[R]** = from ruff, **[V+R]** = both. ## 3. CLI / UX (mostly ruff) - [x] **[R] Config file discovery.** Search upward from each input file for - `vfmt.toml` / `.vfmt.toml` (analog of `ruff.toml` / `pyproject.toml`). + `lucisv.toml` / `.lucisv.toml` (analog of `ruff.toml` / `pyproject.toml`). Keys: `line-length`, `indent`, `exclude` globs. CLI flags override file config. Keep Verible's philosophy of *few* knobs — don't grow a clang-format-sized option surface. - → `crates/vfmt_core/src/config.rs` (lifted from crates/vfmt by vfmt-core-lift); discovery rule, TOML subset and + → `crates/lucisv_core/src/config.rs` (lifted from crates/lucisv by lucisv-core-lift); discovery rule, TOML subset and precedence in `docs/features/config-discovery/README.md`. - [x] **[R] Parallel file processing.** ruff's speed story is embarrassing parallelism over files. `main.rs` formats serially; use `rayon` par_iter over the collected file list (formatting is already pure). - → `crates/vfmt/src/main.rs`; pool sizing (8 MiB worker stacks, per the + → `crates/lucisv/src/main.rs`; pool sizing (8 MiB worker stacks, per the recursion-limit handshake), the reworked panic hook and the ordered-reporting determinism argument in `docs/features/parallel-files/README.md`. `--threads N` pins the worker count; output is byte-identical at any count. 3.6× on 10 cores. - [x] **[R] Content-hash cache.** Skip files whose (content hash, config - hash, vfmt version) triple is unchanged, stored in `.vfmt_cache/`. + hash, lucisv version) triple is unchanged, stored in `.lucisv_cache/`. Do this *after* parallelism; it matters for big monorepo RTL trees. - → `crates/vfmt_core/src/cache.rs` (`--no-cache`, `--cache-dir`); the key + → `crates/lucisv_core/src/cache.rs` (`--no-cache`, `--cache-dir`); the key stores the resolved `line-length`/`indent` *values*, and only the "already formatted" verdict is ever cached — a would-reformat or an error is re-checked every run, so `--check`/`--diff` cannot go stale. @@ -171,7 +171,7 @@ Legend: **[V]** = practice from Verible, **[R]** = from ruff, **[V+R]** = both. directories (`collect_files` in `main.rs` currently walks everything, including e.g. generated netlists). → `--exclude` shipped with cli-polish; `.gitignore` is hand-rolled in - `crates/vfmt_core/src/walk.rs` (anchoring, directory-only, `!` negation, + `crates/lucisv_core/src/walk.rs` (anchoring, directory-only, `!` negation, nested files override) with a `--no-gitignore` escape hatch. The supported subset and everything git does that this does not are listed in `docs/features/parallel-files/README.md`. @@ -179,24 +179,24 @@ Legend: **[V]** = practice from Verible, **[R]** = from ruff, **[V+R]** = both. 1 would-reformat / 2 error) — document it in README and freeze it; CI scripts will depend on it. -## 4. Linter (`vfmt check`) — new crate `vlog_linter` +## 4. Linter (`lucisv check`) — new crate `vlog_linter` Design it ruff-style from day one (shared parse, fix model), with Verible's rule ergonomics (waivers, configurable rules). -- [x] **[R] One parse, two tools.** `vfmt check` and `vfmt format` must - share `vlog_parser` output in a single invocation (`vfmt check --fix - --format` style workflows come free later). ~~*Not done:* `vfmt check` +- [x] **[R] One parse, two tools.** `lucisv check` and `lucisv format` must + share `vlog_parser` output in a single invocation (`lucisv check --fix + --format` style workflows come free later). ~~*Not done:* `lucisv check` re-parses today (tolerantly, which the formatter does not), and nothing in `vlog_linter`'s API prevents sharing a tree later — only `LintContext` would change.~~ → Delivered on the linter side (`docs/features/one-parse/README.md`): `LintContext::from_parse` accepts pre-built products, `ParsedSource` is the - owned bundle, `vfmt check` parses once per file (one lex instead of two — - corpus check 266 → 208 ms single-threaded), and `vfmt_server` lints from the + owned bundle, `lucisv check` parses once per file (one lex instead of two — + corpus check 266 → 208 ms single-threaded), and `lucisv_server` lints from the `Document` it already analyzed (didChange→publish 18 → 11 ms on picorv32.v). Byte-identical output proven against a HEAD-worktree binary. The formatter - half stands unchanged by design: `vfmt format` needs the *strict* parse its + half stands unchanged by design: `lucisv format` needs the *strict* parse its safety net is defined over, so a combined `check --fix --format` workflow remains a future feature — but nothing in the API blocks it anymore. - [x] **[V+R] Rule trait + registry.** Each rule: stable kebab-case name, @@ -209,7 +209,7 @@ Verible's rule ergonomics (waivers, configurable rules). grammar and the corpus baseline in `docs/features/linter-core/README.md`. - [x] **[V] Diagnostic format `FILE:LINE:COL: message [rule-name]`** plus **[R]** `--output-format json` for tooling from the start. - → `vfmt check`; text sorted by file then position, JSON one array on stdout + → `lucisv check`; text sorted by file then position, JSON one array on stdout (hand-rolled, no new dependency) with location, end_location, range and fix. - [x] **[R] Fix applicability model.** ruff distinguishes *safe* vs *unsafe* fixes (`--fix` vs `--unsafe-fixes`). Adopt it now — retrofitting @@ -217,13 +217,13 @@ Verible's rule ergonomics (waivers, configurable rules). → `Fix { edits, applicability: Safe | Unsafe }` and `--fix` / `--unsafe-fixes`. Only `no-tabs` and `no-trailing-whitespace` ship fixes (both Safe); the unsafe path is plumbed and tested but no rule uses it yet. -- [ ] **[V] Waiver mechanisms:** inline `// vfmt: waive rule-name` (accept +- [ ] **[V] Waiver mechanisms:** inline `// lucisv: waive rule-name` (accept `verilog_lint: waive` for migration), `waive-start`/`waive-stop` ranges, and external waiver files (`waive --rule=X --line=N --location=glob`) for code you can't touch. ruff's lesson: also warn about *unused* waivers. - [x] inline `waive`, `waive-start`/`waive-stop`, both spellings, and the `unused-waiver` pseudo-rule (unused, unknown rule, malformed, unmatched - `waive-stop`). A `verilog_lint:` waiver naming a rule vfmt lacks is + `waive-stop`). A `verilog_lint:` waiver naming a rule lucisv lacks is ignored rather than reported, so Verible-annotated code lints unedited. - [ ] external waiver files — needs a file format, a discovery rule and a precedence story against inline waivers. @@ -237,15 +237,15 @@ Verible's rule ergonomics (waivers, configurable rules). in `crates/vlog_linter/src/naming.rs`; the justification, the parked rules and the corpus baseline are in `docs/features/lint-rules-2/README.md`. *Not* done: making the style **configurable per rule** — that needs the - `lint` key in `vfmt.toml`, still open below. + `lint` key in `lucisv.toml`, still open below. - [x] **[V] `--generate_markdown`-style self-documentation** — generate the rule reference from the registry so docs can't drift. ruff does the same for its 900+ rules. → `vlog_linter::rules_markdown() -> String` renders the whole registry (name, default on/off, fix applicability, summary, doc), with a golden shape test and an "every registered rule appears" test. Renderable today via - `cargo run -p vlog_linter --example rules_markdown`; a `vfmt check - --rules-doc` flag is filed as a handshake for `crates/vfmt`. + `cargo run -p vlog_linter --example rules_markdown`; a `lucisv check + --rules-doc` flag is filed as a handshake for `crates/lucisv`. - [ ] Seed rules (all syntactic, all from Verible's default set): no-tabs, no-trailing-spaces, explicit-parameter-storage-type, case-missing-default, always-ff-non-blocking / always-comb-blocking, @@ -314,7 +314,7 @@ Adapt each: - [x] **[R] Real-world corpus check (ruff's "ecosystem check").** ruff CI runs against big OSS codebases and diffs results between commits. Do the same with permissively-licensed RTL: e.g. lowRISC Ibex, OpenTitan, - PULP cores, picorv32. Script: clone pinned revs, run vfmt over every + PULP cores, picorv32. Script: clone pinned revs, run lucisv over every `.sv/.v`, report parse-success rate + equivalence/convergence failures; fail CI on regression. Also the honest tracker for the "not yet supported" list in README. @@ -389,7 +389,7 @@ Adapt each: whose digits are a macro (`` 32'h`DM_ADDR ``) are done; the `lex-macro-number` bucket is gone. `compare_helper.sv` stays failing and is not fixable: `` `X_EACH_CSR 1 `` needs the macro's body, which - lives in a file vfmt deliberately does not read. `directive-split` (14 + lives in a file lucisv deliberately does not read. `directive-split` (14 files) is still the top blocker, and every remaining failure is in a deliberately-unsupported category. - [ ] **[R] Fuzzing.** ruff fuzzes its parser. `cargo-fuzz` targets: @@ -401,7 +401,7 @@ Adapt each: ## 6. LSP: full editor support (a first-class goal, not a maybe) -Goal (owner's requirement, 2026-08-19): vfmt becomes a language server +Goal (owner's requirement, 2026-08-19): lucisv becomes a language server for VS Code and Vim/Neovim with feature parity, for Verilog/ SystemVerilog, with what the Python VS Code stack (ruff + Pylance) offers over LSP — scoped to **synthesizable Verilog first**: @@ -486,7 +486,7 @@ later: normalization (backslash-newline removed, nothing else touched) and the gaps — no `` `ifdef`` evaluation, no cross-file `` `include`` — in `docs/features/define-table/README.md`. Hover itself waits on - `vfmt_server`; this is only the table. + `lucisv_server`; this is only the table. - [x] **Workspace index for cross-file navigation.** Map module/package/ typedef names → (file, span) across all workspace files, so header imports (`import pkg::*;`) and instantiations resolve to definitions @@ -519,7 +519,7 @@ later: were already indexed); what moved is 6 more files that now format, and with them external candidates answered 93.6 % → **94.0 %** on cleanly-parsed files (unresolved-external rate 1.3 % → **1.2 %**). -- [x] **New crate `vfmt_server`** (analog of `ruff_server`): LSP over +- [x] **New crate `lucisv_server`** (analog of `ruff_server`): LSP over stdio via `tower-lsp` or `lsp-server`. Order of capabilities: 1. `textDocument/formatting` + `rangeFormatting` (reuses §2 `--lines`), 2. publish parse/lint diagnostics, @@ -528,7 +528,7 @@ later: (needs `vlog_semantic` + workspace index), 5. document/workspace symbols; then completion, rename, signature help for instantiations. - → `crates/vfmt_server`, binary `vfmt-server`, on `lsp-server` + + → `crates/lucisv_server`, binary `lucisv-server`, on `lsp-server` + `lsp-types` (synchronous, no async runtime). **Shipped:** `textDocument/formatting`, `textDocument/rangeFormatting` (round 18, on §2's `--lines`), parse diagnostics on didOpen/didChange/didSave, @@ -540,12 +540,12 @@ later: `vlog_linter`) **delivered**, cross-file references, completion/rename/signature help. Byte↔UTF-16 position conversion, the state/staleness model and the dependency audit - are in `docs/features/vfmt-server/README.md`. + are in `docs/features/lucisv-server/README.md`. - [x] **Editor packaging.** A minimal VS Code extension (launch the server, register file types) and a documented Vim/Neovim `lspconfig` snippet. No editor-specific features beyond launching. → `editors/vscode/` (41-line plain-JS `extension.js` on the official - `vscode-languageclient`, pinned `9.0.1`; one setting, `vfmt.serverPath`; + `vscode-languageclient`, pinned `9.0.1`; one setting, `lucisv.serverPath`; `.v`/`.vh`→`verilog`, `.sv`/`.svh`→`systemverilog`; no grammar — semantic tokens come from the server; no commands, no status bar) and `editors/nvim/README.md` (`vim.lsp.config` for Neovim 0.11+, plus @@ -620,7 +620,7 @@ section only tracks the milestones. instantiates X / what X instantiates) over LSP callHierarchy. - [x] **M12 `semantic-lints`** — unused-signal, undriven-net, multiply-driven: the first semantic lint rules on `vlog_semantic`. -- [x] **M13 `cli-filelist`** — `vfmt -f files.f` on the command line, +- [x] **M13 `cli-filelist`** — `lucisv -f files.f` on the command line, reusing M1's parser; format/lint exactly the project's files. - [x] **M14 `macro-expansion`** — single-step macro expansion on hover (the define-table README's promised follow-up); version 0.5.0 with a diff --git a/crates/vfmt/Cargo.toml b/crates/lucisv/Cargo.toml similarity index 83% rename from crates/vfmt/Cargo.toml rename to crates/lucisv/Cargo.toml index 880fba8..908ff73 100644 --- a/crates/vfmt/Cargo.toml +++ b/crates/lucisv/Cargo.toml @@ -1,16 +1,16 @@ [package] -name = "vfmt" +name = "lucisv" version.workspace = true edition.workspace = true license.workspace = true description = "A Verilog/SystemVerilog formatter, in the spirit of ruff" [[bin]] -name = "vfmt" +name = "lucisv" path = "src/main.rs" [dependencies] -vfmt_core = { path = "../vfmt_core" } +lucisv_core = { path = "../lucisv_core" } vlog_parser = { path = "../vlog_parser" } vlog_formatter = { path = "../vlog_formatter" } vlog_linter = { path = "../vlog_linter" } diff --git a/crates/vfmt/src/args.rs b/crates/lucisv/src/args.rs similarity index 89% rename from crates/vfmt/src/args.rs rename to crates/lucisv/src/args.rs index 278f0f1..3668651 100644 --- a/crates/vfmt/src/args.rs +++ b/crates/lucisv/src/args.rs @@ -1,24 +1,24 @@ -//! Hand-rolled command line parsing for the `vfmt` binary. +//! Hand-rolled command line parsing for the `lucisv` binary. -use vfmt_core::cache; -use vfmt_core::config::FileConfig; +use lucisv_core::cache; +use lucisv_core::config::FileConfig; use vlog_formatter::{Config, LineRanges}; /// Which tool this invocation runs. /// -/// A bare `vfmt ` is [`Command::Format`], exactly as before +/// A bare `lucisv ` is [`Command::Format`], exactly as before /// subcommands existed; the word is only read when it is the **first** -/// argument, so `vfmt --check rtl/` and every other old command line means +/// argument, so `lucisv --check rtl/` and every other old command line means /// what it always did. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum Command { - /// `vfmt`, `vfmt format` — the formatter. + /// `lucisv`, `lucisv format` — the formatter. Format, - /// `vfmt check` — the linter. + /// `lucisv check` — the linter. Check, } -/// How `vfmt check` renders its diagnostics. +/// How `lucisv check` renders its diagnostics. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum OutputFormat { /// `FILE:LINE:COL: message [rule-name]`, one per line. @@ -37,13 +37,13 @@ pub struct Options { pub diff: bool, /// Print formatted output instead of rewriting files. pub stdout: bool, - /// Ignore `vfmt.toml` / `.vfmt.toml` files entirely. + /// Ignore `lucisv.toml` / `.lucisv.toml` files entirely. pub no_config: bool, /// Ignore `.gitignore` files while walking directories. pub no_gitignore: bool, /// Neither read nor write the "already formatted" cache. pub no_cache: bool, - /// Where that cache lives; `None` means `.vfmt_cache` in the current + /// Where that cache lives; `None` means `.lucisv_cache` in the current /// directory. pub cache_dir: Option, /// `--threads`: worker count for the file pool. `None` or `Some(0)` @@ -132,18 +132,18 @@ impl Options { /// Prints the `--help` text, including the frozen exit-code contract. pub fn print_help() { println!( - "vfmt — a Verilog/SystemVerilog formatter and linter + "lucisv — a Verilog/SystemVerilog formatter and linter USAGE: - vfmt [OPTIONS] ... format files in place - vfmt format [OPTIONS] ... the same, spelled out - vfmt check [OPTIONS] ... lint files - vfmt [OPTIONS] -f format what an EDA .f filelist names - vfmt - read from stdin, write to stdout + lucisv [OPTIONS] ... format files in place + lucisv format [OPTIONS] ... the same, spelled out + lucisv check [OPTIONS] ... lint files + lucisv [OPTIONS] -f format what an EDA .f filelist names + lucisv - read from stdin, write to stdout A subcommand is only recognized as the *first* argument, so every command line that worked before subcommands existed still formats. To format a - file actually named `check`, write `vfmt format check` or `./check`. + file actually named `check`, write `lucisv format check` or `./check`. OPTIONS: --check don't write; exit 1 if any file would be reformatted @@ -159,7 +159,7 @@ OPTIONS: taken exactly as written — neither --exclude nor .gitignore filters them, just as neither filters a file named on the command line. A listed file that - is missing, an option vfmt does not know and an + is missing, an option lucisv does not know and an unset $VAR are warnings on stderr and change no exit code; a filelist that cannot be read at all is an error and nothing is processed @@ -167,8 +167,8 @@ OPTIONS: also the directory config discovery starts from --no-gitignore don't read .gitignore files while walking directories --no-cache don't read or write the \"already formatted\" cache - --cache-dir where that cache lives (default: .vfmt_cache in the - current directory). `vfmt check` accepts both flags + --cache-dir where that cache lives (default: .lucisv_cache in the + current directory). `lucisv check` accepts both flags and ignores them: linting is not cached --threads worker threads used to format files (default: one per logical CPU). `--threads 1` formats on a single worker; @@ -181,11 +181,11 @@ OPTIONS: filelist, and neither reads nor writes the cache --line-length maximum line length (default 100) --indent indent width in spaces (default 2) - --no-config ignore vfmt.toml / .vfmt.toml files + --no-config ignore lucisv.toml / .lucisv.toml files -h, --help show this help -V, --version show version -CHECK OPTIONS (`vfmt check` only): +CHECK OPTIONS (`lucisv check` only): --select run only these rules (comma-separated, repeatable) --ignore drop these rules from the set that would run --output-format `text` (default): FILE:LINE:COL: message [rule]; @@ -194,14 +194,14 @@ CHECK OPTIONS (`vfmt check` only): --unsafe-fixes let --fix apply unsafe fixes too (no rule ships one yet, so today this changes nothing) - Suppress a finding with a comment: `// vfmt: waive ` on the line - itself or on the line above it, or a `// vfmt: waive-start ` / - `// vfmt: waive-stop ` pair around a region. `verilog_lint:` is - accepted in place of `vfmt:`. A waiver that suppresses nothing is + Suppress a finding with a comment: `// lucisv: waive ` on the line + itself or on the line above it, or a `// lucisv: waive-start ` / + `// lucisv: waive-stop ` pair around a region. `verilog_lint:` is + accepted in place of `lucisv:`. A waiver that suppresses nothing is reported under the `unused-waiver` rule. IGNORE FILES: - While walking a directory, vfmt reads a `.gitignore` in every directory it + While walking a directory, lucisv reads a `.gitignore` in every directory it enters and skips what it names; a deeper file overrides a shallower one and the last matching line wins. Supported: `#` comments, `*` inside one path component, a leading or embedded `/` (anchors to that .gitignore's own @@ -213,27 +213,27 @@ FILELISTS: `-f project.f` reads the EDA filelist every Verilog build already has: one source path per line, resolved against the directory of the filelist naming it, plus `-f other.f` to nest another, `+incdir+`/`+define+` (accepted and - ignored — vfmt does not preprocess), `$VAR`/`${{VAR}}` expansion, and `//` or + ignored — lucisv does not preprocess), `$VAR`/`${{VAR}}` expansion, and `//` or `#` comments. The files it names are added to whatever the command line already names, in that order, and a file named twice over is processed once. Paths containing whitespace cannot be listed: there is no quoting. CACHE: - A file whose exact content vfmt has already verified is formatted — under - the same line-length, indent and vfmt version — is skipped on the next run + A file whose exact content lucisv has already verified is formatted — under + the same line-length, indent and lucisv version — is skipped on the next run and reported as `N files from cache`. Only that \"already formatted\" verdict is ever cached: a file that would be reformatted, or that failed, - is re-checked every run. The cache is one text file under `.vfmt_cache/`; + is re-checked every run. The cache is one text file under `.lucisv_cache/`; deleting it, or a corrupt one, costs a slow run and nothing else. CONFIGURATION: - For each input, vfmt searches upward from its directory for `vfmt.toml` - or `.vfmt.toml` (the first found wins; the search also stops at a + For each input, lucisv searches upward from its directory for `lucisv.toml` + or `.lucisv.toml` (the first found wins; the search also stops at a directory containing `.git`, after checking it). Recognized keys, all optional: `line-length` (40-400), `indent` (1-8), `exclude` (array of patterns, added to `--exclude`), `filelist` (path to an EDA `.f` file, - read by vfmt-server only — the CLI reads a filelist only when `-f` names - one, so `vfmt rtl/` always means the directory it was given). A command + read by lucisv-server only — the CLI reads a filelist only when `-f` names + one, so `lucisv rtl/` always means the directory it was given). A command line flag overrides the file. RANGE FORMATTING: @@ -365,7 +365,7 @@ fn parse_from(args: impl Iterator) -> Result { std::process::exit(0); } "-V" | "--version" => { - println!("vfmt {}", env!("CARGO_PKG_VERSION")); + println!("lucisv {}", env!("CARGO_PKG_VERSION")); std::process::exit(0); } "-" => opts.inputs.push("-".to_string()), @@ -376,7 +376,7 @@ fn parse_from(args: impl Iterator) -> Result { // A filelist is an input like any other, so `-f files.f` alone is a // complete command line and needs no positional argument. if opts.inputs.is_empty() && opts.filelists.is_empty() { - return Err("no input files (try `vfmt --help`)".to_string()); + return Err("no input files (try `lucisv --help`)".to_string()); } // Repeating the flag is the same as one comma-separated list; both spell // "these lines", and the ranges are merged either way. @@ -409,7 +409,7 @@ fn split_rules(value: &str) -> Vec { } /// Rejects a flag used with the wrong subcommand. A quiet no-op would be the -/// worse outcome: `vfmt check --diff` looking like it worked, having linted +/// worse outcome: `lucisv check --diff` looking like it worked, having linted /// nothing. fn check_flag_scopes(opts: &Options) -> Result<(), String> { let lint_only = [ @@ -429,14 +429,14 @@ fn check_flag_scopes(opts: &Options) -> Result<(), String> { Command::Format => { for (given, flag) in lint_only { if given { - return Err(format!("{flag} is only valid for `vfmt check`")); + return Err(format!("{flag} is only valid for `lucisv check`")); } } } Command::Check => { for (given, flag) in format_only { if given { - return Err(format!("{flag} is not valid for `vfmt check`")); + return Err(format!("{flag} is not valid for `lucisv check`")); } } if opts.unsafe_fixes && !opts.fix { @@ -521,7 +521,7 @@ mod tests { fn the_cache_is_on_unless_switched_off() { let opts = parse(&["rtl"]).unwrap(); assert!(opts.cache_enabled()); - assert_eq!(opts.cache_dir(), ".vfmt_cache"); + assert_eq!(opts.cache_dir(), ".lucisv_cache"); assert!(!parse(&["--no-cache", "rtl"]).unwrap().cache_enabled()); // `--stdout` has to print every file, so nothing may be skipped. diff --git a/crates/vfmt/src/diff.rs b/crates/lucisv/src/diff.rs similarity index 100% rename from crates/vfmt/src/diff.rs rename to crates/lucisv/src/diff.rs diff --git a/crates/vfmt/src/lint.rs b/crates/lucisv/src/lint.rs similarity index 96% rename from crates/vfmt/src/lint.rs rename to crates/lucisv/src/lint.rs index fff4bcc..67d2303 100644 --- a/crates/vfmt/src/lint.rs +++ b/crates/lucisv/src/lint.rs @@ -1,4 +1,4 @@ -//! The `vfmt check` driver: lint files, print diagnostics, apply fixes. +//! The `lucisv check` driver: lint files, print diagnostics, apply fixes. //! //! Everything about *which* files are linted — the walk, `--exclude`, //! `.gitignore`, config discovery — is the formatter's, unchanged: `check` @@ -107,7 +107,7 @@ fn check_one(file: &Path, config: &Config, opts: &Options, rules: &[&'static dyn // A file that does not lex still gets its text-level findings — those // rules ran — but every token- and AST-level rule silently saw nothing, // so the file must not pass as checked. It is an error (exit 2), exactly - // as `vfmt format` treats the same file. + // as `lucisv format` treats the same file. let error = lex_error.map(|e| format!("{path}: {e}")); Report { path, index, violations, fixed, error } } @@ -126,7 +126,7 @@ fn run_rules( // lent to the context. Under `--fix` each *round* re-enters through this // function with rewritten text — that re-parse is inherent (the old // products describe text that no longer exists), so only the first round - // saves a parse; a plain `vfmt check` always does. + // saves a parse; a plain `lucisv check` always does. let parsed = ParsedSource::parse(src); let lex_error = parsed.lex_error().map(|e| format!("lex error: {e}")); // The indent width the formatter would use is also the width a tab @@ -140,7 +140,7 @@ fn run_rules( /// /// `off` means hands-off across both tools. The formatter emits a fenced /// region as the exact source bytes it was written with; a linter that -/// rewrote those same bytes would make the fence a promise only half of vfmt +/// rewrote those same bytes would make the fence a promise only half of lucisv /// keeps. The violation is still **reported** — a finding is information, and /// silencing it is what waivers are for — it just loses its automatic fix. /// @@ -383,7 +383,7 @@ mod tests { #[test] fn fixes_outside_a_fence_survive_the_filter() { // Line 2 is fenced, line 4 is not; both have a tab worth fixing. - let text = "module m;\n// vfmt: off\n\ta = 1;\n// vfmt: on\n\tb = 2;\nendmodule\n"; + let text = "module m;\n// lucisv: off\n\ta = 1;\n// lucisv: on\n\tb = 2;\nendmodule\n"; let fenced = text.find("\ta = 1").unwrap_or(0) as u32; let free = text.find("\tb = 2").unwrap_or(0) as u32; let violations = vec![ @@ -418,14 +418,14 @@ mod tests { // Error recovery can swallow the structure `fence::collect` hangs a // region on; the union's scan half still finds it. Owned by // `fence::protected_regions` now — this is the CLI end of it. - let text = "module m;\n@@@ junk;\n// vfmt: off\n\ta = 1;\n// vfmt: on\nendmodule\n"; + let text = "module m;\n@@@ junk;\n// lucisv: off\n\ta = 1;\n// lucisv: on\nendmodule\n"; let tab = text.find("\ta = 1").unwrap_or(0); assert!(fixable_outside_fences(text, &tab_violation(tab)).is_empty(), "declined"); } #[test] fn an_unclosed_fence_runs_to_the_end_of_the_file() { - let text = "module m;\n// vfmt: off\n\ta = 1;\nendmodule\n"; + let text = "module m;\n// lucisv: off\n\ta = 1;\nendmodule\n"; let tab = text.find("\ta = 1").unwrap_or(0); assert!(fixable_outside_fences(text, &tab_violation(tab)).is_empty(), "declined"); } @@ -433,10 +433,10 @@ mod tests { #[test] fn an_ordinary_comment_is_not_a_fence() { for text in [ - "module m;\n// vfmt: off-by-one\n\ta = 1;\nendmodule\n", + "module m;\n// lucisv: off-by-one\n\ta = 1;\nendmodule\n", "module m;\n// just a note\n\ta = 1;\nendmodule\n", // A stray `on` opens nothing. - "module m;\n// vfmt: on\n\ta = 1;\nendmodule\n", + "module m;\n// lucisv: on\n\ta = 1;\nendmodule\n", ] { let tab = text.find("\ta = 1").unwrap_or(0); assert_eq!(fixable_outside_fences(text, &tab_violation(tab)).len(), 1, "{text:?}"); diff --git a/crates/vfmt/src/main.rs b/crates/lucisv/src/main.rs similarity index 94% rename from crates/vfmt/src/main.rs rename to crates/lucisv/src/main.rs index 9d6d292..d940cb2 100644 --- a/crates/vfmt/src/main.rs +++ b/crates/lucisv/src/main.rs @@ -1,13 +1,13 @@ -//! vfmt — a Verilog/SystemVerilog formatter and linter in the spirit of +//! lucisv — a Verilog/SystemVerilog formatter and linter in the spirit of //! `ruff format` and `ruff check`. //! //! Usage: -//! vfmt [OPTIONS] ... format files in place -//! vfmt --check ... exit 1 if anything would change -//! vfmt --diff ... print a unified diff of what would change -//! vfmt check ... lint files (exit 1 if anything is found) -//! vfmt -f files.f format what an EDA `.f` filelist names -//! vfmt - read stdin, write stdout +//! lucisv [OPTIONS] ... format files in place +//! lucisv --check ... exit 1 if anything would change +//! lucisv --diff ... print a unified diff of what would change +//! lucisv check ... lint files (exit 1 if anything is found) +//! lucisv -f files.f format what an EDA `.f` filelist names +//! lucisv - read stdin, write stdout //! //! Exit codes: 0 nothing to do, 1 `--check`/`--diff` found changes or `check` //! found violations, 2 an error occurred (the affected files are left @@ -27,10 +27,10 @@ use std::process::ExitCode; use rayon::prelude::*; use args::{Command, Options}; -use vfmt_core::cache::{content_hash, Cache, Entry}; -use vfmt_core::config::Discovery; -use vfmt_core::filelist; -use vfmt_core::walk::{collect_files, EXTENSIONS}; +use lucisv_core::cache::{content_hash, Cache, Entry}; +use lucisv_core::config::Discovery; +use lucisv_core::filelist; +use lucisv_core::walk::{collect_files, EXTENSIONS}; use vlog_formatter::{format_range, format_source, Config, LineRanges}; /// Worker stack size. `docs/features/recursion-limit/README.md` measured @@ -57,7 +57,7 @@ fn main() -> ExitCode { } } -/// `vfmt check`: the linter over the same file set the formatter would take. +/// `lucisv check`: the linter over the same file set the formatter would take. fn run_check(opts: &Options) -> ExitCode { let rules = match vlog_linter::select_rules(&opts.select, &opts.ignore) { Ok(rules) => rules, @@ -195,7 +195,7 @@ struct FileResult { outcome: Outcome, /// Hash of content verified to be already formatted. `None` for every /// other verdict: a would-reformat or an error is never cached, - /// because the fix for both is outside vfmt. + /// because the fix for both is outside lucisv. clean: Option, } @@ -266,7 +266,7 @@ fn process_file(file: &Path, config: &Config, opts: &Options, cache: &Cache) -> /// The cache entry for content formatted under `config`. The *values* are /// the key, not the config file that produced them, so identical settings -/// from different `vfmt.toml` files share entries. +/// from different `lucisv.toml` files share entries. fn entry_for(content: u64, config: &Config) -> Entry { Entry { content, line_length: config.max_width, indent: config.indent_width } } @@ -320,7 +320,7 @@ fn gather(opts: &Options) -> Result, String> { /// Every file the `-f` filelists name, in flag order then list order. /// /// The one place `gather` speaks to the user: a filelist's warnings — a -/// listed file that is gone, an option vfmt does not know, an unset `$VAR`, +/// listed file that is gone, an option lucisv does not know, an unset `$VAR`, /// a `-f` chain nested too deep — have to be said even though the run /// succeeds, so they go to stderr and change no exit code. Only the filelist /// itself being unreadable is an error, and it aborts the run here, before @@ -348,9 +348,9 @@ fn dedup(files: Vec) -> Vec { } /// `path` folded to the absolute, `.`/`..`-free spelling two names for one -/// file share. Lexical, like `vfmt_core`'s own normalization: symlinks are +/// file share. Lexical, like `lucisv_core`'s own normalization: symlinks are /// deliberately left unresolved, so this is only ever a dedup key and never -/// the path vfmt reports. +/// the path lucisv reports. fn absolute(cwd: &Path, path: &Path) -> PathBuf { let joined = if path.is_absolute() { path.to_path_buf() } else { cwd.join(path) }; let mut out = PathBuf::new(); @@ -421,12 +421,12 @@ fn format_contained( thread_local! { /// True while this thread is inside `catch_panic`, which is how the - /// panic hook knows to keep quiet: vfmt reports contained panics + /// panic hook knows to keep quiet: lucisv reports contained panics /// itself, in its own error style. static CONTAINED: Cell = const { Cell::new(false) }; } -/// Installs vfmt's panic hook. Called once at startup, before any worker +/// Installs lucisv's panic hook. Called once at startup, before any worker /// thread exists, because swapping the process-global hook per call would /// race once files are formatted in parallel. A panic outside /// `catch_panic` — a real bug in the driver — still reaches the default diff --git a/crates/vfmt/tests/cli.rs b/crates/lucisv/tests/cli.rs similarity index 95% rename from crates/vfmt/tests/cli.rs rename to crates/lucisv/tests/cli.rs index 9f04423..273f7e4 100644 --- a/crates/vfmt/tests/cli.rs +++ b/crates/lucisv/tests/cli.rs @@ -1,4 +1,4 @@ -//! End-to-end tests that drive the real `vfmt` binary. +//! End-to-end tests that drive the real `lucisv` binary. //! //! Fixtures use the most trivial Verilog possible so these tests stay //! stable while the formatter's layout rules evolve. @@ -8,7 +8,7 @@ use std::path::PathBuf; use std::process::{Command, Output, Stdio}; use std::sync::atomic::{AtomicUsize, Ordering}; -const VFMT: &str = env!("CARGO_BIN_EXE_vfmt"); +const LUCISV: &str = env!("CARGO_BIN_EXE_lucisv"); /// Formats to `FORMATTED`: the only change is the newline before `endmodule`. const UNFORMATTED: &str = "module m;endmodule\n"; const FORMATTED: &str = "module m;\nendmodule\n"; @@ -31,7 +31,8 @@ impl TempDir { fn new(tag: &str) -> TempDir { static COUNTER: AtomicUsize = AtomicUsize::new(0); let n = COUNTER.fetch_add(1, Ordering::Relaxed); - let path = std::env::temp_dir().join(format!("vfmt-cli-{}-{tag}-{n}", std::process::id())); + let path = + std::env::temp_dir().join(format!("lucisv-cli-{}-{tag}-{n}", std::process::id())); let _ = std::fs::remove_dir_all(&path); std::fs::create_dir_all(&path).expect("create temp dir"); TempDir { path } @@ -61,9 +62,9 @@ impl Drop for TempDir { } } -/// Runs vfmt with the cache switched off. Every test here shares one +/// Runs lucisv with the cache switched off. Every test here shares one /// working directory (the crate's), so a default-on cache would put a -/// `.vfmt_cache/` in the source tree *and* let one test's run change what +/// `.lucisv_cache/` in the source tree *and* let one test's run change what /// another observes. The cache tests opt back in with `run_raw` and their /// own `--cache-dir`. fn run(args: &[&str]) -> Output { @@ -80,27 +81,27 @@ fn with_no_cache<'a>(args: &[&'a str]) -> Vec<&'a str> { args } -/// Runs vfmt exactly as given, cache and all. +/// Runs lucisv exactly as given, cache and all. fn run_raw(args: &[&str]) -> Output { - Command::new(VFMT).args(args).output().expect("run vfmt") + Command::new(LUCISV).args(args).output().expect("run lucisv") } -/// Runs vfmt exactly as given, from `dir` — the cache's default location +/// Runs lucisv exactly as given, from `dir` — the cache's default location /// is relative to the working directory. fn run_in(dir: &TempDir, args: &[&str]) -> Output { - Command::new(VFMT).args(args).current_dir(&dir.path).output().expect("run vfmt") + Command::new(LUCISV).args(args).current_dir(&dir.path).output().expect("run lucisv") } fn run_with_stdin(args: &[&str], input: &str) -> Output { - let mut child = Command::new(VFMT) + let mut child = Command::new(LUCISV) .args(with_no_cache(args)) .stdin(Stdio::piped()) .stdout(Stdio::piped()) .stderr(Stdio::piped()) .spawn() - .expect("spawn vfmt"); + .expect("spawn lucisv"); child.stdin.as_mut().expect("stdin").write_all(input.as_bytes()).expect("write stdin"); - child.wait_with_output().expect("run vfmt") + child.wait_with_output().expect("run lucisv") } fn code(out: &Output) -> i32 { @@ -427,9 +428,9 @@ fn a_deeply_nested_file_formats_on_a_worker_thread() { #[test] fn every_file_keeps_its_own_config_when_formatted_in_parallel() { let dir = TempDir::new("configpar"); - dir.write("vfmt.toml", "indent = 4\n"); - dir.write("sub/vfmt.toml", "indent = 8\n"); - dir.write("sub/deeper/vfmt.toml", "indent = 2\n"); + dir.write("lucisv.toml", "indent = 4\n"); + dir.write("sub/lucisv.toml", "indent = 8\n"); + dir.write("sub/deeper/lucisv.toml", "indent = 2\n"); for n in 0..12 { dir.write(&format!("root{n:02}.sv"), UNINDENTED); dir.write(&format!("sub/mid{n:02}.sv"), UNINDENTED); @@ -550,7 +551,7 @@ fn help_documents_the_exit_codes() { #[test] fn a_config_file_is_found_by_searching_upward() { let dir = TempDir::new("configup"); - dir.write("vfmt.toml", "indent = 4\nline-length = 40\n"); + dir.write("lucisv.toml", "indent = 4\nline-length = 40\n"); dir.write("a/b/x.sv", UNINDENTED); dir.write("a/b/wide.sv", WIDE); @@ -562,9 +563,9 @@ fn a_config_file_is_found_by_searching_upward() { dir.read("a/b/wide.sv"), "module m (\n input wire aaaa,\n input wire bbbb\n);\nendmodule\n" ); - // Both names work; `.vfmt.toml` is the fallback within one directory. + // Both names work; `.lucisv.toml` is the fallback within one directory. dir.write("a/b/x.sv", UNINDENTED); - std::fs::rename(dir.path.join("vfmt.toml"), dir.path.join(".vfmt.toml")).expect("rename"); + std::fs::rename(dir.path.join("lucisv.toml"), dir.path.join(".lucisv.toml")).expect("rename"); assert_eq!(code(&run(&[&dir.root()])), 0); assert_eq!(dir.read("a/b/x.sv"), INDENT_4); } @@ -572,9 +573,9 @@ fn a_config_file_is_found_by_searching_upward() { #[test] fn each_file_gets_the_config_of_its_own_directory() { let dir = TempDir::new("configper"); - dir.write("vfmt.toml", "indent = 4\n"); + dir.write("lucisv.toml", "indent = 4\n"); dir.write("root.sv", UNINDENTED); - dir.write("sub/vfmt.toml", "indent = 8\n"); + dir.write("sub/lucisv.toml", "indent = 8\n"); dir.write("sub/deep/inner.sv", UNINDENTED); dir.write("other/plain.sv", UNINDENTED); @@ -594,7 +595,7 @@ fn each_file_gets_the_config_of_its_own_directory() { #[test] fn a_cli_flag_overrides_the_config_file() { let dir = TempDir::new("configcli"); - dir.write("vfmt.toml", "indent = 4\nline-length = 40\n"); + dir.write("lucisv.toml", "indent = 4\nline-length = 40\n"); dir.write("x.sv", UNINDENTED); dir.write("wide.sv", WIDE); @@ -608,7 +609,7 @@ fn a_cli_flag_overrides_the_config_file() { fn no_config_ignores_config_files_entirely() { let dir = TempDir::new("noconfig"); // Not even parsed: --no-config reads nothing from disk. - dir.write("vfmt.toml", "this file is not valid at all\n"); + dir.write("lucisv.toml", "this file is not valid at all\n"); dir.write("x.sv", UNINDENTED); let out = run(&["--no-config", &dir.root()]); @@ -619,23 +620,23 @@ fn no_config_ignores_config_files_entirely() { #[test] fn a_broken_config_exits_2_before_writing_anything() { let dir = TempDir::new("configbad"); - dir.write("vfmt.toml", "indent = 4\nline_length = 80\n"); + dir.write("lucisv.toml", "indent = 4\nline_length = 80\n"); dir.write("x.sv", UNINDENTED); let out = run(&[&dir.root()]); assert_eq!(code(&out), 2, "a config error is an error, not a warning"); assert_eq!(dir.read("x.sv"), UNINDENTED, "nothing is written when the config is broken"); let err = stderr(&out); - assert!(err.contains("vfmt.toml:2:"), "the error names the file and line: {err}"); + assert!(err.contains("lucisv.toml:2:"), "the error names the file and line: {err}"); assert!(err.contains("unknown key `line_length`"), "{err}"); for (contents, expected) in [ ("indent = 99\n", "between 1 and 8"), ("line-length = wide\n", "expects an integer"), - ("[tool.vfmt]\nindent = 2\n", "tables"), + ("[tool.lucisv]\nindent = 2\n", "tables"), ("exclude = [\n \"a\",\n]\n", "multi-line arrays are unsupported"), ] { - dir.write("vfmt.toml", contents); + dir.write("lucisv.toml", contents); let out = run(&[&dir.root()]); assert_eq!(code(&out), 2, "{contents}"); assert!(stderr(&out).contains(expected), "{contents}: {}", stderr(&out)); @@ -646,7 +647,7 @@ fn a_broken_config_exits_2_before_writing_anything() { #[test] fn config_excludes_are_added_to_cli_excludes() { let dir = TempDir::new("configexclude"); - dir.write("vfmt.toml", "exclude = [ \"*_gen.sv\", \"build\" ] # generated\n"); + dir.write("lucisv.toml", "exclude = [ \"*_gen.sv\", \"build\" ] # generated\n"); dir.write("keep.sv", UNINDENTED); dir.write("skip_gen.sv", UNINDENTED); dir.write("build/inner.sv", UNINDENTED); @@ -663,7 +664,7 @@ fn config_excludes_are_added_to_cli_excludes() { #[test] fn stdin_discovers_config_from_stdin_filename() { let dir = TempDir::new("configstdin"); - dir.write("vfmt.toml", "indent = 4\n"); + dir.write("lucisv.toml", "indent = 4\n"); let buffer = format!("{}/rtl/buffer.sv", dir.root()); let out = run_with_stdin(&["--stdin-filename", &buffer, "-"], UNINDENTED); @@ -681,7 +682,7 @@ fn stdin_discovers_config_from_stdin_filename() { assert_eq!(stdout(&out), INDENT_2, "--no-config applies to stdin too"); // A broken config is an error in stdin mode too, and nothing is echoed. - dir.write("vfmt.toml", "indent = 4\nbogus = 1\n"); + dir.write("lucisv.toml", "indent = 4\nbogus = 1\n"); let out = run_with_stdin(&["--stdin-filename", &buffer, "-"], UNINDENTED); assert_eq!(code(&out), 2); assert_eq!(stdout(&out), "", "no output when the config is broken"); @@ -691,7 +692,7 @@ fn stdin_discovers_config_from_stdin_filename() { #[test] fn the_search_stops_at_a_git_directory_after_checking_it() { let dir = TempDir::new("configgit"); - dir.write("vfmt.toml", "indent = 4\n"); + dir.write("lucisv.toml", "indent = 4\n"); std::fs::create_dir_all(dir.path.join("repo/.git")).expect("create .git"); dir.write("repo/rtl/x.sv", UNINDENTED); @@ -702,13 +703,13 @@ fn the_search_stops_at_a_git_directory_after_checking_it() { // A config file *in* the repo root is still found: `.git` only stops // the walk after its own directory has been checked. dir.write("repo/rtl/x.sv", UNINDENTED); - dir.write("repo/vfmt.toml", "indent = 8\n"); + dir.write("repo/lucisv.toml", "indent = 8\n"); let out = run(&[&dir.root()]); assert_eq!(code(&out), 0, "{}", stderr(&out)); assert_eq!(dir.read("repo/rtl/x.sv"), "module m;\n wire x;\nendmodule\n"); } -// -------------------------------------------------------------- vfmt check +// -------------------------------------------------------------- lucisv check /// Two findings: a tab on line 2 and a module/file-name mismatch. const LINTY: &str = "module foo;\n\twire a;\nendmodule\n"; @@ -868,7 +869,7 @@ fn check_select_and_ignore_pick_the_rule_set() { #[test] fn check_honors_inline_waivers_and_reports_dead_ones() { let dir = TempDir::new("check-waive"); - let path = dir.write("foo.sv", "module foo;\n\twire a; // vfmt: waive no-tabs\nendmodule\n"); + let path = dir.write("foo.sv", "module foo;\n\twire a; // lucisv: waive no-tabs\nendmodule\n"); let out = run(&["check", &path]); assert_eq!(code(&out), 0, "{}", stdout(&out)); @@ -912,7 +913,7 @@ fn check_reuses_the_walk_and_its_exclusions() { #[test] fn check_expands_tabs_to_the_configured_indent() { let dir = TempDir::new("check-indent"); - dir.write("vfmt.toml", "indent = 4\n"); + dir.write("lucisv.toml", "indent = 4\n"); let path = dir.write("foo.sv", "module foo;\n\twire a;\nendmodule\n"); let out = run(&["check", "--fix", &path]); @@ -990,24 +991,24 @@ fn flags_of_the_other_tool_are_rejected() { ] { let out = run(&args); assert_eq!(code(&out), 2, "{args:?} must not be accepted by the formatter"); - assert!(stderr(&out).contains("only valid for `vfmt check`"), "{}", stderr(&out)); + assert!(stderr(&out).contains("only valid for `lucisv check`"), "{}", stderr(&out)); } for flag in ["--check", "--diff", "--stdout"] { let out = run(&["check", flag, &path]); assert_eq!(code(&out), 2, "{flag} must not be accepted by the linter"); - assert!(stderr(&out).contains("not valid for `vfmt check`"), "{}", stderr(&out)); + assert!(stderr(&out).contains("not valid for `lucisv check`"), "{}", stderr(&out)); } let out = run(&["check", "--unsafe-fixes", &path]); assert_eq!(code(&out), 2, "--unsafe-fixes without --fix is a mistake"); } /// A fenced region (tab + trailing whitespace, deliberately hand-aligned) and -/// an unfenced one with the same problems. `vfmt format` emits the fenced -/// bytes verbatim; `vfmt check --fix` must do the same. +/// an unfenced one with the same problems. `lucisv format` emits the fenced +/// bytes verbatim; `lucisv check --fix` must do the same. const FENCED: &str = "module foo;\n\ - // vfmt: off\n\ + // lucisv: off\n\ \tlocalparam int A = 1; \n\ - // vfmt: on\n\ + // lucisv: on\n\ \tlocalparam int B = 2; \n\ endmodule\n"; @@ -1043,7 +1044,7 @@ fn check_reports_inside_a_fence_but_never_fixes_there() { #[test] fn a_fence_holds_even_in_a_file_that_does_not_parse() { let dir = TempDir::new("check-fence-broken"); - let src = "module foo;\n @@@ not verilog;\n // vfmt: off\n\tlocalparam int A = 1; \n // vfmt: on\nendmodule\n"; + let src = "module foo;\n @@@ not verilog;\n // lucisv: off\n\tlocalparam int A = 1; \n // lucisv: on\nendmodule\n"; let path = dir.write("foo.sv", src); let out = run(&["check", "--fix", &path]); @@ -1062,7 +1063,7 @@ fn a_fence_holds_even_in_a_file_that_does_not_parse() { // --------------------------------------------------------------------------- /// The version stamped into every cache entry: the workspace version, which -/// `vfmt_core` reads with the same `env!`. +/// `lucisv_core` reads with the same `env!`. const VERSION: &str = env!("CARGO_PKG_VERSION"); impl TempDir { @@ -1084,7 +1085,7 @@ fn cache_line( indent: usize, version: &str, ) -> String { - let hash = vfmt_core::cache::content_hash(content.as_bytes()); + let hash = lucisv_core::cache::content_hash(content.as_bytes()); format!("{hash:016x}\t{line_length}\t{indent}\t{version}\t{path}\n") } @@ -1182,23 +1183,23 @@ fn a_hit_skips_the_work_entirely() { #[test] fn a_config_file_change_invalidates_the_entry_too() { let dir = TempDir::new("cache-tomlchange"); - dir.write("vfmt.toml", "indent = 2\n"); + dir.write("lucisv.toml", "indent = 2\n"); let path = dir.write("a.sv", INDENT_2); let cache = dir.cache(); assert_eq!(code(&run_raw(&["--check", &path, "--cache-dir", &cache])), 0); - dir.write("vfmt.toml", "indent = 4\n"); + dir.write("lucisv.toml", "indent = 4\n"); let out = run_raw(&["--check", &path, "--cache-dir", &cache]); assert_eq!(code(&out), 1, "the resolved settings are the key: {}", stderr(&out)); // …and an equivalent config written a different way is still a hit. - dir.write("vfmt.toml", "indent = 2 # back again\n"); + dir.write("lucisv.toml", "indent = 2 # back again\n"); let out = run_raw(&["--check", &path, "--cache-dir", &cache]); assert_eq!(code(&out), 0, "{}", stderr(&out)); assert!(stderr(&out).contains("1 file from cache"), "{}", stderr(&out)); } #[test] -fn an_entry_from_another_vfmt_version_is_ignored() { +fn an_entry_from_another_lucisv_version_is_ignored() { let dir = TempDir::new("cache-version"); let path = dir.write("a.sv", UNFORMATTED); let cache = dir.cache(); @@ -1328,7 +1329,7 @@ fn the_default_cache_lives_in_the_working_directory_and_ignores_itself() { let out = run_in(&dir, &["--check", "."]); assert_eq!(code(&out), 0, "{}", stderr(&out)); - let cache_dir = dir.path.join(".vfmt_cache"); + let cache_dir = dir.path.join(".lucisv_cache"); assert!(cache_dir.join("cache").is_file(), "the default cache is cwd-relative"); assert_eq!( std::fs::read_to_string(cache_dir.join(".gitignore")).unwrap(), @@ -1472,7 +1473,7 @@ fn lines_refuses_a_directory_and_a_bad_range() { // The linter has no line ranges. let out = run(&["check", "--lines", "2", &dir.write("c.sv", THREE)]); assert_eq!(code(&out), 2); - assert!(stderr(&out).contains("`vfmt check`"), "{}", stderr(&out)); + assert!(stderr(&out).contains("`lucisv check`"), "{}", stderr(&out)); } #[test] @@ -1501,15 +1502,15 @@ fn lines_neither_reads_nor_writes_the_cache() { } fn run_with_stdin_raw(args: &[&str], input: &str) -> Output { - let mut child = Command::new(VFMT) + let mut child = Command::new(LUCISV) .args(args) .stdin(Stdio::piped()) .stdout(Stdio::piped()) .stderr(Stdio::piped()) .spawn() - .expect("spawn vfmt"); + .expect("spawn lucisv"); child.stdin.as_mut().expect("stdin").write_all(input.as_bytes()).expect("write stdin"); - child.wait_with_output().expect("run vfmt") + child.wait_with_output().expect("run lucisv") } // --- `-f`, the EDA filelist (docs/features/cli-filelist/README.md) --------- @@ -1695,5 +1696,5 @@ fn help_documents_the_filelist_flag() { let text = stdout(&run(&["--help"])); assert!(text.contains("FILELISTS:"), "{text}"); assert!(text.contains("-f "), "{text}"); - assert!(text.contains("read by vfmt-server only"), "the toml key stays server-only: {text}"); + assert!(text.contains("read by lucisv-server only"), "the toml key stays server-only: {text}"); } diff --git a/crates/vfmt_core/Cargo.toml b/crates/lucisv_core/Cargo.toml similarity index 69% rename from crates/vfmt_core/Cargo.toml rename to crates/lucisv_core/Cargo.toml index 0b042fc..fe96e65 100644 --- a/crates/vfmt_core/Cargo.toml +++ b/crates/lucisv_core/Cargo.toml @@ -1,12 +1,12 @@ [package] -name = "vfmt_core" +name = "lucisv_core" version.workspace = true edition.workspace = true license.workspace = true -description = "Config discovery and file walking, shared by the vfmt CLI and the vfmt language server" +description = "Config discovery and file walking, shared by the lucisv CLI and the lucisv language server" [lib] -name = "vfmt_core" +name = "lucisv_core" path = "src/lib.rs" [dependencies] diff --git a/crates/vfmt_core/src/cache.rs b/crates/lucisv_core/src/cache.rs similarity index 97% rename from crates/vfmt_core/src/cache.rs rename to crates/lucisv_core/src/cache.rs index fa33e87..734e304 100644 --- a/crates/vfmt_core/src/cache.rs +++ b/crates/lucisv_core/src/cache.rs @@ -13,12 +13,12 @@ use std::fmt::Write as _; use std::path::{Path, PathBuf}; /// The default cache directory, resolved against the current directory. -pub const DEFAULT_DIR: &str = ".vfmt_cache"; +pub const DEFAULT_DIR: &str = ".lucisv_cache"; /// The entry file inside the cache directory. const FILE: &str = "cache"; -/// vfmt's version, part of every entry: a new release may format the same +/// lucisv's version, part of every entry: a new release may format the same /// bytes differently, so another version's entries are ignored. const VERSION: &str = env!("CARGO_PKG_VERSION"); @@ -57,7 +57,7 @@ impl Cache { } /// True when `path`'s current content was already verified formatted - /// under these settings by this version of vfmt. + /// under these settings by this version of lucisv. pub fn is_clean(&self, path: &Path, entry: Entry) -> bool { key(path).and_then(|k| self.entries.get(k)) == Some(&entry) } @@ -140,10 +140,10 @@ fn key(path: &Path) -> Option<&str> { Some(text) } -/// Parses the store. `None` means "this file is not something vfmt wrote" +/// Parses the store. `None` means "this file is not something lucisv wrote" /// — one malformed line discards the whole cache, because partial trust in /// a file already caught lying is not worth the branch. Entries from -/// another vfmt version are dropped individually; that is staleness, not +/// another lucisv version are dropped individually; that is staleness, not /// corruption. fn parse(text: &str) -> Option> { let mut entries = HashMap::new(); @@ -179,7 +179,7 @@ mod tests { static COUNTER: AtomicUsize = AtomicUsize::new(0); let n = COUNTER.fetch_add(1, Ordering::Relaxed); let path = - std::env::temp_dir().join(format!("vfmt-cache-{}-{tag}-{n}", std::process::id())); + std::env::temp_dir().join(format!("lucisv-cache-{}-{tag}-{n}", std::process::id())); let _ = std::fs::remove_dir_all(&path); std::fs::create_dir_all(&path).expect("create temp dir"); TempDir { path } diff --git a/crates/vfmt_core/src/config.rs b/crates/lucisv_core/src/config.rs similarity index 92% rename from crates/vfmt_core/src/config.rs rename to crates/lucisv_core/src/config.rs index 62cc3b5..f9b3eef 100644 --- a/crates/vfmt_core/src/config.rs +++ b/crates/lucisv_core/src/config.rs @@ -1,4 +1,4 @@ -//! `vfmt.toml` / `.vfmt.toml` discovery and its TOML-subset parser. +//! `lucisv.toml` / `.lucisv.toml` discovery and its TOML-subset parser. //! //! Only what a three-key config file needs is supported (comments, //! `key = int`, `key = "string"`, `key = ["a", "b"]`); everything else is @@ -10,7 +10,7 @@ use std::collections::HashMap; use std::path::{Component, Path, PathBuf}; /// Config file names, in the order a directory is probed. -const NAMES: [&str; 2] = ["vfmt.toml", ".vfmt.toml"]; +const NAMES: [&str; 2] = ["lucisv.toml", ".lucisv.toml"]; /// The settings one config file carries. Every key is optional; an unset /// key leaves the CLI flag (or the built-in default) in charge. @@ -50,7 +50,7 @@ pub fn parse(text: &str) -> Result { fn parse_entry(line: &str, config: &mut FileConfig) -> Result<(), String> { if line.starts_with('[') { - return Err("tables (`[section]`) are unsupported in vfmt.toml".to_string()); + return Err("tables (`[section]`) are unsupported in lucisv.toml".to_string()); } let (key, value) = line.split_once('=').ok_or_else(|| format!("expected `key = value`, found `{line}`"))?; @@ -110,7 +110,7 @@ fn parse_array(value: &str) -> Result, String> { let inner = value .strip_prefix('[') .and_then(|rest| rest.strip_suffix(']')) - .ok_or("multi-line arrays are unsupported in vfmt.toml; write `[ \"a\", \"b\" ]`")?; + .ok_or("multi-line arrays are unsupported in lucisv.toml; write `[ \"a\", \"b\" ]`")?; let mut items: Vec<&str> = inner.split(',').map(str::trim).collect(); if items.last() == Some(&"") { // Either an empty array or a permitted trailing comma. @@ -125,7 +125,7 @@ fn parse_string(value: &str) -> Result { .and_then(|rest| rest.strip_suffix('"')) .ok_or_else(|| format!("expected a quoted string, found `{value}`"))?; if inner.contains('"') || inner.contains('\\') { - return Err("quotes and escapes inside strings are unsupported in vfmt.toml".to_string()); + return Err("quotes and escapes inside strings are unsupported in lucisv.toml".to_string()); } Ok(inner.to_string()) } @@ -292,7 +292,7 @@ exclude = [ \"build\", \"*_gen.sv\", ] #[test] fn a_relative_filelist_resolves_against_the_config_files_directory() { let tree = TempTree::new(); - tree.write("vfmt.toml", "filelist = \"rtl/files.f\"\n"); + tree.write("lucisv.toml", "filelist = \"rtl/files.f\"\n"); let deep = tree.write("a/b/x.sv", ""); let mut discovery = Discovery::new(true); let found = discovery.for_file(&deep).unwrap(); @@ -302,7 +302,7 @@ exclude = [ \"build\", \"*_gen.sv\", ] #[test] fn an_absolute_filelist_is_left_alone() { let tree = TempTree::new(); - tree.write("vfmt.toml", "filelist = \"/opt/project/files.f\"\n"); + tree.write("lucisv.toml", "filelist = \"/opt/project/files.f\"\n"); let file = tree.write("x.sv", ""); let mut discovery = Discovery::new(true); assert_eq!( @@ -366,7 +366,7 @@ exclude = [ \"build\", \"*_gen.sv\", ] #[test] fn unsupported_toml_is_named_not_ignored() { - assert!(err("[tool.vfmt]\nindent = 2").contains("tables")); + assert!(err("[tool.lucisv]\nindent = 2").contains("tables")); assert!(err("exclude = [\n \"a\",\n]").contains("multi-line arrays are unsupported")); assert!(err("exclude = [\"a\\tb\"]").contains("escapes")); assert!(err("indent").contains("expected `key = value`")); @@ -387,7 +387,8 @@ exclude = [ \"build\", \"*_gen.sv\", ] fn new() -> TempTree { static COUNTER: AtomicUsize = AtomicUsize::new(0); let n = COUNTER.fetch_add(1, Ordering::Relaxed); - let path = std::env::temp_dir().join(format!("vfmt-config-{}-{n}", std::process::id())); + let path = + std::env::temp_dir().join(format!("lucisv-config-{}-{n}", std::process::id())); let _ = std::fs::remove_dir_all(&path); std::fs::create_dir_all(&path).expect("create temp dir"); TempTree { path } @@ -418,7 +419,7 @@ exclude = [ \"build\", \"*_gen.sv\", ] #[test] fn searches_upward_from_the_files_directory() { let tree = TempTree::new(); - tree.write("vfmt.toml", "indent = 4\n"); + tree.write("lucisv.toml", "indent = 4\n"); let deep = tree.write("a/b/c/x.sv", ""); let mut discovery = Discovery::new(true); assert_eq!(discovery.for_file(&deep).unwrap().indent, Some(4)); @@ -427,8 +428,8 @@ exclude = [ \"build\", \"*_gen.sv\", ] #[test] fn the_nearest_config_wins_and_does_not_merge() { let tree = TempTree::new(); - tree.write("vfmt.toml", "indent = 4\nline-length = 120\n"); - tree.write("a/vfmt.toml", "indent = 8\n"); + tree.write("lucisv.toml", "indent = 4\nline-length = 120\n"); + tree.write("a/lucisv.toml", "indent = 8\n"); let near = tree.write("a/x.sv", ""); let far = tree.write("b/x.sv", ""); let mut discovery = Discovery::new(true); @@ -442,26 +443,26 @@ exclude = [ \"build\", \"*_gen.sv\", ] #[test] fn dotted_name_is_the_fallback_in_one_directory() { let tree = TempTree::new(); - tree.write(".vfmt.toml", "indent = 3\n"); + tree.write(".lucisv.toml", "indent = 3\n"); let only_dotted = tree.write("x.sv", ""); let mut discovery = Discovery::new(true); assert_eq!(discovery.for_file(&only_dotted).unwrap().indent, Some(3)); - tree.write("vfmt.toml", "indent = 5\n"); + tree.write("lucisv.toml", "indent = 5\n"); let mut discovery = Discovery::new(true); assert_eq!( discovery.for_file(&only_dotted).unwrap().indent, Some(5), - "vfmt.toml is preferred when both are present" + "lucisv.toml is preferred when both are present" ); } #[test] fn git_stops_the_walk_but_only_after_its_own_directory() { let tree = TempTree::new(); - tree.write("vfmt.toml", "indent = 4\n"); + tree.write("lucisv.toml", "indent = 4\n"); tree.dir("repo/.git"); - tree.write("repo/vfmt.toml", "indent = 8\n"); + tree.write("repo/lucisv.toml", "indent = 8\n"); let inside = tree.write("repo/rtl/x.sv", ""); let mut discovery = Discovery::new(true); assert_eq!( @@ -473,7 +474,7 @@ exclude = [ \"build\", \"*_gen.sv\", ] // With no config in the repo root, the walk stops there rather // than escaping into the parent's config. let tree = TempTree::new(); - tree.write("vfmt.toml", "indent = 4\n"); + tree.write("lucisv.toml", "indent = 4\n"); tree.dir("repo/.git"); let inside = tree.write("repo/rtl/x.sv", ""); let mut discovery = Discovery::new(true); @@ -484,7 +485,7 @@ exclude = [ \"build\", \"*_gen.sv\", ] fn a_git_file_stops_the_walk_too() { // Submodules and worktrees have a `.git` *file*, not a directory. let tree = TempTree::new(); - tree.write("vfmt.toml", "indent = 4\n"); + tree.write("lucisv.toml", "indent = 4\n"); tree.write("repo/.git", "gitdir: ../.git/modules/repo\n"); let inside = tree.write("repo/x.sv", ""); let mut discovery = Discovery::new(true); @@ -494,7 +495,7 @@ exclude = [ \"build\", \"*_gen.sv\", ] #[test] fn disabled_discovery_reads_nothing() { let tree = TempTree::new(); - tree.write("vfmt.toml", "this is not even valid\n"); + tree.write("lucisv.toml", "this is not even valid\n"); let file = tree.write("x.sv", ""); let mut discovery = Discovery::new(false); assert_eq!(discovery.for_file(&file).unwrap(), FileConfig::default()); @@ -503,7 +504,7 @@ exclude = [ \"build\", \"*_gen.sv\", ] #[test] fn a_broken_config_is_an_error_naming_file_and_line() { let tree = TempTree::new(); - let config = tree.write("vfmt.toml", "indent = 2\nbogus = 1\n"); + let config = tree.write("lucisv.toml", "indent = 2\nbogus = 1\n"); let file = tree.write("x.sv", ""); let message = Discovery::new(true).for_file(&file).expect_err("expected an error"); assert!(message.starts_with(&format!("{}:2: ", config.display())), "{message}"); @@ -513,7 +514,7 @@ exclude = [ \"build\", \"*_gen.sv\", ] #[test] fn the_cache_answers_for_every_directory_on_the_walked_chain() { let tree = TempTree::new(); - tree.write("vfmt.toml", "indent = 4\n"); + tree.write("lucisv.toml", "indent = 4\n"); let deep = tree.write("a/b/c/x.sv", ""); let mut discovery = Discovery::new(true); assert_eq!(discovery.for_file(&deep).unwrap().indent, Some(4)); @@ -523,15 +524,15 @@ exclude = [ \"build\", \"*_gen.sv\", ] // Deleting the file afterwards proves the second lookup is served // from the cache and not from disk. - std::fs::remove_file(tree.path.join("vfmt.toml")).expect("remove config"); + std::fs::remove_file(tree.path.join("lucisv.toml")).expect("remove config"); assert_eq!(discovery.for_file(&tree.path.join("a/b/y.sv")).unwrap().indent, Some(4)); } #[test] fn a_directory_input_resolves_from_itself() { let tree = TempTree::new(); - tree.write("a/vfmt.toml", "indent = 8\n"); - tree.write("vfmt.toml", "indent = 4\n"); + tree.write("a/lucisv.toml", "indent = 8\n"); + tree.write("lucisv.toml", "indent = 4\n"); let dir = tree.dir("a"); let mut discovery = Discovery::new(true); assert_eq!(discovery.for_input(&dir).unwrap().indent, Some(8)); @@ -542,7 +543,7 @@ exclude = [ \"build\", \"*_gen.sv\", ] let tree = TempTree::new(); let mut discovery = Discovery::new(true); discovery.cwd = tree.path.clone(); - tree.write("vfmt.toml", "indent = 4\n"); + tree.write("lucisv.toml", "indent = 4\n"); tree.write("a/b/x.sv", ""); assert_eq!(discovery.for_file(Path::new("./a/b/x.sv")).unwrap().indent, Some(4)); assert_eq!(discovery.for_file(Path::new("a/b/../b/x.sv")).unwrap().indent, Some(4)); diff --git a/crates/vfmt_core/src/filelist.rs b/crates/lucisv_core/src/filelist.rs similarity index 98% rename from crates/vfmt_core/src/filelist.rs rename to crates/lucisv_core/src/filelist.rs index 9425161..fc0a4f2 100644 --- a/crates/vfmt_core/src/filelist.rs +++ b/crates/lucisv_core/src/filelist.rs @@ -4,7 +4,7 @@ //! One source path per line, `-f` to nest another filelist, `+incdir+` and //! `+define+` recorded for later, `//` and `#` comments, `$VAR` expansion. //! Nothing here fails on bad content: a filelist that names a deleted file, -//! nests one that cannot be read, carries a flag vfmt does not know, or nests +//! nests one that cannot be read, carries a flag lucisv does not know, or nests //! `-f` past [`MAX_NESTING_DEPTH`] still produces the files it did name, plus //! a warning for each problem. See `docs/features/filelist/README.md`. @@ -258,7 +258,7 @@ mod tests { static COUNTER: AtomicUsize = AtomicUsize::new(0); let n = COUNTER.fetch_add(1, Ordering::Relaxed); let path = - std::env::temp_dir().join(format!("vfmt-filelist-{}-{n}", std::process::id())); + std::env::temp_dir().join(format!("lucisv-filelist-{}-{n}", std::process::id())); let _ = std::fs::remove_dir_all(&path); std::fs::create_dir_all(&path).expect("create temp dir"); TempTree { path } @@ -552,10 +552,10 @@ rtl/b.sv // the trailing form // and a wrong closure there would be invisible to every other test. let tree = TempTree::new(); tree.source("a.sv"); - let f = tree.write("files.f", "${VFMT_FILELIST_UNSET_PROBE}a.sv\n"); + let f = tree.write("files.f", "${LUCISV_FILELIST_UNSET_PROBE}a.sv\n"); let list = read(&f).expect("readable"); assert_eq!(names(&list), ["a.sv"]); - assert!(list.warnings[0].contains("VFMT_FILELIST_UNSET_PROBE"), "{:?}", list.warnings); + assert!(list.warnings[0].contains("LUCISV_FILELIST_UNSET_PROBE"), "{:?}", list.warnings); } #[test] diff --git a/crates/vfmt_core/src/lib.rs b/crates/lucisv_core/src/lib.rs similarity index 56% rename from crates/vfmt_core/src/lib.rs rename to crates/lucisv_core/src/lib.rs index c0f92c7..fbeddd9 100644 --- a/crates/vfmt_core/src/lib.rs +++ b/crates/lucisv_core/src/lib.rs @@ -1,13 +1,13 @@ -//! The parts of vfmt that decide *which* files are processed and *with what -//! settings*, shared by the `vfmt` CLI and the `vfmt-server` language server. +//! The parts of lucisv that decide *which* files are processed and *with what +//! settings*, shared by the `lucisv` CLI and the `lucisv-server` language server. //! -//! `config` and `walk` were lifted out of `crates/vfmt` unchanged so the two +//! `config` and `walk` were lifted out of `crates/lucisv` unchanged so the two //! front ends cannot silently disagree: an editor's format-on-save must find -//! the same `vfmt.toml` and skip the same files as CI's `vfmt --check`. +//! the same `lucisv.toml` and skip the same files as CI's `lucisv --check`. //! `cache` answers the third question of the same family — whether a file //! needs to be processed at all, and `filelist` answers the first one the way //! an EDA project already does, from a `.f` file. See -//! `docs/features/vfmt-core-lift/README.md`, and +//! `docs/features/lucisv-core-lift/README.md`, and //! `docs/features/{config-discovery,parallel-files,format-cache,filelist}/README.md` //! for the rules themselves. diff --git a/crates/vfmt_core/src/walk.rs b/crates/lucisv_core/src/walk.rs similarity index 99% rename from crates/vfmt_core/src/walk.rs rename to crates/lucisv_core/src/walk.rs index 8b49375..113f98f 100644 --- a/crates/vfmt_core/src/walk.rs +++ b/crates/lucisv_core/src/walk.rs @@ -4,7 +4,7 @@ use std::path::{Path, PathBuf}; -/// File extensions vfmt formats when walking a directory. +/// File extensions lucisv formats when walking a directory. pub const EXTENSIONS: &[&str] = &["v", "sv", "vh", "svh"]; /// The name of the per-directory ignore file that is honoured by default. diff --git a/crates/vfmt_server/Cargo.toml b/crates/lucisv_server/Cargo.toml similarity index 84% rename from crates/vfmt_server/Cargo.toml rename to crates/lucisv_server/Cargo.toml index d86f13f..d1443c8 100644 --- a/crates/vfmt_server/Cargo.toml +++ b/crates/lucisv_server/Cargo.toml @@ -1,15 +1,15 @@ [package] -name = "vfmt_server" +name = "lucisv_server" version.workspace = true edition.workspace = true license.workspace = true [[bin]] -name = "vfmt-server" +name = "lucisv-server" path = "src/main.rs" [dependencies] -vfmt_core = { path = "../vfmt_core" } +lucisv_core = { path = "../lucisv_core" } vlog_parser = { path = "../vlog_parser" } vlog_semantic = { path = "../vlog_semantic" } vlog_refactor = { path = "../vlog_refactor" } diff --git a/crates/vfmt_server/src/candidates.rs b/crates/lucisv_server/src/candidates.rs similarity index 99% rename from crates/vfmt_server/src/candidates.rs rename to crates/lucisv_server/src/candidates.rs index 5bd11b5..a2f4264 100644 --- a/crates/vfmt_server/src/candidates.rs +++ b/crates/lucisv_server/src/candidates.rs @@ -110,7 +110,7 @@ fn units_of(index: &WorkspaceIndex) -> Vec { } /// Every `` `define`` the workspace declares. `` `undef`` entries are skipped: -/// vfmt does not preprocess, so it cannot say where a name stopped being +/// lucisv does not preprocess, so it cannot say where a name stopped being /// defined, and offering the name is the honest answer either way. fn macros_of(index: &WorkspaceIndex) -> Vec { let mut out: Vec = Vec::new(); diff --git a/crates/vfmt_server/src/code_action.rs b/crates/lucisv_server/src/code_action.rs similarity index 94% rename from crates/vfmt_server/src/code_action.rs rename to crates/lucisv_server/src/code_action.rs index 3d05bc2..d26ebc8 100644 --- a/crates/vfmt_server/src/code_action.rs +++ b/crates/lucisv_server/src/code_action.rs @@ -1,5 +1,5 @@ //! `textDocument/codeAction` — one quick fix per Safe lint fix, plus one -//! `source.fixAll.vfmt` that applies all of them in a single pass. +//! `source.fixAll.lucisv` that applies all of them in a single pass. //! //! Only **Safe** fixes are offered. `--unsafe-fixes` is a flag a CLI user types //! on purpose; a lightbulb in an editor is not that, and a fix that may change @@ -17,14 +17,14 @@ use crate::convert::Positions; use crate::state::Document; /// The kind of the fix-everything action, namespaced under `source.fixAll` so -/// an editor's fix-on-save can name vfmt without also running another server's +/// an editor's fix-on-save can name lucisv without also running another server's /// fixer. -pub const FIX_ALL: &str = "source.fixAll.vfmt"; +pub const FIX_ALL: &str = "source.fixAll.lucisv"; /// The actions available for `range` in a buffer. /// /// `only` is the client's filter; it is honored here rather than left to the -/// client, because a fix-on-save request asks for `source.fixAll.vfmt` alone +/// client, because a fix-on-save request asks for `source.fixAll.lucisv` alone /// and computing every quick fix for it would be work nobody reads. pub fn code_actions( uri: &Uri, @@ -86,7 +86,7 @@ fn quick_fix( /// One action applying every Safe fix in the buffer, as a whole-document edit. /// -/// **One pass, deliberately.** `vfmt check --fix` loops fix → re-lint until +/// **One pass, deliberately.** `lucisv check --fix` loops fix → re-lint until /// nothing changes, because a pass skips a fix overlapping one already applied /// (a line ending in a tab needs two rounds: `no-tabs` and /// `no-trailing-whitespace` both want those bytes). An editor does not need @@ -110,7 +110,7 @@ fn fix_all( } let edit = TextEdit { range: positions.whole_document(), new_text: fixed.output }; Some(CodeAction { - title: "vfmt: fix all auto-fixable lint violations".to_string(), + title: "lucisv: fix all auto-fixable lint violations".to_string(), kind: Some(CodeActionKind::new(FIX_ALL)), // No `diagnostics` list: one pass skips fixes that overlap an applied // one, so this action cannot honestly name the findings it resolves. @@ -128,11 +128,11 @@ fn workspace_edit(uri: &Uri, edits: Vec) -> WorkspaceEdit { /// is what the user would put in a waiver. fn title(violation: &Violation) -> String { let what = rule_by_name(violation.rule).map_or(violation.message.as_str(), |r| r.summary()); - format!("vfmt: {what} [{}]", violation.rule) + format!("lucisv: {what} [{}]", violation.rule) } /// Whether a client asking for `only` wants this kind. A filter is a prefix of -/// the kinds it selects (`source` selects `source.fixAll.vfmt`), and no filter +/// the kinds it selects (`source` selects `source.fixAll.lucisv`), and no filter /// at all selects everything. pub fn wanted(only: Option<&[CodeActionKind]>, kind: &CodeActionKind) -> bool { let Some(only) = only else { return true }; @@ -216,12 +216,12 @@ mod tests { let ws = workspace(text); let actions = actions_of(&ws); let fix = actions.iter().find(|a| a.kind == Some(CodeActionKind::QUICKFIX)).expect("one"); - assert_eq!(fix.title, "vfmt: use spaces, not tabs [no-tabs]"); + assert_eq!(fix.title, "lucisv: use spaces, not tabs [no-tabs]"); assert_eq!(fix.is_preferred, Some(true)); let diagnostics = fix.diagnostics.as_ref().expect("the finding it resolves"); assert_eq!(diagnostics.len(), 1); assert_eq!(diagnostics[0].code, Some(lsp_types::NumberOrString::String("no-tabs".into()))); - // The edit must reproduce what `vfmt check --fix` would have written. + // The edit must reproduce what `lucisv check --fix` would have written. let expected = vlog_linter::apply_fixes( text, &run(text, Some("/rtl/m.sv".into()), &default_rules()), @@ -301,7 +301,8 @@ mod tests { } /// A tab inside a fence and a tab outside one, both `no-tabs` findings. - const FENCED: &str = "module m;\n// vfmt: off\n\twire a;\n// vfmt: on\n\twire b;\nendmodule\n"; + const FENCED: &str = + "module m;\n// lucisv: off\n\twire a;\n// lucisv: on\n\twire b;\nendmodule\n"; #[test] fn a_violation_inside_a_fence_gets_a_diagnostic_but_no_quick_fix() { @@ -339,7 +340,7 @@ mod tests { .expect("a fixAll action"); let output = applied(FENCED, all); assert_eq!( - output, "module m;\n// vfmt: off\n\twire a;\n// vfmt: on\n wire b;\nendmodule\n", + output, "module m;\n// lucisv: off\n\twire a;\n// lucisv: on\n wire b;\nendmodule\n", "the fenced line is byte-identical, the free one is fixed" ); // And the fenced bytes really are the input's own, tab included. @@ -357,7 +358,7 @@ mod tests { #[test] fn a_waived_violation_offers_no_fix() { - let text = "module m;\n\twire a; // vfmt: waive no-tabs\nendmodule\n"; + let text = "module m;\n\twire a; // lucisv: waive no-tabs\nendmodule\n"; let ws = workspace(text); assert!(actions_of(&ws).is_empty(), "a waiver silences the lightbulb too"); } @@ -371,7 +372,7 @@ mod tests { let fix_all_only = [CodeActionKind::new(FIX_ALL)]; let actions = code_actions(&uri(), doc, whole, Some(&fix_all_only), 2); assert_eq!(actions.len(), 1, "no quick fixes when only fixAll was asked for"); - // `source` is a prefix filter for `source.fixAll.vfmt`. + // `source` is a prefix filter for `source.fixAll.lucisv`. let source = [CodeActionKind::SOURCE]; assert_eq!(code_actions(&uri(), doc, whole, Some(&source), 2).len(), 1); // And an unrelated filter selects nothing. diff --git a/crates/vfmt_server/src/completion.rs b/crates/lucisv_server/src/completion.rs similarity index 99% rename from crates/vfmt_server/src/completion.rs rename to crates/lucisv_server/src/completion.rs index eddd5ba..96a8e9e 100644 --- a/crates/vfmt_server/src/completion.rs +++ b/crates/lucisv_server/src/completion.rs @@ -317,7 +317,7 @@ fn offered(template: &Template, at_item: bool, at_statement: bool) -> bool { } /// How generated text is indented at `offset`: the line's own indentation, and -/// one step as `vfmt.indent` spells it. +/// one step as `lucisv.indent` spells it. /// /// Private again as of 2026-08-25. `inline.rs` used to share it, so that ghost /// text and the completion list could not indent the same body differently; @@ -906,7 +906,7 @@ endmodule impl Tree { fn new(name: &str) -> Tree { let path = std::env::temp_dir() - .join(format!("vfmt_server_completion_{}_{name}", std::process::id())); + .join(format!("lucisv_server_completion_{}_{name}", std::process::id())); let _ = fs::remove_dir_all(&path); fs::create_dir_all(&path).expect("temp dir"); Tree { path } @@ -1168,7 +1168,7 @@ endmodule // appear is the tabstop syntax that would eat it. assert!(!text.contains("${"), "no tabstop may survive here: {text}"); assert!(text.contains(".\\my-port$1 (\\my-port$1 )"), "{text}"); - let probe = format!("module vfmt_probe;\n{text}\nendmodule\n"); + let probe = format!("module lucisv_probe;\n{text}\nendmodule\n"); assert!( vlog_parser::parse_source_tolerant(&probe).1.is_empty(), "the inserted text must parse: {text}" @@ -1736,8 +1736,8 @@ endmodule // A buffer that is not on disk: it overlays the walk, so the corpus is // never written to. - let top = "module vfmt_probe;\n logic clk;\n assign x = pr\nendmodule\n"; - let uri = path_to_uri(&corpus.join("vfmt_probe.sv")).expect("uri"); + let top = "module lucisv_probe;\n logic clk;\n assign x = pr\nendmodule\n"; + let uri = path_to_uri(&corpus.join("lucisv_probe.sv")).expect("uri"); ws.set_document(uri.clone(), top.to_string()); let offset = (top.find("= pr").expect("needle") + 4) as u32; let position = ws.document(&uri).expect("open").positions().position(offset); diff --git a/crates/vfmt_server/src/convert.rs b/crates/lucisv_server/src/convert.rs similarity index 99% rename from crates/vfmt_server/src/convert.rs rename to crates/lucisv_server/src/convert.rs index 06fa046..c968df0 100644 --- a/crates/vfmt_server/src/convert.rs +++ b/crates/lucisv_server/src/convert.rs @@ -4,7 +4,7 @@ //! speaks UTF-16 code units within a line. The two agree only on ASCII, which //! is why getting this wrong survives to production. The exact rules — mid- //! character clamping, surrogate halves, CRLF — are in -//! `docs/features/vfmt-server/README.md`. +//! `docs/features/lucisv-server/README.md`. use lsp_types::{Position, Range}; use vlog_parser::{LineIndex, TextRange}; diff --git a/crates/vfmt_server/src/diagnostics.rs b/crates/lucisv_server/src/diagnostics.rs similarity index 98% rename from crates/vfmt_server/src/diagnostics.rs rename to crates/lucisv_server/src/diagnostics.rs index b10cb5d..0426478 100644 --- a/crates/vfmt_server/src/diagnostics.rs +++ b/crates/lucisv_server/src/diagnostics.rs @@ -6,7 +6,7 @@ use crate::state::Document; /// The source string every diagnostic this server publishes carries, so a /// user can tell ours from another server's. -pub const SOURCE: &str = "vfmt"; +pub const SOURCE: &str = "lucisv"; /// Everything the server has to say about a buffer: the parse errors first, /// then the lint warnings. @@ -95,7 +95,7 @@ mod tests { assert_eq!(diags.len(), 1); assert_eq!(diags[0].range.start.line, 1, "the broken line, 0-based"); assert_eq!(diags[0].severity, Some(DiagnosticSeverity::ERROR)); - assert_eq!(diags[0].source.as_deref(), Some("vfmt")); + assert_eq!(diags[0].source.as_deref(), Some("lucisv")); assert!(diags[0].range.start < diags[0].range.end, "never zero-width"); } @@ -128,7 +128,7 @@ mod tests { let severities: Vec<_> = published.iter().map(|d| d.severity).collect(); assert!(severities.contains(&Some(DiagnosticSeverity::ERROR)), "{published:#?}"); assert!(severities.contains(&Some(DiagnosticSeverity::WARNING)), "{published:#?}"); - assert!(published.iter().all(|d| d.source.as_deref() == Some("vfmt"))); + assert!(published.iter().all(|d| d.source.as_deref() == Some("lucisv"))); // Errors first: a parse error is what the user must fix. assert_eq!(published[0].severity, Some(DiagnosticSeverity::ERROR)); } diff --git a/crates/vfmt_server/src/expand.rs b/crates/lucisv_server/src/expand.rs similarity index 99% rename from crates/vfmt_server/src/expand.rs rename to crates/lucisv_server/src/expand.rs index a99d446..bc11505 100644 --- a/crates/vfmt_server/src/expand.rs +++ b/crates/lucisv_server/src/expand.rs @@ -3,7 +3,7 @@ //! One step means one thing: the definition's body with the call site's //! arguments substituted for the parameters. A nested `` `INNER`` inside the //! body stays exactly as written — expanding it too would be preprocessing, -//! and TODO.md §7 says vfmt does not preprocess. So this module is the same +//! and TODO.md §7 says lucisv does not preprocess. So this module is the same //! kind of bookkeeping `vlog_parser::defines` is: it never touches the //! formatter, never rewrites the buffer, and its only consumer is the hover //! card. See `docs/features/macro-expansion/README.md` for the full rule diff --git a/crates/vfmt_server/src/folding.rs b/crates/lucisv_server/src/folding.rs similarity index 100% rename from crates/vfmt_server/src/folding.rs rename to crates/lucisv_server/src/folding.rs diff --git a/crates/vfmt_server/src/format.rs b/crates/lucisv_server/src/format.rs similarity index 90% rename from crates/vfmt_server/src/format.rs rename to crates/lucisv_server/src/format.rs index 91699a5..3036e3e 100644 --- a/crates/vfmt_server/src/format.rs +++ b/crates/lucisv_server/src/format.rs @@ -10,24 +10,24 @@ use std::path::Path; use lsp_types::{FormattingOptions, Range, TextEdit}; -use vfmt_core::config::{Discovery, FileConfig}; +use lucisv_core::config::{Discovery, FileConfig}; use vlog_formatter::{format_range, format_source, Config, LineRanges}; use crate::settings::ClientSettings; use crate::state::Document; -/// Indent widths a client may ask for. The same 1..8 range `vfmt.toml`'s own +/// Indent widths a client may ask for. The same 1..8 range `lucisv.toml`'s own /// `indent` key allows, so the two agree. const INDENT_RANGE: std::ops::RangeInclusive = 1..=8; /// What to format a buffer with, and the config problem to tell the user -/// about. The two are separate because a broken `vfmt.toml` must not stop the +/// about. The two are separate because a broken `lucisv.toml` must not stop the /// buffer from being formatted. pub struct Settings { /// The settings to format with — the fallback defaults when `problem` is /// set. pub config: Config, - /// The `vfmt.toml` error governing this buffer, if there is one. + /// The `lucisv.toml` error governing this buffer, if there is one. pub problem: Option, } @@ -35,11 +35,11 @@ pub struct Settings { /// /// Precedence, highest first: /// -/// 1. **`vfmt.toml`** — a checked-in config is the project speaking, and it +/// 1. **`lucisv.toml`** — a checked-in config is the project speaking, and it /// must stay authoritative or format-on-save would disagree with CI's -/// `vfmt --check`. That divergence is the exact thing lifting the config -/// into `vfmt_core` exists to remove. -/// 2. **The client's `vfmt.*` settings** (`settings.rs`) — typed on purpose +/// `lucisv --check`. That divergence is the exact thing lifting the config +/// into `lucisv_core` exists to remove. +/// 2. **The client's `lucisv.*` settings** (`settings.rs`) — typed on purpose /// into an editor's settings UI, so more deliberate than a tab size, but /// it is one user's editor and the repository outranks it. /// 3. **`FormattingOptions::tab_size`** — sent on every request whether or @@ -49,7 +49,7 @@ pub struct Settings { /// 4. **The built-in default.** /// /// Each rung applies only where every rung above it is silent, so a project -/// with no `vfmt.toml` and no `vfmt.*` settings behaves exactly as it did +/// with no `lucisv.toml` and no `lucisv.*` settings behaves exactly as it did /// before either existed. pub fn settings_for( doc: &Document, @@ -109,7 +109,7 @@ pub fn range_formatting( /// /// A `textDocument/codeAction` request carries no `FormattingOptions`, so there /// is no client `tabSize` to consider here — the precedence is the same ladder -/// `settings_for` documents with rung 3 missing: `vfmt.toml` > `vfmt.indent` > +/// `settings_for` documents with rung 3 missing: `lucisv.toml` > `lucisv.indent` > /// the built-in default. A broken config is silent on this path: the /// formatting path is where the user is told about it, and warning from a /// lightbulb the editor requests on every cursor move would be noise. @@ -123,7 +123,7 @@ pub fn indent_width(path: Option<&Path>, client: &ClientSettings) -> usize { /// has no directory to search from, so it gets no config. fn discover(path: Option<&Path>) -> (FileConfig, Option) { let Some(path) = path else { return (FileConfig::default(), None) }; - // A fresh `Discovery` per request, so a `vfmt.toml` edited while the + // A fresh `Discovery` per request, so a `lucisv.toml` edited while the // server runs takes effect at the next format. One file read on an // explicit, user-initiated request is cheaper than any cache invalidation // scheme that could be wrong. @@ -133,16 +133,16 @@ fn discover(path: Option<&Path>) -> (FileConfig, Option) { } } -/// Fold the config file, the pushed `vfmt.*` settings and the client's tab +/// Fold the config file, the pushed `lucisv.*` settings and the client's tab /// options into formatter settings, in the precedence `settings_for` /// documents. Written weakest-first, so the last writer wins. /// /// The client's `tab_size` is taken only when the request is sane: a client /// asking for hard tabs, or for a 40-space indent, is asking for something -/// vfmt does not do, and silently honoring half of it is worse than ignoring -/// it. `vfmt.lineLength` has no `FormattingOptions` analog at all — the +/// lucisv does not do, and silently honoring half of it is worse than ignoring +/// it. `lucisv.lineLength` has no `FormattingOptions` analog at all — the /// protocol carries no line-length option — so before it existed there was no -/// way to set a width from an editor without a `vfmt.toml`. +/// way to set a width from an editor without a `lucisv.toml`. fn config_from(file: &FileConfig, client: &ClientSettings, options: &FormattingOptions) -> Config { let mut config = Config::default(); if options.insert_spaces && INDENT_RANGE.contains(&options.tab_size) { @@ -184,7 +184,7 @@ mod tests { FormattingOptions { tab_size, insert_spaces, ..Default::default() } } - /// No `vfmt.*` settings pushed — what every test predating them assumes. + /// No `lucisv.*` settings pushed — what every test predating them assumes. fn none() -> ClientSettings { ClientSettings::default() } @@ -222,7 +222,7 @@ mod tests { formatting(doc, &settings_for(doc, client, options).config) } - /// A scratch directory holding a `vfmt.toml` and one source file, so + /// A scratch directory holding a `lucisv.toml` and one source file, so /// discovery runs against a real tree. Removed on drop. struct Tree { path: PathBuf, @@ -233,13 +233,13 @@ mod tests { static COUNTER: AtomicUsize = AtomicUsize::new(0); let n = COUNTER.fetch_add(1, Ordering::Relaxed); let path = - std::env::temp_dir().join(format!("vfmt_server_fmt_{}_{n}", std::process::id())); + std::env::temp_dir().join(format!("lucisv_server_fmt_{}_{n}", std::process::id())); let _ = std::fs::remove_dir_all(&path); std::fs::create_dir_all(&path).expect("temp dir"); - // A `.git` marker stops discovery here, so a `vfmt.toml` in a real + // A `.git` marker stops discovery here, so a `lucisv.toml` in a real // ancestor of the temp dir can never leak into these tests. std::fs::write(path.join(".git"), "gitdir: nowhere\n").expect("write .git"); - std::fs::write(path.join("vfmt.toml"), config).expect("write config"); + std::fs::write(path.join("lucisv.toml"), config).expect("write config"); Tree { path } } @@ -317,11 +317,11 @@ mod tests { #[test] fn a_config_file_beats_the_editors_tab_size() { // The precedence decision, pinned: `tab_size` is the editor's default - // unless the user changed it, and a checked-in `vfmt.toml` is always + // unless the user changed it, and a checked-in `lucisv.toml` is always // deliberate. See `settings_for`. let file = FileConfig { line_length: Some(120), indent: Some(4), ..Default::default() }; let config = config_from(&file, &none(), &options(2, true)); - assert_eq!(config.indent_width, 4, "vfmt.toml wins over tab_size"); + assert_eq!(config.indent_width, 4, "lucisv.toml wins over tab_size"); assert_eq!(config.max_width, 120, "line-length has no client analog at all"); // Where the config is silent the tab size still beats the default. let only_width = FileConfig { line_length: Some(120), ..Default::default() }; @@ -329,7 +329,7 @@ mod tests { } #[test] - fn a_vfmt_toml_governs_the_buffer_it_sits_above() { + fn a_lucisv_toml_governs_the_buffer_it_sits_above() { let tree = Tree::new("indent = 4\n"); let (ws, uri) = tree.document("module m;\nwire a;\nendmodule\n"); // The client asks for 2, the config says 4: the config wins. @@ -341,13 +341,13 @@ mod tests { } #[test] - fn a_broken_vfmt_toml_reports_a_problem_and_formats_with_defaults() { + fn a_broken_lucisv_toml_reports_a_problem_and_formats_with_defaults() { let tree = Tree::new("indent = 4\nbogus = 1\n"); let (ws, uri) = tree.document("module m;\nwire a;\nendmodule\n"); let settings = settings(&ws, &uri, &options(2, true)); let problem = settings.problem.expect("a broken config must be reported"); assert!(problem.contains("unknown key `bogus`"), "{problem}"); - assert!(problem.contains("vfmt.toml:2"), "the message names file and line: {problem}"); + assert!(problem.contains("lucisv.toml:2"), "the message names file and line: {problem}"); // Nothing from the broken file is used, not even the key that parsed. assert_eq!(settings.config.indent_width, Config::default().indent_width); // And the buffer is still formatted: an editor must not hard-fail on a @@ -359,7 +359,7 @@ mod tests { #[test] fn a_lint_fixs_indent_comes_from_the_config_or_the_built_in_default() { // A code action has no `tabSize` to consider, so a quick fix that - // writes spaces where a tab was gets the buffer's own `vfmt.toml`. + // writes spaces where a tab was gets the buffer's own `lucisv.toml`. let tree = Tree::new("indent = 4\n"); let (ws, uri) = tree.document("module m;\n\twire a;\nendmodule\n"); let doc = ws.document(&uri).expect("open"); @@ -393,7 +393,7 @@ mod tests { // the precedence ladder, one rung at a time // ------------------------------------------------------------------ - /// `vfmt.*` settings as a client would push them. + /// `lucisv.*` settings as a client would push them. fn pushed(line_length: Option, indent: Option) -> ClientSettings { ClientSettings { line_length, indent, ..Default::default() } } @@ -401,13 +401,13 @@ mod tests { #[test] fn rung_1_a_config_file_beats_a_pushed_setting() { // The whole reason the ladder is in this order: a checked-in - // `vfmt.toml` is the project speaking, and format-on-save must agree - // with what `vfmt --check` does in CI. + // `lucisv.toml` is the project speaking, and format-on-save must agree + // with what `lucisv --check` does in CI. let tree = Tree::new("indent = 4\nline-length = 120\n"); let (ws, uri) = tree.document("module m;\nwire a;\nendmodule\n"); let client = pushed(Some(80), Some(8)); let settings = settings_with(&ws, &uri, &client, &options(2, true)); - assert_eq!(settings.config.indent_width, 4, "vfmt.toml wins"); + assert_eq!(settings.config.indent_width, 4, "lucisv.toml wins"); assert_eq!(settings.config.max_width, 120, "for line-length too"); let edit = edit_with(&ws, &uri, &client, &options(2, true)).expect("formats"); assert_eq!(edit.expect("changed").new_text, "module m;\n wire a;\nendmodule\n"); @@ -416,7 +416,7 @@ mod tests { #[test] fn rung_2_a_pushed_setting_beats_the_editors_tab_size() { // `tabSize` arrives on every request whether the user chose it or - // not; `vfmt.indent` was typed on purpose. + // not; `lucisv.indent` was typed on purpose. let (ws, uri) = document("module m;\nwire a;\nendmodule\n"); let client = pushed(None, Some(4)); let settings = settings_with(&ws, &uri, &client, &options(2, true)); @@ -446,7 +446,7 @@ mod tests { #[test] fn each_key_climbs_the_ladder_independently() { - // A `vfmt.toml` naming only `indent` must not also claim the width: + // A `lucisv.toml` naming only `indent` must not also claim the width: // the pushed `lineLength` is still the best answer for that key. let tree = Tree::new("indent = 4\n"); let (ws, uri) = tree.document("module m;\nwire a;\nendmodule\n"); @@ -458,7 +458,7 @@ mod tests { #[test] fn a_pushed_line_length_is_the_only_way_to_set_a_width_without_a_config() { // The protocol has no line-length option at all, so before - // `vfmt.lineLength` a config-less project could not narrow its lines + // `lucisv.lineLength` a config-less project could not narrow its lines // from the editor. This is the new capability, at the level that // actually reflows text. let long = "module m;\n assign a = bbbbbbbbbbbb + cccccccccccc + dddddddddddd + eeeeeeeeeeee;\nendmodule\n"; @@ -472,7 +472,7 @@ mod tests { #[test] fn an_untitled_buffer_honours_pushed_settings() { - // It has no directory to discover a `vfmt.toml` from, so rung 2 is the + // It has no directory to discover a `lucisv.toml` from, so rung 2 is the // highest rung it has — and before this feature it had only `tabSize`. let uri = Uri::from_str("untitled:Untitled-1").expect("uri"); let mut ws = Workspace::default(); @@ -485,8 +485,8 @@ mod tests { #[test] fn a_lint_fix_climbs_the_same_ladder_without_rung_3() { - // A code action has no `tabSize`, so `vfmt.indent` is the only thing - // under a `vfmt.toml` here. + // A code action has no `tabSize`, so `lucisv.indent` is the only thing + // under a `lucisv.toml` here. let tree = Tree::new("indent = 4\n"); let (ws, uri) = tree.document("module m;\n\twire a;\nendmodule\n"); let doc = ws.document(&uri).expect("open"); @@ -497,7 +497,7 @@ mod tests { #[test] fn a_broken_config_leaves_the_pushed_settings_in_charge() { - // Nothing from a broken `vfmt.toml` is used, so the next rung down is + // Nothing from a broken `lucisv.toml` is used, so the next rung down is // the one that answers — which is now the pushed settings, not the // built-in default. let tree = Tree::new("indent = 4\nbogus = 1\n"); diff --git a/crates/vfmt_server/src/hierarchy.rs b/crates/lucisv_server/src/hierarchy.rs similarity index 99% rename from crates/vfmt_server/src/hierarchy.rs rename to crates/lucisv_server/src/hierarchy.rs index 72cb127..93b4f90 100644 --- a/crates/vfmt_server/src/hierarchy.rs +++ b/crates/lucisv_server/src/hierarchy.rs @@ -279,7 +279,7 @@ mod tests { impl Tree { fn new(name: &str) -> Tree { let path = std::env::temp_dir() - .join(format!("vfmt_server_hierarchy_{}_{name}", std::process::id())); + .join(format!("lucisv_server_hierarchy_{}_{name}", std::process::id())); let _ = fs::remove_dir_all(&path); fs::create_dir_all(&path).expect("temp dir"); Tree { path } @@ -499,7 +499,7 @@ endmodule tree.write("sub.sv", SUB); tree.write("top.sv", TOP); tree.write("files.f", "sub.sv\n"); - tree.write("vfmt.toml", "filelist = \"files.f\"\n"); + tree.write("lucisv.toml", "filelist = \"files.f\"\n"); let mut ws = Workspace::default(); ws.open_roots(vec![tree.path.clone()]); let sub_uri = path_to_uri(&tree.path.join("sub.sv")).expect("uri"); @@ -757,7 +757,7 @@ endmodule // Unlike `inlay.rs` (which treats an `ifdef`-carrying list as an // uncertainty and stays silent, see docs/features/inlay-hints — // "ifdef" QA finding), this feature's README documents no `ifdef` - // policy at all. The answer is arguably the honest one — vfmt cannot + // policy at all. The answer is arguably the honest one — lucisv cannot // know which arm is live, and showing both is not a *wrong* single // claim the way a mis-ordered port hint would be — but it should be // stated as an Assumption rather than left silent. See QA log. diff --git a/crates/vfmt_server/src/hover.rs b/crates/lucisv_server/src/hover.rs similarity index 98% rename from crates/vfmt_server/src/hover.rs rename to crates/lucisv_server/src/hover.rs index 7383df1..c229943 100644 --- a/crates/vfmt_server/src/hover.rs +++ b/crates/lucisv_server/src/hover.rs @@ -3,7 +3,7 @@ //! Four things can be under the cursor, tried in this order: a macro usage, a //! reference resolved in this file, a reference the workspace answered, and a //! declaration itself. The order and the rendering rules are in -//! `docs/features/vfmt-server/README.md`. +//! `docs/features/lucisv-server/README.md`. //! //! A macro card also shows what the hovered use expands to in one step, when //! that is more than the body it already prints — `crate::expand` and @@ -245,7 +245,7 @@ mod tests { fn temp_dir(tag: &str) -> PathBuf { let dir = - std::env::temp_dir().join(format!("vfmt_server_hover_{tag}_{}", std::process::id())); + std::env::temp_dir().join(format!("lucisv_server_hover_{tag}_{}", std::process::id())); let _ = fs::remove_dir_all(&dir); fs::create_dir_all(&dir).expect("temp dir"); dir @@ -625,7 +625,7 @@ mod qa_findings { /// the dev shipped in this file only exercise the quoted form. #[test] fn an_angled_include_narrows_hover_same_as_a_quoted_one() { - let dir = std::env::temp_dir().join(format!("vfmt_qa_hover_sys_{}", std::process::id())); + let dir = std::env::temp_dir().join(format!("lucisv_qa_hover_sys_{}", std::process::id())); let _ = fs::remove_dir_all(&dir); fs::create_dir_all(dir.join("inc")).expect("mkdir"); fs::write(dir.join("inc/uvm_macros.svh"), "`define W 8\n").expect("write"); @@ -684,7 +684,7 @@ mod qa_findings { #[cfg(any(target_os = "macos", target_os = "windows"))] #[test] fn a_case_mismatched_include_still_counts_as_reachable() { - let dir = std::env::temp_dir().join(format!("vfmt_qa_hover_case_{}", std::process::id())); + let dir = std::env::temp_dir().join(format!("lucisv_qa_hover_case_{}", std::process::id())); let _ = fs::remove_dir_all(&dir); fs::create_dir_all(&dir).expect("mkdir"); fs::write(dir.join("Defs.svh"), "`define W 8\n").expect("write"); diff --git a/crates/vfmt_server/src/includes.rs b/crates/lucisv_server/src/includes.rs similarity index 98% rename from crates/vfmt_server/src/includes.rs rename to crates/lucisv_server/src/includes.rs index 2739e00..642b389 100644 --- a/crates/vfmt_server/src/includes.rs +++ b/crates/lucisv_server/src/includes.rs @@ -210,7 +210,7 @@ impl IncludeGraph { /// Fold `.`/`..` away so one file has one spelling, and so a resolved include /// compares equal to the same file's path in the index. Symlinks are -/// deliberately not resolved, matching `vfmt_core`'s lexical rule. +/// deliberately not resolved, matching `lucisv_core`'s lexical rule. fn normalize(path: &Path) -> PathBuf { let mut out = PathBuf::new(); for component in path.components() { @@ -352,7 +352,7 @@ mod tests { impl Tree { fn new(name: &str) -> Tree { let path = std::env::temp_dir() - .join(format!("vfmt_server_includes_{}_{name}", std::process::id())); + .join(format!("lucisv_server_includes_{}_{name}", std::process::id())); let _ = fs::remove_dir_all(&path); fs::create_dir_all(&path).expect("temp dir"); Tree { path } @@ -608,7 +608,7 @@ mod tests { /// Order-of-magnitude perf checks, not run as part of the ordinary suite: /// timing assertions in a shared runner are flaky by nature. Run with - /// `cargo test --release -p vfmt_server --bin vfmt-server perf -- --ignored --nocapture`. + /// `cargo test --release -p lucisv_server --bin lucisv-server perf -- --ignored --nocapture`. mod perf { use super::*; @@ -693,7 +693,7 @@ mod qa_scope_probe { /// list — but pinned here since it was previously untested. #[test] fn a_link_resolves_to_a_file_the_filelist_never_names() { - let dir = std::env::temp_dir().join(format!("vfmt_qa_outscope_{}", std::process::id())); + let dir = std::env::temp_dir().join(format!("lucisv_qa_outscope_{}", std::process::id())); let _ = fs::remove_dir_all(&dir); fs::create_dir_all(dir.join("inc")).expect("mkdir"); // defs.svh exists on disk but is not named in files.f. @@ -734,7 +734,8 @@ mod qa_round2 { #[cfg(any(target_os = "macos", target_os = "windows"))] #[test] fn three_files_colliding_on_one_folded_spelling_stay_ambiguous() { - let dir = std::env::temp_dir().join(format!("vfmt_qa_r2_threeway_{}", std::process::id())); + let dir = + std::env::temp_dir().join(format!("lucisv_qa_r2_threeway_{}", std::process::id())); let _ = fs::remove_dir_all(&dir); fs::create_dir_all(&dir).expect("mkdir"); let top = dir.join("top.sv"); @@ -765,7 +766,8 @@ mod qa_round2 { #[cfg(any(target_os = "macos", target_os = "windows"))] #[test] fn a_case_mismatch_on_a_file_outside_the_graphs_scope_is_unchanged() { - let dir = std::env::temp_dir().join(format!("vfmt_qa_r2_outscope_{}", std::process::id())); + let dir = + std::env::temp_dir().join(format!("lucisv_qa_r2_outscope_{}", std::process::id())); let _ = fs::remove_dir_all(&dir); fs::create_dir_all(&dir).expect("mkdir"); let top = dir.join("top.sv"); diff --git a/crates/vfmt_server/src/inlay.rs b/crates/lucisv_server/src/inlay.rs similarity index 99% rename from crates/vfmt_server/src/inlay.rs rename to crates/lucisv_server/src/inlay.rs index 96838e5..f89006b 100644 --- a/crates/vfmt_server/src/inlay.rs +++ b/crates/lucisv_server/src/inlay.rs @@ -235,7 +235,7 @@ endmodule impl Tree { fn new(name: &str) -> Tree { let path = std::env::temp_dir() - .join(format!("vfmt_server_inlay_{}_{name}", std::process::id())); + .join(format!("lucisv_server_inlay_{}_{name}", std::process::id())); let _ = fs::remove_dir_all(&path); fs::create_dir_all(&path).expect("temp dir"); Tree { path } @@ -727,7 +727,7 @@ endmodule /// Order-of-magnitude perf checks, not run as part of the ordinary suite: /// timing assertions in a shared CI runner are flaky by nature. Run with - /// `cargo test --release -p vfmt_server --bin vfmt-server qa_perf -- --ignored --nocapture`. + /// `cargo test --release -p lucisv_server --bin lucisv-server qa_perf -- --ignored --nocapture`. mod qa_perf { use super::*; diff --git a/crates/vfmt_server/src/inline.rs b/crates/lucisv_server/src/inline.rs similarity index 99% rename from crates/vfmt_server/src/inline.rs rename to crates/lucisv_server/src/inline.rs index d46166d..b98dc2b 100644 --- a/crates/vfmt_server/src/inline.rs +++ b/crates/lucisv_server/src/inline.rs @@ -371,7 +371,7 @@ fn rest_of_line_is_blank(text: &str, offset: u32) -> bool { /// /// So the server says "one step in" and the editor says where and how wide: /// `\t` is the one character `normalizeIndentation` re-spells as the user's -/// own `editor.tabSize`/`insertSpaces`. The consequence is that `vfmt.indent` +/// own `editor.tabSize`/`insertSpaces`. The consequence is that `lucisv.indent` /// does **not** decide the width of an accepted snippet — the editor's /// settings do, which is the more correct answer for text the editor is /// writing. There is no plain-text spelling here: unlike a completion item, an @@ -531,7 +531,7 @@ mod tests { #[test] fn the_indent_setting_no_longer_reaches_a_snippet() { - // `vfmt.indent` still decides what the *formatter* writes and what the + // `lucisv.indent` still decides what the *formatter* writes and what the // completion popup inserts; an accepted inline snippet is laid out by // the editor's own tab settings, because the editor re-spells the // leading whitespace on insert whatever the server sent. @@ -986,9 +986,11 @@ endmodule match trigger.keyword { "module" => format!("{text}\n"), "generate" | "always" | "always_ff" => { - format!("module vfmt_probe;\n {text}\nendmodule\n") + format!("module lucisv_probe;\n {text}\nendmodule\n") + } + _ => { + format!("module lucisv_probe;\n always @(*) begin\n {text}\n end\nendmodule\n") } - _ => format!("module vfmt_probe;\n always @(*) begin\n {text}\n end\nendmodule\n"), } } diff --git a/crates/vfmt_server/src/instantiations.rs b/crates/lucisv_server/src/instantiations.rs similarity index 100% rename from crates/vfmt_server/src/instantiations.rs rename to crates/lucisv_server/src/instantiations.rs diff --git a/crates/vfmt_server/src/lint.rs b/crates/lucisv_server/src/lint.rs similarity index 94% rename from crates/vfmt_server/src/lint.rs rename to crates/lucisv_server/src/lint.rs index aa20195..f710c7f 100644 --- a/crates/vfmt_server/src/lint.rs +++ b/crates/lucisv_server/src/lint.rs @@ -1,9 +1,9 @@ //! Lint findings, and the diagnostics they become. //! -//! `vlog_linter` is the same engine `vfmt check` runs, with the same default +//! `vlog_linter` is the same engine `lucisv check` runs, with the same default //! rule set — an editor that disagreed with CI about what a violation is would //! be worse than one that showed none. Selection (`--select`/`--ignore`) has no -//! `vfmt.toml` key yet, so there is nothing here to configure; see +//! `lucisv.toml` key yet, so there is nothing here to configure; see //! `docs/features/server-lint/README.md`. use lsp_types::{Diagnostic, DiagnosticSeverity, NumberOrString}; @@ -39,12 +39,12 @@ pub fn violations(doc: &Document) -> Vec { /// The findings a code action may offer a fix for, with their fixes built for /// `tab_width`. /// -/// The code-action path passes the indent width of the `vfmt.toml` governing -/// the buffer, so a quick fix that replaces a tab writes exactly what `vfmt` +/// The code-action path passes the indent width of the `lucisv.toml` governing +/// the buffer, so a quick fix that replaces a tab writes exactly what `lucisv` /// would have written there. /// /// A finding whose fix would edit bytes inside a `// verilog_format: off` -/// region is dropped here, so the editor keeps the same promise `vfmt check +/// region is dropped here, so the editor keeps the same promise `lucisv check /// --fix` does: **reported, never auto-fixed**. The diagnostic still reaches /// the user — [`violations`] is the publishing path and is not filtered — it /// just has no lightbulb. Which bytes count as fenced is @@ -115,14 +115,14 @@ mod tests { assert_eq!(diags.len(), 1); assert_eq!(diags[0].severity, Some(DiagnosticSeverity::WARNING)); assert_eq!(diags[0].code, Some(NumberOrString::String("no-tabs".into()))); - assert_eq!(diags[0].source.as_deref(), Some("vfmt")); + assert_eq!(diags[0].source.as_deref(), Some("lucisv")); assert_eq!(diags[0].range.start.line, 1); assert!(diags[0].range.start < diags[0].range.end, "never zero-width"); } #[test] fn a_waived_violation_is_never_published() { - let (ws, uri) = doc_of("module m;\n\twire a; // vfmt: waive no-tabs\nendmodule\n"); + let (ws, uri) = doc_of("module m;\n\twire a; // lucisv: waive no-tabs\nendmodule\n"); assert!(diagnostics(ws.document(&uri).expect("open")).is_empty()); } @@ -171,7 +171,7 @@ mod tests { fn a_violation_inside_a_fence_is_reported_but_not_fixable() { // `off` means hands-off for the editor too: the warning is published, // the fix is withheld. - let text = "module m;\n// vfmt: off\n\twire a;\n// vfmt: on\n\twire b;\nendmodule\n"; + let text = "module m;\n// lucisv: off\n\twire a;\n// lucisv: on\n\twire b;\nendmodule\n"; let (ws, uri) = doc_of(text); let doc = ws.document(&uri).expect("open"); let diags = diagnostics(doc); @@ -187,7 +187,7 @@ mod tests { // Error recovery can swallow the item structure `fence::collect` hangs // a region on — the buffers the server sees mid-keystroke are exactly // that population, and the shared filter's scan half covers them. - let text = "module m;\n@@@ junk;\n// vfmt: off\n\twire a;\n// vfmt: on\nendmodule\n"; + let text = "module m;\n@@@ junk;\n// lucisv: off\n\twire a;\n// lucisv: on\nendmodule\n"; let (ws, uri) = doc_of(text); let doc = ws.document(&uri).expect("open"); assert!( diff --git a/crates/vfmt_server/src/locate.rs b/crates/lucisv_server/src/locate.rs similarity index 100% rename from crates/vfmt_server/src/locate.rs rename to crates/lucisv_server/src/locate.rs diff --git a/crates/vfmt_server/src/main.rs b/crates/lucisv_server/src/main.rs similarity index 97% rename from crates/vfmt_server/src/main.rs rename to crates/lucisv_server/src/main.rs index a970ace..6e0e6d9 100644 --- a/crates/vfmt_server/src/main.rs +++ b/crates/lucisv_server/src/main.rs @@ -1,10 +1,10 @@ -//! `vfmt-server` — the vfmt language server, speaking LSP over stdio. +//! `lucisv-server` — the lucisv language server, speaking LSP over stdio. //! //! One binary for every editor: VS Code through a thin extension, Vim/Neovim //! through built-in LSP config. No editor-specific logic lives below the //! protocol layer, and no language logic lives in it — every answer comes from //! `vlog_parser`, `vlog_semantic` or `vlog_formatter`. See -//! `docs/features/vfmt-server/README.md`. +//! `docs/features/lucisv-server/README.md`. mod candidates; mod code_action; @@ -123,7 +123,7 @@ fn capabilities() -> ServerCapabilities { // Every action is returned complete; there is nothing to resolve. resolve_provider: None, })), - // The port refactorings. `vfmt.addPort` needs a declaration typed by + // The port refactorings. `lucisv.addPort` needs a declaration typed by // the user, which no code action can carry, and a Vim user has no // lightbulb at all — so all three are commands as well. execute_command_provider: Some(ExecuteCommandOptions { @@ -167,7 +167,7 @@ fn capabilities() -> ServerCapabilities { call_hierarchy_provider: Some(CallHierarchyServerCapability::Simple(true)), // Ghost text for `if (` and `begin`, LSP 3.18. `true` rather than // options: there is nothing to configure on the server side, and the - // one thing a user can say — `vfmt.inlineTemplates` — is a setting the + // one thing a user can say — `lucisv.inlineTemplates` — is a setting the // handler reads, not a registration option. The VS Code client only // sends the request after opting into `ProposedFeatures`, so an // extension older than this server simply never asks. @@ -191,7 +191,7 @@ fn initialize_result() -> lsp_types::InitializeResult { lsp_types::InitializeResult { capabilities: capabilities(), server_info: Some(lsp_types::ServerInfo { - name: "vfmt-server".to_string(), + name: "lucisv-server".to_string(), version: Some(env!("CARGO_PKG_VERSION").to_string()), }), // `lsp-types`' `proposed` feature adds an `offsetEncoding` field here @@ -360,7 +360,11 @@ mod tests { fn every_advertised_command_is_one_the_server_runs() { let options = capabilities().execute_command_provider.expect("commands"); assert_eq!(options.commands, ports::commands()); - assert!(options.commands.iter().all(|c| c.starts_with("vfmt.")), "{:?}", options.commands); + assert!( + options.commands.iter().all(|c| c.starts_with("lucisv.")), + "{:?}", + options.commands + ); } #[test] diff --git a/crates/vfmt_server/src/nav.rs b/crates/lucisv_server/src/nav.rs similarity index 99% rename from crates/vfmt_server/src/nav.rs rename to crates/lucisv_server/src/nav.rs index 0f4ea93..cae7a43 100644 --- a/crates/vfmt_server/src/nav.rs +++ b/crates/lucisv_server/src/nav.rs @@ -228,7 +228,7 @@ mod tests { fn temp_dir(tag: &str) -> PathBuf { let dir = - std::env::temp_dir().join(format!("vfmt_server_nav_{tag}_{}", std::process::id())); + std::env::temp_dir().join(format!("lucisv_server_nav_{tag}_{}", std::process::id())); let _ = fs::remove_dir_all(&dir); fs::create_dir_all(&dir).expect("temp dir"); dir diff --git a/crates/vfmt_server/src/pairs.rs b/crates/lucisv_server/src/pairs.rs similarity index 99% rename from crates/vfmt_server/src/pairs.rs rename to crates/lucisv_server/src/pairs.rs index 94e478d..ad38c14 100644 --- a/crates/vfmt_server/src/pairs.rs +++ b/crates/lucisv_server/src/pairs.rs @@ -2,7 +2,7 @@ //! stack over the token stream. //! //! One engine, three consumers, all below: `textDocument/documentHighlight`, -//! the missing-closer warnings, and `vfmt/scopePairs`, which feeds the +//! the missing-closer warnings, and `lucisv/scopePairs`, which feeds the //! extension's rainbow colouring. Matching runs over `Document.tokens` //! rather than the text, so a `// end` in a comment or a `"begin"` in a string //! cannot be mistaken for a keyword: the lexer has already thrown comments out @@ -396,7 +396,7 @@ fn covers(span: TextRange, offset: u32) -> bool { } // ---------------------------------------------------------------------- -// vfmt/scopePairs — the extension's rainbow +// lucisv/scopePairs — the extension's rainbow // ---------------------------------------------------------------------- /// The custom request the VS Code extension polls for rainbow colouring. @@ -406,9 +406,9 @@ fn covers(span: TextRange, offset: u32) -> bool { /// different ranges. A custom method needs no capability — a client that does /// not know it simply never sends it, and one that does gets an error if this /// server is too old, which is the same handshake a capability would give. -pub const SCOPE_PAIRS_METHOD: &str = "vfmt/scopePairs"; +pub const SCOPE_PAIRS_METHOD: &str = "lucisv/scopePairs"; -/// `vfmt/scopePairs` params — the document to describe, and nothing else. +/// `lucisv/scopePairs` params — the document to describe, and nothing else. #[derive(serde::Deserialize)] #[serde(rename_all = "camelCase")] pub struct ScopePairsParams { @@ -424,7 +424,7 @@ pub struct ScopePair { pub depth: u32, } -/// The `vfmt/scopePairs` result. An object rather than a bare array so a later +/// The `lucisv/scopePairs` result. An object rather than a bare array so a later /// round can add a field without breaking a client that ignores it. #[derive(serde::Serialize)] pub struct ScopePairs { @@ -1438,7 +1438,7 @@ mod tests { } // ------------------------------------------------------------------ - // vfmt/scopePairs + // lucisv/scopePairs // ------------------------------------------------------------------ #[test] @@ -1598,7 +1598,7 @@ mod tests { } // ------------------------------------------------------------------ - // vfmt/scopePairs — unmatched block delimiters + // lucisv/scopePairs — unmatched block delimiters // ------------------------------------------------------------------ /// The unmatched ranges of a buffer as `(line, character)` starts. @@ -1736,7 +1736,7 @@ mod tests { let warnings = missing_end_diagnostics(&doc); assert_eq!(warnings.len(), 1); assert_eq!(warnings[0].severity, Some(DiagnosticSeverity::WARNING)); - assert_eq!(warnings[0].source.as_deref(), Some("vfmt")); + assert_eq!(warnings[0].source.as_deref(), Some("lucisv")); assert_eq!(warnings[0].range.start.line, 1, "the `initial begin` line"); assert_eq!(warnings[0].message, "`begin` has no matching `end` — is an `end` missing?"); } diff --git a/crates/vfmt_server/src/ports.rs b/crates/lucisv_server/src/ports.rs similarity index 92% rename from crates/vfmt_server/src/ports.rs rename to crates/lucisv_server/src/ports.rs index df09966..4699f64 100644 --- a/crates/vfmt_server/src/ports.rs +++ b/crates/lucisv_server/src/ports.rs @@ -8,8 +8,8 @@ //! //! **Why commands as well as code actions.** Adding a port needs a //! declaration typed by the user, and a code action carries no input — so -//! `vfmt.addPort` is the API a UI calls once it has asked. `vfmt.removePort` -//! and `vfmt.propagatePorts` take a position and exist for the same reason a +//! `lucisv.addPort` is the API a UI calls once it has asked. `lucisv.removePort` +//! and `lucisv.propagatePorts` take a position and exist for the same reason a //! Vim user has no lightbulb: a command works everywhere a keybinding does. //! See `docs/features/refactor-ports/README.md`. @@ -32,14 +32,14 @@ use crate::uri::{path_to_uri, uri_to_path}; /// The kind every port refactoring is filed under, so a client can ask for /// them alone. -pub const REFACTOR_PORTS: &str = "refactor.rewrite.vfmt.ports"; +pub const REFACTOR_PORTS: &str = "refactor.rewrite.lucisv.ports"; /// Add a port: `[uri, module-name-or-position, "input logic [7:0] cfg"]`. -pub const ADD_PORT: &str = "vfmt.addPort"; +pub const ADD_PORT: &str = "lucisv.addPort"; /// Remove the port at a position: `[uri, position]`. -pub const REMOVE_PORT: &str = "vfmt.removePort"; +pub const REMOVE_PORT: &str = "lucisv.removePort"; /// Connect an instantiation's missing ports: `[uri, position]`. -pub const PROPAGATE_PORTS: &str = "vfmt.propagatePorts"; +pub const PROPAGATE_PORTS: &str = "lucisv.propagatePorts"; /// Every command this server executes. pub fn commands() -> Vec { @@ -115,12 +115,12 @@ pub fn execute( let offset = position_argument(ws, arguments, PROPAGATE_PORTS)?; vlog_refactor::propagate_ports(&sources, &path, offset)? } - other => return Err(format!("`{other}` is not a vfmt command.")), + other => return Err(format!("`{other}` is not a lucisv command.")), }; Ok((workspace_edit(ws, &refactoring)?, refactoring.warnings)) } -/// What the second argument of `vfmt.addPort` said. +/// What the second argument of `lucisv.addPort` said. enum ModuleArgument { Name(String), Position(Position), @@ -142,13 +142,13 @@ fn module_argument(argument: Option<&Value>) -> ModuleArgument { fn target(ws: &Workspace, argument: Option<&Value>) -> Result<(Uri, PathBuf), String> { let uri: Uri = argument.and_then(|value| serde_json::from_value(value.clone()).ok()).ok_or_else(|| { - "a vfmt port command wants a document URI as its first argument.".to_string() + "a lucisv port command wants a document URI as its first argument.".to_string() })?; let path = ws .document(&uri) .and_then(|doc| doc.path.clone()) .or_else(|| uri_to_path(&uri)) - .ok_or_else(|| "vfmt can only refactor inside a saved file.".to_string())?; + .ok_or_else(|| "lucisv can only refactor inside a saved file.".to_string())?; Ok((uri, path)) } @@ -167,8 +167,9 @@ fn offset_of(ws: &Workspace, uri: Option<&Value>, position: Position) -> Result< match ws.document(&uri) { Some(doc) => Ok(doc.positions().offset(position)), None => { - let text = - ws.text_of(&path).ok_or_else(|| format!("vfmt cannot read {}.", path.display()))?; + let text = ws + .text_of(&path) + .ok_or_else(|| format!("lucisv cannot read {}.", path.display()))?; let index = LineIndex::new(&text); Ok(Positions::new(&text, &index).offset(position)) } @@ -182,7 +183,7 @@ pub fn workspace_edit(ws: &Workspace, refactoring: &RefactorEdit) -> Result Tree { let path = std::env::temp_dir() - .join(format!("vfmt_server_ports_{}_{name}", std::process::id())); + .join(format!("lucisv_server_ports_{}_{name}", std::process::id())); let _ = fs::remove_dir_all(&path); fs::create_dir_all(&path).expect("temp dir"); Tree { path } @@ -348,7 +349,7 @@ mod tests { let actions = code_actions(&ws, &sub_uri, offset); assert_eq!(actions.len(), 1, "{actions:#?}"); let CodeActionOrCommand::CodeAction(action) = &actions[0] else { panic!("an action") }; - assert_eq!(action.title, "vfmt: remove port `rst` (updates 1 instantiation)"); + assert_eq!(action.title, "lucisv: remove port `rst` (updates 1 instantiation)"); assert_eq!(action.kind, Some(CodeActionKind::new(REFACTOR_PORTS))); let edit = action.edit.as_ref().expect("an edit"); assert_eq!(edits_for(edit, &sub_uri).len(), 2, "the comma and the port itself"); @@ -360,8 +361,8 @@ mod tests { let tree = Tree::new("unknown"); let (ws, uri, _) = opened(&tree); let arguments = vec![serde_json::to_value(&uri).expect("uri")]; - let message = execute(&ws, "vfmt.nope", &arguments).expect_err("unknown"); - assert!(message.contains("not a vfmt command"), "{message}"); + let message = execute(&ws, "lucisv.nope", &arguments).expect_err("unknown"); + assert!(message.contains("not a lucisv command"), "{message}"); } #[test] diff --git a/crates/vfmt_server/src/rename.rs b/crates/lucisv_server/src/rename.rs similarity index 97% rename from crates/vfmt_server/src/rename.rs rename to crates/lucisv_server/src/rename.rs index b53ea98..28d054a 100644 --- a/crates/vfmt_server/src/rename.rs +++ b/crates/lucisv_server/src/rename.rs @@ -54,7 +54,7 @@ pub fn rename( // text nobody has. let (Some(target), Some(text)) = (path_to_uri(path), ws.text_of(path)) else { return Err(format!( - "vfmt could not address {} as a document; no edits were made.", + "lucisv could not address {} as a document; no edits were made.", path.display() )); }; @@ -74,7 +74,7 @@ pub fn rename( Ok((WorkspaceEdit::new(changes), refactoring.warnings)) } -const UNSAVED: &str = "vfmt can only rename inside a saved file."; +const UNSAVED: &str = "lucisv can only rename inside a saved file."; #[cfg(test)] mod tests { @@ -91,7 +91,7 @@ mod tests { impl Tree { fn new(name: &str) -> Tree { let path = std::env::temp_dir() - .join(format!("vfmt_server_rename_{}_{name}", std::process::id())); + .join(format!("lucisv_server_rename_{}_{name}", std::process::id())); let _ = fs::remove_dir_all(&path); fs::create_dir_all(&path).expect("temp dir"); Tree { path } diff --git a/crates/vfmt_server/src/server.rs b/crates/lucisv_server/src/server.rs similarity index 95% rename from crates/vfmt_server/src/server.rs rename to crates/lucisv_server/src/server.rs index 41922fd..20197fa 100644 --- a/crates/vfmt_server/src/server.rs +++ b/crates/lucisv_server/src/server.rs @@ -3,7 +3,7 @@ //! `lsp-server` runs two I/O threads of its own and hands this loop framed //! messages over a channel. Everything below is synchronous and un-cancellable //! — Verilog files are small, every handler is milliseconds, and a worker pool -//! would buy nothing yet. See `docs/features/vfmt-server/README.md`. +//! would buy nothing yet. See `docs/features/lucisv-server/README.md`. use std::collections::HashSet; use std::error::Error; @@ -59,13 +59,13 @@ pub struct ClientAbilities { pub struct Server { connection: Connection, workspace: Workspace, - /// Documents whose `vfmt.toml` problem has already been reported. Cleared + /// Documents whose `lucisv.toml` problem has already been reported. Cleared /// for a document whenever its text changes, so the warning is said once /// per file change rather than once per format-on-save. config_warnings: HashSet, abilities: ClientAbilities, /// The id of the file-watcher registration in force, if any. Kept so a - /// changed `vfmt.filelist` can replace it: the watched filelist path is + /// changed `lucisv.filelist` can replace it: the watched filelist path is /// part of the registration, so a new path needs a new registration. watchers: Option, /// Numbers the file-watcher registrations, so a replacement can name the @@ -220,7 +220,7 @@ impl Server { let only = p.context.only; let Some(doc) = self.workspace.document(&uri) else { return Ok(Value::Null) }; // A code-action request carries no `tabSize`, so the width a - // `no-tabs` fix writes comes from the buffer's own `vfmt.toml` + // `no-tabs` fix writes comes from the buffer's own `lucisv.toml` // or from the built-in default. let tab_width = format::indent_width(doc.path.as_deref(), self.workspace.client_settings()); @@ -357,7 +357,7 @@ impl Server { let Some(doc) = self.workspace.document(&uri) else { return Ok(Value::Null) }; let settings = format::settings_for(doc, self.workspace.client_settings(), ¶ms.options); let result = format::formatting(doc, &settings.config); - // A broken `vfmt.toml` is a warning, not a failure: the CLI exits 2 on + // A broken `lucisv.toml` is a warning, not a failure: the CLI exits 2 on // one, but an editor that refuses to format because of a typo in a // config file is an editor the user turns off. The buffer is formatted // with the built-in defaults, and the reason is said once per change of @@ -380,13 +380,13 @@ impl Server { self.edits(result) } - /// Say once per change of a file that its `vfmt.toml` could not be read. + /// Say once per change of a file that its `lucisv.toml` could not be read. fn warn_about_config(&mut self, uri: &Uri, problem: Option) { if let Some(problem) = problem { if self.config_warnings.insert(uri.clone()) { self.show_message( MessageType::WARNING, - format!("vfmt: {problem} — formatting with default settings"), + format!("lucisv: {problem} — formatting with default settings"), ); } } @@ -406,7 +406,7 @@ impl Server { Ok(Some(edit)) => to_value(vec![edit]), Ok(None) => to_value(Vec::::new()), Err(message) => { - self.show_message(MessageType::ERROR, format!("vfmt: cannot format — {message}")); + self.show_message(MessageType::ERROR, format!("lucisv: cannot format — {message}")); to_value(Vec::::new()) } } @@ -450,7 +450,7 @@ impl Server { self.set_document(p.text_document.uri.clone(), text); } // A save is one of the things that rebuild the index; the - // others are a change to `vfmt.exclude`/`vfmt.filelist` + // others are a change to `lucisv.exclude`/`lucisv.filelist` // below, and a watched file changing on disk. The // staleness window that is left is in the feature README. self.reindex(); @@ -468,7 +468,7 @@ impl Server { } } } - // The `vfmt.*` settings, pushed at startup and on every change. + // The `lucisv.*` settings, pushed at startup and on every change. // Nothing here trusts the payload — `settings::from_payload` // drops whatever it cannot use. DidChangeConfiguration::METHOD => { @@ -532,7 +532,7 @@ impl Server { /// Ask the client something. The answer is ignored (see `run`), but the id /// must still be unique — a repeated one is a protocol error. fn send_request(&mut self, method: &str, params: impl serde::Serialize) { - let id = RequestId::from(format!("vfmt-{}", self.request_ids)); + let id = RequestId::from(format!("lucisv-{}", self.request_ids)); self.request_ids += 1; let request = Request::new(id, method.to_string(), params); // A closed channel means the client is gone; there is nobody left to @@ -542,7 +542,7 @@ impl Server { /// Rescan the workspace and republish every open buffer against the new /// index. Every caller changed what the index should contain — a save, a - /// new `vfmt.exclude`/`vfmt.filelist`, or a watched file changing on disk. + /// new `lucisv.exclude`/`lucisv.filelist`, or a watched file changing on disk. fn reindex(&mut self) { let warnings = self.workspace.rebuild_index(); self.report_scope(warnings); @@ -553,29 +553,32 @@ impl Server { /// Say what went wrong while working out which files to index — a /// filelist naming a file that has moved, an unset variable, an option - /// vfmt does not know. + /// lucisv does not know. /// /// Every one is logged, but only the first is *shown*: a filelist that has /// drifted from the tree can easily carry forty stale paths, and forty /// popups would be worse than the problem. Said once per rebuild, which is - /// once per save — the same rhythm the `vfmt.toml` warning has. + /// once per save — the same rhythm the `lucisv.toml` warning has. fn report_scope(&self, warnings: Vec) { for warning in &warnings { self.notify( LogMessage::METHOD, - LogMessageParams { typ: MessageType::WARNING, message: format!("vfmt: {warning}") }, + LogMessageParams { + typ: MessageType::WARNING, + message: format!("lucisv: {warning}"), + }, ); } let Some(first) = warnings.first() else { return }; let rest = warnings.len() - 1; let message = match rest { - 0 => format!("vfmt: {first}"), - _ => format!("vfmt: {first} (and {rest} more — see the vfmt log)"), + 0 => format!("lucisv: {first}"), + _ => format!("lucisv: {first} (and {rest} more — see the lucisv log)"), }; self.notify(ShowMessage::METHOD, ShowMessageParams { typ: MessageType::WARNING, message }); } - /// Replace a buffer's text, re-arming its `vfmt.toml` warning: the user + /// Replace a buffer's text, re-arming its `lucisv.toml` warning: the user /// has moved on, and a config problem is worth saying once more. fn set_document(&mut self, uri: Uri, text: String) { self.config_warnings.remove(&uri); @@ -639,7 +642,7 @@ impl Failure { } Failure::Internal(message) => (lsp_server::ErrorCode::InternalError as i32, message), Failure::Request(message) => { - (lsp_server::ErrorCode::RequestFailed as i32, format!("vfmt: {message}")) + (lsp_server::ErrorCode::RequestFailed as i32, format!("lucisv: {message}")) } }; Response::new_err(id, code, message) @@ -681,7 +684,7 @@ mod tests { impl Tree { fn new(name: &str) -> Tree { let path = std::env::temp_dir() - .join(format!("vfmt_server_watch_{}_{name}", std::process::id())); + .join(format!("lucisv_server_watch_{}_{name}", std::process::id())); let _ = std::fs::remove_dir_all(&path); std::fs::create_dir_all(&path).expect("temp dir"); Tree { path } @@ -808,7 +811,7 @@ mod tests { requests[0].1, serde_json::json!({ "registrations": [{ - "id": "vfmt-watched-files-0", + "id": "lucisv-watched-files-0", "method": "workspace/didChangeWatchedFiles", "registerOptions": { "watchers": [{ "globPattern": "**/*.{v,vh,sv,svh}" }] @@ -823,7 +826,7 @@ mod tests { let tree = Tree::new("registerfilelist"); tree.package("rtl/a.sv", "a"); tree.write("files.f", "rtl/a.sv\n"); - tree.write("vfmt.toml", "filelist = \"files.f\"\n"); + tree.write("lucisv.toml", "filelist = \"files.f\"\n"); let session = Session::new(vec![tree.path.clone()], true); let requests = session.requests(); @@ -838,9 +841,9 @@ mod tests { ); } - /// A `vfmt.filelist` push, in the shape a client sends it. + /// A `lucisv.filelist` push, in the shape a client sends it. fn filelist_push(path: &str) -> Value { - serde_json::json!({ "settings": { "vfmt": { "filelist": path } } }) + serde_json::json!({ "settings": { "lucisv": { "filelist": path } } }) } #[test] @@ -860,10 +863,10 @@ mod tests { let requests = session.requests(); assert_eq!(requests.len(), 2, "{requests:#?}"); assert_eq!(requests[0].0, UnregisterCapability::METHOD); - assert_eq!(requests[0].1["unregisterations"][0]["id"], "vfmt-watched-files-0"); + assert_eq!(requests[0].1["unregisterations"][0]["id"], "lucisv-watched-files-0"); assert_eq!(requests[1].0, RegisterCapability::METHOD); let registration = &requests[1].1["registrations"][0]; - assert_eq!(registration["id"], "vfmt-watched-files-1", "a fresh id"); + assert_eq!(registration["id"], "lucisv-watched-files-1", "a fresh id"); assert_eq!( registration["registerOptions"]["watchers"][1]["globPattern"], tree.path.join("files.f").to_str().expect("utf-8").to_string() @@ -877,7 +880,7 @@ mod tests { session.notify(DidChangeConfiguration::METHOD, filelist_push("other.f")); let requests = session.requests(); assert_eq!(requests.len(), 2, "{requests:#?}"); - assert_eq!(requests[0].1["unregisterations"][0]["id"], "vfmt-watched-files-1"); + assert_eq!(requests[0].1["unregisterations"][0]["id"], "lucisv-watched-files-1"); assert_eq!( requests[1].1["registrations"][0]["registerOptions"]["watchers"][1]["globPattern"], tree.path.join("other.f").to_str().expect("utf-8").to_string() @@ -947,7 +950,7 @@ mod tests { tree.package("rtl/a.sv", "a"); tree.package("rtl/unlisted.sv", "unlisted"); tree.write("files.f", "rtl/a.sv\n"); - tree.write("vfmt.toml", "filelist = \"files.f\"\n"); + tree.write("lucisv.toml", "filelist = \"files.f\"\n"); let mut session = Session::new(vec![tree.path.clone()], true); assert_eq!(indexed(&session, "unlisted"), 0, "premise: the filelist omits it"); @@ -1010,7 +1013,7 @@ mod tests { tree.package("rtl/a.sv", "a"); tree.package("rtl/b.sv", "b"); tree.write("files.f", "rtl/a.sv\n"); - tree.write("vfmt.toml", "filelist = \"files.f\"\n"); + tree.write("lucisv.toml", "filelist = \"files.f\"\n"); let mut session = Session::new(vec![tree.path.clone()], true); session.open(&tree.path.join("rtl/a.sv"), "package a;\n localparam K = 1;\nendpackage\n"); diff --git a/crates/vfmt_server/src/settings.rs b/crates/lucisv_server/src/settings.rs similarity index 74% rename from crates/vfmt_server/src/settings.rs rename to crates/lucisv_server/src/settings.rs index 6384bb2..f00c28f 100644 --- a/crates/vfmt_server/src/settings.rs +++ b/crates/lucisv_server/src/settings.rs @@ -1,8 +1,8 @@ -//! The `vfmt.*` settings a client pushes over `workspace/didChangeConfiguration`. +//! The `lucisv.*` settings a client pushes over `workspace/didChangeConfiguration`. //! -//! These are the editor's copy of what `vfmt.toml` carries — the same keys, so +//! These are the editor's copy of what `lucisv.toml` carries — the same keys, so //! a user with no config file in the tree can still say "indent 4" from their -//! editor's settings UI. The three formatting ones never *beat* a `vfmt.toml`: +//! editor's settings UI. The three formatting ones never *beat* a `lucisv.toml`: //! see the precedence ladder in `format::settings_for` and //! `docs/features/editor-settings/README.md`. `filelist` is the exception, and //! deliberately so — it names a *scope* rather than a style, and the person @@ -18,37 +18,37 @@ use serde_json::Value; /// Accepted `line-length`, and accepted `indent`. /// -/// Duplicated from `vfmt_core::config`'s parser, which spells the same bounds +/// Duplicated from `lucisv_core::config`'s parser, which spells the same bounds /// inline in `parse_entry` and exports no constant for them. A client's value -/// must be exactly as acceptable as the same value written in a `vfmt.toml`, +/// must be exactly as acceptable as the same value written in a `lucisv.toml`, /// or the two front ends would disagree about what is valid; -/// `the_accepted_ranges_are_the_ones_vfmt_toml_accepts` asserts that against +/// `the_accepted_ranges_are_the_ones_lucisv_toml_accepts` asserts that against /// the real parser rather than against a copied number. const LINE_LENGTH_RANGE: RangeInclusive = 40..=400; const INDENT_RANGE: RangeInclusive = 1..=8; -/// The `vfmt.*` settings in force, after validation. Every field is "no +/// The `lucisv.*` settings in force, after validation. Every field is "no /// opinion" until a client says otherwise, which is exactly what an unset /// VS Code setting means. #[derive(Debug, Default, Clone, PartialEq, Eq)] pub struct ClientSettings { - /// `vfmt.lineLength`. + /// `lucisv.lineLength`. pub line_length: Option, - /// `vfmt.indent`. + /// `lucisv.indent`. pub indent: Option, - /// `vfmt.exclude`, appended to the config's excludes in the workspace scan. + /// `lucisv.exclude`, appended to the config's excludes in the workspace scan. pub exclude: Vec, - /// `vfmt.filelist`: the `.f` file that defines the index's scope, absolute + /// `lucisv.filelist`: the `.f` file that defines the index's scope, absolute /// or relative to the workspace root. Empty means "unset", which is what /// the VS Code default is — see `docs/features/filelist/README.md`. pub filelist: Option, - /// `vfmt.inlineTemplates`: whether `if (` and `begin` grow ghost text. + /// `lucisv.inlineTemplates`: whether `if (` and `begin` grow ghost text. /// Unset means on, which is what the VS Code default declares — see /// `docs/features/inline-templates/README.md`. pub inline_templates: Option, } -/// Read the `vfmt` section out of a `workspace/didChangeConfiguration` payload. +/// Read the `lucisv` section out of a `workspace/didChangeConfiguration` payload. /// /// **Nothing here trusts the client.** `package.json`'s JSON schema constrains /// the settings UI, but the notification is just JSON on a socket, and other @@ -59,17 +59,17 @@ pub struct ClientSettings { /// `tabSize`, for the same reason: silently honouring half of a nonsensical /// request is worse than ignoring it. pub fn from_payload(settings: &Value) -> ClientSettings { - // `{"settings": {"vfmt": {...}}}` — the shape - // `synchronize.configurationSection: 'vfmt'` produces. A payload without + // `{"settings": {"lucisv": {...}}}` — the shape + // `synchronize.configurationSection: 'lucisv'` produces. A payload without // the section (including the `{"settings": null}` a client sends when it // syncs no section at all) means "no opinion about anything". - let Some(vfmt) = settings.get("vfmt") else { return ClientSettings::default() }; + let Some(lucisv) = settings.get("lucisv") else { return ClientSettings::default() }; ClientSettings { - line_length: bounded(vfmt.get("lineLength"), LINE_LENGTH_RANGE), - indent: bounded(vfmt.get("indent"), INDENT_RANGE), - exclude: strings(vfmt.get("exclude")), - filelist: path(vfmt.get("filelist")), - inline_templates: flag(vfmt.get("inlineTemplates")), + line_length: bounded(lucisv.get("lineLength"), LINE_LENGTH_RANGE), + indent: bounded(lucisv.get("indent"), INDENT_RANGE), + exclude: strings(lucisv.get("exclude")), + filelist: path(lucisv.get("filelist")), + inline_templates: flag(lucisv.get("inlineTemplates")), } } @@ -81,7 +81,7 @@ fn flag(value: Option<&Value>) -> Option { value?.as_bool() } -/// A non-empty JSON string, or nothing. The empty string is `vfmt.filelist`'s +/// A non-empty JSON string, or nothing. The empty string is `lucisv.filelist`'s /// default and means "no filelist", not "the filelist named by the empty /// path"; anything that is not a string is dropped like every other /// wrong-typed value here. @@ -120,13 +120,13 @@ mod tests { } /// The payload shape `vscode-languageclient` actually sends for - /// `synchronize.configurationSection: 'vfmt'` — the whole section, with + /// `synchronize.configurationSection: 'lucisv'` — the whole section, with /// every key present at its default. Verified against the real library in /// `node_modules`; see the feature README's Handshakes. fn vscode_payload(line_length: Value, indent: Value, exclude: Value) -> Value { json!({ - "vfmt": { - "serverPath": "vfmt-server", + "lucisv": { + "serverPath": "lucisv-server", "rainbowBeginEnd": true, "lineLength": line_length, "indent": indent, @@ -139,9 +139,9 @@ mod tests { #[test] fn a_filelist_is_taken_when_it_names_something() { - let found = settings(json!({ "vfmt": { "filelist": "rtl/files.f" } })); + let found = settings(json!({ "lucisv": { "filelist": "rtl/files.f" } })); assert_eq!(found.filelist.as_deref(), Some("rtl/files.f")); - let found = settings(json!({ "vfmt": { "filelist": " /abs/files.f " } })); + let found = settings(json!({ "lucisv": { "filelist": " /abs/files.f " } })); assert_eq!( found.filelist.as_deref(), Some("/abs/files.f"), @@ -154,10 +154,10 @@ mod tests { // `""` is the setting's own default: it must mean "no filelist", not // "a filelist whose path is empty". for bad in [json!(""), json!(" "), json!(null), json!(3), json!(["a.f"]), json!(true)] { - let found = settings(json!({ "vfmt": { "filelist": bad } })); + let found = settings(json!({ "lucisv": { "filelist": bad } })); assert_eq!(found.filelist, None, "filelist {bad} must be ignored"); } - assert_eq!(settings(json!({ "vfmt": {} })).filelist, None, "and so must its absence"); + assert_eq!(settings(json!({ "lucisv": {} })).filelist, None, "and so must its absence"); } #[test] @@ -177,14 +177,14 @@ mod tests { #[test] fn inline_templates_is_a_boolean_and_nothing_else() { - let found = settings(json!({ "vfmt": { "inlineTemplates": false } })); + let found = settings(json!({ "lucisv": { "inlineTemplates": false } })); assert_eq!(found.inline_templates, Some(false)); - let found = settings(json!({ "vfmt": { "inlineTemplates": true } })); + let found = settings(json!({ "lucisv": { "inlineTemplates": true } })); assert_eq!(found.inline_templates, Some(true)); // Absence is not `false`: the feature is on unless a client says no. - assert_eq!(settings(json!({ "vfmt": {} })).inline_templates, None); + assert_eq!(settings(json!({ "lucisv": {} })).inline_templates, None); for bad in [json!("false"), json!(0), json!(null), json!([false]), json!({ "on": false })] { - let found = settings(json!({ "vfmt": { "inlineTemplates": bad } })); + let found = settings(json!({ "lucisv": { "inlineTemplates": bad } })); assert_eq!(found.inline_templates, None, "inlineTemplates {bad} must be ignored"); } } @@ -208,7 +208,7 @@ mod tests { fn a_missing_key_is_not_an_opinion() { // A hand-written Neovim `settings` table names only what it cares // about; the keys it leaves out must stay silent, not become 0. - let found = settings(json!({ "vfmt": { "indent": 4 } })); + let found = settings(json!({ "lucisv": { "indent": 4 } })); assert_eq!(found.indent, Some(4)); assert_eq!(found.line_length, None); assert!(found.exclude.is_empty()); @@ -217,27 +217,27 @@ mod tests { #[test] fn out_of_range_numbers_are_ignored() { for bad in [json!(0), json!(9), json!(100), json!(-1)] { - let found = settings(json!({ "vfmt": { "indent": bad } })); + let found = settings(json!({ "lucisv": { "indent": bad } })); assert_eq!(found.indent, None, "indent {bad} must be ignored"); } for bad in [json!(0), json!(39), json!(401), json!(-40)] { - let found = settings(json!({ "vfmt": { "lineLength": bad } })); + let found = settings(json!({ "lucisv": { "lineLength": bad } })); assert_eq!(found.line_length, None, "lineLength {bad} must be ignored"); } } #[test] fn the_range_edges_are_accepted() { - let found = settings(json!({ "vfmt": { "indent": 1, "lineLength": 40 } })); + let found = settings(json!({ "lucisv": { "indent": 1, "lineLength": 40 } })); assert_eq!((found.indent, found.line_length), (Some(1), Some(40))); - let found = settings(json!({ "vfmt": { "indent": 8, "lineLength": 400 } })); + let found = settings(json!({ "lucisv": { "indent": 8, "lineLength": 400 } })); assert_eq!((found.indent, found.line_length), (Some(8), Some(400))); } #[test] fn wrong_types_are_ignored_rather_than_coerced() { for bad in [json!("4"), json!(true), json!([4]), json!({ "n": 4 }), json!(4.5)] { - let found = settings(json!({ "vfmt": { "indent": bad, "lineLength": bad } })); + let found = settings(json!({ "lucisv": { "indent": bad, "lineLength": bad } })); assert_eq!(found.indent, None, "indent {bad} must be ignored"); assert_eq!(found.line_length, None, "lineLength {bad} must be ignored"); } @@ -245,22 +245,22 @@ mod tests { #[test] fn an_exclude_that_is_not_a_list_of_strings_contributes_nothing() { - assert!(settings(json!({ "vfmt": { "exclude": "vendor" } })).exclude.is_empty()); - assert!(settings(json!({ "vfmt": { "exclude": 3 } })).exclude.is_empty()); - assert!(settings(json!({ "vfmt": { "exclude": null } })).exclude.is_empty()); + assert!(settings(json!({ "lucisv": { "exclude": "vendor" } })).exclude.is_empty()); + assert!(settings(json!({ "lucisv": { "exclude": 3 } })).exclude.is_empty()); + assert!(settings(json!({ "lucisv": { "exclude": null } })).exclude.is_empty()); // A mixed array keeps the strings and drops the rest. - let found = settings(json!({ "vfmt": { "exclude": ["ok", 3, null, "fine"] } })); + let found = settings(json!({ "lucisv": { "exclude": ["ok", 3, null, "fine"] } })); assert_eq!(found.exclude, vec!["ok".to_string(), "fine".to_string()]); } #[test] - fn the_accepted_ranges_are_the_ones_vfmt_toml_accepts() { - // The bounds above are copied from `vfmt_core::config`, which exports + fn the_accepted_ranges_are_the_ones_lucisv_toml_accepts() { + // The bounds above are copied from `lucisv_core::config`, which exports // no constant for them. Rather than trust the copy, ask the real // parser: every edge this module accepts must parse, and every value - // it rejects must be rejected there too. If `vfmt.toml` ever widens a + // it rejects must be rejected there too. If `lucisv.toml` ever widens a // range, this fails and says so. - let ok = |text: &str| vfmt_core::config::parse(text).is_ok(); + let ok = |text: &str| lucisv_core::config::parse(text).is_ok(); assert!(ok("indent = 1") && ok("indent = 8"), "the indent edges"); assert!(!ok("indent = 0") && !ok("indent = 9"), "just outside indent"); assert!(ok("line-length = 40") && ok("line-length = 400"), "the line-length edges"); diff --git a/crates/vfmt_server/src/signature.rs b/crates/lucisv_server/src/signature.rs similarity index 99% rename from crates/vfmt_server/src/signature.rs rename to crates/lucisv_server/src/signature.rs index 8a3f643..a65a3c5 100644 --- a/crates/vfmt_server/src/signature.rs +++ b/crates/lucisv_server/src/signature.rs @@ -296,7 +296,7 @@ endmodule impl Tree { fn new(name: &str) -> Tree { let path = std::env::temp_dir() - .join(format!("vfmt_server_signature_{}_{name}", std::process::id())); + .join(format!("lucisv_server_signature_{}_{name}", std::process::id())); let _ = fs::remove_dir_all(&path); fs::create_dir_all(&path).expect("temp dir"); Tree { path } diff --git a/crates/vfmt_server/src/state.rs b/crates/lucisv_server/src/state.rs similarity index 95% rename from crates/vfmt_server/src/state.rs rename to crates/lucisv_server/src/state.rs index 8db85f1..9c0f099 100644 --- a/crates/vfmt_server/src/state.rs +++ b/crates/lucisv_server/src/state.rs @@ -1,6 +1,6 @@ //! What the server remembers: one analysis per open buffer, one index for the //! workspace. The invalidation rules are in -//! `docs/features/vfmt-server/README.md`; the short version is that a buffer's +//! `docs/features/lucisv-server/README.md`; the short version is that a buffer's //! analysis is rebuilt on every change and the index only on save. use std::collections::HashMap; @@ -14,8 +14,8 @@ use vlog_parser::token::Token; use vlog_parser::{parse_source_tolerant, parse_tolerant, tokenize, LineIndex, ParseDiagnostic}; use vlog_semantic::{analyze, resolve_external, ExternalResolutions, Semantics, WorkspaceIndex}; -use vfmt_core::config::Discovery; -use vfmt_core::walk::{collect_files, EXTENSIONS}; +use lucisv_core::config::Discovery; +use lucisv_core::walk::{collect_files, EXTENSIONS}; use crate::candidates::Candidates; use crate::convert::Positions; @@ -113,7 +113,7 @@ pub struct Workspace { /// What every in-scope file `` `include``s, and the `+incdir+`s an /// include is looked for in. Rebuilt with `index`, from the same list. includes: IncludeGraph, - /// The last `vfmt.*` settings a client pushed. Default until it does. + /// The last `lucisv.*` settings a client pushed. Default until it does. client: ClientSettings, } @@ -148,7 +148,7 @@ impl Workspace { !self.roots.is_empty() } - /// The `vfmt.*` settings in force, for the resolution points in + /// The `lucisv.*` settings in force, for the resolution points in /// `format.rs` to fold in. pub fn client_settings(&self) -> &ClientSettings { &self.client @@ -252,7 +252,7 @@ impl Workspace { /// The files the index covers, and what the user should be told about how /// they were chosen. The scope ladder, highest first: /// - /// 1. **A filelist** — `vfmt.filelist`, else a `filelist` key in the + /// 1. **A filelist** — `lucisv.filelist`, else a `filelist` key in the /// config governing a workspace root. It names *exactly* the files to /// index; the project said so, and guessing past it would defeat the /// point of having one. @@ -272,7 +272,7 @@ impl Workspace { let Some(path) = self.filelist_path() else { return Scope { files: self.default_files(), ..Default::default() }; }; - match vfmt_core::filelist::read(&path) { + match lucisv_core::filelist::read(&path) { Ok(list) => Scope { files: list.files, incdirs: list.incdirs, warnings: list.warnings }, Err(problem) => Scope { files: self.default_files(), @@ -298,7 +298,7 @@ impl Workspace { }); } let mut discovery = Discovery::new(true); - // A broken `vfmt.toml` names no filelist, exactly as it contributes no + // A broken `lucisv.toml` names no filelist, exactly as it contributes no // excludes below: the user hears about it when they format. self.roots.iter().find_map(|root| discovery.for_dir(root).ok()?.filelist) } @@ -340,7 +340,7 @@ impl Workspace { /// Every source file under the roots, found by the CLI's own walk: the /// same extensions, the same `.gitignore` handling, and the `exclude` - /// patterns of the config governing each root. What `vfmt` skips, the + /// patterns of the config governing each root. What `lucisv` skips, the /// index skips. fn walked_files(&self) -> Vec { let mut discovery = Discovery::new(true); @@ -349,13 +349,13 @@ impl Workspace { // The walk names its inputs as strings; every root came from a // `file:` URI, which cannot carry a non-UTF-8 path. let Some(input) = root.to_str() else { continue }; - // A broken `vfmt.toml` must not stop the server from indexing: an + // A broken `lucisv.toml` must not stop the server from indexing: an // index that excludes nothing is a far better failure than a // server that comes up empty. The error is reported when the user // formats a file in this tree (`format::settings_for`). let mut exclude = discovery.for_dir(root).unwrap_or_default().exclude.unwrap_or_default(); - // The client's `vfmt.exclude` is *appended*, never substituted — + // The client's `lucisv.exclude` is *appended*, never substituted — // the CLI appends a config's excludes to `--exclude` the same way, // and a setting that silently dropped a checked-in exclude would // put vendored code back in the index for one user only. @@ -419,7 +419,7 @@ mod tests { #[test] fn an_open_buffer_overrides_disk_in_the_index() { - let dir = std::env::temp_dir().join(format!("vfmt_server_state_{}", std::process::id())); + let dir = std::env::temp_dir().join(format!("lucisv_server_state_{}", std::process::id())); let _ = fs::remove_dir_all(&dir); fs::create_dir_all(&dir).expect("temp dir"); let path = dir.join("pkg.sv"); @@ -447,7 +447,7 @@ mod tests { impl Tree { fn new(name: &str) -> Tree { let path = std::env::temp_dir() - .join(format!("vfmt_server_scan_{}_{name}", std::process::id())); + .join(format!("lucisv_server_scan_{}_{name}", std::process::id())); let _ = fs::remove_dir_all(&path); fs::create_dir_all(&path).expect("temp dir"); Tree { path } @@ -492,14 +492,14 @@ mod tests { #[test] fn the_scan_honours_the_root_configs_excludes() { let tree = Tree::new("excludes"); - tree.write("vfmt.toml", "exclude = [\"vendor\"]\n"); + tree.write("lucisv.toml", "exclude = [\"vendor\"]\n"); tree.package("kept.sv", "kept"); tree.package("vendor/ip.sv", "vendor_pkg"); let mut ws = Workspace::default(); ws.open_roots(vec![tree.path.clone()]); assert_eq!(ws.index().member("kept", "K").len(), 1); - assert_eq!(ws.index().member("vendor_pkg", "K").len(), 0, "vfmt.toml excludes apply"); + assert_eq!(ws.index().member("vendor_pkg", "K").len(), 0, "lucisv.toml excludes apply"); } #[test] @@ -507,7 +507,7 @@ mod tests { // Exit 2 is the CLI's answer to a broken config; a server that indexed // nothing because of a typo would look simply broken instead. let tree = Tree::new("brokencfg"); - tree.write("vfmt.toml", "bogus = 1\n"); + tree.write("lucisv.toml", "bogus = 1\n"); tree.package("kept.sv", "kept"); let mut ws = Workspace::default(); @@ -515,7 +515,7 @@ mod tests { assert_eq!(ws.index().member("kept", "K").len(), 1); } - /// `vfmt.exclude` as a client would push it. + /// `lucisv.exclude` as a client would push it. fn excluding(patterns: &[&str]) -> ClientSettings { ClientSettings { exclude: patterns.iter().map(|p| p.to_string()).collect(), @@ -541,11 +541,11 @@ mod tests { #[test] fn a_pushed_exclude_is_appended_to_the_configs_and_does_not_replace_it() { - // The failure this guards: a user setting `vfmt.exclude` in their + // The failure this guards: a user setting `lucisv.exclude` in their // editor and thereby putting the project's vendored code — which the - // checked-in `vfmt.toml` excludes — back into the index for them only. + // checked-in `lucisv.toml` excludes — back into the index for them only. let tree = Tree::new("bothexcludes"); - tree.write("vfmt.toml", "exclude = [\"vendor\"]\n"); + tree.write("lucisv.toml", "exclude = [\"vendor\"]\n"); tree.package("kept.sv", "kept"); tree.package("vendor/ip.sv", "vendor_pkg"); tree.package("scratch/wip.sv", "scratch_pkg"); @@ -602,7 +602,7 @@ mod tests { assert_eq!(ws.client_settings().line_length, Some(120)); } - /// `vfmt.filelist` as a client would push it. + /// `lucisv.filelist` as a client would push it. fn using_filelist(path: &str) -> ClientSettings { ClientSettings { filelist: Some(path.to_string()), ..Default::default() } } @@ -631,7 +631,7 @@ mod tests { // The point of a filelist: a file sitting in the tree that the project // does not build is not indexed, however much the walk would find it. let tree = filelist_tree("filelistkey"); - tree.write("vfmt.toml", "filelist = \"files.f\"\n"); + tree.write("lucisv.toml", "filelist = \"files.f\"\n"); let mut ws = Workspace::default(); let warnings = ws.open_roots(vec![tree.path.clone()]); @@ -642,7 +642,7 @@ mod tests { #[test] fn the_filelist_setting_beats_the_config_key_and_may_be_absolute() { let tree = filelist_tree("filelistsetting"); - tree.write("vfmt.toml", "filelist = \"files.f\"\n"); + tree.write("lucisv.toml", "filelist = \"files.f\"\n"); tree.write("other.f", "rtl/unlisted.sv\n"); // Relative: against the workspace root, not the current directory. diff --git a/crates/vfmt_server/src/symbols.rs b/crates/lucisv_server/src/symbols.rs similarity index 98% rename from crates/vfmt_server/src/symbols.rs rename to crates/lucisv_server/src/symbols.rs index 6be4ee8..b67f969 100644 --- a/crates/vfmt_server/src/symbols.rs +++ b/crates/lucisv_server/src/symbols.rs @@ -171,7 +171,7 @@ mod tests { #[test] fn workspace_symbols_find_declarations_across_files() { - let dir = std::env::temp_dir().join(format!("vfmt_server_wsym_{}", std::process::id())); + let dir = std::env::temp_dir().join(format!("lucisv_server_wsym_{}", std::process::id())); let _ = std::fs::remove_dir_all(&dir); std::fs::create_dir_all(&dir).expect("temp dir"); std::fs::write(dir.join("a.sv"), "module alpha;\nendmodule\n").expect("write"); diff --git a/crates/vfmt_server/src/templates.rs b/crates/lucisv_server/src/templates.rs similarity index 98% rename from crates/vfmt_server/src/templates.rs rename to crates/lucisv_server/src/templates.rs index ef4cb1c..f409ae2 100644 --- a/crates/vfmt_server/src/templates.rs +++ b/crates/lucisv_server/src/templates.rs @@ -426,11 +426,11 @@ mod tests { /// be handed to a whole-file parser. fn planted(gate: Gate, text: &str) -> Vec { let statement = - format!("module vfmt_probe;\n always @(*) begin\n{text}\n end\nendmodule\n"); + format!("module lucisv_probe;\n always @(*) begin\n{text}\n end\nendmodule\n"); let tail = format!( - "module vfmt_probe;\n always @(*) begin\n if (1) begin\n end\n{text}\n end\nendmodule\n" + "module lucisv_probe;\n always @(*) begin\n if (1) begin\n end\n{text}\n end\nendmodule\n" ); - let item = format!("module vfmt_probe;\n{text}\nendmodule\n"); + let item = format!("module lucisv_probe;\n{text}\nendmodule\n"); match gate { Gate::Statement => vec![statement], Gate::ElseTail => vec![tail], diff --git a/crates/vfmt_server/src/tokens.rs b/crates/lucisv_server/src/tokens.rs similarity index 99% rename from crates/vfmt_server/src/tokens.rs rename to crates/lucisv_server/src/tokens.rs index 629df75..fe1de8e 100644 --- a/crates/vfmt_server/src/tokens.rs +++ b/crates/lucisv_server/src/tokens.rs @@ -2,7 +2,7 @@ //! //! Classification comes from the lexer's token stream, refined for plain //! identifiers by `vlog_semantic`. The full mapping table is in -//! `docs/features/vfmt-server/README.md`. +//! `docs/features/lucisv-server/README.md`. use lsp_types::{SemanticToken, SemanticTokenModifier, SemanticTokenType, SemanticTokens}; use vlog_parser::token::{Token, TokenKind}; diff --git a/crates/vfmt_server/src/uri.rs b/crates/lucisv_server/src/uri.rs similarity index 100% rename from crates/vfmt_server/src/uri.rs rename to crates/lucisv_server/src/uri.rs diff --git a/crates/vfmt_server/src/watch.rs b/crates/lucisv_server/src/watch.rs similarity index 96% rename from crates/vfmt_server/src/watch.rs rename to crates/lucisv_server/src/watch.rs index 93b63a9..141dc88 100644 --- a/crates/vfmt_server/src/watch.rs +++ b/crates/lucisv_server/src/watch.rs @@ -1,4 +1,4 @@ -//! `workspace/didChangeWatchedFiles`: the index's answer to changes vfmt never +//! `workspace/didChangeWatchedFiles`: the index's answer to changes lucisv never //! saw an editor make. //! //! Until this, the index was rebuilt on save and (with no workspace root) on @@ -16,13 +16,13 @@ use lsp_types::{ InitializeParams, Registration, Unregistration, }; -use vfmt_core::walk::EXTENSIONS; +use lucisv_core::walk::EXTENSIONS; use crate::uri::uri_to_path; /// Every source file the workspace walk would take, in one glob. /// -/// Deliberately the same four extensions as `vfmt_core::walk::EXTENSIONS` and +/// Deliberately the same four extensions as `lucisv_core::walk::EXTENSIONS` and /// nothing else: a watcher wide enough to cover a build directory or a /// `target/` tree would hand us thousands of events that cannot change the /// index. `pinned_to_the_extensions_the_walk_takes` asserts the two agree. @@ -48,7 +48,7 @@ pub fn dynamic_registration(params: &InitializeParams) -> bool { /// plus the configured filelist's own path when there is one. /// /// `serial` numbers the registration so a later one can unregister it by name; -/// a re-registration is what a change of `vfmt.filelist` needs, because the +/// a re-registration is what a change of `lucisv.filelist` needs, because the /// path being watched is part of the registration itself. /// /// No `kind` is set on either watcher, which the protocol defines as @@ -93,7 +93,7 @@ fn watcher(pattern: String) -> FileSystemWatcher { } fn registration_id(serial: u32) -> String { - format!("vfmt-watched-files-{serial}") + format!("lucisv-watched-files-{serial}") } /// Whether a notification's events touch anything the index reads. @@ -162,7 +162,7 @@ mod tests { assert_eq!( value, serde_json::json!({ - "id": "vfmt-watched-files-0", + "id": "lucisv-watched-files-0", "method": "workspace/didChangeWatchedFiles", "registerOptions": { "watchers": [{ "globPattern": "**/*.{v,vh,sv,svh}" }] }, }) @@ -176,7 +176,7 @@ mod tests { assert_eq!( value, serde_json::json!({ - "id": "vfmt-watched-files-2", + "id": "lucisv-watched-files-2", "method": "workspace/didChangeWatchedFiles", "registerOptions": { "watchers": [ { "globPattern": "**/*.{v,vh,sv,svh}" }, @@ -196,7 +196,7 @@ mod tests { fn an_unregistration_names_the_same_id_and_method() { let registration = registration(7, None); let undo = unregistration(registration.id.clone()); - assert_eq!(undo.id, "vfmt-watched-files-7"); + assert_eq!(undo.id, "lucisv-watched-files-7"); assert_eq!(undo.method, registration.method); } diff --git a/crates/vfmt_server/tests/e2e.rs b/crates/lucisv_server/tests/e2e.rs similarity index 96% rename from crates/vfmt_server/tests/e2e.rs rename to crates/lucisv_server/tests/e2e.rs index ae68042..3b93063 100644 --- a/crates/vfmt_server/tests/e2e.rs +++ b/crates/lucisv_server/tests/e2e.rs @@ -52,7 +52,7 @@ fn read_message(input: &mut impl BufRead) -> Option { } fn temp_dir(name: &str) -> PathBuf { - let dir = std::env::temp_dir().join(format!("vfmt_server_e2e_{}_{name}", std::process::id())); + let dir = std::env::temp_dir().join(format!("lucisv_server_e2e_{}_{name}", std::process::id())); let _ = std::fs::remove_dir_all(&dir); std::fs::create_dir_all(&dir).expect("temp dir"); dir @@ -64,7 +64,7 @@ fn temp_dir(name: &str) -> PathBuf { /// processes the messages in order and exits on `exit`, so stdout closes and /// the read terminates on its own. fn talk(session: &str) -> Vec { - let mut child = Command::new(env!("CARGO_BIN_EXE_vfmt-server")) + let mut child = Command::new(env!("CARGO_BIN_EXE_lucisv-server")) .stdin(Stdio::piped()) .stdout(Stdio::piped()) .stderr(Stdio::null()) @@ -79,7 +79,7 @@ fn talk(session: &str) -> Vec { } /// An `initialize` + `didOpen` + one `textDocument/formatting` + shutdown -/// session against a scratch workspace holding `config` as its `vfmt.toml`. +/// session against a scratch workspace holding `config` as its `lucisv.toml`. /// The client asks for a 2-space indent, which is what an editor default /// looks like. fn format_session(dir: &Path, file: &Path, ids: &[u32]) -> Vec { @@ -120,9 +120,9 @@ fn new_text(messages: &[serde_json::Value], id: u32) -> String { const UNFORMATTED: &str = "module m;\nwire a;\nendmodule\n"; #[test] -fn a_vfmt_toml_governs_formatting_over_the_editors_tab_size() { +fn a_lucisv_toml_governs_formatting_over_the_editors_tab_size() { let dir = temp_dir("config"); - std::fs::write(dir.join("vfmt.toml"), "indent = 4\n").expect("write config"); + std::fs::write(dir.join("lucisv.toml"), "indent = 4\n").expect("write config"); let file = dir.join("m.sv"); std::fs::write(&file, UNFORMATTED).expect("write"); @@ -141,9 +141,9 @@ fn a_vfmt_toml_governs_formatting_over_the_editors_tab_size() { } #[test] -fn a_broken_vfmt_toml_warns_once_and_still_formats() { +fn a_broken_lucisv_toml_warns_once_and_still_formats() { let dir = temp_dir("brokenconfig"); - std::fs::write(dir.join("vfmt.toml"), "indent = 4\nbogus = 1\n").expect("write config"); + std::fs::write(dir.join("lucisv.toml"), "indent = 4\nbogus = 1\n").expect("write config"); let file = dir.join("m.sv"); std::fs::write(&file, UNFORMATTED).expect("write"); @@ -163,7 +163,7 @@ fn a_broken_vfmt_toml_warns_once_and_still_formats() { assert_eq!(warnings[0]["params"]["type"], 2, "a warning, not an error"); let text = warnings[0]["params"]["message"].as_str().expect("a message"); assert!(text.contains("unknown key `bogus`"), "{text}"); - assert!(text.contains("vfmt.toml:2"), "the message names file and line: {text}"); + assert!(text.contains("lucisv.toml:2"), "the message names file and line: {text}"); let _ = std::fs::remove_dir_all(&dir); } @@ -196,7 +196,7 @@ fn range_formatting_is_advertised_and_formats_only_the_selection() { )), // "Select line 3", the way an editor sends it: end at the start of 4. request(2, 2, 0, 3, 0), - // A cursor on `endmodule`, which is already written as vfmt writes it. + // A cursor on `endmodule`, which is already written as lucisv writes it. request(3, 4, 0, 4, 9), request(4, 0, 0, 99, 0), // A cursor on the emoji comment: a leading comment belongs to its @@ -265,7 +265,7 @@ fn lint_diagnostics_and_a_code_action_round_trip_over_the_wire() { )), // And the fix-on-save request an editor sends: one kind only. frame(&format!( - r#"{{"jsonrpc":"2.0","id":3,"method":"textDocument/codeAction","params":{{"textDocument":{{"uri":"{uri}"}},"range":{{"start":{{"line":0,"character":0}},"end":{{"line":3,"character":0}}}},"context":{{"diagnostics":[],"only":["source.fixAll.vfmt"]}}}}}}"# + r#"{{"jsonrpc":"2.0","id":3,"method":"textDocument/codeAction","params":{{"textDocument":{{"uri":"{uri}"}},"range":{{"start":{{"line":0,"character":0}},"end":{{"line":3,"character":0}}}},"context":{{"diagnostics":[],"only":["source.fixAll.lucisv"]}}}}}}"# )), frame(r#"{"jsonrpc":"2.0","id":9,"method":"shutdown","params":null}"#), frame(r#"{"jsonrpc":"2.0","method":"exit","params":null}"#), @@ -279,7 +279,7 @@ fn lint_diagnostics_and_a_code_action_round_trip_over_the_wire() { let kinds = &initialize["result"]["capabilities"]["codeActionProvider"]["codeActionKinds"]; let kinds = kinds.as_array().expect("the kinds are listed, not just `true`"); assert!(kinds.iter().any(|k| k == "quickfix"), "{kinds:#?}"); - assert!(kinds.iter().any(|k| k == "source.fixAll.vfmt"), "{kinds:#?}"); + assert!(kinds.iter().any(|k| k == "source.fixAll.lucisv"), "{kinds:#?}"); // 2. Exactly one publish for this version, carrying both lint findings. let published: Vec<_> = @@ -292,7 +292,7 @@ fn lint_diagnostics_and_a_code_action_round_trip_over_the_wire() { assert!(codes.contains(&"no-trailing-whitespace"), "{codes:?}"); for diagnostic in diagnostics { assert_eq!(diagnostic["severity"], 2, "a lint finding is a warning"); - assert_eq!(diagnostic["source"], "vfmt"); + assert_eq!(diagnostic["source"], "lucisv"); } // 3. Two quick fixes and one fixAll, and the quick fixes name the finding. @@ -301,7 +301,7 @@ fn lint_diagnostics_and_a_code_action_round_trip_over_the_wire() { let quick: Vec<_> = actions.iter().filter(|a| a["kind"] == "quickfix").collect(); assert_eq!(quick.len(), 2, "{actions:#?}"); assert_eq!(quick[0]["diagnostics"].as_array().expect("its diagnostic").len(), 1); - let all: Vec<_> = actions.iter().filter(|a| a["kind"] == "source.fixAll.vfmt").collect(); + let all: Vec<_> = actions.iter().filter(|a| a["kind"] == "source.fixAll.lucisv").collect(); assert_eq!(all.len(), 1, "{actions:#?}"); // 4. The filtered request returns the fixAll action and nothing else, and @@ -322,23 +322,24 @@ fn lint_diagnostics_and_a_code_action_round_trip_over_the_wire() { /// A fenced tab and an unfenced one, in a file whose name matches its module. /// One pass converges here (no two fixes want the same bytes), which is what /// makes the server's single-pass `fixAll` comparable to the CLI's loop. -const FENCED: &str = "module fenced;\n// vfmt: off\n\twire a;\n// vfmt: on\n\twire b;\nendmodule\n"; +const FENCED: &str = + "module fenced;\n// lucisv: off\n\twire a;\n// lucisv: on\n\twire b;\nendmodule\n"; -/// The `vfmt` CLI binary, built beside this crate's own. +/// The `lucisv` CLI binary, built beside this crate's own. /// /// Cargo names no env var for another package's binary, so it is found by /// path. `cargo test --workspace` — the gate this test belongs to — always -/// builds it; `cargo test -p vfmt_server` alone may not, and the test says so +/// builds it; `cargo test -p lucisv_server` alone may not, and the test says so /// and passes rather than failing for a reason that is not about the server. -fn vfmt_binary() -> Option { - let path = Path::new(env!("CARGO_BIN_EXE_vfmt-server")).with_file_name("vfmt"); +fn lucisv_binary() -> Option { + let path = Path::new(env!("CARGO_BIN_EXE_lucisv-server")).with_file_name("lucisv"); path.is_file().then_some(path) } #[test] -fn fix_all_edits_exactly_what_vfmt_check_fix_edits_inside_a_fence() { - let Some(vfmt) = vfmt_binary() else { - eprintln!("skipped: the `vfmt` binary is not built next to `vfmt-server`"); +fn fix_all_edits_exactly_what_lucisv_check_fix_edits_inside_a_fence() { + let Some(lucisv) = lucisv_binary() else { + eprintln!("skipped: the `lucisv` binary is not built next to `lucisv-server`"); return; }; let dir = temp_dir("fence"); @@ -358,7 +359,7 @@ fn fix_all_edits_exactly_what_vfmt_check_fix_edits_inside_a_fence() { )), // Fix-on-save, then a cursor sitting on the fenced tab. frame(&format!( - r#"{{"jsonrpc":"2.0","id":2,"method":"textDocument/codeAction","params":{{"textDocument":{{"uri":"{uri}"}},"range":{{"start":{{"line":0,"character":0}},"end":{{"line":5,"character":0}}}},"context":{{"diagnostics":[],"only":["source.fixAll.vfmt"]}}}}}}"# + r#"{{"jsonrpc":"2.0","id":2,"method":"textDocument/codeAction","params":{{"textDocument":{{"uri":"{uri}"}},"range":{{"start":{{"line":0,"character":0}},"end":{{"line":5,"character":0}}}},"context":{{"diagnostics":[],"only":["source.fixAll.lucisv"]}}}}}}"# )), frame(&format!( r#"{{"jsonrpc":"2.0","id":3,"method":"textDocument/codeAction","params":{{"textDocument":{{"uri":"{uri}"}},"range":{{"start":{{"line":2,"character":0}},"end":{{"line":2,"character":1}}}},"context":{{"diagnostics":[]}}}}}}"# @@ -386,7 +387,7 @@ fn fix_all_edits_exactly_what_vfmt_check_fix_edits_inside_a_fence() { "no lightbulb inside a fence: {at_fence:#?}" ); - // And `fixAll` writes exactly what `vfmt check --fix` writes. + // And `fixAll` writes exactly what `lucisv check --fix` writes. let fix_all = messages.iter().find(|m| m["id"] == 2).expect("fixAll response"); let fix_all = fix_all["result"].as_array().expect("an array"); assert_eq!(fix_all.len(), 1, "only what was asked for: {fix_all:#?}"); @@ -395,14 +396,14 @@ fn fix_all_edits_exactly_what_vfmt_check_fix_edits_inside_a_fence() { let fixed = edits[0]["newText"].as_str().expect("newText").to_string(); let cli = dir.join("cli.sv"); std::fs::write(&cli, FENCED).expect("write"); - let status = Command::new(&vfmt) + let status = Command::new(&lucisv) .arg("check") .arg("--fix") .arg(&cli) .stdout(Stdio::null()) .stderr(Stdio::null()) .status() - .expect("the vfmt binary runs"); + .expect("the lucisv binary runs"); // Two findings remain (the fenced tab is reported and unfixed), so the // CLI exits 1 — the documented "reported, never auto-fixed" contract. assert_eq!(status.code(), Some(1), "violations remain, and that is correct"); @@ -459,7 +460,7 @@ fn the_binary_serves_a_whole_session_over_stdio() { assert_eq!(capabilities["documentFormattingProvider"], true); assert_eq!(capabilities["definitionProvider"], true); assert!(capabilities["semanticTokensProvider"].is_object()); - assert_eq!(initialize["result"]["serverInfo"]["name"], "vfmt-server"); + assert_eq!(initialize["result"]["serverInfo"]["name"], "lucisv-server"); // 2. Diagnostics were pushed for the broken buffer. let published = messages @@ -470,7 +471,7 @@ fn the_binary_serves_a_whole_session_over_stdio() { let diagnostics = published["params"]["diagnostics"].as_array().expect("an array"); assert_eq!(diagnostics.len(), 1, "one error for `wire ;`"); assert_eq!(diagnostics[0]["severity"], 1, "an error"); - assert_eq!(diagnostics[0]["source"], "vfmt"); + assert_eq!(diagnostics[0]["source"], "lucisv"); assert_eq!(diagnostics[0]["range"]["start"]["line"], 3, "the `wire ;` line"); // 3. Definition jumped to the declaration, in the same file. @@ -543,7 +544,7 @@ fn scope_highlights_and_the_missing_end_warning_round_trip_over_the_wire() { // The rainbow's data source — a custom method, so this is the only // thing that proves the request loop routes it at all. frame(&format!( - r#"{{"jsonrpc":"2.0","id":6,"method":"vfmt/scopePairs","params":{{"textDocument":{{"uri":"{uri}"}}}}}}"# + r#"{{"jsonrpc":"2.0","id":6,"method":"lucisv/scopePairs","params":{{"textDocument":{{"uri":"{uri}"}}}}}}"# )), // The same request against a balanced buffer: `unmatched` has to come // back present and empty, because that is what clears the extension's @@ -553,7 +554,7 @@ fn scope_highlights_and_the_missing_end_warning_round_trip_over_the_wire() { serde_json::to_string(BALANCED).expect("json") )), frame(&format!( - r#"{{"jsonrpc":"2.0","id":7,"method":"vfmt/scopePairs","params":{{"textDocument":{{"uri":"{clean_uri}"}}}}}}"# + r#"{{"jsonrpc":"2.0","id":7,"method":"lucisv/scopePairs","params":{{"textDocument":{{"uri":"{clean_uri}"}}}}}}"# )), frame(r#"{"jsonrpc":"2.0","id":9,"method":"shutdown","params":null}"#), frame(r#"{"jsonrpc":"2.0","method":"exit","params":null}"#), @@ -637,7 +638,7 @@ fn scope_highlights_and_the_missing_end_warning_round_trip_over_the_wire() { assert_eq!(warning["message"], "`begin` has no matching `end` — is an `end` missing?"); assert_eq!(warning["range"]["start"]["line"], 1, "the `initial begin`"); assert_eq!(warning["range"]["start"]["character"], 10); - assert_eq!(warning["source"], "vfmt"); + assert_eq!(warning["source"], "lucisv"); assert!( diagnostics.iter().any(|d| d["severity"] == 1), "the parse error it explains is still there" @@ -666,7 +667,7 @@ fn pushed_settings_reach_the_formatter_and_can_change_mid_session() { }; let push = |indent: &str| { frame(&format!( - r#"{{"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{{"settings":{{"vfmt":{{"serverPath":"vfmt-server","rainbowBeginEnd":true,"lineLength":null,"indent":{indent},"exclude":[]}}}}}}}}"# + r#"{{"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{{"settings":{{"lucisv":{{"serverPath":"lucisv-server","rainbowBeginEnd":true,"lineLength":null,"indent":{indent},"exclude":[]}}}}}}}}"# )) }; let session = [ @@ -690,7 +691,7 @@ fn pushed_settings_reach_the_formatter_and_can_change_mid_session() { push("null"), format(5), // A payload that is nonsense must be ignored, not honoured by halves. - frame(r#"{"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{"settings":{"vfmt":{"indent":"four","lineLength":9999}}}}"#), + frame(r#"{"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{"settings":{"lucisv":{"indent":"four","lineLength":9999}}}}"#), format(6), frame(r#"{"jsonrpc":"2.0","id":9,"method":"shutdown","params":null}"#), frame(r#"{"jsonrpc":"2.0","method":"exit","params":null}"#), @@ -743,7 +744,7 @@ fn a_pushed_exclude_rebuilds_the_index_mid_session() { }; let exclude = |patterns: &str| { frame(&format!( - r#"{{"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{{"settings":{{"vfmt":{{"exclude":{patterns}}}}}}}}}"# + r#"{{"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{{"settings":{{"lucisv":{{"exclude":{patterns}}}}}}}}}"# )) }; // An open buffer, so the *republish* half of `reindex()` has somewhere to @@ -826,7 +827,7 @@ fn a_pushed_filelist_narrows_the_index_mid_session_and_reports_a_bad_one() { }; let filelist = |path: &str| { frame(&format!( - r#"{{"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{{"settings":{{"vfmt":{{"filelist":"{path}"}}}}}}}}"# + r#"{{"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{{"settings":{{"lucisv":{{"filelist":"{path}"}}}}}}}}"# )) }; let session = [ @@ -1068,22 +1069,22 @@ fn a_port_code_action_and_the_port_commands_round_trip_over_the_wire() { frame(&format!( r#"{{"jsonrpc":"2.0","id":2,"method":"textDocument/codeAction","params":{{"textDocument":{{"uri":"{top_uri}"}},"range":{{"start":{{"line":2,"character":6}},"end":{{"line":2,"character":6}}}},"context":{{"diagnostics":[]}}}}}}"# )), - // `vfmt.propagatePorts` at the same place, through the command. + // `lucisv.propagatePorts` at the same place, through the command. frame(&format!( - r#"{{"jsonrpc":"2.0","id":3,"method":"workspace/executeCommand","params":{{"command":"vfmt.propagatePorts","arguments":["{top_uri}",{{"line":2,"character":6}}]}}}}"# + r#"{{"jsonrpc":"2.0","id":3,"method":"workspace/executeCommand","params":{{"command":"lucisv.propagatePorts","arguments":["{top_uri}",{{"line":2,"character":6}}]}}}}"# )), - // `vfmt.addPort` — the one that needs text nobody can click. + // `lucisv.addPort` — the one that needs text nobody can click. frame(&format!( - r#"{{"jsonrpc":"2.0","id":4,"method":"workspace/executeCommand","params":{{"command":"vfmt.addPort","arguments":["{top_uri}","sub","input logic cfg"]}}}}"# + r#"{{"jsonrpc":"2.0","id":4,"method":"workspace/executeCommand","params":{{"command":"lucisv.addPort","arguments":["{top_uri}","sub","input logic cfg"]}}}}"# )), // ...and a declaration that is not one is refused with a sentence. frame(&format!( - r#"{{"jsonrpc":"2.0","id":5,"method":"workspace/executeCommand","params":{{"command":"vfmt.addPort","arguments":["{top_uri}","sub","wire"]}}}}"# + r#"{{"jsonrpc":"2.0","id":5,"method":"workspace/executeCommand","params":{{"command":"lucisv.addPort","arguments":["{top_uri}","sub","wire"]}}}}"# )), // ...and a port that would land inside an `ifdef arm is refused, over // the wire, not only in the crate's own tests. frame(&format!( - r#"{{"jsonrpc":"2.0","id":6,"method":"workspace/executeCommand","params":{{"command":"vfmt.addPort","arguments":["{cond_uri}","cond","input logic cfg"]}}}}"# + r#"{{"jsonrpc":"2.0","id":6,"method":"workspace/executeCommand","params":{{"command":"lucisv.addPort","arguments":["{cond_uri}","cond","input logic cfg"]}}}}"# )), frame(r#"{"jsonrpc":"2.0","id":9,"method":"shutdown","params":null}"#), frame(r#"{"jsonrpc":"2.0","method":"exit","params":null}"#), @@ -1098,22 +1099,22 @@ fn a_port_code_action_and_the_port_commands_round_trip_over_the_wire() { let commands = capabilities["executeCommandProvider"]["commands"] .as_array() .unwrap_or_else(|| panic!("no executeCommandProvider in {capabilities:#?}")); - assert!(commands.iter().any(|c| c == "vfmt.addPort"), "{commands:#?}"); - assert!(commands.iter().any(|c| c == "vfmt.removePort"), "{commands:#?}"); - assert!(commands.iter().any(|c| c == "vfmt.propagatePorts"), "{commands:#?}"); + assert!(commands.iter().any(|c| c == "lucisv.addPort"), "{commands:#?}"); + assert!(commands.iter().any(|c| c == "lucisv.removePort"), "{commands:#?}"); + assert!(commands.iter().any(|c| c == "lucisv.propagatePorts"), "{commands:#?}"); let kinds = capabilities["codeActionProvider"]["codeActionKinds"] .as_array() .expect("the kinds are listed"); - assert!(kinds.iter().any(|k| k == "refactor.rewrite.vfmt.ports"), "{kinds:#?}"); + assert!(kinds.iter().any(|k| k == "refactor.rewrite.lucisv.ports"), "{kinds:#?}"); // 2. The code action carries its own edit, ready to apply. let actions = messages.iter().find(|m| m["id"] == 2).expect("codeAction response"); let offered = actions["result"].as_array().expect("an array of actions"); let port_action = offered .iter() - .find(|a| a["kind"] == "refactor.rewrite.vfmt.ports") + .find(|a| a["kind"] == "refactor.rewrite.lucisv.ports") .unwrap_or_else(|| panic!("no port action in {offered:#?}")); - assert_eq!(port_action["title"], "vfmt: connect 1 missing port"); + assert_eq!(port_action["title"], "lucisv: connect 1 missing port"); let edits = port_action["edit"]["changes"][&top_uri].as_array().expect("one file's edits"); assert_eq!(edits.len(), 1); assert_eq!(edits[0]["newText"], ", .rst(rst)"); @@ -1433,7 +1434,7 @@ fn inline_templates_round_trip_over_the_wire() { let _ = std::fs::remove_dir_all(&dir); } -/// `vfmt.inlineTemplates` really suppresses the request handler when pushed +/// `lucisv.inlineTemplates` really suppresses the request handler when pushed /// over the wire — the link a unit test cannot check, since /// `inline.rs`'s own tests call `Workspace::set_client_settings` directly /// rather than going through `workspace/didChangeConfiguration`. @@ -1453,7 +1454,7 @@ fn the_inline_templates_setting_is_honoured_over_the_wire() { }; let push = |setting: &str| { frame(&format!( - r#"{{"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{{"settings":{{"vfmt":{{"inlineTemplates":{setting}}}}}}}}}"# + r#"{{"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{{"settings":{{"lucisv":{{"inlineTemplates":{setting}}}}}}}}}"# )) }; let session = [ @@ -1874,7 +1875,7 @@ struct Live { impl Live { fn start() -> Live { - let mut child = Command::new(env!("CARGO_BIN_EXE_vfmt-server")) + let mut child = Command::new(env!("CARGO_BIN_EXE_lucisv-server")) .stdin(Stdio::piped()) .stdout(Stdio::piped()) .stderr(Stdio::null()) @@ -2038,7 +2039,7 @@ endmodule fn include_links_definition_and_a_reachable_define_round_trip_over_the_wire() { // What only an e2e test can check: that `documentLinkProvider` is // advertised in the shape a client reads, that the `+incdir+` from a - // `vfmt.toml`-configured filelist survives the whole trip from disk to a + // `lucisv.toml`-configured filelist survives the whole trip from disk to a // resolved URI, and that the two capabilities answer the same line. let dir = temp_dir("include"); std::fs::create_dir_all(dir.join("inc")).expect("inc"); @@ -2054,7 +2055,7 @@ fn include_links_definition_and_a_reachable_define_round_trip_over_the_wire() { "+incdir+inc\nrtl/top.sv\ninc/defs.svh\nother/elsewhere.svh\n", ) .expect("write"); - std::fs::write(dir.join("vfmt.toml"), "filelist = \"files.f\"\n").expect("write"); + std::fs::write(dir.join("lucisv.toml"), "filelist = \"files.f\"\n").expect("write"); let root = format!("file://{}", dir.display()); let uri = format!("file://{}", top.display()); @@ -2131,7 +2132,7 @@ fn include_nav_round_trips_in_a_workspace_whose_directory_has_a_space() { let top = dir.join("top.sv"); std::fs::write(&top, INCLUDE_TOP).expect("write"); std::fs::write(dir.join("files.f"), "+incdir+inc\ntop.sv\ninc/defs.svh\n").expect("write"); - std::fs::write(dir.join("vfmt.toml"), "filelist = \"files.f\"\n").expect("write"); + std::fs::write(dir.join("lucisv.toml"), "filelist = \"files.f\"\n").expect("write"); // The URIs the wire actually needs: the directory's own space encoded, // matching what `path_to_uri` would produce and `uri_to_path` requires. diff --git a/crates/vfmt_server/tests/grammar.rs b/crates/lucisv_server/tests/grammar.rs similarity index 100% rename from crates/vfmt_server/tests/grammar.rs rename to crates/lucisv_server/tests/grammar.rs diff --git a/crates/vlog_formatter/Cargo.toml b/crates/vlog_formatter/Cargo.toml index b76d7d8..72a1566 100644 --- a/crates/vlog_formatter/Cargo.toml +++ b/crates/vlog_formatter/Cargo.toml @@ -3,7 +3,7 @@ name = "vlog_formatter" version.workspace = true edition.workspace = true license.workspace = true -description = "Verilog/SystemVerilog formatter engine for vfmt" +description = "Verilog/SystemVerilog formatter engine for lucisv" [dependencies] vlog_parser = { path = "../vlog_parser" } diff --git a/crates/vlog_formatter/src/align.rs b/crates/vlog_formatter/src/align.rs index 5367af1..297a822 100644 --- a/crates/vlog_formatter/src/align.rs +++ b/crates/vlog_formatter/src/align.rs @@ -5,7 +5,7 @@ //! This is Verible's most-loved formatter feature minus the configuration: a //! group whose author padded any of its lines by four or more excess spaces — //! or that already sits at one common column — keeps its columns; everything -//! else formats flush, which is what vfmt has always done. The two states are +//! else formats flush, which is what lucisv has always done. The two states are //! fixed points of each other, which is what lets the convergence check in //! `verify.rs` stay untouched; the argument is written out in //! `docs/features/alignment/README.md`. diff --git a/crates/vlog_formatter/src/fence.rs b/crates/vlog_formatter/src/fence.rs index b140227..056e80c 100644 --- a/crates/vlog_formatter/src/fence.rs +++ b/crates/vlog_formatter/src/fence.rs @@ -7,7 +7,7 @@ //! //! [`protected_regions`] and [`is_protected`] are the same answer for the //! tools that only *edit* fenced bytes rather than lay them out — the CLI's -//! `vfmt check --fix` and the language server's quick fixes. They live here so +//! `lucisv check --fix` and the language server's quick fixes. They live here so //! there is one definition of "what is fenced": see //! `docs/features/shared-fence-filter/README.md`. @@ -27,12 +27,12 @@ pub enum Fence { /// The fence a comment spells, if it spells one exactly. /// /// The match is exact after trimming, not a prefix: a comment that merely -/// starts with a fence (`// vfmt: off-by-one`) is an ordinary comment, because +/// starts with a fence (`// lucisv: off-by-one`) is an ordinary comment, because /// a fence firing by accident is worse than one that never fires. pub fn fence_of(text: &str) -> Option { match text.strip_prefix("//")?.trim() { - "verilog_format: off" | "vfmt: off" => Some(Fence::Off), - "verilog_format: on" | "vfmt: on" => Some(Fence::On), + "verilog_format: off" | "lucisv: off" => Some(Fence::Off), + "verilog_format: on" | "lucisv: on" => Some(Fence::On), _ => None, } } @@ -78,7 +78,7 @@ pub fn region_at(regions: &[Region], pos: usize) -> Option<&Region> { /// Every byte range in `src` that no tool may edit automatically. /// -/// `off` means hands-off across all of vfmt, not just the layout engine, so +/// `off` means hands-off across all of lucisv, not just the layout engine, so /// the CLI's `--fix` and the server's quick fixes both ask this question here /// rather than each answering it themselves. The answer is deliberately /// wider than [`collect`]'s: it is the union of @@ -291,49 +291,49 @@ mod tests { fn both_spellings_and_both_sides_are_fences() { assert_eq!(fence_of("// verilog_format: off"), Some(Fence::Off)); assert_eq!(fence_of("// verilog_format: on"), Some(Fence::On)); - assert_eq!(fence_of("// vfmt: off"), Some(Fence::Off)); - assert_eq!(fence_of("// vfmt: on"), Some(Fence::On)); + assert_eq!(fence_of("// lucisv: off"), Some(Fence::Off)); + assert_eq!(fence_of("// lucisv: on"), Some(Fence::On)); } #[test] fn surrounding_whitespace_is_trimmed() { - assert_eq!(fence_of("//vfmt: off"), Some(Fence::Off)); + assert_eq!(fence_of("//lucisv: off"), Some(Fence::Off)); assert_eq!(fence_of("// verilog_format: on"), Some(Fence::On)); - assert_eq!(fence_of("//\tvfmt: off"), Some(Fence::Off)); - assert_eq!(fence_of("// vfmt: on "), Some(Fence::On)); + assert_eq!(fence_of("//\tlucisv: off"), Some(Fence::Off)); + assert_eq!(fence_of("// lucisv: on "), Some(Fence::On)); } #[test] fn anything_else_is_an_ordinary_comment() { // Trailing text disqualifies a fence: an accidental switch is worse // than one that never fires. - assert_eq!(fence_of("// vfmt: off (for now)"), None); - assert_eq!(fence_of("// vfmt: off-by-one bug here"), None); + assert_eq!(fence_of("// lucisv: off (for now)"), None); + assert_eq!(fence_of("// lucisv: off-by-one bug here"), None); // The match is exact, not fuzzy. - assert_eq!(fence_of("// vfmt:off"), None); - assert_eq!(fence_of("// vfmt : off"), None); + assert_eq!(fence_of("// lucisv:off"), None); + assert_eq!(fence_of("// lucisv : off"), None); assert_eq!(fence_of("// verilog_format off"), None); - assert_eq!(fence_of("// VFMT: OFF"), None); + assert_eq!(fence_of("// LUCISV: OFF"), None); assert_eq!(fence_of("// verilog_lint: waive x"), None); // Block comments are not fences. - assert_eq!(fence_of("/* vfmt: off */"), None); + assert_eq!(fence_of("/* lucisv: off */"), None); assert_eq!(fence_of("/* verilog_format: off */"), None); - assert_eq!(fence_of("// vfmt: off\n// vfmt: on"), None); + assert_eq!(fence_of("// lucisv: off\n// lucisv: on"), None); assert_eq!(fence_of(""), None); assert_eq!(fence_of("// off"), None); } #[test] fn a_fence_line_starts_at_its_indentation() { - let src = "module m;\n // vfmt: off\n"; + let src = "module m;\n // lucisv: off\n"; let at = src.find("//").expect("fence"); assert_eq!(line_start(src, at), src.find(" //").expect("indent")); // Not when another comment shares the line. - let src = "module m;\n /* a */ // vfmt: off\n"; + let src = "module m;\n /* a */ // lucisv: off\n"; let at = src.find("//").expect("fence"); assert_eq!(line_start(src, at), at); // At the very start of the file. - assert_eq!(line_start("// vfmt: off\n", 0), 0); + assert_eq!(line_start("// lucisv: off\n", 0), 0); } #[test] @@ -387,7 +387,7 @@ mod tests { // exercises the scan half it claims not to test (QA find): `\ta = 1;` // bare at item position does not parse, and `collect` then hangs no // region on the tree. `wire` declarations parse cleanly. - let src = "module m;\n// vfmt: off\n\twire a;\n// vfmt: on\n\twire b;\nendmodule\n"; + let src = "module m;\n// lucisv: off\n\twire a;\n// lucisv: on\n\twire b;\nendmodule\n"; let (parsed, diagnostics) = vlog_parser::parse_source_tolerant(src); assert!(diagnostics.is_empty(), "the tree must be clean for this test to mean anything"); assert!(!collect(src, &parsed).is_empty(), "the TREE path must find the region"); @@ -402,7 +402,7 @@ mod tests { fn the_line_scan_backstops_a_file_that_does_not_parse() { // Error recovery can swallow the structure `collect` hangs a region // on; the scan still finds it. - let src = "module m;\n@@@ junk;\n// vfmt: off\n\ta = 1;\n// vfmt: on\nendmodule\n"; + let src = "module m;\n@@@ junk;\n// lucisv: off\n\ta = 1;\n// lucisv: on\nendmodule\n"; let (parsed, _) = vlog_parser::parse_source_tolerant(src); assert!(collect(src, &parsed).is_empty(), "the premise: no tree region here"); let tab = src.find("\ta = 1").expect("tab"); @@ -411,7 +411,7 @@ mod tests { #[test] fn an_unclosed_fence_runs_to_the_end_of_the_file() { - let src = "module m;\n@@@ junk;\n// vfmt: off\n\ta = 1;\nendmodule\n"; + let src = "module m;\n@@@ junk;\n// lucisv: off\n\ta = 1;\nendmodule\n"; let regions = scanned_regions(src); assert_eq!(regions.len(), 1); assert_eq!(regions[0].end, src.len()); @@ -419,9 +419,9 @@ mod tests { #[test] fn an_ordinary_comment_protects_nothing() { - assert!(scanned_regions("// vfmt: off-by-one\n\ta = 1;\n").is_empty()); + assert!(scanned_regions("// lucisv: off-by-one\n\ta = 1;\n").is_empty()); assert!(scanned_regions("// just a note\n\ta = 1;\n").is_empty()); - assert!(scanned_regions("// vfmt: on\n\ta = 1;\n").is_empty(), "a stray `on`"); + assert!(scanned_regions("// lucisv: on\n\ta = 1;\n").is_empty(), "a stray `on`"); assert!(protected_regions("module m;\n\ta = 1;\nendmodule\n").is_empty()); } } diff --git a/crates/vlog_formatter/src/format.rs b/crates/vlog_formatter/src/format.rs index 1fced29..dc43a9c 100644 --- a/crates/vlog_formatter/src/format.rs +++ b/crates/vlog_formatter/src/format.rs @@ -245,7 +245,7 @@ impl<'a> Fmt<'a> { /// into the middle of a line. /// /// Like [`Fmt::raw_inline`] it is reproduced byte for byte — the block is - /// a constraint body vfmt does not model, so there is no layout to apply + /// a constraint body lucisv does not model, so there is no layout to apply /// and re-indenting it would only drift on every pass — but the printer /// is told about the line breaks inside it, so the expression around it /// is still measured against the line width correctly. diff --git a/crates/vlog_formatter/src/verify.rs b/crates/vlog_formatter/src/verify.rs index c3859ae..33569ec 100644 --- a/crates/vlog_formatter/src/verify.rs +++ b/crates/vlog_formatter/src/verify.rs @@ -263,7 +263,7 @@ fn trim_lines(text: &str) -> String { /// re-indent the *contents of a string* and still pass this check — masked /// corruption, and the reason this function exists (QA finding, 2026-08-19: /// `` `uvm_info("id", "line one\n line two", UVM_LOW) `` had its string -/// rewritten with vfmt exiting 0). Leaving those lines untrimmed makes the +/// rewritten with lucisv exiting 0). Leaving those lines untrimmed makes the /// comparison byte-exact exactly where bytes are meaningful. fn trim_lines_outside_strings(text: &str) -> String { if !text.contains('\n') { diff --git a/crates/vlog_formatter/tests/cases/assertions.cases b/crates/vlog_formatter/tests/cases/assertions.cases index f0b1896..d653d2f 100644 --- a/crates/vlog_formatter/tests/cases/assertions.cases +++ b/crates/vlog_formatter/tests/cases/assertions.cases @@ -256,7 +256,7 @@ else $error("line one endmodule ==== # a property spec far past the line limit is *not* broken: the property -# expression is a grammar vfmt does not model, so it is reproduced as written +# expression is a grammar lucisv does not model, so it is reproduced as written module m; assert property (@(posedge clk_i) disable iff (!rst_ni) some_very_long_signal_name_here |-> ##[1:3] another_quite_long_signal_name); endmodule diff --git a/crates/vlog_formatter/tests/cases/fences.cases b/crates/vlog_formatter/tests/cases/fences.cases index 0edc4bb..3238c88 100644 --- a/crates/vlog_formatter/tests/cases/fences.cases +++ b/crates/vlog_formatter/tests/cases/fences.cases @@ -15,18 +15,18 @@ wire [31:0] bb= 32'h2; wire c; endmodule ==== -# the vfmt alias fences the same region +# the lucisv alias fences the same region module m; - // vfmt: off + // lucisv: off wire [3:0] a; - // vfmt: on + // lucisv: on wire b; endmodule ---- module m; - // vfmt: off + // lucisv: off wire [3:0] a; - // vfmt: on + // lucisv: on wire b; endmodule ==== @@ -34,45 +34,45 @@ endmodule module m; // verilog_format: off wire a; - // vfmt: on + // lucisv: on wire b; endmodule ---- module m; // verilog_format: off wire a; - // vfmt: on + // lucisv: on wire b; endmodule ==== # a region keeps its own indentation, first line included module m; - // vfmt: off + // lucisv: off wire a; wire b; - // vfmt: on + // lucisv: on wire c; endmodule ---- module m; - // vfmt: off + // lucisv: off wire a; wire b; - // vfmt: on + // lucisv: on wire c; endmodule ==== # a fence at the top of the file -// vfmt: off +// lucisv: off module m; endmodule -// vfmt: on +// lucisv: on module n; wire a; endmodule ---- -// vfmt: off +// lucisv: off module m; endmodule -// vfmt: on +// lucisv: on module n; wire a; endmodule @@ -81,19 +81,19 @@ endmodule module m; wire a; endmodule -// vfmt: off +// lucisv: off module n; wire b; endmodule ---- module m; wire a; endmodule -// vfmt: off +// lucisv: off module n; wire b; endmodule ==== # an unmatched off runs to the end of the module body, not past endmodule module m; wire a; - // vfmt: off + // lucisv: off wire b; wire c; endmodule @@ -104,7 +104,7 @@ endmodule ---- module m; wire a; - // vfmt: off + // lucisv: off wire b; wire c; endmodule @@ -115,25 +115,25 @@ endmodule ==== # an unmatched off keeps the comment trailing its last item module m; - // vfmt: off + // lucisv: off wire a; // note endmodule ---- module m; - // vfmt: off + // lucisv: off wire a; // note endmodule ==== # an unmatched off swallows the scope's dangling comments too module m; - // vfmt: off + // lucisv: off wire a; // dangling one // dangling two endmodule ---- module m; - // vfmt: off + // lucisv: off wire a; // dangling one // dangling two @@ -141,137 +141,137 @@ endmodule ==== # an on written after endmodule cannot close an off inside the module module m; - // vfmt: off + // lucisv: off wire a; endmodule -// vfmt: on +// lucisv: on module n; wire b; endmodule ---- module m; - // vfmt: off + // lucisv: off wire a; endmodule -// vfmt: on +// lucisv: on module n; wire b; endmodule ==== # two regions in one file module m; - // vfmt: off + // lucisv: off wire a; - // vfmt: on + // lucisv: on wire b; - // vfmt: off + // lucisv: off wire c; - // vfmt: on + // lucisv: on wire d; endmodule ---- module m; - // vfmt: off + // lucisv: off wire a; - // vfmt: on + // lucisv: on wire b; - // vfmt: off + // lucisv: off wire c; - // vfmt: on + // lucisv: on wire d; endmodule ==== # a fence with trailing text is not a fence module m; - // vfmt: off (just for now) + // lucisv: off (just for now) wire a; - // vfmt: on + // lucisv: on wire b; endmodule ---- module m; - // vfmt: off (just for now) + // lucisv: off (just for now) wire a; - // vfmt: on + // lucisv: on wire b; endmodule ==== # a block comment is not a fence module m; - /* vfmt: off */ + /* lucisv: off */ wire a; - /* vfmt: on */ + /* lucisv: on */ wire b; endmodule ---- module m; - /* vfmt: off */ + /* lucisv: off */ wire a; - /* vfmt: on */ + /* lucisv: on */ wire b; endmodule ==== # a fence written after code on the same line is not a fence module m; - wire z; // vfmt: off + wire z; // lucisv: off wire a; endmodule ---- module m; - wire z; // vfmt: off + wire z; // lucisv: off wire a; endmodule ==== # an on with no open off is an ordinary comment module m; - // vfmt: on + // lucisv: on wire a; endmodule ---- module m; - // vfmt: on + // lucisv: on wire a; endmodule ==== # a second off inside an open region is just text, the first on closes module m; - // vfmt: off + // lucisv: off wire a; - // vfmt: off + // lucisv: off wire b; - // vfmt: on + // lucisv: on wire c; - // vfmt: on + // lucisv: on wire d; endmodule ---- module m; - // vfmt: off + // lucisv: off wire a; - // vfmt: off + // lucisv: off wire b; - // vfmt: on + // lucisv: on wire c; - // vfmt: on + // lucisv: on wire d; endmodule ==== # a region of nothing but comments module m; - // vfmt: off + // lucisv: off // +-------+ // | ascii | // +-------+ - // vfmt: on + // lucisv: on wire a; endmodule ---- module m; - // vfmt: off + // lucisv: off // +-------+ // | ascii | // +-------+ - // vfmt: on + // lucisv: on wire a; endmodule ==== @@ -280,9 +280,9 @@ module m; wire z; // doc for the table -// vfmt: off +// lucisv: off wire a; -// vfmt: on +// lucisv: on wire b; endmodule ---- @@ -290,62 +290,62 @@ module m; wire z; // doc for the table -// vfmt: off +// lucisv: off wire a; -// vfmt: on +// lucisv: on wire b; endmodule ==== # valid-but-ugly code inside a region is left exactly as written module m; - // vfmt: off + // lucisv: off always@(posedge clk)if(en)q<=d;else q <= 1'b0; assign y = {a,b , c} ; - // vfmt: on + // lucisv: on assign z = a + b; endmodule ---- module m; - // vfmt: off + // lucisv: off always@(posedge clk)if(en)q<=d;else q <= 1'b0; assign y = {a,b , c} ; - // vfmt: on + // lucisv: on assign z = a + b; endmodule ==== # attributes and directives inside a region are source bytes like anything else module m; - // vfmt: off + // lucisv: off (* keep *) wire a; `ifdef FOO wire b; `endif - // vfmt: on + // lucisv: on wire c; endmodule ---- module m; - // vfmt: off + // lucisv: off (* keep *) wire a; `ifdef FOO wire b; `endif - // vfmt: on + // lucisv: on wire c; endmodule ==== # fences work in a package body package p; - // vfmt: off + // lucisv: off localparam int A =1; - // vfmt: on + // lucisv: on localparam int B =2; endpackage ---- package p; - // vfmt: off + // lucisv: off localparam int A =1; - // vfmt: on + // lucisv: on localparam int B = 2; endpackage ==== @@ -353,9 +353,9 @@ endpackage module m; generate if (X) begin : g -// vfmt: off +// lucisv: off wire a; -// vfmt: on +// lucisv: on wire b; end endgenerate @@ -364,9 +364,9 @@ endmodule module m; generate if (X) begin : g -// vfmt: off +// lucisv: off wire a; -// vfmt: on +// lucisv: on wire b; end endgenerate @@ -375,18 +375,18 @@ endmodule # a statement-level fence has no effect this round module m; always @(*) begin -// vfmt: off +// lucisv: off x = 1; -// vfmt: on +// lucisv: on y = 2; end endmodule ---- module m; always @(*) begin - // vfmt: off + // lucisv: off x = 1; - // vfmt: on + // lucisv: on y = 2; end endmodule @@ -397,29 +397,29 @@ module m; - // vfmt: off + // lucisv: off wire a; - // vfmt: on + // lucisv: on endmodule ---- module m; wire z; - // vfmt: off + // lucisv: off wire a; - // vfmt: on + // lucisv: on endmodule ==== # a region ending the file keeps exactly one final newline module m; wire a; endmodule -// vfmt: off +// lucisv: off `define WIDTH 8 ---- module m; wire a; endmodule -// vfmt: off +// lucisv: off `define WIDTH 8 ==== diff --git a/crates/vlog_formatter/tests/fences.rs b/crates/vlog_formatter/tests/fences.rs index 1882cfd..0e7a9cd 100644 --- a/crates/vlog_formatter/tests/fences.rs +++ b/crates/vlog_formatter/tests/fences.rs @@ -26,9 +26,9 @@ fn fenced(src: &str, region: &str) -> String { fn a_region_is_emitted_byte_for_byte() { // Interior spacing, alignment, trailing comments and a blank line inside // the region all survive; the item after it is formatted normally. - let src = "module m;\n // vfmt: off\n wire [3:0] a = 4'h1; // lo\n\n wire [31:0] b= 32'h2;\n // vfmt: on\n wire c;\nendmodule\n"; + let src = "module m;\n // lucisv: off\n wire [3:0] a = 4'h1; // lo\n\n wire [31:0] b= 32'h2;\n // lucisv: on\n wire c;\nendmodule\n"; let region = - " // vfmt: off\n wire [3:0] a = 4'h1; // lo\n\n wire [31:0] b= 32'h2;\n // vfmt: on"; + " // lucisv: off\n wire [3:0] a = 4'h1; // lo\n\n wire [31:0] b= 32'h2;\n // lucisv: on"; let out = fenced(src, region); assert!(out.ends_with(" wire c;\nendmodule\n"), "{out}"); } @@ -38,8 +38,8 @@ fn a_region_keeps_its_own_indentation_on_every_line() { // The source is indented four spaces inside a module the formatter // indents by two: the region's first line is not re-indented either. let src = - "module m;\n // vfmt: off\n wire a;\n // vfmt: on\n wire b;\nendmodule\n"; - let out = fenced(src, " // vfmt: off\n wire a;\n // vfmt: on"); + "module m;\n // lucisv: off\n wire a;\n // lucisv: on\n wire b;\nendmodule\n"; + let out = fenced(src, " // lucisv: off\n wire a;\n // lucisv: on"); assert!( out.contains("\n wire b;\n"), "formatting did not resume at the module indent:\n{out}" @@ -51,15 +51,16 @@ fn an_unmatched_off_runs_to_the_end_of_its_scope_only() { // It must stop at the module's last item — the comment trailing that item // included, since `Meta.trailing` has no span of its own to splice from — // and the next module must still be formatted. - let src = "module m;\n // vfmt: off\n wire a; // note\nendmodule\n\nmodule n;\n wire b;\nendmodule\n"; - let out = fenced(src, " // vfmt: off\n wire a; // note"); + let src = "module m;\n // lucisv: off\n wire a; // note\nendmodule\n\nmodule n;\n wire b;\nendmodule\n"; + let out = fenced(src, " // lucisv: off\n wire a; // note"); assert!(out.contains("module n;\n wire b;\n"), "the next module was not formatted:\n{out}"); } #[test] fn comments_before_the_off_fence_are_still_formatted_and_never_dropped() { - let src = "module m;\n// doc for the table\n// vfmt: off\nwire a;\n// vfmt: on\nendmodule\n"; - let out = fenced(src, "// vfmt: off\nwire a;\n// vfmt: on"); + let src = + "module m;\n// doc for the table\n// lucisv: off\nwire a;\n// lucisv: on\nendmodule\n"; + let out = fenced(src, "// lucisv: off\nwire a;\n// lucisv: on"); assert!(out.contains(" // doc for the table\n"), "leading comment lost or unindented:\n{out}"); } @@ -68,18 +69,18 @@ fn a_corrupted_fenced_region_is_still_rejected_by_the_safety_net() { // The fence is not a licence to change bytes: a hand-built "output" that // reformats, drops or adds anything inside the region must fail // equivalence exactly as it would outside one. - let src = "module m;\n // vfmt: off\n wire [3:0] a;\n wire b; // note\n // vfmt: on\nendmodule\n"; + let src = "module m;\n // lucisv: off\n wire [3:0] a;\n wire b; // note\n // lucisv: on\nendmodule\n"; let corrupted = [ // a token dropped from inside the region - "module m;\n // vfmt: off\n wire a;\n wire b; // note\n // vfmt: on\nendmodule\n", + "module m;\n // lucisv: off\n wire a;\n wire b; // note\n // lucisv: on\nendmodule\n", // the region's trailing comment dropped - "module m;\n // vfmt: off\n wire [3:0] a;\n wire b;\n // vfmt: on\nendmodule\n", + "module m;\n // lucisv: off\n wire [3:0] a;\n wire b;\n // lucisv: on\nendmodule\n", // a fence comment itself dropped - "module m;\n wire [3:0] a;\n wire b; // note\n // vfmt: on\nendmodule\n", + "module m;\n wire [3:0] a;\n wire b; // note\n // lucisv: on\nendmodule\n", // a token added inside the region - "module m;\n // vfmt: off\n wire [3:0] a, z;\n wire b; // note\n // vfmt: on\nendmodule\n", + "module m;\n // lucisv: off\n wire [3:0] a, z;\n wire b; // note\n // lucisv: on\nendmodule\n", // a fence turned into an ordinary comment - "module m;\n // vfmt: off\n wire [3:0] a;\n wire b; // note\n // vfmt: onward\nendmodule\n", + "module m;\n // lucisv: off\n wire [3:0] a;\n wire b; // note\n // lucisv: onward\nendmodule\n", ]; // The real formatter gets it right... verify_equivalence(src, &fmt(src)).expect("the real output is equivalent"); @@ -97,12 +98,12 @@ fn the_matcher_agrees_with_what_the_formatter_honours() { // The unit tests in `fence.rs` pin the matcher; this pins that the // formatter is driven by it, in both directions. let body = "module m;\n {}\n wire a;\nendmodule\n"; - for spelling in ["// verilog_format: off", "//vfmt: off", "//\tverilog_format: off"] { + for spelling in ["// verilog_format: off", "//lucisv: off", "//\tverilog_format: off"] { assert_eq!(fence_of(spelling), Some(Fence::Off)); let out = fmt(&body.replace("{}", spelling)); assert!(out.contains("wire a;"), "{spelling} did not fence:\n{out}"); } - for spelling in ["// vfmt: off now", "// vfmt:off", "/* vfmt: off */", "// VFMT: OFF"] { + for spelling in ["// lucisv: off now", "// lucisv:off", "/* lucisv: off */", "// LUCISV: OFF"] { assert_eq!(fence_of(spelling), None); let out = fmt(&body.replace("{}", spelling)); assert!(out.contains("wire a;"), "{spelling} fenced but should not have:\n{out}"); diff --git a/crates/vlog_formatter/tests/ranges.rs b/crates/vlog_formatter/tests/ranges.rs index 90b75fe..270ad73 100644 --- a/crates/vlog_formatter/tests/ranges.rs +++ b/crates/vlog_formatter/tests/ranges.rs @@ -192,10 +192,10 @@ fn a_statement_is_never_the_unit_the_item_around_it_is() { const WITH_FENCE: &str = "\ module m; wire a; - // vfmt: off + // lucisv: off wire b; wire c; - // vfmt: on + // lucisv: on wire d; endmodule "; @@ -203,7 +203,7 @@ endmodule #[test] fn a_fence_outranks_a_range() { // Selecting a fenced line must not lay it out: `off` means hands off - // across all of vfmt, whatever the caller asked for. + // across all of lucisv, whatever the caller asked for. for spec in ["3", "4", "5", "3-5"] { assert_eq!(fixed_point(WITH_FENCE, spec), WITH_FENCE, "spec {spec}"); } diff --git a/crates/vlog_formatter/tests/verification.rs b/crates/vlog_formatter/tests/verification.rs index 05d9166..3d27647 100644 --- a/crates/vlog_formatter/tests/verification.rs +++ b/crates/vlog_formatter/tests/verification.rs @@ -53,7 +53,7 @@ fn multiline_macro_invocation_may_be_reindented() { /// physical lines. Its continuation line's leading whitespace is part of the /// string's *value*, so re-indenting it corrupts the string — and a blind /// per-line trim in `normalize` used to report the pair as equivalent, so -/// `vfmt` exited 0 and wrote the corrupted file. The net must reject this. +/// `lucisv` exited 0 and wrote the corrupted file. The net must reject this. #[test] fn reindented_string_inside_a_macro_argument_is_rejected() { let input = "module m;\nif (X) begin : g\n`uvm_info(\"id\", \"line one\n line two\", UVM_LOW);\nend\nendmodule\n"; diff --git a/crates/vlog_linter/examples/rules_markdown.rs b/crates/vlog_linter/examples/rules_markdown.rs index 9e7037e..c676ebb 100644 --- a/crates/vlog_linter/examples/rules_markdown.rs +++ b/crates/vlog_linter/examples/rules_markdown.rs @@ -1,8 +1,8 @@ //! Prints the generated rule reference. //! //! `cargo run -p vlog_linter --example rules_markdown > docs/lint-rules.md`. -//! This exists because the CLI flag that will do the same (`vfmt check -//! --rules-doc`) belongs to `crates/vfmt` and is not wired yet — see the +//! This exists because the CLI flag that will do the same (`lucisv check +//! --rules-doc`) belongs to `crates/lucisv` and is not wired yet — see the //! Handshakes section of `docs/features/lint-rules-2/README.md`. fn main() { diff --git a/crates/vlog_linter/src/context.rs b/crates/vlog_linter/src/context.rs index 33c701d..73cb363 100644 --- a/crates/vlog_linter/src/context.rs +++ b/crates/vlog_linter/src/context.rs @@ -11,14 +11,14 @@ use vlog_semantic::{analyze, Semantics}; use crate::signals::Signals; -/// The default tab stop used when a fix expands a tab, matching vfmt's +/// The default tab stop used when a fix expands a tab, matching lucisv's /// default indent. `LintContext::with_tab_width` follows `--indent`. const DEFAULT_TAB_WIDTH: usize = 2; /// One text, parsed once: the products a lint run reads. /// /// This is the owned half of "one parse, two tools" (TODO §4): a caller with -/// no products of its own — `vfmt check` per file, [`LintContext::new`] — +/// no products of its own — `lucisv check` per file, [`LintContext::new`] — /// parses here and lends the results to [`LintContext::from_parse`] via /// [`ParsedSource::context`]. A caller that already holds the products (the /// language server's per-buffer document) skips this type and calls @@ -102,7 +102,7 @@ enum Backing<'a> { /// rule asks for it. /// /// Lazy rather than eager because most rules are syntactic: a run with no -/// semantic rule enabled — which is every default `vfmt check`, since all +/// semantic rule enabled — which is every default `lucisv check`, since all /// three semantic rules ship off — must not pay for an analysis nobody reads. enum SemanticsSlot<'a> { Lent(&'a Semantics), diff --git a/crates/vlog_linter/src/lib.rs b/crates/vlog_linter/src/lib.rs index 5040960..9a58a76 100644 --- a/crates/vlog_linter/src/lib.rs +++ b/crates/vlog_linter/src/lib.rs @@ -1,5 +1,5 @@ //! Syntactic lint rules for Verilog/SystemVerilog — the engine behind -//! `vfmt check`. +//! `lucisv check`. //! //! This crate plays the role of `ruff_linter` in ruff's architecture: a //! registry of named rules, each handed a prepared file ([`LintContext`]) and @@ -105,7 +105,7 @@ mod tests { #[test] fn a_same_line_waiver_suppresses_that_line_only() { - let src = "module m;\n\twire a; // vfmt: waive no-tabs\n\twire b;\nendmodule\n"; + let src = "module m;\n\twire a; // lucisv: waive no-tabs\n\twire b;\nendmodule\n"; let found = lint_all(src); assert_eq!(names(&found), vec!["no-tabs"]); assert_eq!(found[0].span.start as usize, src.find("\twire b").unwrap()); @@ -113,7 +113,7 @@ mod tests { #[test] fn a_waiver_on_its_own_line_covers_the_next_one() { - let src = "module m;\n // vfmt: waive no-tabs\n\twire a;\n\twire b;\nendmodule\n"; + let src = "module m;\n // lucisv: waive no-tabs\n\twire a;\n\twire b;\nendmodule\n"; let found = lint_all(src); assert_eq!(names(&found), vec!["no-tabs"], "only the second tab line survives"); assert_eq!(found[0].span.start as usize, src.find("\twire b").unwrap()); @@ -128,10 +128,10 @@ mod tests { #[test] fn a_start_stop_range_covers_its_markers_and_everything_between() { let src = "module m;\n\ - // vfmt: waive-start no-tabs\n\ + // lucisv: waive-start no-tabs\n\ \twire a;\n\ \twire b;\n\ - // vfmt: waive-stop no-tabs\n\ + // lucisv: waive-stop no-tabs\n\ \twire c;\n\ endmodule\n"; let found = lint_all(src); @@ -141,13 +141,13 @@ mod tests { #[test] fn an_unclosed_range_runs_to_the_end_of_the_file() { - let src = "module m;\n// vfmt: waive-start no-tabs\n\twire a;\n\twire b;\nendmodule\n"; + let src = "module m;\n// lucisv: waive-start no-tabs\n\twire a;\n\twire b;\nendmodule\n"; assert!(lint_all(src).is_empty()); } #[test] fn a_waiver_that_suppresses_nothing_is_reported() { - let src = "module m;\n wire a; // vfmt: waive no-tabs\nendmodule\n"; + let src = "module m;\n wire a; // lucisv: waive no-tabs\nendmodule\n"; let found = lint_all(src); assert_eq!(names(&found), vec![UNUSED_WAIVER]); assert!(found[0].message.contains("no-tabs"), "{}", found[0].message); @@ -155,7 +155,7 @@ mod tests { #[test] fn an_unknown_or_malformed_waiver_is_reported() { - let src = "module m;\n // vfmt: waive no-such-rule\n // vfmt: waive\nendmodule\n"; + let src = "module m;\n // lucisv: waive no-such-rule\n // lucisv: waive\nendmodule\n"; let found = lint_all(src); assert_eq!(names(&found), vec![UNUSED_WAIVER, UNUSED_WAIVER]); assert!(found[0].message.contains("unknown rule"), "{}", found[0].message); @@ -163,21 +163,21 @@ mod tests { } #[test] - fn a_verible_waiver_for_a_rule_vfmt_does_not_have_is_ignored() { - // Real corpus RTL is annotated for Verible. Waivers naming rules vfmt + fn a_verible_waiver_for_a_rule_lucisv_does_not_have_is_ignored() { + // Real corpus RTL is annotated for Verible. Waivers naming rules lucisv // has not implemented are that codebase's, not typos, so they are // neither honored nor reported. let src = "module m;\n // verilog_lint: waive macro-name-style\n wire a;\nendmodule\n"; assert!(lint_all(src).is_empty()); - // vfmt's own spelling gets no such benefit of the doubt. - let src = "module m;\n // vfmt: waive macro-name-style\n wire a;\nendmodule\n"; + // lucisv's own spelling gets no such benefit of the doubt. + let src = "module m;\n // lucisv: waive macro-name-style\n wire a;\nendmodule\n"; assert_eq!(names(&lint_all(src)), vec![UNUSED_WAIVER]); } #[test] fn a_waive_stop_without_a_start_is_reported() { - let src = "module m;\n // vfmt: waive-stop no-tabs\nendmodule\n"; + let src = "module m;\n // lucisv: waive-stop no-tabs\nendmodule\n"; let found = lint_all(src); assert_eq!(names(&found), vec![UNUSED_WAIVER]); assert!(found[0].message.contains("no matching"), "{}", found[0].message); @@ -185,7 +185,7 @@ mod tests { #[test] fn a_waiver_for_a_rule_this_run_did_not_enable_is_silent() { - let src = "module m;\n wire a; // vfmt: waive no-tabs\nendmodule\n"; + let src = "module m;\n wire a; // lucisv: waive no-tabs\nendmodule\n"; let enabled = select_rules(&[], &["no-tabs".to_string()]).unwrap(); assert!(run(src, None, &enabled).is_empty()); } @@ -193,15 +193,15 @@ mod tests { #[test] fn unused_waiver_findings_can_themselves_be_waived() { let src = "module m;\n\ - // vfmt: waive unused-waiver\n\ - wire a; // vfmt: waive no-tabs\n\ + // lucisv: waive unused-waiver\n\ + wire a; // lucisv: waive no-tabs\n\ endmodule\n"; assert!(lint_all(src).is_empty()); } #[test] fn disabling_the_pseudo_rule_silences_unused_reporting() { - let src = "module m;\n wire a; // vfmt: waive no-tabs\nendmodule\n"; + let src = "module m;\n wire a; // lucisv: waive no-tabs\nendmodule\n"; let enabled = select_rules(&[], &[UNUSED_WAIVER.to_string()]).unwrap(); assert!(run(src, None, &enabled).is_empty()); } @@ -216,7 +216,7 @@ mod tests { fn fixing_leaves_the_file_clean_for_the_fixed_rules() { // A tab that is also trailing whitespace needs two rounds: the two // fixes overlap, so the first pass applies one and the second the - // other. This is the loop `vfmt check --fix` runs. + // other. This is the loop `lucisv check --fix` runs. let mut src = "module m;\n\twire a;\t\n wire b; \nendmodule\n".to_string(); for _ in 0..10 { let found = run(&src, None, &default_rules()); diff --git a/crates/vlog_linter/src/naming.rs b/crates/vlog_linter/src/naming.rs index f0fc563..97dd16d 100644 --- a/crates/vlog_linter/src/naming.rs +++ b/crates/vlog_linter/src/naming.rs @@ -1,12 +1,12 @@ //! The naming-style presets the naming rules check against. //! -//! Verible spells its naming conventions as RE2 regular expressions. vfmt +//! Verible spells its naming conventions as RE2 regular expressions. lucisv //! spells the same conventions as character-class predicates instead, on //! purpose: every preset anyone actually uses is "these character classes, in //! this order", which is four small functions — and a regex engine is a //! dependency this crate (today: `vlog_parser` + std) does not otherwise need. //! The cost is that user-supplied patterns are not expressible; that waits on -//! the `lint` key in `vfmt.toml` and is recorded as such in +//! the `lint` key in `lucisv.toml` and is recorded as such in //! `docs/features/lint-rules-2/README.md`. //! //! An **escaped identifier** (`\my$name `) is exempt from every style: its diff --git a/crates/vlog_linter/src/registry.rs b/crates/vlog_linter/src/registry.rs index 70aef68..7234422 100644 --- a/crates/vlog_linter/src/registry.rs +++ b/crates/vlog_linter/src/registry.rs @@ -20,7 +20,7 @@ pub trait Rule: Sync { /// Why the rule exists — the style-guide rationale, in prose. fn doc(&self) -> &'static str; - /// Whether a plain `vfmt check` runs this rule. A rule is default-on only + /// Whether a plain `lucisv check` runs this rule. A rule is default-on only /// where Verible defaults its equivalent on; see /// `docs/features/lint-rules-2/README.md` for the citation per rule. fn default_on(&self) -> bool { @@ -60,7 +60,7 @@ pub fn all_rules() -> Vec<&'static dyn Rule> { ] } -/// The rules a plain `vfmt check` runs: every rule whose +/// The rules a plain `lucisv check` runs: every rule whose /// [`default_on`](Rule::default_on) says so. pub fn default_rules() -> Vec<&'static dyn Rule> { all_rules().into_iter().filter(|rule| rule.default_on()).collect() diff --git a/crates/vlog_linter/src/rule_docs.rs b/crates/vlog_linter/src/rule_docs.rs index 0f4109a..e1bf410 100644 --- a/crates/vlog_linter/src/rule_docs.rs +++ b/crates/vlog_linter/src/rule_docs.rs @@ -11,13 +11,13 @@ use crate::registry::all_rules; /// The whole rule reference as one markdown document. pub fn rules_markdown() -> String { let mut out = String::new(); - out.push_str("# vfmt lint rules\n\n"); + out.push_str("# lucisv lint rules\n\n"); out.push_str( "Generated from the rule registry by `vlog_linter::rules_markdown` — \ do not edit by hand.\n\n\ - A rule marked **default** runs for a plain `vfmt check`; the others \ + A rule marked **default** runs for a plain `lucisv check`; the others \ need `--select `. Any rule can be turned off with `--ignore \ - ` or waived in the source with `// vfmt: waive `.\n\n", + ` or waived in the source with `// lucisv: waive `.\n\n", ); out.push_str("| Rule | Default | Fix |\n|---|---|---|\n"); @@ -124,14 +124,14 @@ mod tests { assert_eq!( head, vec![ - "# vfmt lint rules", + "# lucisv lint rules", "", "Generated from the rule registry by `vlog_linter::rules_markdown` — do not edit \ by hand.", "", - "A rule marked **default** runs for a plain `vfmt check`; the others need \ + "A rule marked **default** runs for a plain `lucisv check`; the others need \ `--select `. Any rule can be turned off with `--ignore ` or waived \ - in the source with `// vfmt: waive `.", + in the source with `// lucisv: waive `.", "", "| Rule | Default | Fix |", "|---|---|---|", diff --git a/crates/vlog_linter/src/rules/enum_name_style.rs b/crates/vlog_linter/src/rules/enum_name_style.rs index 5f63f87..f0b16ed 100644 --- a/crates/vlog_linter/src/rules/enum_name_style.rs +++ b/crates/vlog_linter/src/rules/enum_name_style.rs @@ -27,7 +27,7 @@ impl Rule for EnumNameStyle { readable at a glance: `state_e cur_state` says which identifier is the \ type without knowing the codebase. Verible's `enum-name-style` \ (enabled by default) spells this as the pattern `[a-z_0-9]+(_t|_e)` — \ - lower_snake_case with an `_e` or `_t` suffix — and vfmt checks the \ + lower_snake_case with an `_e` or `_t` suffix — and lucisv checks the \ same shape. Only a `typedef enum` is judged: an anonymous enum has no \ name to check, and giving it one is Verible's separate \ `typedef-enums` idea. Escaped identifiers are exempt, and there is no \ diff --git a/crates/vlog_linter/src/rules/no_tabs.rs b/crates/vlog_linter/src/rules/no_tabs.rs index 88ad851..499ea08 100644 --- a/crates/vlog_linter/src/rules/no_tabs.rs +++ b/crates/vlog_linter/src/rules/no_tabs.rs @@ -23,7 +23,7 @@ impl Rule for NoTabs { "A tab renders at a width nobody agrees on, so a file mixing tabs and \ spaces looks aligned in the editor that wrote it and ragged everywhere \ else — and code review diffs inherit the mess. Verible's style guide \ - (and vfmt's own output) indents with spaces only. The fix expands each \ + (and lucisv's own output) indents with spaces only. The fix expands each \ tab to the run's indent width; tabs inside string literals are left \ alone, because there the whitespace is data." } diff --git a/crates/vlog_linter/src/rules/no_trailing_whitespace.rs b/crates/vlog_linter/src/rules/no_trailing_whitespace.rs index 3d64042..cc89d65 100644 --- a/crates/vlog_linter/src/rules/no_trailing_whitespace.rs +++ b/crates/vlog_linter/src/rules/no_trailing_whitespace.rs @@ -23,7 +23,7 @@ impl Rule for NoTrailingWhitespace { "Trailing whitespace is invisible, so it survives review and then shows \ up as diff noise the day somebody's editor strips it — a one-character \ change that touches every line of the file. Verible's style guide \ - forbids it and vfmt's formatter never emits it. The fix deletes the \ + forbids it and lucisv's formatter never emits it. The fix deletes the \ run; a run inside a string literal is left alone, because there the \ whitespace is data." } diff --git a/crates/vlog_linter/src/rules/parameter_name_style.rs b/crates/vlog_linter/src/rules/parameter_name_style.rs index 56390a2..93a784b 100644 --- a/crates/vlog_linter/src/rules/parameter_name_style.rs +++ b/crates/vlog_linter/src/rules/parameter_name_style.rs @@ -26,7 +26,7 @@ impl Rule for ParameterNameStyle { "A parameter is a compile-time constant, and reading one at a use site \ should not require scrolling back to the declaration to learn that. \ Verible's `parameter-name-style` (enabled by default) enforces exactly \ - this, with `CamelCase` and `ALL_CAPS` as its presets. vfmt accepts \ + this, with `CamelCase` and `ALL_CAPS` as its presets. lucisv accepts \ either preset for both `parameter` and `localparam` — Verible's \ default is stricter for `localparam` (`CamelCase` only), which would \ flag most `localparam int FOO_BAR` in existing RTL; until per-rule \ diff --git a/crates/vlog_linter/src/rules/struct_union_name_style.rs b/crates/vlog_linter/src/rules/struct_union_name_style.rs index 3a4408a..1f45430 100644 --- a/crates/vlog_linter/src/rules/struct_union_name_style.rs +++ b/crates/vlog_linter/src/rules/struct_union_name_style.rs @@ -27,7 +27,7 @@ impl Rule for StructUnionNameStyle { nearly universal: it marks an identifier as a type, which the language \ itself gives no syntax for at a use site. Verible's \ `struct-union-name-style` (enabled by default) requires \ - lower_snake_case ending in `_t`, and vfmt checks the same shape. Only \ + lower_snake_case ending in `_t`, and lucisv checks the same shape. Only \ a `typedef struct` / `typedef union` is judged — an anonymous struct \ has no name, and requiring it to have one is Verible's separate \ `typedef-structs-unions` idea. Escaped identifiers are exempt, and \ diff --git a/crates/vlog_linter/src/rules/undriven_net.rs b/crates/vlog_linter/src/rules/undriven_net.rs index d88c8f1..8aa1437 100644 --- a/crates/vlog_linter/src/rules/undriven_net.rs +++ b/crates/vlog_linter/src/rules/undriven_net.rs @@ -29,7 +29,7 @@ impl Rule for UndrivenNet { as an accusation. It stays silent about: ports (an input is driven \ by the instantiating file, an `inout` from either side), any signal \ wired to an instance or gate connection or passed to a task — those \ - positions may be `output`, and vfmt does not read the instantiated \ + positions may be `output`, and lucisv does not read the instantiated \ module to find out — any signal a macro, a compiler directive, a \ verbatim block or an unparsed region mentions, any signal in a \ module that instantiates with `.*`, anything declared with an \ diff --git a/crates/vlog_linter/src/rules/unused_signal.rs b/crates/vlog_linter/src/rules/unused_signal.rs index e576c25..77e519c 100644 --- a/crates/vlog_linter/src/rules/unused_signal.rs +++ b/crates/vlog_linter/src/rules/unused_signal.rs @@ -23,7 +23,7 @@ impl Rule for UnusedSignal { "A `wire` or `logic` that nothing reads and nothing drives is dead \ weight: it costs a reader the effort of working out what it is for, \ and it is often the leftover of a signal that was renamed everywhere \ - but here. This is the first rule vfmt writes against the symbol \ + but here. This is the first rule lucisv writes against the symbol \ table rather than the syntax tree — Verible cannot express it, \ because knowing that a name is unused means knowing which \ declaration every use refers to.\n\n\ @@ -34,7 +34,7 @@ impl Rule for UnusedSignal { default), and any name mentioned *anywhere else* in the file's \ tokens, even inside a macro invocation, a compiler directive or a \ region that failed to parse. That last guard is the important one: \ - vfmt does not expand macros, so a signal used only by \ + lucisv does not expand macros, so a signal used only by \ `` `MY_ASSERT(foo) `` would otherwise be reported as unused. The \ cost of the guard is that two same-named unused signals in one file \ shield each other — a false negative, which is the harmless \ diff --git a/crates/vlog_linter/src/rules/unused_waiver.rs b/crates/vlog_linter/src/rules/unused_waiver.rs index 5ec892b..9cb89c9 100644 --- a/crates/vlog_linter/src/rules/unused_waiver.rs +++ b/crates/vlog_linter/src/rules/unused_waiver.rs @@ -18,10 +18,10 @@ impl Rule for UnusedWaiver { } fn doc(&self) -> &'static str { - "A `// vfmt: waive` comment outlives the problem it was written for: \ + "A `// lucisv: waive` comment outlives the problem it was written for: \ the code is fixed, the waiver stays, and the next reader believes the \ line is still exempt. ruff's experience is that suppressions only stay \ - honest if the linter reports the dead ones, so vfmt does it from day \ + honest if the linter reports the dead ones, so lucisv does it from day \ one. Reported for a waiver that suppressed nothing, one that names a \ rule that does not exist, and one that is malformed. A waiver for a \ rule this run did not enable is *not* reported — it never had a \ diff --git a/crates/vlog_linter/src/signals.rs b/crates/vlog_linter/src/signals.rs index 2c79a8d..8f7bc0b 100644 --- a/crates/vlog_linter/src/signals.rs +++ b/crates/vlog_linter/src/signals.rs @@ -9,7 +9,7 @@ //! //! Everything here leans one way: **when the answer is not certain, say //! nothing**. A name that a macro, a compiler directive, a verbatim block or -//! an unparsed region mentions is dropped from every judgement, because vfmt +//! an unparsed region mentions is dropped from every judgement, because lucisv //! does not expand macros and cannot see what those regions do. That is the //! insurance a semantic rule needs — a lint that cries wolf on real RTL is //! worse than no lint at all. @@ -125,7 +125,7 @@ struct ModuleInfo { /// declared in it can therefore be judged. Two ways to earn it: an /// instance connected with `.*`, which reads and drives same-named /// signals without writing any of their names down, and an `` `include`` - /// in the module body, which is arbitrary code vfmt does not follow. + /// in the module body, which is arbitrary code lucisv does not follow. blind: bool, } @@ -392,7 +392,7 @@ impl Scanner { } } // An `include` in a module body is arbitrary code — it may - // declare, read or drive anything — and vfmt does not follow one. + // declare, read or drive anything — and lucisv does not follow one. ItemKind::Directive(raw) if is_include(&raw.text) => self.blind(module), // Nothing here can be read: a macro is not expanded, a directive // is not evaluated, a verbatim block is not modelled, and an diff --git a/crates/vlog_linter/src/waiver.rs b/crates/vlog_linter/src/waiver.rs index e7a3081..2f789a0 100644 --- a/crates/vlog_linter/src/waiver.rs +++ b/crates/vlog_linter/src/waiver.rs @@ -1,12 +1,12 @@ -//! Inline waivers: `// vfmt: waive ` and friends. +//! Inline waivers: `// lucisv: waive ` and friends. //! -//! Grammar (Verible's, with a `vfmt:` alias — `verilog_lint:` is what +//! Grammar (Verible's, with a `lucisv:` alias — `verilog_lint:` is what //! existing RTL is annotated with, so both spellings are accepted): //! //! ```text -//! // vfmt: waive this line, or the next if written alone -//! // vfmt: waive-start from this line ... -//! // vfmt: waive-stop ... to this one, both included +//! // lucisv: waive this line, or the next if written alone +//! // lucisv: waive-start from this line ... +//! // lucisv: waive-stop ... to this one, both included //! ``` //! //! A waiver that suppresses nothing is itself reported, under the @@ -31,10 +31,10 @@ pub(crate) struct Waivers { struct Entry { /// The rule waived; empty when the comment did not parse. rule: String, - /// Written with the `vfmt:` spelling. A `verilog_lint:` waiver naming a - /// rule vfmt does not have is Verible's, not a typo, so it is ignored + /// Written with the `lucisv:` spelling. A `verilog_lint:` waiver naming a + /// rule lucisv does not have is Verible's, not a typo, so it is ignored /// rather than reported — that is what makes a Verible-annotated - /// codebase lintable by vfmt without editing it first. + /// codebase lintable by lucisv without editing it first. ours: bool, scope: Scope, /// The waiver comment itself — where an `unused-waiver` points. @@ -101,7 +101,7 @@ impl Waivers { }, Directive::Malformed => entries.push(Entry::broken( comment.span, - "malformed waiver: expected `// vfmt: waive `".to_string(), + "malformed waiver: expected `// lucisv: waive `".to_string(), )), } } @@ -206,10 +206,10 @@ fn alone_on_its_line(ctx: &LintContext, span: TextRange) -> bool { } /// Reads one comment as a waiver directive plus whether it was written with -/// vfmt's own prefix, or `None` if it is not a waiver at all. +/// lucisv's own prefix, or `None` if it is not a waiver at all. fn parse_directive(text: &str) -> Option<(Directive, bool)> { let body = strip_markers(text).trim(); - let (rest, ours) = match body.strip_prefix("vfmt:") { + let (rest, ours) = match body.strip_prefix("lucisv:") { Some(rest) => (rest, true), None => (body.strip_prefix("verilog_lint:")?, false), }; @@ -257,22 +257,22 @@ mod tests { #[test] fn both_spellings_are_accepted() { - assert_eq!(directive_of("// vfmt: waive no-tabs"), Some("waive")); + assert_eq!(directive_of("// lucisv: waive no-tabs"), Some("waive")); assert_eq!(directive_of("// verilog_lint: waive no-tabs"), Some("waive")); - assert_eq!(directive_of("/* vfmt: waive-start no-tabs */"), Some("start")); + assert_eq!(directive_of("/* lucisv: waive-start no-tabs */"), Some("start")); assert_eq!(directive_of("//verilog_lint:waive-stop no-tabs"), Some("stop")); } #[test] fn ordinary_comments_and_format_fences_are_not_waivers() { assert_eq!(directive_of("// a note"), None); - assert_eq!(directive_of("// vfmt: off"), None); + assert_eq!(directive_of("// lucisv: off"), None); assert_eq!(directive_of("// verilog_format: off"), None); } #[test] fn a_waiver_without_exactly_one_rule_is_malformed() { - assert_eq!(directive_of("// vfmt: waive"), Some("malformed")); - assert_eq!(directive_of("// vfmt: waive no-tabs and more"), Some("malformed")); + assert_eq!(directive_of("// lucisv: waive"), Some("malformed")); + assert_eq!(directive_of("// lucisv: waive no-tabs and more"), Some("malformed")); } } diff --git a/crates/vlog_linter/tests/cases/always_rules.lint b/crates/vlog_linter/tests/cases/always_rules.lint index 9bc3c3d..eea6286 100644 --- a/crates/vlog_linter/tests/cases/always_rules.lint +++ b/crates/vlog_linter/tests/cases/always_rules.lint @@ -11,12 +11,12 @@ endmodule ==== # always-ff-non-blocking waived on the same line module m; - always_ff @(posedge clk) q = d; // vfmt: waive always-ff-non-blocking + always_ff @(posedge clk) q = d; // lucisv: waive always-ff-non-blocking endmodule ==== # an always-ff waiver that waives nothing is reported module m; - always_ff @(posedge clk) q <= d; // vfmt: waive always-ff-non-blocking + always_ff @(posedge clk) q <= d; // lucisv: waive always-ff-non-blocking //^ 36 unused-waiver endmodule ==== @@ -39,6 +39,6 @@ endmodule ==== # an always-comb waiver that waives nothing is reported module m; - always_comb x = y; // vfmt: waive always-comb-blocking + always_comb x = y; // lucisv: waive always-comb-blocking //^ 22 unused-waiver endmodule diff --git a/crates/vlog_linter/tests/cases/case_missing_default.lint b/crates/vlog_linter/tests/cases/case_missing_default.lint index 1e06003..df2c698 100644 --- a/crates/vlog_linter/tests/cases/case_missing_default.lint +++ b/crates/vlog_linter/tests/cases/case_missing_default.lint @@ -31,7 +31,7 @@ endmodule # waived from the line above module m; always_comb begin - // vfmt: waive case-missing-default + // lucisv: waive case-missing-default case (s) 0: x = 1; endcase @@ -44,7 +44,7 @@ module m; case (s) 0: x = 1; default: x = 0; - endcase // vfmt: waive case-missing-default + endcase // lucisv: waive case-missing-default //^ 13 unused-waiver end endmodule diff --git a/crates/vlog_linter/tests/cases/enum_name_style.lint b/crates/vlog_linter/tests/cases/enum_name_style.lint index cc8a7f6..793aba1 100644 --- a/crates/vlog_linter/tests/cases/enum_name_style.lint +++ b/crates/vlog_linter/tests/cases/enum_name_style.lint @@ -17,6 +17,6 @@ endpackage ==== # a waiver that waives nothing is reported package p; - typedef enum logic { A } state_e; // vfmt: waive enum-name-style + typedef enum logic { A } state_e; // lucisv: waive enum-name-style //^ 37 unused-waiver endpackage diff --git a/crates/vlog_linter/tests/cases/explicit_parameter_storage_type.lint b/crates/vlog_linter/tests/cases/explicit_parameter_storage_type.lint index c37c0a7..bb4816b 100644 --- a/crates/vlog_linter/tests/cases/explicit_parameter_storage_type.lint +++ b/crates/vlog_linter/tests/cases/explicit_parameter_storage_type.lint @@ -11,11 +11,11 @@ endmodule ==== # waived on the same line module m; - parameter WIDTH = 8; // vfmt: waive explicit-parameter-storage-type + parameter WIDTH = 8; // lucisv: waive explicit-parameter-storage-type endmodule ==== # a waiver that waives nothing is reported module m; - parameter int WIDTH = 8; // vfmt: waive explicit-parameter-storage-type + parameter int WIDTH = 8; // lucisv: waive explicit-parameter-storage-type //^ 28 unused-waiver endmodule diff --git a/crates/vlog_linter/tests/cases/module_filename.lint b/crates/vlog_linter/tests/cases/module_filename.lint index 67b0245..5b69119 100644 --- a/crates/vlog_linter/tests/cases/module_filename.lint +++ b/crates/vlog_linter/tests/cases/module_filename.lint @@ -15,11 +15,11 @@ endmodule ==== # waived on the same line #path rtl/bar.sv -module foo; // vfmt: waive module-filename +module foo; // lucisv: waive module-filename endmodule ==== # a waiver that waives nothing is reported #path rtl/foo.sv -module foo; // vfmt: waive module-filename +module foo; // lucisv: waive module-filename //^ 13 unused-waiver endmodule diff --git a/crates/vlog_linter/tests/cases/module_name_style.lint b/crates/vlog_linter/tests/cases/module_name_style.lint index c4d033e..686063b 100644 --- a/crates/vlog_linter/tests/cases/module_name_style.lint +++ b/crates/vlog_linter/tests/cases/module_name_style.lint @@ -15,11 +15,11 @@ endmodule ==== # waived on the same line #select module-name-style,unused-waiver -module FooBar; // vfmt: waive module-name-style +module FooBar; // lucisv: waive module-name-style endmodule ==== # a waiver that waives nothing is reported #select module-name-style,unused-waiver -module foo_bar; // vfmt: waive module-name-style +module foo_bar; // lucisv: waive module-name-style //^ 17 unused-waiver endmodule diff --git a/crates/vlog_linter/tests/cases/multiply_driven.lint b/crates/vlog_linter/tests/cases/multiply_driven.lint index 925a0df..c08edab 100644 --- a/crates/vlog_linter/tests/cases/multiply_driven.lint +++ b/crates/vlog_linter/tests/cases/multiply_driven.lint @@ -147,7 +147,7 @@ endmodule # waived on the same line #select multiply-driven,unused-waiver module m (input logic c, output logic q); - logic a; // vfmt: waive multiply-driven + logic a; // lucisv: waive multiply-driven always_comb a = c; always_comb a = 1'b0; assign q = a; @@ -156,7 +156,7 @@ endmodule # a waiver that waives nothing is reported #select multiply-driven,unused-waiver module m (input logic c, output logic q); - logic a; // vfmt: waive multiply-driven + logic a; // lucisv: waive multiply-driven //^ 12 unused-waiver always_comb a = c; assign q = a; diff --git a/crates/vlog_linter/tests/cases/no_tabs.lint b/crates/vlog_linter/tests/cases/no_tabs.lint index 9763382..e78a35f 100644 --- a/crates/vlog_linter/tests/cases/no_tabs.lint +++ b/crates/vlog_linter/tests/cases/no_tabs.lint @@ -28,18 +28,18 @@ endmodule ==== # waived on the same line module m; - wire a; // vfmt: waive no-tabs + wire a; // lucisv: waive no-tabs endmodule ==== # waived from the line above module m; -// vfmt: waive no-tabs +// lucisv: waive no-tabs wire a; endmodule ==== # a waiver that waives nothing is reported module m; - wire a; // vfmt: waive no-tabs + wire a; // lucisv: waive no-tabs //^ 11 unused-waiver endmodule ==== diff --git a/crates/vlog_linter/tests/cases/no_trailing_whitespace.lint b/crates/vlog_linter/tests/cases/no_trailing_whitespace.lint index 88c84c4..969b1e2 100644 --- a/crates/vlog_linter/tests/cases/no_trailing_whitespace.lint +++ b/crates/vlog_linter/tests/cases/no_trailing_whitespace.lint @@ -11,13 +11,13 @@ endmodule ==== # waived from the line above module m; -// vfmt: waive no-trailing-whitespace +// lucisv: waive no-trailing-whitespace wire a; endmodule ==== # a waiver that waives nothing is reported module m; - wire a; // vfmt: waive no-trailing-whitespace + wire a; // lucisv: waive no-trailing-whitespace //^ 11 unused-waiver endmodule ==== diff --git a/crates/vlog_linter/tests/cases/parameter_name_style.lint b/crates/vlog_linter/tests/cases/parameter_name_style.lint index 109c041..344bfab 100644 --- a/crates/vlog_linter/tests/cases/parameter_name_style.lint +++ b/crates/vlog_linter/tests/cases/parameter_name_style.lint @@ -11,11 +11,11 @@ endmodule ==== # waived on the same line module m; - parameter int addr_width = 8; // vfmt: waive parameter-name-style + parameter int addr_width = 8; // lucisv: waive parameter-name-style endmodule ==== # a waiver that waives nothing is reported module m; - parameter int AddrWidth = 8; // vfmt: waive parameter-name-style + parameter int AddrWidth = 8; // lucisv: waive parameter-name-style //^ 32 unused-waiver endmodule diff --git a/crates/vlog_linter/tests/cases/struct_union_name_style.lint b/crates/vlog_linter/tests/cases/struct_union_name_style.lint index 6fa3d1a..869f437 100644 --- a/crates/vlog_linter/tests/cases/struct_union_name_style.lint +++ b/crates/vlog_linter/tests/cases/struct_union_name_style.lint @@ -11,11 +11,11 @@ endpackage ==== # waived on the same line package p; - typedef struct packed { logic a; } addr; // vfmt: waive struct-union-name-style + typedef struct packed { logic a; } addr; // lucisv: waive struct-union-name-style endpackage ==== # a waiver that waives nothing is reported package p; - typedef struct packed { logic a; } addr_t; // vfmt: waive struct-union-name-style + typedef struct packed { logic a; } addr_t; // lucisv: waive struct-union-name-style //^ 46 unused-waiver endpackage diff --git a/crates/vlog_linter/tests/cases/undriven_net.lint b/crates/vlog_linter/tests/cases/undriven_net.lint index dab9907..05d8bc0 100644 --- a/crates/vlog_linter/tests/cases/undriven_net.lint +++ b/crates/vlog_linter/tests/cases/undriven_net.lint @@ -149,14 +149,14 @@ endmodule # waived on the same line #select undriven-net,unused-waiver module m (output logic q); - wire a; // vfmt: waive undriven-net + wire a; // lucisv: waive undriven-net assign q = a; endmodule ==== # a waiver that waives nothing is reported #select undriven-net,unused-waiver module m (input logic c, output logic q); - wire a; // vfmt: waive undriven-net + wire a; // lucisv: waive undriven-net //^ 11 unused-waiver assign a = c; assign q = a; diff --git a/crates/vlog_linter/tests/cases/unused_signal.lint b/crates/vlog_linter/tests/cases/unused_signal.lint index e2c2f81..54d3c91 100644 --- a/crates/vlog_linter/tests/cases/unused_signal.lint +++ b/crates/vlog_linter/tests/cases/unused_signal.lint @@ -42,7 +42,7 @@ module m; wire spare_unused; endmodule ==== -# a name only a macro invocation mentions is used as far as vfmt can tell +# a name only a macro invocation mentions is used as far as lucisv can tell #select unused-signal,unused-waiver module m; wire a; @@ -98,20 +98,20 @@ endmodule # waived on the same line #select unused-signal,unused-waiver module m; - wire a; // vfmt: waive unused-signal + wire a; // lucisv: waive unused-signal endmodule ==== # waived from the line above #select unused-signal,unused-waiver module m; - // vfmt: waive unused-signal + // lucisv: waive unused-signal wire a; endmodule ==== # a waiver that waives nothing is reported #select unused-signal,unused-waiver module m (input logic c, output logic q); - wire a; // vfmt: waive unused-signal + wire a; // lucisv: waive unused-signal //^ 11 unused-waiver assign a = c; assign q = a; diff --git a/crates/vlog_linter/tests/cases/waivers.lint b/crates/vlog_linter/tests/cases/waivers.lint index d9af050..097c600 100644 --- a/crates/vlog_linter/tests/cases/waivers.lint +++ b/crates/vlog_linter/tests/cases/waivers.lint @@ -1,65 +1,65 @@ # a start/stop range covers its markers and everything between module m; -// vfmt: waive-start no-tabs +// lucisv: waive-start no-tabs wire a; wire b; -// vfmt: waive-stop no-tabs +// lucisv: waive-stop no-tabs wire c; //^ 1 no-tabs endmodule ==== # an unclosed range runs to the end of the file module m; -// vfmt: waive-start no-tabs +// lucisv: waive-start no-tabs wire a; wire b; endmodule ==== # a stop closes the innermost open start module m; -// vfmt: waive-start no-tabs -// vfmt: waive-start no-tabs +// lucisv: waive-start no-tabs +// lucisv: waive-start no-tabs wire a; -// vfmt: waive-stop no-tabs +// lucisv: waive-stop no-tabs wire b; -// vfmt: waive-stop no-tabs +// lucisv: waive-stop no-tabs wire c; //^ 1 no-tabs endmodule ==== -# a verible waiver for a rule vfmt does not have is ignored +# a verible waiver for a rule lucisv does not have is ignored module m; // verilog_lint: waive macro-name-style wire a; endmodule ==== -# vfmt's own spelling for an unknown rule is reported +# lucisv's own spelling for an unknown rule is reported module m; - // vfmt: waive macro-name-style + // lucisv: waive macro-name-style //^ 3 unused-waiver wire a; endmodule ==== # a malformed waiver is reported module m; - // vfmt: waive + // lucisv: waive //^ 3 unused-waiver endmodule ==== # a waive-stop with nothing open is reported module m; - // vfmt: waive-stop no-tabs + // lucisv: waive-stop no-tabs //^ 3 unused-waiver endmodule ==== # a waiver for a rule this run did not enable is silent #select no-trailing-whitespace,unused-waiver module m; - wire a; // vfmt: waive no-tabs + wire a; // lucisv: waive no-tabs endmodule ==== # an unused waiver can itself be waived module m; -// vfmt: waive unused-waiver - wire a; // vfmt: waive no-tabs +// lucisv: waive unused-waiver + wire a; // lucisv: waive no-tabs endmodule diff --git a/crates/vlog_linter/tests/cases/wire_reg_mixup.lint b/crates/vlog_linter/tests/cases/wire_reg_mixup.lint index dd73459..71a2c13 100644 --- a/crates/vlog_linter/tests/cases/wire_reg_mixup.lint +++ b/crates/vlog_linter/tests/cases/wire_reg_mixup.lint @@ -26,12 +26,12 @@ endmodule # waived on the same line #path rtl/m.sv module m; - reg q; // vfmt: waive wire-reg-mixup + reg q; // lucisv: waive wire-reg-mixup endmodule ==== # a waiver that waives nothing is reported #path rtl/m.sv module m; - logic q; // vfmt: waive wire-reg-mixup + logic q; // lucisv: waive wire-reg-mixup //^ 12 unused-waiver endmodule diff --git a/crates/vlog_linter/tests/lint_cases.rs b/crates/vlog_linter/tests/lint_cases.rs index ca345d9..9e9fd4e 100644 --- a/crates/vlog_linter/tests/lint_cases.rs +++ b/crates/vlog_linter/tests/lint_cases.rs @@ -5,7 +5,7 @@ //! `====` lines. A case is Verilog source with its expected findings written //! into it: a line whose trimmed text is `//^ ` asserts one //! finding of that rule at that 1-based column on the nearest preceding -//! non-marker line — the same `line:col` that `vfmt check` prints, so a +//! non-marker line — the same `line:col` that `lucisv check` prints, so a //! marker can be written by copying the diagnostic. Marker lines are ordinary //! comments to the linter, so the source stays valid Verilog. //! @@ -18,7 +18,7 @@ //! - `#SKIP ...` — a known-bad case: it must still fail, and the moment it //! passes the suite demands the marker's removal. //! - `#path

` — lint the source as if it were read from this file path. -//! - `#select ...` — comma-separated rule names, `vfmt check --select` +//! - `#select ...` — comma-separated rule names, `lucisv check --select` //! semantics (replaces the default rule set). //! //! A `----` line splits a case into `(input, expected fixed output)`: the diff --git a/crates/vlog_parser/Cargo.toml b/crates/vlog_parser/Cargo.toml index 9107781..7d4e8f7 100644 --- a/crates/vlog_parser/Cargo.toml +++ b/crates/vlog_parser/Cargo.toml @@ -3,6 +3,6 @@ name = "vlog_parser" version.workspace = true edition.workspace = true license.workspace = true -description = "Verilog/SystemVerilog lexer and parser for vfmt" +description = "Verilog/SystemVerilog lexer and parser for lucisv" [dependencies] diff --git a/crates/vlog_parser/src/ast.rs b/crates/vlog_parser/src/ast.rs index 7f7eb01..2f5c533 100644 --- a/crates/vlog_parser/src/ast.rs +++ b/crates/vlog_parser/src/ast.rs @@ -126,7 +126,7 @@ pub struct RawText { /// It is kept in a vector *beside* the elements rather than folded into one /// enum with them: the element vectors are read by `vlog_semantic` and /// `vlog_linter`, and a directive is not a port. `before` is what puts the -/// two back into source order. vfmt does not evaluate the condition — both +/// two back into source order. lucisv does not evaluate the condition — both /// arms' elements are ordinary elements of the one list, exactly as an /// `` `ifdef`` at item position already works. #[derive(Debug, Clone)] @@ -240,7 +240,7 @@ pub enum ItemKind { /// `clocking cb @(posedge clk); ... endclocking` and the `default` /// spellings of it (IEEE 1800 §14). Clocking(ClockingDecl), - /// A block vfmt deliberately does not model, kept byte-for-byte: + /// A block lucisv deliberately does not model, kept byte-for-byte: /// `constraint c { ... }`, `covergroup ... endgroup`, a concurrent /// assertion (`assert property ( ... );`) and a `property`/`sequence` /// declaration. See `docs/features/classes/README.md` and @@ -446,7 +446,7 @@ impl DataType { pub enum TypeExtra { /// The `#( ... )` of a parameterized type reference, verbatim: /// `uvm_analysis_port #(bit [31:0]) port;`. Its arguments are types as - /// often as expressions (`#(virtual bus_if)`, `#(item #(A, B))`), so vfmt + /// often as expressions (`#(virtual bus_if)`, `#(item #(A, B))`), so lucisv /// reproduces them as written instead of modelling a second grammar. Params(RawText), /// An anonymous enum standing where a type name would: @@ -619,7 +619,7 @@ pub struct ContAssign { /// The `( strength0 , strength1 )` pair of a continuous assignment. The two /// strengths are stored in the order the source wrote them — the language -/// allows either order and vfmt is not a legality checker. +/// allows either order and lucisv is not a legality checker. #[derive(Debug)] pub struct DriveStrength { pub first: String, diff --git a/crates/vlog_parser/src/lexer.rs b/crates/vlog_parser/src/lexer.rs index 174c922..5419b02 100644 --- a/crates/vlog_parser/src/lexer.rs +++ b/crates/vlog_parser/src/lexer.rs @@ -636,7 +636,7 @@ impl<'a> RawLexer<'a> { text.push(self.bump() as char); // A based number whose digits come from a macro: `` 32'h`DM_ADDR `` // (corpus `ibex/dv/uvm/core_ibex/tb/core_ibex_tb_top.sv:75`). The - // digits are preprocessor output vfmt does not expand, so the number + // digits are preprocessor output lucisv does not expand, so the number // token ends here, with no digits, and the invocation lexes as the // macro token it is; the parser rejoins the pair into one primary // expression and the formatter prints them adjacent, as written. diff --git a/crates/vlog_parser/src/parser.rs b/crates/vlog_parser/src/parser.rs index e28416c..3c156a3 100644 --- a/crates/vlog_parser/src/parser.rs +++ b/crates/vlog_parser/src/parser.rs @@ -228,7 +228,7 @@ pub struct Parser<'a> { /// Parse a token stream, stopping at the first error. /// /// `source` must be the exact text `tokens` were lexed from: the constructs -/// vfmt keeps verbatim (`constraint`, `covergroup` — see +/// lucisv keeps verbatim (`constraint`, `covergroup` — see /// `docs/features/classes/README.md`) copy their bytes out of it by span. pub fn parse(tokens: Vec, source: &str) -> PResult { Parser::new(tokens, source, false).parse_source_file() @@ -720,7 +720,7 @@ impl<'a> Parser<'a> { // argument (`.value(x)`, `.name()`) and a `[lo:hi]` value range (a // `case ... inside` label). Both are recognized here, in the shared // element parse, because rejecting them in the lists that cannot - // legally hold them would gain nothing — vfmt checks legality + // legally hold them would gain nothing — lucisv checks legality // nowhere else either, and a wrong guess emits the same tokens. let expr = if self.cur().is_sym(".") && self.nth(1).kind == TokenKind::Ident { self.parse_named_arg()? @@ -902,7 +902,7 @@ impl<'a> Parser<'a> { /// expression or a port/parameter list. In an expression `` `A (b) `` may /// well be `` `A `` applied to the parenthesized value `(b)` — the answer /// depends on whether the macro was defined with formals, which lives in - /// a file vfmt does not read (IEEE 1800 §22.5.1, and the analysis in + /// a file lucisv does not read (IEEE 1800 §22.5.1, and the analysis in /// `docs/features/lexer-cleanup/README.md`). At item position there is no /// such ambiguity: neither reading is an item on its own. /// @@ -925,7 +925,7 @@ impl<'a> Parser<'a> { self.bump(); // ( self.skip_balanced("(", ")")?; // Verbatim, space included: the argument text is preprocessor - // input vfmt does not model, and closing the gap would make the + // input lucisv does not model, and closing the gap would make the // output's token text differ from the input's (`` `A (b) `` and // `` `A(b) `` are one token each, of different text) — which the // safety net rightly refuses. @@ -1156,7 +1156,7 @@ impl<'a> Parser<'a> { match kw.as_str() { "module" | "macromodule" => self.parse_module("endmodule").map(ItemKind::Module), // `interface class` is a class, not an interface (IEEE 1800 - // §8.26): a different construct that vfmt does not model, so it + // §8.26): a different construct that lucisv does not model, so it // falls through to the unsupported-construct error below. "interface" if !self.nth(1).is_kw("class") => { self.parse_module("endinterface").map(ItemKind::Module) @@ -1574,7 +1574,7 @@ impl<'a> Parser<'a> { /// `constraint name { ... }`, kept as verbatim source. /// /// The constraint language is a grammar of its own (`dist`, `->`, - /// `solve ... before`, `inside`, `foreach`, `if`/`else`) that vfmt models + /// `solve ... before`, `inside`, `foreach`, `if`/`else`) that lucisv models /// none of, and reflowing it has no payoff, so the block is copied out of /// the source by span. A prototype (`constraint c;`) has no braces. fn parse_constraint(&mut self) -> PResult { @@ -1654,7 +1654,7 @@ impl<'a> Parser<'a> { /// /// `assert property (@(posedge clk) a |-> ##[1:3] b) else $error("...");` /// — the property expression is a grammar of its own (`|->`, `##[1:3]`, - /// `throughout`, `disable iff`, `$rose`) that vfmt models none of, and + /// `throughout`, `disable iff`, `$rose`) that lucisv models none of, and /// there is no layout convention worth inventing for it, so the whole /// item is copied out of the source by span exactly as a `constraint` is. fn parse_concurrent_assertion(&mut self) -> PResult { @@ -2024,7 +2024,7 @@ impl<'a> Parser<'a> { } /// A clocking skew, as written: `#2`, `#1step`, `negedge`. Kept as text — - /// it is a delay or an edge, never something vfmt re-lays out — so the + /// it is a delay or an edge, never something lucisv re-lays out — so the /// printer writes back exactly what the source said. The `#(min:typ:max)` /// spelling is not supported; see the feature README's Assumptions. fn parse_clocking_skew(&mut self) -> PResult { @@ -2643,7 +2643,7 @@ impl<'a> Parser<'a> { /// True when the cursor opens a `bind` directive (IEEE 1800 §23.11). /// /// `bind` is deliberately *not* in the lexer's keyword table — the same - /// call vfmt makes for `new`/`this`/`super` — so that `obj.bind()` keeps + /// call lucisv makes for `new`/`this`/`super` — so that `obj.bind()` keeps /// parsing as the ordinary method call it is in existing testbenches. /// A directive is recognized from its shape instead: the word `bind`, /// then a target scope (a name, possibly a `.`-separated hierarchical @@ -4154,7 +4154,7 @@ impl<'a> Parser<'a> { // `with { ... }` (a `randomize` constraint block) are the two // postfix spellings of `with`; the delimiter tells them apart and // demanding one keeps the `with [range]` of a stream expression, - // which vfmt does not model, out of this path. + // which lucisv does not model, out of this path. || (t.is_kw("with") && (self.nth(1).is_sym("(") || self.nth(1).is_sym("{"))) } @@ -4463,7 +4463,7 @@ impl<'a> Parser<'a> { // A bare `$` — the upper bound of a queue (`q[$]`, // `q[$-1]`, `int q[$]`). Kept an ordinary name, like // `new`/`this`/`super`: one leaf makes every position - // work through the existing expression grammar, and vfmt + // work through the existing expression grammar, and lucisv // checks legality nowhere else either. "$" => { self.bump(); @@ -4508,7 +4508,7 @@ impl<'a> Parser<'a> { if self.cur().is_sym("}") { // `{}` — the empty queue/dynamic-array literal // (`q = {};`). Illegal as a Verilog concatenation, - // but vfmt is not a legality checker. + // but lucisv is not a legality checker. self.bump(); return Ok(self.expr_at(start, ExprKind::Concat(Vec::new()))); } @@ -5018,7 +5018,7 @@ mod tests { /// The spaced reading is offered at item and statement position only. In /// an expression `` `A (b) `` may be `` `A `` applied to `(b)`, which - /// depends on a `` `define`` vfmt never sees. + /// depends on a `` `define`` lucisv never sees. #[test] fn a_spaced_macro_in_expression_position_is_still_a_call() { let file = parse_ok("module m;\nassign x = `A (b);\nendmodule"); @@ -5327,11 +5327,14 @@ mod tests { // The handshake `docs/features/format-fences/README.md` asked for: a // same-line comment now has a byte offset, so a fence written there // can be located in the source. - let src = "module m;\n wire a; // vfmt: off\nendmodule\n"; + let src = "module m;\n wire a; // lucisv: off\nendmodule\n"; let file = parse_ok(src); let ItemKind::Module(m) = &file.items[0].kind else { panic!("expected a module") }; let trailing = m.items[0].meta.trailing.as_ref().expect("a trailing comment"); - assert_eq!(&src[trailing.span.start as usize..trailing.span.end as usize], "// vfmt: off"); + assert_eq!( + &src[trailing.span.start as usize..trailing.span.end as usize], + "// lucisv: off" + ); assert_eq!((trailing.line, trailing.col), (2, 11)); } @@ -5479,7 +5482,7 @@ mod tests { #[test] fn both_arms_of_an_else_are_ordinary_elements_of_one_list() { - // vfmt does not evaluate the condition: an `ifdef/`else pair simply + // lucisv does not evaluate the condition: an `ifdef/`else pair simply // contributes every element of both arms, in source order. let src = "module m (\n`ifdef X\n input a\n`else\n input b\n`endif\n);\nendmodule\n"; let file = parse_ok(src); diff --git a/crates/vlog_refactor/src/check.rs b/crates/vlog_refactor/src/check.rs index c999e36..9babfe3 100644 --- a/crates/vlog_refactor/src/check.rs +++ b/crates/vlog_refactor/src/check.rs @@ -136,7 +136,7 @@ pub(crate) fn verify_splice( watch_name: &str, what: &str, ) -> Result<(), String> { - let abandoned = format!("vfmt could not verify {what}, so it made no edits."); + let abandoned = format!("lucisv could not verify {what}, so it made no edits."); let edited: Vec<(PathBuf, String)> = edits .iter() .filter_map(|(i, edits)| { @@ -279,7 +279,7 @@ fn watched_files( watched } -const ABANDONED: &str = "vfmt could not verify the rename, so it made no edits."; +const ABANDONED: &str = "lucisv could not verify the rename, so it made no edits."; /// The workspace index as it would be after the edits, so that a cross-file /// capture is caught exactly the way an in-file one is. @@ -799,7 +799,7 @@ mod tests { let edits = vec![TextEdit { range: TextRange::empty(at), new_text: "x".into() }]; let corrupted = apply(text, &edits); let outcome = pieces_match(text, &corrupted, &edits, Path::new("/rtl/m.sv"), "an edit"); - assert!(outcome.is_err(), "the string's own text is not a token vfmt may write"); + assert!(outcome.is_err(), "the string's own text is not a token lucisv may write"); } #[test] diff --git a/crates/vlog_refactor/src/instantiate.rs b/crates/vlog_refactor/src/instantiate.rs index aab9fd0..41bff63 100644 --- a/crates/vlog_refactor/src/instantiate.rs +++ b/crates/vlog_refactor/src/instantiate.rs @@ -117,9 +117,9 @@ pub fn module_definition<'i>(index: &'i WorkspaceIndex, module: &str) -> Result< index.units(module).iter().filter(|def| def.kind == SymbolKind::Module).collect(); let [def] = defs.as_slice() else { return Err(match defs.len() { - 0 => format!("vfmt indexes no module named `{module}`."), + 0 => format!("lucisv indexes no module named `{module}`."), _ => format!( - "`{module}` is declared in more than one indexed file; vfmt will not guess which one to instantiate." + "`{module}` is declared in more than one indexed file; lucisv will not guess which one to instantiate." ), }); }; @@ -150,16 +150,16 @@ pub fn instantiation_plan( let Some((declaration, _)) = find_module(&tree, module) else { // Two very different stories end here, and telling them apart is the // difference between "someone edited the file out from under the - // index" and "vfmt's parser does not support this syntax" — the + // index" and "lucisv's parser does not support this syntax" — the // second is what an interface-typed ANSI port produces today (see the // feature README's Handshakes). return Err(match diagnostics.first() { Some(problem) => format!( - "vfmt cannot read `{module}`'s declaration: its file does not parse ({} at line {}), so no instantiation was written.", + "lucisv cannot read `{module}`'s declaration: its file does not parse ({} at line {}), so no instantiation was written.", problem.message, problem.line ), None => format!( - "the file that declared `{module}` no longer declares it, so vfmt cannot write an instantiation of it." + "the file that declared `{module}` no longer declares it, so lucisv cannot write an instantiation of it." ), }); }; @@ -169,7 +169,7 @@ pub fn instantiation_plan( ports: ports(declaration, definition), warnings: Vec::new(), }; - // vfmt does not preprocess, so a port list split across `` `ifdef`` arms is + // lucisv does not preprocess, so a port list split across `` `ifdef`` arms is // read straight through: every arm's ports are in the list. That is the // honest answer for a *skeleton* — it is a suggestion the user edits, not // an edit to code they already wrote — but it is only honest if it is said @@ -359,11 +359,11 @@ fn params(module: &Module, text: &str) -> Vec { /// * it is written across several lines — the source's own indentation means /// nothing inside a `#( ... )` on someone else's line, and re-flowing it /// would risk rewriting a string literal's spaces; -/// * writing it back does not parse — vfmt's expression grammar does not +/// * writing it back does not parse — lucisv's expression grammar does not /// accept an inline aggregate as a parameter override, and a skeleton that /// does not parse hands the user a red squiggle from our own server. /// -/// A default vfmt cannot write back is simply not offered: the tabstop comes +/// A default lucisv cannot write back is simply not offered: the tabstop comes /// up empty and the user types what they meant. fn default_text(text: &str, param: &ParamPort) -> String { let Some(expr) = ¶m.default else { return String::new() }; @@ -374,7 +374,7 @@ fn default_text(text: &str, param: &ParamPort) -> String { // The spaces are the ones `terminate` writes: a default ending in an // escaped identifier is legal where the renderer puts it, so the probe // must not reject it for want of the space the renderer will supply. - let probe = format!("module __vfmt_probe;\n m #(.P( {written} )) u ();\nendmodule\n"); + let probe = format!("module __lucisv_probe;\n m #(.P( {written} )) u ();\nendmodule\n"); let (_, diagnostics) = parse_source_tolerant(&probe); match diagnostics.is_empty() { true => written.to_string(), @@ -690,10 +690,10 @@ endmodule } #[test] - fn a_default_vfmt_could_not_write_back_is_not_offered() { + fn a_default_lucisv_could_not_write_back_is_not_offered() { // The corpus case: a `parameter type` defaulting to an anonymous // multi-line `struct packed`. Pasting it into `#(.T( ... ))` gives - // text vfmt's own parser rejects, so no default is offered at all. + // text lucisv's own parser rejects, so no default is offered at all. let text = "\ module ecc #( parameter int DataWidth = 64, @@ -762,7 +762,7 @@ endmodule /// The skeleton, wrapped so it can be parsed as the module item it is. fn parses(skeleton: &str) -> bool { - let probe = format!("module vfmt_probe;\n{skeleton}\nendmodule\n"); + let probe = format!("module lucisv_probe;\n{skeleton}\nendmodule\n"); parse_source_tolerant(&probe).1.is_empty() } @@ -895,7 +895,7 @@ endmodule fn a_definition_that_does_not_parse_says_so_rather_than_blaming_an_edit() { // QA's LOW finding: "no longer declares it" reads as "someone changed // the file", which is the wrong story when the real cause is a syntax - // vfmt's parser does not support. + // lucisv's parser does not support. let message = instantiation_plan("sub", "moduel sub (;;;\n", None).expect_err("garbage"); assert!(message.contains("does not parse"), "{message}"); assert!(!message.contains("no longer declares it"), "{message}"); diff --git a/crates/vlog_refactor/src/ports.rs b/crates/vlog_refactor/src/ports.rs index d52d47d..1721afc 100644 --- a/crates/vlog_refactor/src/ports.rs +++ b/crates/vlog_refactor/src/ports.rs @@ -3,7 +3,7 @@ //! //! Read top-to-bottom, each one is the same four steps: find the module (or //! the instantiation) the request names, work out the *plan* — one edit per -//! place the signature is written down, plus a sentence for every place vfmt +//! place the signature is written down, plus a sentence for every place lucisv //! deliberately left alone — verify the whole plan in memory, and hand it back //! or refuse it whole. A refusal is a sentence for the user, never a partial //! edit. @@ -33,7 +33,7 @@ use crate::{check, RefactorEdit, TextEdit}; #[derive(Debug, Clone, Copy)] pub enum ModuleRef<'a> { /// The module declared under this name. It must be declared exactly once - /// in the in-scope files: vfmt does not guess between two of them. + /// in the in-scope files: lucisv does not guess between two of them. Name(&'a str), /// The module whose declaration covers this byte offset. At { @@ -126,7 +126,7 @@ pub fn port_actions(files: &[(PathBuf, String)], file: &Path, offset: u32) -> Ve } if let Ok((edit, port, sites)) = removal(files, file, offset) { out.push(PortAction { - title: format!("vfmt: remove port `{port}` ({})", sites_phrase(sites)), + title: format!("lucisv: remove port `{port}` ({})", sites_phrase(sites)), edit, }); } @@ -134,7 +134,7 @@ pub fn port_actions(files: &[(PathBuf, String)], file: &Path, offset: u32) -> Ve let missing = edit.edit_count(); out.push(PortAction { title: format!( - "vfmt: connect {missing} missing port{}", + "lucisv: connect {missing} missing port{}", if missing == 1 { "" } else { "s" } ), edit, @@ -237,7 +237,7 @@ impl Plan { } } -const OVERLAP: &str = "two of the edits vfmt computed overlap, so it made none."; +const OVERLAP: &str = "two of the edits lucisv computed overlap, so it made none."; /// Verify a plan and turn it into the refactoring's answer. fn finish( @@ -248,7 +248,7 @@ fn finish( ) -> Result<(RefactorEdit, usize), String> { plan.settle()?; if plan.edits.is_empty() { - return Err(format!("vfmt found nothing to change for {what}.")); + return Err(format!("lucisv found nothing to change for {what}.")); } check::verify_splice(scope, &plan.edits, module, what)?; confirm(scope, &plan, module, what)?; @@ -256,7 +256,7 @@ fn finish( let mut edits: Vec<(PathBuf, Vec)> = Vec::new(); for (i, file_edits) in plan.edits { let Some(path) = scope.path(i) else { - return Err(format!("vfmt could not name one of the files it edited for {what}.")); + return Err(format!("lucisv could not name one of the files it edited for {what}.")); }; edits.push((path.to_path_buf(), file_edits)); } @@ -309,14 +309,14 @@ fn shape(text: &str, module: &str) -> Shape { fn confirm(scope: &Scope, plan: &Plan, module: &str, what: &str) -> Result<(), String> { for (i, expected) in &plan.expected { let (Some(text), Some(path)) = (scope.text(*i), scope.path(*i)) else { - return Err(format!("vfmt could not re-read a file it edited for {what}.")); + return Err(format!("lucisv could not re-read a file it edited for {what}.")); }; let edits = plan.edits.iter().find(|(j, _)| j == i).map(|(_, e)| e.as_slice()); let edited = crate::apply(text, edits.unwrap_or(&[])); let actual = shape(&edited, module); if &actual != expected { return Err(format!( - "{what} would not leave {} with the signature vfmt intended; no edits were made.", + "{what} would not leave {} with the signature lucisv intended; no edits were made.", display(path) )); } @@ -359,9 +359,9 @@ fn locate_module(scope: &mut Scope, module: ModuleRef<'_>) -> Result format!("vfmt indexes no module named `{name}`."), + 0 => format!("lucisv indexes no module named `{name}`."), _ => format!( - "`{name}` is declared in more than one indexed file; vfmt will not guess which module's ports these are." + "`{name}` is declared in more than one indexed file; lucisv will not guess which module's ports these are." ), }); }; @@ -373,7 +373,7 @@ fn locate_module(scope: &mut Scope, module: ModuleRef<'_>) -> Result String { format!( - "{} is not one of the files vfmt indexes; nothing outside the project scope can be refactored.", + "{} is not one of the files lucisv indexes; nothing outside the project scope can be refactored.", display(file) ) } @@ -488,7 +488,7 @@ fn collect_gen_block<'t>(block: &'t GenBlock, out: &mut Vec<&'t Instantiation>) // the free-form input: one port declaration // ---------------------------------------------------------------------- -/// A port declaration the user typed, once vfmt has agreed that it is one. +/// A port declaration the user typed, once lucisv has agreed that it is one. struct NewPort { name: String, /// The declaration as written, trimmed. @@ -511,16 +511,16 @@ fn parse_port_decl(decl: &str) -> Result { let Ok(tokens) = tokenize(text) else { return Err(refusal) }; if tokens.iter().any(|t| !t.leading.is_empty() || t.trailing.is_some()) { return Err( - "a port declaration vfmt writes into a header must carry no comment.".to_string() + "a port declaration lucisv writes into a header must carry no comment.".to_string() ); } if tokens.iter().any(|t| t.kind == TokenKind::Directive || t.is_macro()) { return Err( - "a port declaration vfmt writes into a header must contain no compiler directive or macro call: vfmt does not preprocess." + "a port declaration lucisv writes into a header must contain no compiler directive or macro call: lucisv does not preprocess." .to_string(), ); } - let probe = format!("module __vfmt_port_probe ({text});\nendmodule\n"); + let probe = format!("module __lucisv_port_probe ({text});\nendmodule\n"); let (tree, diagnostics) = parse_source_tolerant(&probe); if !diagnostics.is_empty() { return Err(refusal); @@ -537,7 +537,7 @@ fn parse_port_decl(decl: &str) -> Result { } if port.dir.is_none() { return Err(format!( - "`{text}` does not say a direction; a port vfmt adds must start with `input`, `output` or `inout`." + "`{text}` does not say a direction; a port lucisv adds must start with `input`, `output` or `inout`." )); } if port.name.is_empty() { @@ -605,11 +605,11 @@ fn plan_add(scope: &mut Scope, site: &ModuleSite, port: &NewPort) -> Result String { - format!("vfmt can no longer find the declaration of `{name}`.") + format!("lucisv can no longer find the declaration of `{name}`.") } fn lex_failed(path: Option<&Path>) -> String { - format!("{} does not lex, so vfmt will not edit it.", display(path.unwrap_or(Path::new("?")))) + format!("{} does not lex, so lucisv will not edit it.", display(path.unwrap_or(Path::new("?")))) } /// The file a module is written in, as the planners read it: its text, its @@ -660,7 +660,7 @@ fn header_edits( // the modern way: ANSI, in the header. PortList::Empty | PortList::Ansi(_) | PortList::NonAnsi(_) => { let Some(open) = port_list_open(tokens, name_end) else { - return Err("vfmt cannot find this module's port list.".to_string()); + return Err("lucisv cannot find this module's port list.".to_string()); }; let edits = append_to_list(text, Some(open), &[], &port.text); guard_conditionals(&list, written_at(&edits), &header, text, path, warnings)?; @@ -669,12 +669,12 @@ fn header_edits( PortList::None => { if !module.imports.is_empty() { return Err(format!( - "`{}` writes an `import` in its header and has no port list; write `()` first and vfmt will fill it in.", + "`{}` writes an `import` in its header and has no port list; write `()` first and lucisv will fill it in.", module.name )); } let Some(semi) = header_semicolon(tokens, name_end) else { - return Err("vfmt cannot find where this module's header ends.".to_string()); + return Err("lucisv cannot find where this module's header ends.".to_string()); }; Ok(vec![insert(semi, format!(" ({})", port.text))]) } @@ -747,11 +747,11 @@ fn body_directives(module: &Module) -> Vec { /// Refuse an insertion that would land **inside** a conditional arm, and warn /// when the region it joins is conditionally compiled at all. /// -/// vfmt does not preprocess, so an `` `ifdef`` arm is ordinary text to it: a +/// lucisv does not preprocess, so an `` `ifdef`` arm is ordinary text to it: a /// port appended after the last declared port lands wherever that port sits, /// conditional arm included, and every later check would wave it through — /// the file parses, no name changes meaning, and the re-parsed header really -/// does declare the port, because vfmt reads through the `` `ifdef``. Only the +/// does declare the port, because lucisv reads through the `` `ifdef``. Only the /// *plan* can catch this, so it is caught here: count the arms open at the /// insertion point, and refuse when the count is not zero. fn guard_conditionals( @@ -784,12 +784,12 @@ fn guard_conditionals( format!(" opened by `{}` at {}", first_line(&d.text), where_(d.span)) }); return Err(format!( - "{region} is conditionally compiled, and the new port would land inside the arm{arm}; a port added to one arm of an `ifdef does not exist in the other, so vfmt made no edits — place it by hand." + "{region} is conditionally compiled, and the new port would land inside the arm{arm}; a port added to one arm of an `ifdef does not exist in the other, so lucisv made no edits — place it by hand." )); } if depth != 0 { return Err(format!( - "the compiler directives in {region} do not balance, so vfmt cannot tell whether a new port would be conditionally compiled; it made no edits." + "the compiler directives in {region} do not balance, so lucisv cannot tell whether a new port would be conditionally compiled; it made no edits." )); } let first = directives.first(); @@ -802,7 +802,7 @@ fn guard_conditionals( n => format!(", and {n} more"), }; warnings.push(format!( - "{region} carries compiler directives ({named}{more}), so what ports it declares depends on the configuration; vfmt added the port outside every conditional arm." + "{region} carries compiler directives ({named}{more}), so what ports it declares depends on the configuration; lucisv added the port outside every conditional arm." )); Ok(()) } @@ -836,7 +836,7 @@ fn non_ansi_declaration( // A non-ANSI module with a header port list and no items at all is not // legal Verilog, but a tolerant parse can still hand one over. let Some(semi) = header_semicolon(tokens, module.name_span.end) else { - return Err("vfmt cannot find where this module's header ends.".to_string()); + return Err("lucisv cannot find where this module's header ends.".to_string()); }; let indent = format!("{} ", line_indent(text, item_span.start)); Ok(insert(semi + 1, format!("\n{indent}{decl};"))) @@ -898,7 +898,7 @@ fn instantiation_edits( Connections::Ordered(conns) => { if conns.len() != ports_before { return Err(format!( - "`{}` in {} connects {} of `{}`'s {ports_before} port(s) by position, so vfmt cannot tell where a new one goes; give it named connections first.", + "`{}` in {} connects {} of `{}`'s {ports_before} port(s) by position, so lucisv cannot tell where a new one goes; give it named connections first.", instance.name, display(path), conns.len(), @@ -985,7 +985,7 @@ fn at_site(instance: &str, path: &Path, lines: &LineIndex, offset: u32) -> Strin fn missing_parens(instance: &str, path: &Path) -> String { format!( - "vfmt cannot find the connection list of `{instance}` in {}; no edits were made.", + "lucisv cannot find the connection list of `{instance}` in {}; no edits were made.", display(path) ) } @@ -1035,7 +1035,7 @@ fn locate_port( let site = locate_module(scope, ModuleRef::Name(&module_name))?; if site.file != i { return Err(format!( - "`{module_name}` is declared in more than one indexed file; vfmt will not guess which module's ports these are." + "`{module_name}` is declared in more than one indexed file; lucisv will not guess which module's ports these are." )); } Ok((site, name)) @@ -1078,7 +1078,7 @@ fn plan_remove(scope: &mut Scope, site: &ModuleSite, port: &str) -> Result = plan.edits.iter().map(|(i, _)| *i).collect(); if !watched.contains(&site.file) { @@ -1108,7 +1108,7 @@ fn plan_remove(scope: &mut Scope, site: &ModuleSite, port: &str) -> Result Vec let mut out = Vec::new(); for site in scope.macro_argument_sites(file, port) { out.push(format!( - "`{port}` appears in the arguments of the macro invocation `{}` at {where_}:{}; a macro invocation is one opaque token to vfmt, so nothing was removed there and that expansion now names a port `{port}`'s module no longer has.", + "`{port}` appears in the arguments of the macro invocation `{}` at {where_}:{}; a macro invocation is one opaque token to lucisv, so nothing was removed there and that expansion now names a port `{port}`'s module no longer has.", site.macro_name, site.line )); } @@ -1131,7 +1131,7 @@ fn preprocessor_warnings(scope: &Scope, file: usize, port: &str) -> Vec continue; } out.push(format!( - "`{port}` appears in the body of macro `{}` at {where_}:{}; vfmt does not preprocess, so that body still names the removed port.", + "`{port}` appears in the body of macro `{}` at {where_}:{}; lucisv does not preprocess, so that body still names the removed port.", site.macro_name, site.line )); } @@ -1229,7 +1229,7 @@ fn disconnection_edits( Connections::Ordered(conns) if conns.is_empty() => {} Connections::Ordered(_) => { return Err(format!( - "`{}` in {} connects `{}`'s ports by position; dropping one would silently re-bind the rest, so vfmt made no edits — give it named connections first.", + "`{}` in {} connects `{}`'s ports by position; dropping one would silently re-bind the rest, so lucisv made no edits — give it named connections first.", instance.name, display(path), site.name @@ -1318,7 +1318,7 @@ fn plan_propagate( let conns = match &instance.conns { Connections::Ordered(_) => { return Err(format!( - "`{}` connects `{}`'s ports by position; vfmt propagates named connections only.", + "`{}` connects `{}`'s ports by position; lucisv propagates named connections only.", instance.name, instantiation.module )) } @@ -1463,7 +1463,7 @@ fn remove_element( index: usize, ) -> Result, String> { let Some(element) = elements.get(index) else { - return Err("vfmt lost track of the element it was removing.".to_string()); + return Err("lucisv lost track of the element it was removing.".to_string()); }; let delete = |range: TextRange| TextEdit { range, new_text: String::new() }; if elements.len() == 1 { diff --git a/crates/vlog_refactor/src/references.rs b/crates/vlog_refactor/src/references.rs index 892d5e9..e9c0ed1 100644 --- a/crates/vlog_refactor/src/references.rs +++ b/crates/vlog_refactor/src/references.rs @@ -5,7 +5,7 @@ //! occurrences is the same walk with the edits left off, so it is the same //! code — this module only decides what to do with the spans. The sharing is //! the point, not the lines it saves: a reference list that disagreed with -//! what a rename would touch would be a lie about what vfmt is going to do. +//! what a rename would touch would be a lie about what lucisv is going to do. use std::path::{Path, PathBuf}; diff --git a/crates/vlog_refactor/src/rename.rs b/crates/vlog_refactor/src/rename.rs index 40a0680..52121f2 100644 --- a/crates/vlog_refactor/src/rename.rs +++ b/crates/vlog_refactor/src/rename.rs @@ -211,7 +211,7 @@ impl<'a> Scope<'a> { pub(crate) fn locate(&mut self, file: &Path, offset: u32) -> Result { let Some(here) = self.index_of(file) else { return Err(format!( - "{} is not one of the files vfmt indexes; nothing outside the project scope can be renamed.", + "{} is not one of the files lucisv indexes; nothing outside the project scope can be renamed.", display(file) )); }; @@ -231,10 +231,10 @@ impl<'a> Scope<'a> { match &reference.resolution { Resolution::Resolved(symbol) => Found::Here(*symbol, cursor), Resolution::NotFound => return Err(format!( - "`{name}` is not resolved to any declaration, so vfmt cannot tell what renaming it would mean." + "`{name}` is not resolved to any declaration, so lucisv cannot tell what renaming it would mean." )), Resolution::InheritedCandidate { base, .. } => return Err(format!( - "`{name}` could only come from the base class `{base}`, which vfmt does not resolve; renaming it would be a guess." + "`{name}` could only come from the base class `{base}`, which lucisv does not resolve; renaming it would be a guess." )), Resolution::ExternalCandidate { .. } => { Found::Elsewhere(name, cursor, analysis.external.get(id).cloned()) @@ -283,7 +283,7 @@ impl<'a> Scope<'a> { }; if name_span.is_empty() { return Err(format!( - "vfmt cannot find where `{name}` is spelled in its declaration, so it will not edit it." + "lucisv cannot find where `{name}` is spelled in its declaration, so it will not edit it." )); } if at_file_scope && self.index.units(&name).len() > 1 { @@ -304,7 +304,7 @@ impl<'a> Scope<'a> { Some(ExternalTarget::Ambiguous(_)) => return Err(ambiguous(name)), _ => { return Err(format!( - "`{name}` is declared outside the files vfmt indexes, so a rename here would only be half a rename." + "`{name}` is declared outside the files lucisv indexes, so a rename here would only be half a rename." )) } }; @@ -318,7 +318,7 @@ impl<'a> Scope<'a> { analysis.semantics.symbol_at(def.name_span.start) }; let Some(symbol) = found else { - return Err(format!("vfmt cannot locate the declaration of `{name}`.")); + return Err(format!("lucisv cannot locate the declaration of `{name}`.")); }; self.declaration(file, symbol, cursor) } @@ -400,7 +400,7 @@ impl<'a> Scope<'a> { } } if out.is_empty() { - return Err(format!("vfmt found nothing to rename for `{}`.", target.name)); + return Err(format!("lucisv found nothing to rename for `{}`.", target.name)); } Ok(out) } @@ -422,7 +422,7 @@ impl<'a> Scope<'a> { for (n, span) in spans.iter().enumerate() { if text.get(span.as_range()) != Some(name) { return Err(format!( - "vfmt found `{name}` recorded at bytes {}..{} of {}, which does not spell it; the rename was abandoned.", + "lucisv found `{name}` recorded at bytes {}..{} of {}, which does not spell it; the rename was abandoned.", span.start, span.end, display(self.path(file).unwrap_or(Path::new("?"))) @@ -459,7 +459,7 @@ impl<'a> Scope<'a> { warnings } - /// vfmt does not preprocess, so a name that is also a macro name, or that + /// lucisv does not preprocess, so a name that is also a macro name, or that /// appears in a macro body, is left exactly as written — and said so. fn macro_warnings(&self, name: &str) -> Vec { let mut out = Vec::new(); @@ -475,7 +475,7 @@ impl<'a> Scope<'a> { "`{name}` is also a macro undefined at {where_}:{line}; macro names and macro uses are never renamed." )), None => out.push(format!( - "`{name}` appears in the body of macro `{}` at {where_}:{line} and was left unchanged; vfmt does not preprocess.", + "`{name}` appears in the body of macro `{}` at {where_}:{line} and was left unchanged; lucisv does not preprocess.", site.macro_name )), } @@ -494,7 +494,7 @@ impl<'a> Scope<'a> { .into_iter() .map(|site| { format!( - "`{name}` appears in the arguments of the macro invocation `{}` at {where_}:{} and was left unchanged; a macro invocation is one opaque token to vfmt, which does not expand macros.", + "`{name}` appears in the arguments of the macro invocation `{}` at {where_}:{} and was left unchanged; a macro invocation is one opaque token to lucisv, which does not expand macros.", site.macro_name, site.line ) }) @@ -563,7 +563,7 @@ impl<'a> Scope<'a> { } /// Identifier tokens spelling the name that no declaration and no - /// reference covers — grouped by *why* vfmt could not attribute them, so + /// reference covers — grouped by *why* lucisv could not attribute them, so /// the user is told where to look rather than guessing. fn unaccounted_warnings(&mut self, file: usize, name: &str, edits: &[TextEdit]) -> Vec { let (Some(text), Some(path)) = (self.text(file), self.path(file)) else { @@ -598,7 +598,7 @@ impl<'a> Scope<'a> { .map(|(reason, at)| { let at = at.iter().map(u32::to_string).collect::>().join(", "); format!( - "`{name}` also occurs in {} at line(s) {at} as {reason}; vfmt records no reference there, so it was left unchanged.", + "`{name}` also occurs in {} at line(s) {at} as {reason}; lucisv records no reference there, so it was left unchanged.", display(path) ) }) @@ -633,18 +633,18 @@ const NOTHING_HERE: &str = "there is no symbol to rename at this position."; fn ambiguous(name: &str) -> String { format!( - "`{name}` is declared in more than one indexed file; vfmt will not guess which declaration this rename means." + "`{name}` is declared in more than one indexed file; lucisv will not guess which declaration this rename means." ) } -/// Why an identifier spelling the name is not a reference vfmt can edit, +/// Why an identifier spelling the name is not a reference lucisv can edit, /// read off its neighbours in the token stream. Naming the actual construct /// is the difference between a warning the user can act on and one they have /// to decode. fn stray_reason(tokens: &[vlog_parser::token::Token], i: usize) -> &'static str { let before = i.checked_sub(1).and_then(|n| tokens.get(n)); if before.is_some_and(|t| t.is_sym(".")) { - return "a hierarchical or member tail, which vfmt does not resolve"; + return "a hierarchical or member tail, which lucisv does not resolve"; } if before.is_some_and(|t| t.is_sym(":")) { let keyword = i.checked_sub(2).and_then(|n| tokens.get(n)); @@ -652,11 +652,11 @@ fn stray_reason(tokens: &[vlog_parser::token::Token], i: usize) -> &'static str // to its declaration — a name already bound in the enclosing scope, // or a label that does not spell the declared name. if keyword.is_some_and(|t| t.kind == TokenKind::Keyword && t.text.starts_with("end")) { - return "an end label vfmt could not attach to its declaration"; + return "an end label lucisv could not attach to its declaration"; } - return "a label vfmt records no declaration for"; + return "a label lucisv records no declaration for"; } - "an occurrence vfmt cannot attribute to any declaration" + "an occurrence lucisv cannot attribute to any declaration" } /// The macro name of an invocation token, as a message spells it: diff --git a/crates/vlog_refactor/tests/corpus.rs b/crates/vlog_refactor/tests/corpus.rs index 8a6e4d8..2c9160e 100644 --- a/crates/vlog_refactor/tests/corpus.rs +++ b/crates/vlog_refactor/tests/corpus.rs @@ -143,7 +143,8 @@ fn adding_a_port_to_a_real_module_answers_or_refuses() { } let started = Instant::now(); - let outcome = add_port(&sources, ModuleRef::Name("prim_fifo_sync"), "input logic vfmt_probe_i"); + let outcome = + add_port(&sources, ModuleRef::Name("prim_fifo_sync"), "input logic lucisv_probe_i"); let elapsed = started.elapsed(); println!( "corpus add_port over {} files: {:?} in {:.2}s", @@ -189,7 +190,7 @@ fn asking_for_port_actions_all_over_a_real_file_never_panics() { for offset in (0..text.len() as u32).step_by(step) { for action in port_actions(&sources, path, offset) { offered += 1; - assert!(action.title.starts_with("vfmt: "), "{}", action.title); + assert!(action.title.starts_with("lucisv: "), "{}", action.title); assert!(action.edit.edit_count() > 0, "an action with no edit is not an action"); } } @@ -230,7 +231,7 @@ fn every_module_in_the_corpus_yields_a_skeleton_that_parses() { }; planned += 1; let skeleton = plan.render(&Layout::default()); - let probe = format!("module vfmt_probe;\n{skeleton}\nendmodule\n"); + let probe = format!("module lucisv_probe;\n{skeleton}\nendmodule\n"); let (_, diagnostics) = vlog_parser::parse_source_tolerant(&probe); if !diagnostics.is_empty() && unparseable.len() < 10 { unparseable.push(format!("{}: {name}\n{skeleton}", path.display())); diff --git a/crates/vlog_refactor/tests/ports.rs b/crates/vlog_refactor/tests/ports.rs index 45f9114..37ad32d 100644 --- a/crates/vlog_refactor/tests/ports.rs +++ b/crates/vlog_refactor/tests/ports.rs @@ -445,7 +445,7 @@ fn a_file_outside_the_scope_is_refused() { let workspace = files(&[("/rtl/sub.sv", SUB)]); let message = remove_port(&workspace, Path::new("/elsewhere/x.sv"), 0).expect_err("not indexed"); - assert!(message.contains("not one of the files vfmt indexes"), "{message}"); + assert!(message.contains("not one of the files lucisv indexes"), "{message}"); } // ---------------------------------------------------------------------- @@ -561,7 +561,7 @@ fn a_port_declaration_offers_its_removal_with_the_count_in_the_title() { ]); let actions = port_actions(&workspace, Path::new("/rtl/sub.sv"), at(sub, "input b") + 6); assert_eq!(actions.len(), 1, "{actions:#?}"); - assert_eq!(actions[0].title, "vfmt: remove port `b` (updates 2 instantiations)"); + assert_eq!(actions[0].title, "lucisv: remove port `b` (updates 2 instantiations)"); assert_eq!(actions[0].edit.file_count(), 2); } @@ -574,7 +574,7 @@ fn an_instantiation_missing_connections_offers_to_fill_them_in() { ]); let actions = port_actions(&workspace, Path::new("/rtl/top.sv"), at(top, "u1")); assert_eq!(actions.len(), 1, "{actions:#?}"); - assert_eq!(actions[0].title, "vfmt: connect 1 missing port"); + assert_eq!(actions[0].title, "lucisv: connect 1 missing port"); } #[test] diff --git a/crates/vlog_refactor/tests/rename.rs b/crates/vlog_refactor/tests/rename.rs index 997a771..5e0de59 100644 --- a/crates/vlog_refactor/tests/rename.rs +++ b/crates/vlog_refactor/tests/rename.rs @@ -379,7 +379,7 @@ fn an_unresolved_name_is_refused_rather_than_guessed() { fn a_name_declared_outside_the_indexed_files_is_refused() { let text = "module m;\n import other_pkg::*;\n wire w = FROM_ELSEWHERE;\nendmodule\n"; let message = refusal(text, "", "FROM_ELSEWHERE", "renamed"); - assert!(message.contains("outside the files vfmt indexes"), "{message}"); + assert!(message.contains("outside the files lucisv indexes"), "{message}"); } #[test] @@ -421,7 +421,7 @@ fn a_file_outside_the_indexed_set_is_refused() { let files = workspace(&[("m.sv", text)]); let message = rename(&files, &path("elsewhere.sv"), 20, "renamed") .expect_err("an unindexed file must be refused"); - assert!(message.contains("not one of the files vfmt indexes"), "{message}"); + assert!(message.contains("not one of the files lucisv indexes"), "{message}"); } // ---------------------------------------------------------------------- @@ -732,7 +732,7 @@ fn a_comment_or_string_that_looks_like_an_end_label_is_never_edited() { #[test] fn a_mismatched_end_label_is_left_alone_and_says_which_construct_it_is() { - // `endmodule : wrong` is already illegal; vfmt neither edits it nor + // `endmodule : wrong` is already illegal; lucisv neither edits it nor // pretends it is fine. let text = "module m;\n wire a;\nendmodule : wrong\n"; let files = workspace(&[("m.sv", text)]); diff --git a/crates/vlog_semantic/Cargo.toml b/crates/vlog_semantic/Cargo.toml index d1ea168..8f8ffb5 100644 --- a/crates/vlog_semantic/Cargo.toml +++ b/crates/vlog_semantic/Cargo.toml @@ -3,7 +3,7 @@ name = "vlog_semantic" version.workspace = true edition.workspace = true license.workspace = true -description = "Single-file symbol tables and reference resolution for vfmt's language server" +description = "Single-file symbol tables and reference resolution for lucisv's language server" [dependencies] vlog_parser = { path = "../vlog_parser" } diff --git a/docs/features/alignment/README.md b/docs/features/alignment/README.md index 3cf875c..f71e40a 100644 --- a/docs/features/alignment/README.md +++ b/docs/features/alignment/README.md @@ -8,7 +8,7 @@ lines is meant to be **aligned** (padded to a common column) or **flush-left** most-loved formatter feature and the reason RTL teams tolerate a formatter at all: hand-aligned port lists, connection lists and parameter tables are how Verilog is read, and a formatter that flattens them is a formatter nobody -runs. vfmt's rule is Verible's, minus the configuration surface: four or more +runs. lucisv's rule is Verible's, minus the configuration surface: four or more excess spaces before a column's token means "align this", a group already sitting at one column stays there, and everything else formats exactly the way it did before this feature existed. The two layouts are fixed points of each @@ -22,7 +22,7 @@ than by luck. write in that position, not against zero: one space before a declaration's name, none before a connection's `(`. So `localparam int A = 1;` (five spaces) is a hint and `localparam int A = 1;` (four) is not. -- **A tab counts as one space.** vfmt's `no-tabs` lint wants them gone anyway, +- **A tab counts as one space.** lucisv's `no-tabs` lint wants them gone anyway, and guessing a tab stop would make the verdict depend on a setting the formatter does not have. - **A group is a run of *adjacent* rows of one construct.** Alignment never @@ -200,7 +200,7 @@ can agree. build time. **Requested of nobody.** No other crate changed; `vlog_semantic`, -`vlog_linter` and `vfmt_server` compile and pass unmodified. +`vlog_linter` and `lucisv_server` compile and pass unmodified. ## Status / TODO @@ -228,12 +228,12 @@ can agree. Same shape as a named connection; the same argument applies. - [ ] **Parked:** the direction/type column of a port list (`input ` vs `output`) and the type column of a declaration. Verible aligns these as - separate columns; vfmt collapses `input wire` to `input wire`. Adding + separate columns; lucisv collapses `input wire` to `input wire`. Adding them means a row's *first* cell splits too, and the hint rule then has to decide what a group means when one column is hinted and another is not. - [ ] **Parked:** the trailing-comment column. Verible aligns `// ...` after a - port list; vfmt writes one space. This is the most visible remaining + port list; lucisv writes one space. This is the most visible remaining gap on real RTL. - [ ] **Parked:** `wire`/`logic` data declarations and `struct` members. Both are ordinary declaration rows; neither has the same cultural pull as the @@ -353,7 +353,7 @@ Verified claims 1-5. Result: **PASS, no blocking findings.** nothing the dev's own 2312-run sweep didn't already cover, but reproduces cleanly. - **`ibex_core.sv` regression (claim 2, design-bug story).** Reproduced at - `--line-length 60`: the current code converges (`vfmt --check` clean after + `--line-length 60`: the current code converges (`lucisv --check` clean after one pass, and `twice()`-style double-format is byte-identical). The regression test `a_group_that_alignment_gives_up_on_still_converges` in `tests/verification.rs` exercises the same shape @@ -493,5 +493,5 @@ Points reviewed and accepted: The author-intent rule shipped matches Verible's culture: ≥4 excess spaces or existing consistent columns opts in; single-space code stays -exactly as vfmt always wrote it — no existing user's output moves +exactly as lucisv always wrote it — no existing user's output moves unless they asked. diff --git a/docs/features/assertions/README.md b/docs/features/assertions/README.md index 550ac71..e1a411d 100644 --- a/docs/features/assertions/README.md +++ b/docs/features/assertions/README.md @@ -9,7 +9,7 @@ of this round — stops being a parse error. The lead's decision, taken before any code was written, is that all of it is **verbatim pass-through**, exactly like `constraint { ... }` and `covergroup ... endgroup` already are: the property/sequence expression grammar (`|->`, `|=>`, `##[1:3]`, `[*2]`, -`throughout`, `disable iff`, `$rose`, `$past`) is a second language that vfmt +`throughout`, `disable iff`, `$rose`, `$past`) is a second language that lucisv models nowhere else, and there is no layout convention worth inventing for it. The payoff of a hand-rolled property grammar would be zero; the risk — a new place to drop a token — would be real. @@ -202,7 +202,7 @@ blocker, it passes. Key decisions and how they were reached: 1. **Reused `ItemKind::Verbatim` rather than adding an assertion variant.** - The classes round already documents that leaf as "a block vfmt + The classes round already documents that leaf as "a block lucisv deliberately does not model, kept byte-for-byte", and every consumer already treats it as opaque. A new item variant would have bought nothing and cost exhaustive-match arms in four crates. Only the *statement* side @@ -235,7 +235,7 @@ Key decisions and how they were reached: consequence — an action block that stays at column 1 under an assertion indented to column 3 — is the correct trade: those bytes are string *data*. 5. **`verify.rs` untouched.** All 13 corpus files pass through the runtime - safety net (`scripts/score.sh` runs `vfmt --check`, which verifies), so no + safety net (`scripts/score.sh` runs `lucisv --check`, which verifies), so no forgiveness needed widening. The 12 attack pairs were written anyway and each one is refused: a changed `|->` → `|=>`, a changed `##[1:3]` range, a dropped `disable iff` clause, a dropped action block, a dropped label, a @@ -265,7 +265,7 @@ already are; `vlog_linter/src/visit.rs`'s `walk_stmts` ends in `_ => {}` so it needed no arm at all. The text-driven rules still work over these lines — checked by hand on a file with a tab-indented and trailing-whitespaced assertion, which reported `no-tabs` and `no-trailing-whitespace` at the right -columns. `vfmt check` runs clean (exit 0/1) on all 13 new files; that is part +columns. `lucisv check` runs clean (exit 0/1) on all 13 new files; that is part of what `scripts/score.sh` counts as a pass. Files changed: diff --git a/docs/features/bind/README.md b/docs/features/bind/README.md index f7f2155..9dd2985 100644 --- a/docs/features/bind/README.md +++ b/docs/features/bind/README.md @@ -280,7 +280,7 @@ Targeted attacks: refuses to let that reach the file. **NON-BLOCKING** per the hard invariants (no corruption occurred; input is left untouched on disk), but worth a follow-up: comments in that position currently make the file - unformattable via vfmt rather than being preserved and formatted. Same + unformattable via lucisv rather than being preserved and formatted. Same class of gap reproduces for a comment right after the module name / before the instance name of the `bind`'s instantiation tail — not otherwise explored in depth. diff --git a/docs/features/case-tables/README.md b/docs/features/case-tables/README.md index d509c2d..1d619dc 100644 --- a/docs/features/case-tables/README.md +++ b/docs/features/case-tables/README.md @@ -2,7 +2,7 @@ ## Goal -Give vfmt the backbone Verible's formatter has: a large table of small +Give lucisv the backbone Verible's formatter has: a large table of small text-in/text-out `{input, expected}` pairs, organized by construct, that runs on every `cargo test`. Verible's `formatter_test.cc` is thousands of such pairs and is where years of edge cases live; the existing snapshot suite in @@ -244,7 +244,7 @@ form as the wanted output. between committing a red test and losing the finding; with it, the wanted output is committed and the case flips green when the bug is fixed. - Derived every expected output by piping the input through - `target/debug/vfmt -`, then reviewed each one by hand against the "Style" + `target/debug/lucisv -`, then reviewed each one by hand against the "Style" section of the top-level `README.md`. Four outputs failed that review and became the `#SKIP` cases; six more are recorded above as style observations where the output is defensible but debatable. @@ -287,7 +287,7 @@ then restoring them byte-for-byte (`diff` confirmed clean). documented failures, with error text matching the README's bug write-ups verbatim (idempotency divergence at line 3, token-stream divergence at index 9/12, and the un-indented multi-instance continuation). Also - reproduced each bug independently via `target/debug/vfmt -` on a minimal + reproduced each bug independently via `target/debug/lucisv -` on a minimal repro; error messages match character-for-character. **Findings** @@ -322,7 +322,7 @@ then restoring them byte-for-byte (`diff` confirmed clean). supported), and no case exercises a bare module-level `case` without a `generate` wrapper (module-level `if`/`for` both have non-generate cases in `generate.cases`, `case` doesn't). Confirmed both parse and format - correctly via `target/debug/vfmt -` — the formatter isn't wrong, the + correctly via `target/debug/lucisv -` — the formatter isn't wrong, the table just doesn't pin either down. Minor others: `always` with a comma-separated (not `or`-separated) sensitivity list, multiple `import` statements in one module. None of these are blocking; they're the kind @@ -331,7 +331,7 @@ then restoring them byte-for-byte (`diff` confirmed clean). 4. **The "defensible style observations" list has no case backing the `initial fork` claim.** The README's style-observations section states "`initial begin` cuddles, but `initial fork` does not." I confirmed this - is true (`target/debug/vfmt -` on `initial fork ... join` puts `initial` + is true (`target/debug/lucisv -` on `initial fork ... join` puts `initial` and `fork` on separate lines), but no `.cases` file actually contains an `initial fork` (only `fork` nested inside `initial begin`, in `statements.cases`). The other five observations are backed by real diff --git a/docs/features/class-semantics/README.md b/docs/features/class-semantics/README.md index d26d931..af4db7a 100644 --- a/docs/features/class-semantics/README.md +++ b/docs/features/class-semantics/README.md @@ -38,7 +38,7 @@ the deviations are stated where they happen. chain: method scope → class scope → enclosing (package/module/file), imports consulted per scope as everywhere else. *Deliberate LRM inexactness:* the LRM puts inherited members ahead of enclosing scopes; - vfmt cannot see into a base class it does not model, so the full lexical + lucisv cannot see into a base class it does not model, so the full lexical chain is searched first and inheritance is the fallback. An in-file name therefore always wins over a hypothetical inherited one. 4. **Inheritance is never chased — not even in-file.** `extends Base` itself @@ -161,7 +161,7 @@ back to the stored name exactly (`exact_or_empty`), preserving the - **Class scopes are ordinary lexical scopes for bare names.** The LRM restricts a nested class's access to its outer class's instance members; - vfmt does not distinguish static from instance access and lets the chain + lucisv does not distinguish static from instance access and lets the chain through. More permissive, never corrupting, same argument as forward references everywhere. - **The nearest enclosing extends-carrying class supplies `base` for an @@ -204,9 +204,9 @@ keeping `scan.rs` alive (with the deliberate `Disable` exception). precedent** (`SymbolKind` is matched exhaustively downstream, so the new variant does not compile without them; each is one arm, no logic): -- `crates/vfmt_server/src/tokens.rs` — `SymbolKind::Class => +- `crates/lucisv_server/src/tokens.rs` — `SymbolKind::Class => Highlight::Class` in `symbol_type`. -- `crates/vfmt_server/src/symbols.rs` — `SymbolKind::Class => "class"` in +- `crates/lucisv_server/src/symbols.rs` — `SymbolKind::Class => "class"` in `kind_label`, `SymbolKind::Class => LspKind::CLASS` in `lsp_kind`. **Requested of a future round (not done here):** chasing @@ -392,19 +392,19 @@ acceptance tables above updated to the post-fix numbers. **2026-08-20 — QA agent.** Read CLAUDE.md, this README, the vlog-semantic README (rule 6, the pinned package-tail-miss rule) and the full diff of `model.rs` / `resolve.rs` / `bind.rs` / `lib.rs` / `workspace.rs` / -`tests/{classes,corpus,workspace}.rs` and the three `vfmt_server` arms. +`tests/{classes,corpus,workspace}.rs` and the three `lucisv_server` arms. Attacks ran as a 29-test scratch suite (`tests/qa_probe.rs`, deleted after the run) plus a baseline `git worktree` at `da1448e` used to re-measure the "before" rows independently. Scope was held to `-p vlog_semantic --p vfmt_server`; nothing outside this feature was touched. +-p lucisv_server`; nothing outside this feature was touched. **Gates re-run on the current tree.** `cargo test -p vlog_semantic`: **69 passed, 0 failed** (6 lib + 23 classes + 1 corpus + 19 semantics + 20 -workspace) — the claimed split is exact. `cargo test -p vfmt_server`: 122 +workspace) — the claimed split is exact. `cargo test -p lucisv_server`: 122 passed (116 unit + 6 e2e), no test file modified. `cargo clippy --p vlog_semantic -p vfmt_server --all-targets`: **0 warnings**; the crates +-p vlog_semantic -p lucisv_server --all-targets`: **0 warnings**; the crates carry exactly one new `#[allow]` (`bind.rs:694`, `too_many_arguments`) and -it is commented. `cargo fmt -p vlog_semantic -p vfmt_server -- --check`: +it is commented. `cargo fmt -p vlog_semantic -p lucisv_server -- --check`: clean. `cargo test --workspace`: **825 passed, 0 failed** (summed over 28 `test result:` lines), reproducing the work log's number. diff --git a/docs/features/classes/README.md b/docs/features/classes/README.md index bf8f033..423a6cf 100644 --- a/docs/features/classes/README.md +++ b/docs/features/classes/README.md @@ -55,7 +55,7 @@ class without a line of per-site code. | construct | why | corpus evidence | |---|---|---| -| `constraint c { ... }` | the constraint language is its own grammar — `dist { 0 :/ 5, [1:20] :/ 20 }`, `->` implication, `solve x before y`, `inside`, `foreach`, `if`/`else`. None of it appears anywhere else in vfmt, and there is no layout convention worth inventing for it. | `ibex_icache_core_req_item.sv:28-62` (five blocks, all four of those forms) | +| `constraint c { ... }` | the constraint language is its own grammar — `dist { 0 :/ 5, [1:20] :/ 20 }`, `->` implication, `solve x before y`, `inside`, `foreach`, `if`/`else`. None of it appears anywhere else in lucisv, and there is no layout convention worth inventing for it. | `ibex_icache_core_req_item.sv:28-62` (five blocks, all four of those forms) | | `covergroup ... endgroup[: label]` | same argument: `coverpoint`, `cross`, `bins`/`ignore_bins`/`illegal_bins`, `binsof ... intersect`, `with function sample`. | `ibex_icache_core_agent_cov.sv:17-46`, `uart_env_cov.sv:8-55` | | the `#( ... )` of a parameterized **type** reference | its arguments are types as often as expressions (`#(virtual ibex_icache_core_if)`, `#(push_pull_item #(A, B))`), so `parse_expr` cannot represent them. | `push_pull_driver_lib.sv:20-24`, `ibex_icache_core_driver.sv:15` | @@ -71,11 +71,11 @@ slice `source[span]`, drop the trivia copies the skip made. This is why ## Assumptions - **The class body is an item list, not a member list.** SystemVerilog's - `class_item` production overlaps almost exactly with what vfmt already + `class_item` production overlaps almost exactly with what lucisv already accepts at module scope, so the alternative — a separate `ClassItem` enum — would have duplicated a dozen variants to gain nothing. The cost is that a construct only legal at module scope (`always_ff`, an instantiation) parses - inside a class instead of being rejected. vfmt is a formatter, not a + inside a class instead of being rejected. lucisv is a formatter, not a compiler; it does not check legality anywhere else either. - **A verbatim block's *relative* layout is what survives, not its absolute layout.** `raw_lines` dedents continuation lines by `col - 1` and the @@ -204,7 +204,7 @@ verbatim. The fix is one arm — rather than done. Nothing is corrupted by the gap; the fence is simply inactive. *(Lead note, per lint-rules-2 QA: inactive for the FORMATTER only. `fence::protected_regions`' line-based scan backstop still sees the -fence, so `vfmt check --fix` and the server's quick fixes DO decline to +fence, so `lucisv check --fix` and the server's quick fixes DO decline to edit inside it — the asymmetry errs toward hands-off, which is the harmless direction, but readers should not conclude the fence does nothing in a class body.)* @@ -345,7 +345,7 @@ non-zero verification-error count. `./tools/corpus_check.sh corpus` over the same pinned 820-file corpus. All four repos verified unmodified afterwards (`git status --porcelain` clean apart from -the pre-existing untracked `.vfmt-corpus-rev` stamps). +the pre-existing untracked `.lucisv-corpus-rev` stamps). | metric | before | after | |---|---|---| @@ -435,7 +435,7 @@ direction. Gained files by tree: `ibex/dv` 55, `ibex/vendor` 34, corpus leans on parameterized *type references* (`uvm_analysis_port #(...)`) as heavily as on `extends`, which is why the `#` blocker at 40 files was really part of this feature; (c) constraints and covergroups are big, common, - and completely disjoint from every grammar vfmt already has. + and completely disjoint from every grammar lucisv already has. - **Chose verbatim for constraints and covergroups before writing a line of parser.** The deciding argument is not effort but risk symmetry: a verbatim block is re-lexed as ordinary tokens by the safety net, so a wrong byte is @@ -554,10 +554,10 @@ Python (not just by count). 7, others 8 (one each) — exact match, including the "34 of 70 are queues/dynamic arrays" arithmetic (25+9). - Round-tripped **all 578** formattable files (not sampled): copied each to a - scratch dir, `vfmt ` then `vfmt --check `. **0 failures, 0 + scratch dir, `lucisv ` then `lucisv --check `. **0 failures, 0 non-fixed-points.** - Corpus repos confirmed unmodified: `git -C status --porcelain` clean - in all four (only the pre-existing untracked `.vfmt-corpus-rev` stamps), + in all four (only the pre-existing untracked `.lucisv-corpus-rev` stamps), before and after the round-trip. - **Claim 1: PASS**, every number independently reproduced, not just eyeballed against the README. @@ -610,7 +610,7 @@ reverted: real binary on all 3 passes. **PASS.** **Handshakes (claim 6).** -- Fence inactive inside a class body: `// vfmt: off` around a member inside +- Fence inactive inside a class body: `// lucisv: off` around a member inside `class c; ... endclass` is ignored (`int a = 1;` gets reformatted to `int a = 1;`); the identical shape inside `module m; ... endmodule` is left byte-for-byte alone. Also checked the *complementary* case not mentioned in @@ -656,7 +656,7 @@ class c; endclass ``` -`vfmt check` on this file reports `no-tabs` (line 2) but **not** +`lucisv check` on this file reports `no-tabs` (line 2) but **not** `case-missing-default` for the `case` inside the method — exactly the asymmetry the broad wording obscures. Suggest tightening the sentence to name which rules are affected (the 4 AST-walk ones), so a reader doesn't conclude @@ -682,7 +682,7 @@ with `` `uvm_field_* `` macro items between them as class items; `` `ifdef``/ `` `else``/`` `endif`` directives between ordinary class members; `endclass : d` where the label doesn't match the class name `c` — **parses and is preserved verbatim, not rejected and not "corrected"** (consistent with the -Assumptions section: vfmt does not check semantic legality); an empty class; +Assumptions section: lucisv does not check semantic legality); an empty class; a 5-deep `extends` chain (`c5 extends c4 extends c3 extends c2 extends c1`); and a combined case exercising `typedef class` forward declaration, class parameters referenced in an `extends #(.W(W))` override, multiple @@ -753,7 +753,7 @@ Points reviewed and accepted: signature change made mandatory-not-optional for exactly the right reason: an empty verbatim slice would be a corruption bug. -With this, vfmt formats the majority of real-world DV code as well as +With this, lucisv formats the majority of real-world DV code as well as RTL. Next per the owner's directive: alignment inference, content-hash cache, range formatting, remaining lint rules — and the corpus says queues/dynamic arrays after that. diff --git a/docs/features/cli-filelist/README.md b/docs/features/cli-filelist/README.md index 265b6db..a4c8c46 100644 --- a/docs/features/cli-filelist/README.md +++ b/docs/features/cli-filelist/README.md @@ -2,10 +2,10 @@ ## Goal -Give the `vfmt` CLI the same front door the server got in M1: `vfmt -f +Give the `lucisv` CLI the same front door the server got in M1: `lucisv -f project.f` formats or lints exactly the files an EDA filelist names, reusing -`vfmt_core::filelist::read` unchanged. M1 deliberately stopped at the config -key and the language server — "a `vfmt -f` flag is its own change with its own +`lucisv_core::filelist::read` unchanged. M1 deliberately stopped at the config +key and the language server — "a `lucisv -f` flag is its own change with its own exit-code questions" (`docs/features/filelist/README.md`, Status). This is that change: the flag, the answers to those questions, and nothing else. No new parsing, no new dependency, no version bump. @@ -14,7 +14,7 @@ parsing, no new dependency, no version bump. - **A filelist is an *input*, not a *mode*.** `-f` adds files to whatever the command line already names; it does not replace, filter or reorder them. So - `vfmt -f a.f`, `vfmt rtl/` and `vfmt -f a.f rtl/ tb/top.sv` are all ordinary + `lucisv -f a.f`, `lucisv rtl/` and `lucisv -f a.f rtl/ tb/top.sv` are all ordinary runs, and having neither positional inputs nor `-f` is still the usage error it always was. - **Listed paths are named paths.** `--exclude` and `.gitignore` filter @@ -25,7 +25,7 @@ parsing, no new dependency, no version bump. choice would mean a `.gitignore` in a generated-RTL directory could silently shrink the build's own file set. - **Warnings are warnings.** Everything M1's parser reports as a warning — a - listed file that no longer exists, an option vfmt has no table for, an unset + listed file that no longer exists, an option lucisv has no table for, an unset `$VAR`, a repeated filelist, a `-f` chain past `MAX_NESTING_DEPTH` — goes to stderr as `warning: :: ` and leaves the exit code alone. This matches the server, which shows the same strings and keeps @@ -40,19 +40,19 @@ parsing, no new dependency, no version bump. - **Two names for one file are one file.** Dedup is by lexical absolute path (`.`/`..` folded, symlinks deliberately not resolved — the same rule `filelist::Reader::normalize` and `config::Discovery::absolute` already - use), and the *first* spelling seen is the one vfmt reports, so - `vfmt -f p.f rtl/a.sv` still says `rtl/a.sv` and not the absolute path the + use), and the *first* spelling seen is the one lucisv reports, so + `lucisv -f p.f rtl/a.sv` still says `rtl/a.sv` and not the absolute path the filelist produced. This also dedups repeats that have nothing to do with - filelists (`vfmt rtl/ rtl/a.sv`), which previously formatted the file twice + filelists (`lucisv rtl/ rtl/a.sv`), which previously formatted the file twice — see the Work log. -- **The `filelist` key in `vfmt.toml` stays server-only.** Auto-consuming it - would make `vfmt rtl/` process files that are not under `rtl/`, and - `vfmt --check .` in CI change its file set because someone added a key for +- **The `filelist` key in `lucisv.toml` stays server-only.** Auto-consuming it + would make `lucisv rtl/` process files that are not under `rtl/`, and + `lucisv --check .` in CI change its file set because someone added a key for the editor's benefit. A CLI filelist is named on the command line, where it is visible in the CI log. `--help` says so in the CONFIGURATION section. - **An empty result is the existing empty-input error.** A filelist naming nothing that exists produces its warnings and then `no Verilog files found`, - exit 2 — the same answer `vfmt empty-dir/` has always given. + exit 2 — the same answer `lucisv empty-dir/` has always given. - **`-f` is not `-F`.** vcs's `-F` (paths relative to the *invoking* directory rather than to the filelist) is not supported, exactly as M1 left it. Nobody has asked. @@ -61,15 +61,15 @@ parsing, no new dependency, no version bump. ### Consumed -- `vfmt_core::filelist::read(&Path) -> Result` — unchanged, +- `lucisv_core::filelist::read(&Path) -> Result` — unchanged, used exactly as the server uses it. Only `files` and `warnings` are read: `incdirs` and `defines` are meaningless to a formatter that does not preprocess, and are dropped. -- `vfmt_core::walk::collect_files` / `config::Discovery` — unchanged. Filelist +- `lucisv_core::walk::collect_files` / `config::Discovery` — unchanged. Filelist files skip `collect_files` entirely (they are exact paths, and running them through it would only re-`is_file()` them), but they go through `Discovery::for_file` in the same loop as every other file, so a listed file - is formatted with its *own* directory's `vfmt.toml`. + is formatted with its *own* directory's `lucisv.toml`. ### Promised @@ -79,19 +79,19 @@ parsing, no new dependency, no version bump. usage errors (an unreadable filelist, `-f` with no value, `-` or `--lines` with `-f`). - **stdout stays machine-readable.** Every warning goes to stderr, so - `vfmt check --output-format json -f p.f` still prints exactly one JSON array + `lucisv check --output-format json -f p.f` still prints exactly one JSON array on stdout. Pinned by a test. -- **`Options` gains `filelists: Vec`** (`crates/vfmt/src/args.rs`). +- **`Options` gains `filelists: Vec`** (`crates/lucisv/src/args.rs`). Anything constructing an `Options` literal needs the field; nothing outside - `crates/vfmt` does. + `crates/lucisv` does. ### Rejected combinations (all exit 2, all decided at parse time) | Command line | Why | |---|---| -| `vfmt -f p.f -` | stdin is one anonymous buffer; a filelist is a set of paths on disk. Reading both would mean ignoring one. | -| `vfmt --lines 3-9 -f p.f` | Same reason `--lines` rejects a directory: line numbers name lines of *a file*, and a filelist is a file set. | -| `vfmt -f` | Missing flag value, like every other flag. | +| `lucisv -f p.f -` | stdin is one anonymous buffer; a filelist is a set of paths on disk. Reading both would mean ignoring one. | +| `lucisv --lines 3-9 -f p.f` | Same reason `--lines` rejects a directory: line numbers name lines of *a file*, and a filelist is a file set. | +| `lucisv -f` | Missing flag value, like every other flag. | Everything else about a run is unchanged by `-f`: the cache, `--threads`, `--stdout`, `--diff`, `--fix`, config discovery and the summary line all @@ -99,8 +99,8 @@ behave exactly as they do for a file named as an argument. ## Status / TODO -- [x] `-f ` on `vfmt`, `vfmt format`, `vfmt --check/--diff` and - `vfmt check`; repeatable; combines with positional inputs +- [x] `-f ` on `lucisv`, `lucisv format`, `lucisv --check/--diff` and + `lucisv check`; repeatable; combines with positional inputs - [x] Warnings to stderr as `warning: ...`, exit code unaffected; unreadable filelist is exit 2 with nothing processed - [x] Listed paths bypass `--exclude` and `.gitignore`, like named files @@ -112,9 +112,9 @@ behave exactly as they do for a file named as an argument. server-only - [x] `README.md`: `-f` in the CLI examples and in the configuration section - [x] Tests: 3 unit (2 `args.rs`, 1 `main.rs`) + 10 e2e - (`crates/vfmt/tests/cli.rs`); + (`crates/lucisv/tests/cli.rs`); `cargo fmt`, `cargo clippy --all-targets`, `cargo test --workspace` -- [ ] Not done, deliberately: the `vfmt.toml` `filelist` key is still not read +- [ ] Not done, deliberately: the `lucisv.toml` `filelist` key is still not read by the CLI (Assumptions), and `+incdir+`/`+define+` still feed nothing on this side — the formatter and the linter do not preprocess. - [ ] Not done, deliberately: no `-F`, and no quoting for paths containing @@ -124,13 +124,13 @@ behave exactly as they do for a file named as an argument. ### 2026-08-25 — dev agent, M13 -Three files of code, all in `crates/vfmt`. +Three files of code, all in `crates/lucisv`. - **`src/args.rs`** — `Options::filelists`, the `-f` arm (placed before the `s if s.starts_with('-')` catch-all so it is a flag, not an unknown option), the emptiness check widened to "no inputs *and* no filelists", and the two rejected combinations. Both rejections live in `parse_from` rather than in - `gather`, so they are cheap unit tests and so `vfmt -f p.f -` cannot reach + `gather`, so they are cheap unit tests and so `lucisv -f p.f -` cannot reach the stdin path at all: `is_stdin()` is checked before `gather` in `main`, and a run that read stdin while ignoring `-f` would be the silent-wrong answer this feature exists to avoid. @@ -151,7 +151,7 @@ Decisions worth recording: every warning is on stderr before the first file is touched. - **Dedup is global, not filelist-vs-command-line.** It was tempting to dedup only across the two sources, but the same `HashSet` costs nothing and fixes - a pre-existing sharp edge: `vfmt rtl/ rtl/a.sv` used to format `a.sv` twice + a pre-existing sharp edge: `lucisv rtl/ rtl/a.sv` used to format `a.sv` twice and count it twice, and with `--threads > 1` two workers could hold the same path. **This is a behavior change beyond the flag** — a run naming one file twice now reports `1 file`, not `2` — and it is the only one. No existing @@ -160,12 +160,12 @@ Decisions worth recording: `absolute` in `main.rs` is the same twelve lines as `filelist::Reader::normalize` and `config::Discovery::absolute`, which QA already examined once and accepted as deliberate duplication (filelist QA - log, Finding 3). The alternative was widening `vfmt_core`'s public API with + log, Finding 3). The alternative was widening `lucisv_core`'s public API with a `pub fn normalize(path, cwd)` for a single caller, which CLAUDE.md's "don't build the abstraction for a second user that doesn't exist" rule and the "don't touch files outside your feature's scope" rule both argue against. Recorded here so a future third caller knows to extract it. - Unlike the other two, this copy is *only* a dedup key: the path vfmt reads, + Unlike the other two, this copy is *only* a dedup key: the path lucisv reads, writes and reports is always the one it was given. - **`--lines` with `-f` is a new error, not a new behavior.** Today `--lines` only rejects a *directory*; a filelist would have been accepted @@ -176,11 +176,11 @@ Decisions worth recording: simply has no use for them. Saying "ignoring +incdir+" on every run of every real filelist would be noise. -**Files touched outside `crates/vfmt`**: two, both documentation this change +**Files touched outside `crates/lucisv`**: two, both documentation this change makes untrue and both edited in the style each file already uses. `README.md` — the CLI example block and the configuration section's "the CLI does not consume it yet". `docs/features/filelist/README.md` — its Status item -"the CLI does not consume `filelist` yet ... a `vfmt -f` flag is its own +"the CLI does not consume `filelist` yet ... a `lucisv -f` flag is its own change", struck through and answered the same way that README already resolved its `+incdir+` item after M10. `TODO.md` and the umbrella checklist were left for the lead, per the brief — M13's box is still unchecked. @@ -188,13 +188,13 @@ for the lead, per the brief — M13's box is still unchecked. **Verification.** `cargo fmt --all -- --check` clean; `cargo clippy --all-targets` silent; `cargo test --workspace` green — 1556 tests, 13 of them new (2 unit in `args.rs`, 1 in `main.rs` pinning the dedup key, 10 e2e in -`tests/cli.rs`: `crates/vfmt`'s two suites went 30 → 33 and 71 → 81). The e2e +`tests/cli.rs`: `crates/lucisv`'s two suites went 30 → 33 and 71 → 81). The e2e set covers: `-f` alone with a nested `-f` and relative resolution; `-f` plus positional files and a directory with triple dedup; two `-f` flags; a missing listed file (warning on stderr, others formatted, exit 0) and an unknown option; an unreadable filelist (exit 2, nothing written); `--check` with `-f` (exit 1, -then exit 0 once formatted); `vfmt check -f` in text and JSON form (stdout is +then exit 0 once formatted); `lucisv check -f` in text and JSON form (stdout is one array, warnings on stderr); a filelist named from an unrelated working directory; a listed file that both `--exclude` and `.gitignore` name; and the four usage errors. Also hand-driven against the built binary from two @@ -209,7 +209,7 @@ different working directories before the tests were written. matching the Work log's count exactly (0 failed, 4 pre-existing `#[ignore]` elsewhere, unrelated to this feature). -**Exit-code contract audit.** Built `target/release/vfmt` and drove the +**Exit-code contract audit.** Built `target/release/lucisv` and drove the matrix by hand: clean file via `-f` → 0; would-reformat via `-f --check` → 1; lint violation via `check -f` → 1; a filelist naming only a missing file → warning + `no Verilog files found` → **2** (empty-after-skip, matching @@ -226,11 +226,11 @@ exit code outside {0,1,2}. **Claims verified directly, all pass:** - `-f` repeatable, combines with positional inputs, `-f` alone is a valid complete command line (`args.rs:378`, tested live). -- Dedup: `vfmt --check rtl/ rtl/a.sv` reports `a.sv` exactly once and the +- Dedup: `lucisv --check rtl/ rtl/a.sv` reports `a.sv` exactly once and the summary reads `2 files would be reformatted` for a 2-file tree, not 3 — confirmed the behavior change is real and works as claimed. - First-spelling-wins is honored across sources, not just within one: - `vfmt --check -f p.f rtl/a.sv` (filelist lists `rtl/a.sv`, positional arg + `lucisv --check -f p.f rtl/a.sv` (filelist lists `rtl/a.sv`, positional arg also names it) reports `rtl/a.sv`, never the filelist's absolute resolution — matches the Assumptions' worked example verbatim. - Warnings go to stderr only, never touch the exit code: missing listed @@ -239,11 +239,11 @@ exit code outside {0,1,2}. - `check -f --output-format json`: stdout is exactly one parseable JSON array (piped through `python3 -m json.load`, 2 entries) with the missing- file warning only on stderr. Text-mode `check -f` likewise. -- `vfmt.toml`'s `filelist` key: `--help`'s CONFIGURATION section says - "read by vfmt-server only" as claimed; the CLI never opens the key +- `lucisv.toml`'s `filelist` key: `--help`'s CONFIGURATION section says + "read by lucisv-server only" as claimed; the CLI never opens the key (unchanged from before this feature — not separately re-verified beyond reading the help text and the diff, since the CLI simply never reads - `FileConfig::filelist` anywhere in `crates/vfmt`). + `FileConfig::filelist` anywhere in `crates/lucisv`). - `-f` + `-`, `--lines` + `-f`, bare `-f`: all three rejected at parse time, exit 2, with the exact messages the README's Rejected-combinations table promises. @@ -255,12 +255,12 @@ exit code outside {0,1,2}. - CRLF filelist: works with no special-casing needed, `str::lines()` already strips `\r` (same as M1's own QA finding). - `$VAR` expansion to an absolute path: works (first attempt was a shell - quoting mistake on my end, not a vfmt bug — corrected and re-run). + quoting mistake on my end, not a lucisv bug — corrected and re-run). - A filelist that `-f`s itself: one warning, no infinite loop, its own file still processed once. - Usage errors: `-f` with no value → `error: -f requires a value`, exit 2. Repeated identical `-f list.f -f list.f` → deduped, one file reported, not - two. `vfmt -- -f` → `error: unknown option: --`, exit 2 — vfmt has no `--` + two. `lucisv -- -f` → `error: unknown option: --`, exit 2 — lucisv has no `--` end-of-options handling anywhere (pre-existing, not part of this feature's scope; noting only because the brief asked). @@ -276,7 +276,7 @@ two different spellings (`rtl/a.sv` positional + `alias.sv` via `-f`, formatted independently: ``` -$ vfmt --check rtl/a.sv -f list.f # list.f names alias.sv, a symlink to rtl/a.sv +$ lucisv --check rtl/a.sv -f list.f # list.f names alias.sv, a symlink to rtl/a.sv would reformat: rtl/a.sv would reformat: /.../alias.sv 2 files would be reformatted @@ -288,7 +288,7 @@ open-truncate-write, **not** tempfile+rename. `cache.rs:91` sits right next to this code and *does* the atomic tempfile+rename dance, with a doc comment explicitly saying "Writes the cache back, atomically" — so the codebase already has the pattern, just not applied to the file the user actually -asked vfmt to rewrite. +asked lucisv to rewrite. Put together: two workers (`--threads > 1`) that land on the same inode through two spellings — a symlink pair being the realistic case, since @@ -300,13 +300,13 @@ corrupt code... no partial output"), not a hypothetical. **Severity assessment, honestly:** this is **not new in M13** and **not worsened by it**. Before this milestone there was no dedup at all, so -`vfmt a.sv a.sv` (no symlink needed) already put two workers on one path +`lucisv a.sv a.sv` (no symlink needed) already put two workers on one path under `--threads > 1`, and a symlinked pair had exactly the same exposure `collect_files` never resolves symlinks either (`walk.rs`, confirmed by -reading it — no `canonicalize`/`read_link` anywhere in `vfmt_core`). M13's +reading it — no `canonicalize`/`read_link` anywhere in `lucisv_core`). M13's dedup is a strict improvement: it closes the common, likely case (the same literal path named twice) that used to double-process on every run of -`vfmt rtl/ rtl/a.sv`; it was never advertised as closing the symlink case, +`lucisv rtl/ rtl/a.sv`; it was never advertised as closing the symlink case, and the README's own Assumptions section says so precisely ("symlinks deliberately not resolved"). What I'd push back on is only the Work log's framing — "fixes a pre-existing sharp edge... two workers could hold the @@ -347,14 +347,14 @@ if and when a fourth caller appears, as the Work log itself already says. **+incdir+/+define+ silent drop: agree, reasoning holds for `check` too.** Verified by reading `filelist_files` (`main.rs:328-338`): only `list.files` and `list.warnings` are ever read; `list.incdirs`/`list.defines` are -untouched anywhere in `crates/vfmt`. Checked whether any M12 lint rule +untouched anywhere in `crates/lucisv`. Checked whether any M12 lint rule (`crates/vlog_linter/src/rules/`) consults an include graph or any cross-file state — grepped the whole crate for `incdir`/`include_graph`/ `cross-file`/`workspace`: zero hits. Every existing linter rule operates on one file's own parse tree (confirmed by `context.rs`/`visit.rs` taking a single source and no include resolver). `` `include`` resolution using -`incdirs` is M10's, and lives entirely in `vfmt_server` — the CLI has never -resolved includes at all, filelist-fed or not. So the reasoning "vfmt +`incdirs` is M10's, and lives entirely in `lucisv_server` — the CLI has never +resolved includes at all, filelist-fed or not. So the reasoning "lucisv doesn't preprocess, so incdirs genuinely don't matter" holds for the linter exactly as it does for the formatter; nothing in M12 would have consulted them even if they were threaded through. @@ -378,7 +378,7 @@ worsened by this milestone, and fixing it belongs to a change that touches independently (1556 tests, 0 failures). The semantics decisions are the right ones, each argued in place — listed paths bypassing exclude rules matches the positional-arg precedent exactly, the `--lines` + `-f` -rejection prevents a silent 400-file surprise, and keeping the vfmt.toml +rejection prevents a silent 400-file surprise, and keeping the lucisv.toml key server-only respects the CLI user who never asked for it. QA's exit-code matrix confirms the frozen contract untouched, including both ambiguous cells. QA's medium find — lexical-only dedup plus non-atomic diff --git a/docs/features/cli-polish/README.md b/docs/features/cli-polish/README.md index 71e8e18..d83b5e9 100644 --- a/docs/features/cli-polish/README.md +++ b/docs/features/cli-polish/README.md @@ -2,7 +2,7 @@ ## Goal -The small ruff-inspired CLI items from `TODO.md` §1–§3 that make `vfmt` +The small ruff-inspired CLI items from `TODO.md` §1–§3 that make `lucisv` usable in CI and in editors: `--diff` (print a unified diff instead of rewriting), `--stdin-filename` (name the buffer an editor piped in), `--exclude` (skip generated files during directory walks), a frozen and @@ -63,7 +63,7 @@ hand-rolled argument parsing style of `main.rs` is kept. directory inputs), identically on both header lines. Files that would not change print nothing. - The end-of-run summary (`N files would be reformatted, …`) goes to - **stderr**, as with `--check`, so `vfmt --diff … > patch.txt` captures + **stderr**, as with `--check`, so `lucisv --diff … > patch.txt` captures only diff text. - Exit code: `1` if any file would change, `0` if none would, `2` if any file errored (error wins over "would change"). @@ -118,7 +118,7 @@ Each per-file (and stdin) call into `format_source` runs inside `std::panic::catch_unwind`. The default panic hook is swapped for a no-op around that call (`take_hook`/`set_hook`, restored immediately after) so the contained panic prints no backtrace noise; the payload -message is re-reported in vfmt's own error style: +message is re-reported in lucisv's own error style: ``` error: rtl/bad.sv: panicked while formatting: @@ -164,7 +164,7 @@ summary, and the run continues and exits 2. A panic that aborts (e.g. - [x] `main.rs` split into `args.rs` / `walk.rs` / `diff.rs` + driver (it would otherwise have passed ~400 lines). - [x] Unit tests for the glob matcher, the diff renderer and - `catch_panic`; integration tests in `crates/vfmt/tests/cli.rs`. + `catch_panic`; integration tests in `crates/lucisv/tests/cli.rs`. - [x] `cargo test --workspace`, `cargo clippy --all-targets`, `cargo fmt --check` clean. - [x] TODO.md: §1 panic containment, §2 `--diff` and `--stdin-filename`, @@ -181,7 +181,7 @@ summary, and the run continues and exits 2. A panic that aborts (e.g. `cargo clippy --all-targets` has 5 pre-existing warnings, all in `vlog_parser`/`vlog_formatter` (2× `if_same_then_else`, `manual_repeat_n`, `dead_code` on `ListItem.blank_before`) and none in - `vfmt`. + `lucisv`. - Split `main.rs` (was 220 lines; the five items would have taken it past 400) into `args.rs` (option struct, parsing, help), `walk.rs` (file collection + the exclude matcher), `diff.rs` (unified diff) and @@ -218,8 +218,8 @@ summary, and the run continues and exits 2. A panic that aborts (e.g. - Top-level `README.md`: added the new flags to the usage block and an exit-code table, per TODO.md §3's "document it in README and freeze it". -- Tests: `crates/vfmt/tests/cli.rs` drives the real binary via - `env!("CARGO_BIN_EXE_vfmt")`, with a hand-rolled tempdir under +- Tests: `crates/lucisv/tests/cli.rs` drives the real binary via + `env!("CARGO_BIN_EXE_lucisv")`, with a hand-rolled tempdir under `std::env::temp_dir()` (unique name from pid + a counter, removed by a `Drop` guard) so no `tempfile` dependency is needed. All fixtures use trivial Verilog (`module m;endmodule` → `module m;\nendmodule\n`) so @@ -245,14 +245,14 @@ summary, and the run continues and exits 2. A panic that aborts (e.g. **Results** (workspace root, final): -- `cargo test --workspace`: **69 passed, 0 failed** — 18 `vfmt` unit - (args 4, walk 4, diff 6, panic/format 4), 12 `vfmt` CLI integration, +- `cargo test --workspace`: **69 passed, 0 failed** — 18 `lucisv` unit + (args 4, walk 4, diff 6, panic/format 4), 12 `lucisv` CLI integration, 3 + 1 + 2 `vlog_formatter`, 19 `vlog_formatter` verification, 14 `vlog_parser`. -- `cargo clippy --all-targets`: no warnings from `vfmt`. The 5 +- `cargo clippy --all-targets`: no warnings from `lucisv`. The 5 pre-existing warnings in `vlog_parser`/`vlog_formatter` are unchanged from the baseline taken before this work. -- `cargo fmt --check`: clean (ran `cargo fmt -p vfmt` only, so no file +- `cargo fmt --check`: clean (ran `cargo fmt -p lucisv` only, so no file owned by the other agent was reformatted). - Sizes: `main.rs` 231, `args.rs` 156, `diff.rs` 199, `walk.rs` 129, `tests/cli.rs` 261 lines. No `Cargo.toml` change was needed. @@ -261,18 +261,18 @@ summary, and the run continues and exits 2. A panic that aborts (e.g. ### 2026-08-18 — QA agent -Scope: `crates/vfmt/**` and this README only. Nothing in `vlog_parser` / +Scope: `crates/lucisv/**` and this README only. Nothing in `vlog_parser` / `vlog_formatter` was touched in the repo (a concurrent dev agent was active there; the workspace failed to build on the first attempt with -errors in `vlog_formatter::format.rs` unrelated to `vfmt` — waited and +errors in `vlog_formatter::format.rs` unrelated to `lucisv` — waited and retried, second attempt built clean, confirming the failure was transient and outside this feature's scope). **Build / lint / test — all green:** -- `cargo test -p vfmt`: **30 passed, 0 failed** — 18 unit (main 4, args 4, +- `cargo test -p lucisv`: **30 passed, 0 failed** — 18 unit (main 4, args 4, walk 4, diff 6) + 12 CLI integration (`tests/cli.rs`). Matches the claimed counts exactly. -- `cargo clippy -p vfmt --all-targets`: zero warnings from `vfmt`. Full +- `cargo clippy -p lucisv --all-targets`: zero warnings from `lucisv`. Full `cargo clippy --all-targets` still shows exactly 4 warnings, all in `vlog_parser`/`vlog_formatter` (2× `if_same_then_else` in `vlog_parser/src/parser.rs:573,715`, `manual_repeat_n` in @@ -280,7 +280,7 @@ and outside this feature's scope). in `vlog_formatter/src/format.rs:94`) — **note:** the Work log above says "5 pre-existing warnings" but lists only 4; today's run confirms 4. Nit, not fixed (not my log entry to edit). -- `cargo fmt -p vfmt --check`: clean, exit 0. +- `cargo fmt -p lucisv --check`: clean, exit 0. - Module sizes, no-unwrap-outside-tests/main, doc comments: all comply with CLAUDE.md as of this read. `main.rs` 231, `args.rs` 156, `diff.rs` 199, `walk.rs` 129, `tests/cli.rs` 261 lines. @@ -293,8 +293,8 @@ and outside this feature's scope). **Diff correctness (patch round-trip), verified in scratchpad:** - Nontrivial multi-construct file (module + always block + assign): - `vfmt --diff` output applied cleanly with `patch -p0` and byte-matched - `vfmt --stdout` output. + `lucisv --diff` output applied cleanly with `patch -p0` and byte-matched + `lucisv --stdout` output. - >200-line gap between two independent single-line changes (256-line file, 250 filler lines between them): 2 separate hunks emitted, both applied cleanly via `patch -p0`, round-tripped correctly. Bounded @@ -310,7 +310,7 @@ and outside this feature's scope). - Already-formatted file: `--diff` correctly prints nothing, exit 0. **FINDING (should-fix) — `\ No newline at end of file` breaks `patch` -applicability.** `crates/vfmt/src/diff.rs:40-46` (`split_lines`) pushes +applicability.** `crates/lucisv/src/diff.rs:40-46` (`split_lines`) pushes the `NO_NEWLINE` pseudo-line into the same line stream as ordinary content, so `render_one_hunk` (`diff.rs:129-144`) tags it with a regular `-`/`+` sign like any other line. Real unified diff / GNU `patch` expect @@ -318,7 +318,7 @@ this marker as a **bare, unprefixed** line immediately following its associated content line. Repro: ``` printf 'module m;endmodule' > old.sv # no trailing newline -vfmt --diff old.sv +lucisv --diff old.sv ``` produces: ``` @@ -339,10 +339,10 @@ but it directly undercuts the dev work log's "bonus" observation that evidently didn't include a missing-final-newline case. Worth a follow-up fix: don't tag `NO_NEWLINE` rows with a sign in `render_one_hunk`. -**FINDING (should-fix, likely out of vfmt's scope) — stack overflow +**FINDING (should-fix, likely out of lucisv's scope) — stack overflow aborts the whole batch, not just one file.** A syntactically valid but deeply nested input (150 levels of `if (clk) begin ... end`, 454 lines, -built in scratchpad — not committed anywhere) crashes the whole `vfmt` +built in scratchpad — not committed anywhere) crashes the whole `lucisv` process with `thread 'main' has overflowed its stack` / SIGABRT (exit 134), reproduced with plain format, `--check`, and `--diff` alike (i.e. not a `--diff`-specific bug — it's in the parser/formatter's recursive @@ -413,14 +413,14 @@ feature's and this QA pass's scope. the error. Not documented explicitly either way, but seems like the right behavior and is not a finding. - `--` (bare double dash) is **not** treated as an end-of-options - marker — `vfmt -- file.sv` errors with `unknown option: --` (exit 2), + marker — `lucisv -- file.sv` errors with `unknown option: --` (exit 2), since `args.rs:110` rejects any unrecognized token starting with `-`. Not a regression from this feature (pre-existing hand-rolled parser behavior, `args.rs` review confirms this pattern predates the diff/ exclude/stdin-filename additions) and not claimed anywhere in the feature contract, so not filed as a finding against this feature — noting only because it means a file whose name starts with `-` can - never be passed to `vfmt`. Nit, out of this feature's scope. + never be passed to `lucisv`. Nit, out of this feature's scope. - Unknown flag (`--bogus-flag`): clear `error: unknown option: --bogus-flag`, exit 2. @@ -430,7 +430,7 @@ ways:** fully contained within one function call and the process is single- threaded (confirmed: `run_files`/`run_stdin` call `format_contained` in a plain sequential `for` loop, no threads spawned anywhere in - `crates/vfmt`), so there is no possible interleaving between two + `crates/lucisv`), so there is no possible interleaving between two calls — each call's take_hook always sees the hook the previous call restored. The existing `catch_panic_is_reusable` unit test (`main.rs:218-224`) covers this directly. @@ -497,7 +497,7 @@ including the doc comment, close enough). 6. Test counts — **PASS**, 12 CLI integration + 18 unit tests, all green, exact match to the claim. -No fixes were made directly to `crates/vfmt/**` — nothing rose to the +No fixes were made directly to `crates/lucisv/**` — nothing rose to the "typo / missing assertion" bar for a QA-agent-authored fix; both findings above are implementation decisions (diff renderer sign handling; documenting an uncontainable-panic edge case) that belong to diff --git a/docs/features/comments-round-2/README.md b/docs/features/comments-round-2/README.md index d22cede..f18bcec 100644 --- a/docs/features/comments-round-2/README.md +++ b/docs/features/comments-round-2/README.md @@ -10,8 +10,8 @@ formattable corpus file refused **14 files**, in exactly two shapes: a comment between a module/instantiation head and the `#(` or `(` that follows it (10 files), and a comment written next to an `(* attribute *)`, which came out on the wrong side of it (4 files). Both are refusals, not corruption — the -safety net was right both times — but a file `vfmt` cannot format is a file -`vfmt` cannot format. Measuring the fix turned up a third, quieter bug in the +safety net was right both times — but a file `lucisv` cannot format is a file +`lucisv` cannot format. Measuring the fix turned up a third, quieter bug in the same family: `instantiation`'s single-instance branch never read the instance's `Meta`, so a comment before a lone instance's name was parsed and then dropped (hard invariant #3, visible only because the net refused the file). **Result: @@ -100,7 +100,7 @@ fields could regress into (hard invariant #3). **Format fences (`docs/features/format-fences/README.md`): unchanged, and verified so.** `fence::scan_scope` walks item-level leading comments only, so a -`// vfmt: off` written in one of the four new bracket positions opens no region +`// lucisv: off` written in one of the four new bracket positions opens no region — exactly as it opened none when the same comment used to land in the first parameter port's `meta.leading`. The difference is that such a file is now formatted (fence inert, output verified) instead of refused. `fence.rs`, @@ -113,9 +113,9 @@ nothing nests, root-to-leaf depth is unchanged. **`line_starts_inside_string` is still the one in-string-break definition** — untouched; nothing here parses comment or string text. -**Not touched, by scope:** `crates/vfmt`, `crates/vfmt_core`, -`crates/vfmt_server`, `crates/vlog_linter`, `crates/vlog_semantic`, `editors/`, -`tools/`, `corpus/`, `verify.rs`. `vfmt_server`'s tests consume `format_source` +**Not touched, by scope:** `crates/lucisv`, `crates/lucisv_core`, +`crates/lucisv_server`, `crates/vlog_linter`, `crates/vlog_semantic`, `editors/`, +`tools/`, `corpus/`, `verify.rs`. `lucisv_server`'s tests consume `format_source` and stayed green. `cargo fmt --all` rewrote exactly one file, this round's own `tests/verification.rs` (confirmed against `cargo fmt --all --check` beforehand, which listed only that file). @@ -166,7 +166,7 @@ which listed only that file). **The lead's sweep, reproduced and re-run.** One `// marker` line inserted so that it becomes line len/3 (and, separately, line len/2) of every corpus file that formats cleanly unmodified; formatted through -`vfmt --stdin-filename -`. A trial is discarded when the insertion breaks +`lucisv --stdin-filename -`. A trial is discarded when the insertion breaks the *parse* — a comment dropped into a backslash-continued macro body genuinely changes what the file says, and that is the harness's doing, not the formatter's. Script in the session scratchpad (`sweep.py`); not checked in, as @@ -293,7 +293,7 @@ all. - **Checked the fence question the new bucket-1 fields raise**, since they hold comments the fence scanner never sees. It never saw them before either — `scan_scope` walks item-level `meta.leading` only, and the comment used to - live in a *parameter port's* meta. So a `// vfmt: off` in bracket position is + live in a *parameter port's* meta. So a `// lucisv: off` in bracket position is inert now and was inert before; the change is that the file formats instead of refusing. Written up in Handshakes rather than left as a surprise. - **Every fixed shape is 3-pass stable**, checked outside `cargo test` on all @@ -312,7 +312,7 @@ all. does. A comment parsed and never printed is hard invariant #3; it only ever showed up as a refusal. Fixed through the same `bracket_comments` helper, and pinned by its own rejection test. Six more corpus positions, zero test churn. -- **Did not touch** `verify.rs` (`git diff --quiet` exits 0), `crates/vfmt*`, +- **Did not touch** `verify.rs` (`git diff --quiet` exits 0), `crates/lucisv*`, `crates/vlog_linter`, `crates/vlog_semantic`, `editors/`, `tools/` or `corpus/`. Did not run `git commit`/`git push`. @@ -443,7 +443,7 @@ output and exit code on every one. `crates/vlog_formatter/tests/cases/comments.cases`, `crates/vlog_formatter/tests/verification.rs`, `crates/vlog_parser/src/{ast,parser}.rs`, plus this README). `crates/ -vfmt_server/` and `crates/vlog_linter/` show as untracked in `git status` +lucisv_server/` and `crates/vlog_linter/` show as untracked in `git status` but predate this feature (present in the session's initial git-status snapshot) — not touched by this diff. README has all seven required sections; Review is empty, left alone. `TODO.md` §2 note read honest: it diff --git a/docs/features/comments-round/README.md b/docs/features/comments-round/README.md index fa9ec79..35c7160 100644 --- a/docs/features/comments-round/README.md +++ b/docs/features/comments-round/README.md @@ -237,7 +237,7 @@ baseline was reproduced exactly from the `HEAD` worktree binary first (`3fab114f...`, bit for bit), so the whole delta is attributable, and it is six lines of the TSV. The corpus repos are unmodified afterwards (`git status --porcelain` clean apart from the pre-existing untracked -`.vfmt-corpus-rev` stamps). +`.lucisv-corpus-rev` stamps). ## Work log @@ -320,7 +320,7 @@ lines of the TSV. The corpus repos are unmodified afterwards it; the net was right every time. Added seven rejection tests anyway, each crafted as "what this fix would look like if it had been done in the safety net instead", so a future shortcut fails loudly. -- Did not touch `tools/`, `corpus/`, `crates/vfmt/`, `verify.rs`, or the +- Did not touch `tools/`, `corpus/`, `crates/lucisv/`, `verify.rs`, or the concurrent define-table round's files (`crates/vlog_parser/src/defines.rs`, its tests, its `lib.rs` line, its `TODO.md` §6 entry). Did not run `git commit`/`git push`. @@ -354,7 +354,7 @@ blocking findings, no should-fix findings. Two informational notes below. **Tooling (exact results).** `cargo test --workspace`: **229 passed, 0 failed** (summed per-binary: -vfmt 40+21, vlog_formatter 8+1+4+6+2+39, vlog_parser 53+24+19+12 = 229). +lucisv 40+21, vlog_formatter 8+1+4+6+2+39, vlog_parser 53+24+19+12 = 229). `cargo clippy --workspace --all-targets`: silent. `cargo fmt --all --check`: exit 0. `git diff --quiet -- crates/vlog_formatter/src/verify.rs`: exit 0 (byte-identical to HEAD). Case-table count: 299 exactly (`grep -c '^# '` @@ -364,7 +364,7 @@ delta matches exactly). **Claim 1 (Meta.trailing migration) — PASS.** Multi-line block comment as trailing (`wire w; /* a\n b */`) re-indents and is stable across 3 passes. -Same construct inside a `// vfmt: off` fence stays byte-exact (diffed the +Same construct inside a `// lucisv: off` fence stays byte-exact (diffed the fenced lines directly against input) and still 3-pass stable — fences correctly override the new re-indent behavior. Trailing runs (block+block, block+line, block+block+line) reproduce the parser's @@ -440,7 +440,7 @@ it's a several-point absolute deviation; not blocking. **Claim 7 (suite hygiene) — PASS**, see Tooling above. `crates/vlog_formatter/tests/fences.rs`: 6/6. `git diff --stat -- fence.rs tests/fences.rs tests/cases/fences.cases`: -empty (untouched). Two fence probes: a same-line `// vfmt: off` trailing +empty (untouched). Two fence probes: a same-line `// lucisv: off` trailing marker is still ignored (the interior line still gets its extra spaces collapsed — no accidental activation despite `Meta.trailing` now carrying a span); an own-line fence immediately after a line with an unrelated @@ -465,7 +465,7 @@ confirmed).** clippy silent, fmt clean). **Corpus (exact results).** `./tools/corpus_check.sh corpus -b -target/release/vfmt`: 8 ok-unchanged (1.0%), 460 would-reformat (56.1%), +target/release/lucisv`: 8 ok-unchanged (1.0%), 460 would-reformat (56.1%), 352 parse-error (42.9%), 0 verification-error, 0 crash — TSV md5 **`aa982463f68c1a3568c02a0fc5e0c455`**, exact match. Built a `git worktree` at `0ba29d4` (release), re-ran the same script: TSV md5 @@ -477,7 +477,7 @@ else changed. The two files that were already `ok-unchanged` on both binaries (`.../isa/custom/rv64x_instr.sv`, `.../isa/rv32fc_instr.sv`) are byte-identical between the HEAD and current binaries, as required. Corpus working trees clean afterwards (only the pre-existing untracked -`.vfmt-corpus-rev` stamps) in all four vendored repos. +`.lucisv-corpus-rev` stamps) in all four vendored repos. **Findings.** diff --git a/docs/features/completion-core/README.md b/docs/features/completion-core/README.md index 75a791f..dc359d8 100644 --- a/docs/features/completion-core/README.md +++ b/docs/features/completion-core/README.md @@ -49,7 +49,7 @@ workspace index, from the same file list, and are replaced with it. - **The index's freshness is the tables' freshness.** The index rebuilds on `initialize` and on `didSave`, so the project-wide tables do too. An unsaved edit in *another* buffer is therefore not in the word table until it is - saved — exactly the rule the index has always had (`vfmt-server`'s + saved — exactly the rule the index has always had (`lucisv-server`'s invalidation notes). The buffer being typed in is the exception, and needs no rebuild: its own token stream is already computed on every change, so its words are harvested per request and an unsaved name is a candidate @@ -65,7 +65,7 @@ workspace index, from the same file list, and are replaced with it. ## Handshakes -- **Widened in `vlog_parser`** — the only change outside `vfmt_server`. +- **Widened in `vlog_parser`** — the only change outside `lucisv_server`. `token.rs`'s keyword table became a `keywords![...]` macro invocation that generates both `pub const KEYWORDS: &[&str]` and `pub fn is_keyword`; `lib.rs` re-exports `KEYWORDS`. `is_keyword` is still a `matches!` over @@ -90,7 +90,7 @@ workspace index, from the same file list, and are replaced with it. innermost-scope idea and nothing else, and lifting one to fit both would have meant widening another crate's API for a second caller that wants a different answer. Recorded so the lead can overrule it cheaply. -- **Promises `vfmt_server`'s own callers**: `completions` never panics, always +- **Promises `lucisv_server`'s own callers**: `completions` never panics, always returns items whose `textEdit` replaces exactly the typed word (plus the backtick, in the macro case), and never returns a module item whose text differs from what M4 returned — the M4 tests assert the skeleton byte for @@ -146,7 +146,7 @@ cursor is, so the rule is stated rather than implied: a backtick: `` `ifdef NAME ``, `` `ifndef NAME ``, `` `undef NAME ``, `` `define NAME ``. -Both spellings are tested. `` `undef`` entries are not offered: vfmt does not +Both spellings are tested. `` `undef`` entries are not offered: lucisv does not preprocess and cannot say where a name stopped being defined, so a table that listed them would be pretending to know. @@ -232,23 +232,23 @@ examples it does not: - [x] `editors/vscode/package.json` `"version"` - [x] `editors/vscode/package-lock.json` `"version"` in **both** places (top level and `packages[""]`) -- [x] `README.md` — the `code --install-extension dist/vfmt-0.3.0.vsix` example +- [x] `README.md` — the `code --install-extension dist/lucisv-0.3.0.vsix` example - [x] `editors/vscode/README.md` — both install examples - [x] `tools/RELEASING.md` — the `dist/` listing, the install commands, the `git tag v0.3.0` example and the appendix's publish commands - [x] `CHANGELOG.md` — a `0.3.0 — 2026-08-24` section in the existing voice: one paragraph per area (filelists, rename, ports, module hinting, completion, editors), each linking to its feature README -- [x] Verified: `target/debug/vfmt --version` → `vfmt 0.3.0`. Nothing - hard-codes a version string in Rust; `vfmt --version` and the server's +- [x] Verified: `target/debug/lucisv --version` → `lucisv 0.3.0`. Nothing + hard-codes a version string in Rust; `lucisv --version` and the server's `serverInfo.version` both read `env!("CARGO_PKG_VERSION")`. -- [x] Verified: `node editors/vscode/smoke.js target/debug/vfmt-server` → +- [x] Verified: `node editors/vscode/smoke.js target/debug/lucisv-server` → `smoke: OK` Deliberately **not** touched: the `0.2.0` section of `CHANGELOG.md`, `docs/features/release-prep/README.md` and `TODO.md`'s release entry — those record what happened at 0.2.0 and are not install instructions. The literal -`0.2.0` strings in `vfmt_core/src/cache.rs`'s and `vfmt/tests/cli.rs`'s +`0.2.0` strings in `lucisv_core/src/cache.rs`'s and `lucisv/tests/cli.rs`'s corrupt-cache fixtures are deliberately malformed lines whose version field is incidental; they exercise the parser, not the version. @@ -283,7 +283,7 @@ incidental; they exercise the parser, not the version. tests added in `token.rs`; the parser suite (185 → 187 lib tests, all four targets) is green. - **Tables (`crates/vfmt_server/src/candidates.rs`, new).** `Candidates` holds + **Tables (`crates/lucisv_server/src/candidates.rs`, new).** `Candidates` holds three sorted vectors — index names, macro names, project words — built in `Workspace::rebuild_index` from the same `collect_sources()` list the index gets. That is what makes the scope ladder and the open-buffer-beats-disk rule @@ -330,7 +330,7 @@ incidental; they exercise the parser, not the version. **Suite**: 1 232 → 1 262 workspace tests, all green; `cargo fmt --all -- --check` and `cargo clippy --all-targets` clean; `node - editors/vscode/smoke.js target/debug/vfmt-server` → `smoke: OK`. + editors/vscode/smoke.js target/debug/lucisv-server` → `smoke: OK`. ## QA log @@ -343,8 +343,8 @@ incidental; they exercise the parser, not the version. - `cargo test --workspace` — green, **1262** tests (summed the per-crate `test result` lines myself rather than trusting the printed total) — matches the Work log's `1232 → 1262` claim exactly. -- `node editors/vscode/smoke.js target/debug/vfmt-server` — `smoke: OK`. -- `cargo build -p vfmt` then `target/debug/vfmt --version` → `vfmt 0.3.0`. +- `node editors/vscode/smoke.js target/debug/lucisv-server` — `smoke: OK`. +- `cargo build -p lucisv` then `target/debug/lucisv --version` → `lucisv 0.3.0`. All gates: **pass, claims confirmed.** @@ -378,7 +378,7 @@ total**, matching the claim exactly once both files are counted together. Diffed the gate itself: `at_module_item`, `enclosing_scopes`, `is_procedural`, `balanced`, and the `ITEM_SCOPES`/`NOT_ITEM_SCOPES`/ `PROCEDURAL`/`STATEMENT_END` constants are **byte-identical** between -`git show HEAD:crates/vfmt_server/src/completion.rs` and the working tree — +`git show HEAD:crates/lucisv_server/src/completion.rs` and the working tree — only a doc comment above `completions` changed (`"module completions"` → `"completions"`). The gate that decides *where* a skeleton may appear was not touched. @@ -536,13 +536,13 @@ not against this milestone's own code, since nothing in `completion.rs` or is one the dev's README lists as deliberately untouched — `CHANGELOG.md`'s `0.2.0` history section, `TODO.md`'s release-prep line, `docs/features/release-prep/README.md`'s own history, and the - malformed-cache-line fixtures in `vfmt_core/src/cache.rs` and - `vfmt/tests/cli.rs`. No stray `0.2.0` anywhere else. + malformed-cache-line fixtures in `lucisv_core/src/cache.rs` and + `lucisv/tests/cli.rs`. No stray `0.2.0` anywhere else. - `cargo metadata` — all eight workspace crates report `0.3.0`. `editors/vscode/package.json` and **both** places in `package-lock.json` (top level and `packages[""]`) — `0.3.0`. `Cargo.toml`'s `[workspace.package] version` — `0.3.0`. - `target/debug/vfmt --version` → `vfmt 0.3.0`. + `target/debug/lucisv --version` → `lucisv 0.3.0`. - `CHANGELOG.md`'s `0.3.0` section: read against what actually shipped (filelists, rename, ports, module hinting, completion, editors) — accurate, no overclaiming; the completion paragraph's "860 real-world @@ -569,8 +569,8 @@ loaded machine) and the file/word/index counts match exactly (860 / 16 750 ### e2e — real server binary over stdio -Ran the dev's own `crates/vfmt_server/tests/e2e.rs` tests as part of the -full-suite gate (both pass). Independently drove `target/debug/vfmt-server` +Ran the dev's own `crates/lucisv_server/tests/e2e.rs` tests as part of the +full-suite gate (both pass). Independently drove `target/debug/lucisv-server` over stdio by hand (a small Python LSP client, not committed anywhere) for the one case the dev's own e2e test doesn't explicitly assert on: @@ -583,7 +583,7 @@ the one case the dev's own e2e test doesn't explicitly assert on: - Project-word completion from another file, and inside-comment decline: already covered by the dev's own `keyword_and_project_completion_round_trip_over_the_wire`, which I - re-ran in isolation (`cargo test -p vfmt_server --test e2e + re-ran in isolation (`cargo test -p lucisv_server --test e2e keyword_and_project_completion -- --nocapture`) — passes standalone. **LOW, informational — the Status/TODO line "e2e stdio round trip for the @@ -603,7 +603,7 @@ unambiguous fix). ### Cleanup All probing was done with temporary `qa_probe_*` `#[test]` functions added -to `crates/vfmt_server/src/completion.rs`'s existing `tests` module, run +to `crates/lucisv_server/src/completion.rs`'s existing `tests` module, run with `--nocapture`, then fully reverted. Verified clean: `grep -rn qa_probe crates/` — zero hits; `git diff --stat` for this file matches the pre-QA baseline exactly (898 changed lines, same as diff --git a/docs/features/completion-templates/README.md b/docs/features/completion-templates/README.md index 21d11b5..c105053 100644 --- a/docs/features/completion-templates/README.md +++ b/docs/features/completion-templates/README.md @@ -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. diff --git a/docs/features/config-discovery/README.md b/docs/features/config-discovery/README.md index 3dfb0a6..7637be9 100644 --- a/docs/features/config-discovery/README.md +++ b/docs/features/config-discovery/README.md @@ -2,13 +2,13 @@ ## Goal -`vfmt.toml` / `.vfmt.toml` discovery in the style of ruff's `ruff.toml`: +`lucisv.toml` / `.lucisv.toml` discovery in the style of ruff's `ruff.toml`: for every input file, search upward from its directory for a config file and take `line-length`, `indent` and `exclude` from the first one found. -CLI flags still win. This is what makes vfmt usable in a repo where the +CLI flags still win. This is what makes lucisv usable in a repo where the style is a property of the tree rather than of the command line — an editor's format-on-save (which goes through stdin) picks up the same -settings as CI's `vfmt --check`, with no per-editor configuration. Kept +settings as CI's `lucisv --check`, with no per-editor configuration. Kept deliberately tiny per TODO.md §3: three keys, no tables, no option explosion, no new dependency. @@ -24,8 +24,8 @@ explosion, no new dependency. of transitive code to read three scalars and a string array out of a file that is, in practice, four lines long. The hand-rolled subset parser is ~100 lines, has no unsafe, no build-time cost, and its - failure mode ("unsupported in vfmt.toml") is a better error than a - full parser silently accepting syntax vfmt would then ignore. If the + failure mode ("unsupported in lucisv.toml") is a better error than a + full parser silently accepting syntax lucisv would then ignore. If the key set ever grows past ~10 keys or needs tables, revisit. - **The supported grammar is a subset, and says so.** Anything valid in real TOML but outside the subset (tables, multi-line arrays, dotted @@ -59,8 +59,8 @@ explosion, no new dependency. For a directory `D`, in this exact order: -1. If `D/vfmt.toml` exists → use it. Stop. -2. Else if `D/.vfmt.toml` exists → use it. Stop. +1. If `D/lucisv.toml` exists → use it. Stop. +2. Else if `D/.lucisv.toml` exists → use it. Stop. 3. Else if `D/.git` exists (file *or* directory) → stop with **no** config. The `.git` check happens **after** steps 1–2, so a config file sitting next to `.git` in the repo root *is* found. @@ -75,7 +75,7 @@ The starting directory `D` is: current working directory. Relative paths are resolved against the current directory before the -walk, so `vfmt a.sv` searches the cwd and its ancestors. +walk, so `lucisv a.sv` searches the cwd and its ancestors. Exactly one config file is ever used per file — there is no merging of a parent config into a child config (ruff's `extend` is not implemented). @@ -106,8 +106,8 @@ array := '[' ws* (string (ws* ',' ws* string)* (ws* ',')?)? ws* ']' ``` Everything is one entry per line; whitespace around every token is -optional. Rejected with an explicit "unsupported in vfmt.toml" error: -tables/sections (`[tool.vfmt]`), multi-line arrays, string escapes, +optional. Rejected with an explicit "unsupported in lucisv.toml" error: +tables/sections (`[tool.lucisv]`), multi-line arrays, string escapes, booleans/floats/datetimes, and any line that is not a comment, blank, or `key = value`. @@ -150,7 +150,7 @@ respects the frozen exit-code contract (2 = error, files untouched). - **Consumes `vlog_formatter::Config`** (`max_width`, `indent_width`) unchanged. Nothing in `crates/vlog_formatter` or `crates/vlog_parser` was touched; the two fields sufficed, so no change request was needed. -- **Changes `args::Options`** (internal to `crates/vfmt`): the eager +- **Changes `args::Options`** (internal to `crates/lucisv`): the eager `config: Config` field is replaced by `line_length: Option` and `indent: Option` — "was the flag given?" has to survive to the point where the file config is known. `Options::config_with(&FileConfig)` @@ -158,7 +158,7 @@ respects the frozen exit-code contract (2 = error, files untouched). `--no-config`. - **Promises to TODO.md §3's content-hash cache:** the cache key must include the resolved per-file settings (or a hash of the config file - that produced them), not just file content + vfmt version — two files + that produced them), not just file content + lucisv version — two files with identical content under different config files must not share a cache entry. `config::FileConfig` derives `PartialEq` and is cheap to hash-by-debug if that is all the cache needs. @@ -176,7 +176,7 @@ respects the frozen exit-code contract (2 = error, files untouched). - [x] `src/config.rs`: TOML-subset parser (`parse`) + upward discovery with a per-directory `HashMap` cache (`Discovery`). -- [x] Discovery rule: `vfmt.toml` before `.vfmt.toml`, `.git` stops the +- [x] Discovery rule: `lucisv.toml` before `.lucisv.toml`, `.git` stops the walk *after* the current directory is checked, filesystem root stops it. - [x] Keys `line-length` (40..=400), `indent` (1..=8), `exclude` @@ -188,7 +188,7 @@ respects the frozen exit-code contract (2 = error, files untouched). - [x] stdin anchors on `--stdin-filename`'s directory, else cwd. - [x] Config errors are fatal, exit 2, before anything is written. - [x] Unit tests for the parser and for discovery; CLI integration - tests in `crates/vfmt/tests/cli.rs`. + tests in `crates/lucisv/tests/cli.rs`. - [x] `README.md`: Configuration section. `TODO.md` §3 config item checked off. @@ -197,19 +197,19 @@ respects the frozen exit-code contract (2 = error, files untouched). ### 2026-08-19 — dev agent - Read CLAUDE.md, TODO.md §3, README.md, `docs/features/cli-polish/README.md` - and all of `crates/vfmt/src` before writing anything. cli-polish's + and all of `crates/lucisv/src` before writing anything. cli-polish's Handshakes section already promised `stdin_filename` as the discovery anchor and `exclude` as the CLI layer; both are honored literally. - **No TOML dependency.** Justification (CLAUDE.md requires one in writing): three keys, one array, no tables — `toml`+`serde` would be three transitive crates and a proc-macro build step to read four lines of text. The subset parser is 95 lines including error messages, and - it *rejects* what it does not support rather than accepting TOML vfmt + it *rejects* what it does not support rather than accepting TOML lucisv would then ignore, which is the better failure mode here. Revisit if the key set passes ~10 or ever needs tables. - **Discovery walks up, `.git` stops it after the directory is checked.** The alternative (check `.git` first) would make the common - layout — `vfmt.toml` next to `.git` in the repo root — silently not + layout — `lucisv.toml` next to `.git` in the repo root — silently not work, which is exactly the ruff layout people expect. Both halves of the rule have tests (`git_stops_the_walk_but_only_after_its_own_directory` in `config.rs`, `the_search_stops_at_a_git_directory_after_checking_it` @@ -223,15 +223,15 @@ respects the frozen exit-code contract (2 = error, files untouched). (`chain`) over the naive version and needs no extra data structure. - **Config errors are fatal, and resolved before any write.** `gather` now returns `Vec<(PathBuf, Config)>` — every config file in the run is - read while building that list, so a broken `vfmt.toml` in a deep + read while building that list, so a broken `lucisv.toml` in a deep subdirectory aborts with exit 2 and *nothing* written, rather than half the tree formatted. It also keeps the error from being repeated once per file in the offending directory. -- **`Options` changed shape** (internal to `crates/vfmt`): `config: +- **`Options` changed shape** (internal to `crates/lucisv`): `config: Config` became `line_length: Option` / `indent: Option`, because "was the flag given?" has to survive until the file config is known. `Options::config_with` / `exclude_with` apply precedence in one - place each. Nothing outside `crates/vfmt` was touched; + place each. Nothing outside `crates/lucisv` was touched; `vlog_formatter::Config`'s two fields sufficed exactly. - **Range checks (`line-length` 40..=400, `indent` 1..=8) apply to the file only**, not to `--line-length`/`--indent`. Tightening the flags @@ -249,29 +249,29 @@ respects the frozen exit-code contract (2 = error, files untouched). people actually type. - The workspace was uncompilable for part of this run — the concurrent agent's span work in `vlog_parser`/`vlog_formatter` was mid-landing - (56-60 compile errors in `vlog_parser`, none in `vfmt`). Waited it out + (56-60 compile errors in `vlog_parser`, none in `lucisv`). Waited it out rather than touching their crates; final gates re-run on the merged tree, see Results. - Sanity-checked the real binary outside the test suite (scratchpad, then deleted): a tree with `indent = 4` + `exclude = ["gen"] # generated` formatted `rtl/a.sv` to 4 spaces, left `gen/g.sv` untouched, exit 0; changing the key to `line_length` produced - `error: …/vfmt.toml:2: unknown key \`line_length\` (known keys: + `error: …/lucisv.toml:2: unknown key \`line_length\` (known keys: line-length, indent, exclude)` and exit 2 with nothing written. **Results** (workspace root, final): -- `cargo test -p vfmt`: **59 passed, 0 failed** — 38 unit (config 18: +- `cargo test -p lucisv`: **59 passed, 0 failed** — 38 unit (config 18: 8 parser + 10 discovery; args 6; walk 4; diff 6; main 4 — the 6 args tests include the two new precedence tests) and 21 CLI integration (8 new: upward search, per-directory configs, CLI override, `--no-config`, broken-config-exits-2 (5 malformed files), config excludes, stdin discovery + stdin config error, `.git` stop). -- `cargo test --workspace`: **148 passed, 0 failed** (`vfmt` 59, +- `cargo test --workspace`: **148 passed, 0 failed** (`lucisv` 59, `vlog_formatter` 42, `vlog_parser` 47) on the tree as merged with the concurrent span work. -- `cargo clippy -p vfmt --all-targets`: zero warnings. -- `cargo fmt -p vfmt --check`: clean. Only `crates/vfmt` was formatted, +- `cargo clippy -p lucisv --all-targets`: zero warnings. +- `cargo fmt -p lucisv --check`: clean. Only `crates/lucisv` was formatted, so no file owned by the other agent was touched. - Sizes: `config.rs` 476 lines (203 of code + doc comments, 273 of tests; the parser half is 95 lines), `args.rs` 220, `main.rs` 261, @@ -281,20 +281,20 @@ respects the frozen exit-code contract (2 = error, files untouched). ### 2026-08-19 — QA agent -Scope: `crates/vfmt/**` only (a concurrent dev agent was landing the spans +Scope: `crates/lucisv/**` only (a concurrent dev agent was landing the spans feature in `vlog_parser`/`vlog_formatter`; the workspace was compilable by the time these checks ran, so both scoped and full-workspace runs were possible). **Gates** — all clean: -- `cargo test -p vfmt`: 59 passed, 0 failed (38 unit + 21 integration, exact +- `cargo test -p lucisv`: 59 passed, 0 failed (38 unit + 21 integration, exact match to the claim). `cargo test --workspace`: 158 passed, 0 failed - (`vfmt` 59, `vlog_formatter` 42, `vlog_parser` 57) — higher than the + (`lucisv` 59, `vlog_formatter` 42, `vlog_parser` 57) — higher than the work log's "148 at the time of dev's run" because the concurrent span work (10 new `tests/spans.rs` cases) landed afterward; not a config-discovery regression. -- `cargo clippy -p vfmt --all-targets`: zero warnings. -- `cargo fmt -p vfmt --check`: clean. +- `cargo clippy -p lucisv --all-targets`: zero warnings. +- `cargo fmt -p lucisv --check`: clean. - No `Cargo.toml` / `Cargo.lock` diff anywhere in the repo — the no-new-dependency claim holds. - `unwrap()`/`expect()`/`panic!` audit of `config.rs`, `args.rs`, `main.rs`: @@ -322,7 +322,7 @@ and falls through to defaults, exit 0, no crash. **Pre-write fatality (the contract claim most worth breaking) — held.** Built the adversarial case directly: `a_good/x.sv` (alphabetically first, -its directory has no config problem) plus `b_bad/vfmt.toml` with an unknown +its directory has no config problem) plus `b_bad/lucisv.toml` with an unknown key governing `b_bad/y.sv` (alphabetically later, so it's walked and formatted *after* `a_good/x.sv` in `walk_dir`'s sorted order). Ran the real binary: exit 2, and **both** files came back byte-identical to their @@ -335,7 +335,7 @@ parser hole that accepts a wrong value; every malformed input tried failed closed at exit 2 with nothing written): 1. **[Low] BOM breaks key matching with a confusing message.** A - `vfmt.toml` starting with a UTF-8 BOM (`EF BB BF`) fails every key on + `lucisv.toml` starting with a UTF-8 BOM (`EF BB BF`) fails every key on its first line: `read_to_string` doesn't strip it and `str::trim()` doesn't treat U+FEFF as whitespace, so `indent = 4` becomes the "key" `\u{FEFF}indent`, reported as `unknown key` with an invisible character diff --git a/docs/features/corpus-bugs/README.md b/docs/features/corpus-bugs/README.md index a0f8c98..14550f9 100644 --- a/docs/features/corpus-bugs/README.md +++ b/docs/features/corpus-bugs/README.md @@ -6,7 +6,7 @@ Fix the four formatter bugs the 820-file corpus check exposed, catalogued as root causes A–D in `docs/features/corpus-check/README.md` and re-measured at 46 affected files after `macro-items` raised the parse rate to 468/820. Every one of them made the runtime safety net refuse output (exit 2), so each was a file -`vfmt` could not format at all: an event list's `,` rewritten as `or`, comments +`lucisv` could not format at all: an event list's `,` rewritten as `or`, comments moved out of port/parameter lists and out of expressions, two module-header `import` statements folded into one, and a hand-written empty `#()` dropped. Three of the four are token rewrites the net is right to reject; the fourth is @@ -139,7 +139,7 @@ again. `./tools/corpus_check.sh corpus` against the same pinned 820-file corpus, release build, corpus verified unmodified afterwards (`git status --porcelain` -clean in all four repos apart from the untracked `.vfmt-corpus-rev` stamps). +clean in all four repos apart from the untracked `.lucisv-corpus-rev` stamps). | metric | after macro-items | after corpus-bugs | |---|---|---| @@ -353,7 +353,7 @@ verified in a throwaway worktree). Boxing both comment groups fixes it and leaves those variants *smaller* than before this feature. Also dropped an unused `BinaryComments::is_empty` rather than keep a method with no caller. -Did not touch `tools/`, `corpus/` contents, `crates/vfmt/`, `CLAUDE.md`, +Did not touch `tools/`, `corpus/` contents, `crates/lucisv/`, `CLAUDE.md`, `README.md` or `TODO.md` (no matching checkbox exists — these bugs were never backlog items). Did not run `git commit`/`git push`. @@ -409,7 +409,7 @@ committed numbers: - Re-ran the working-tree binary a second time: output TSV byte-identical to the first (deterministic). - All four corpus repos `git status --porcelain` clean after both runs - (only the untracked `.vfmt-corpus-rev` stamps, as documented). + (only the untracked `.lucisv-corpus-rev` stamps, as documented). - Cleaned up the worktree (`git worktree remove --force`) after use; the main working tree's `git status` is unchanged from before this session. diff --git a/docs/features/corpus-check/README.md b/docs/features/corpus-check/README.md index c611070..9401846 100644 --- a/docs/features/corpus-check/README.md +++ b/docs/features/corpus-check/README.md @@ -2,9 +2,9 @@ ## Goal -Run `vfmt` against real open-source RTL and report how much of it we can +Run `lucisv` against real open-source RTL and report how much of it we can parse, how much is already format-clean, and what is blocking the rest — -vfmt's version of ruff's "ecosystem check" (TODO.md §5). Two scripts: +lucisv's version of ruff's "ecosystem check" (TODO.md §5). Two scripts: `tools/corpus_fetch.sh` clones pinned revisions of permissively-licensed Verilog/SystemVerilog projects into a gitignored `corpus/`, and `tools/corpus_check.sh` runs the release binary over every `.v`/`.sv` @@ -47,7 +47,7 @@ bug finder. ## Handshakes -**Consumed from `crates/vfmt` (CLI):** +**Consumed from `crates/lucisv` (CLI):** - The exit-code contract (0/1/2) documented in `README.md`. Frozen; if it ever changes, `check_one()` in `tools/corpus_check.sh` must change with @@ -81,7 +81,7 @@ This feature is scripts + docs only. `tools/corpus_fetch.sh` pins every repo to an exact commit and fetches it shallow (`--depth 1` at that SHA). Nothing tracks a branch, so the numbers below are reproducible. Re-running the script is a no-op when the -recorded SHA in `/.vfmt-corpus-rev` already matches. +recorded SHA in `/.lucisv-corpus-rev` already matches. | Project | License | Pinned commit | Why | |---|---|---|---| @@ -95,7 +95,7 @@ picorv32 41. ## Baseline (2026-08-19) -- vfmt built from commit **`9f1a6cf1d2926358e2a804b33fb4de55bb9f04e7`** +- lucisv built from commit **`9f1a6cf1d2926358e2a804b33fb4de55bb9f04e7`** (`cargo build --release`), working tree otherwise clean apart from this feature's own files. Numbers will move once the recursion-limit and `@(* )` lexer fixes in TODO.md §1 land — re-run and update this section @@ -143,7 +143,7 @@ Two rates, since they differ and both matter: 265/820 (**32.3%**). The 24-file gap is the bug list below. - **format-clean** = 1/820 (0.1%), i.e. 0.4% of what is formattable. -**The 0.1% "already clean" figure is expected, not alarming.** vfmt is an +**The 0.1% "already clean" figure is expected, not alarming.** lucisv is an opinionated reformatter and none of these projects were formatted with it; "would-reformat" is the correct outcome for essentially all third-party code. The number worth tracking over time is @@ -197,7 +197,7 @@ category-1 count is a floor, not a ceiling). the obvious addition before drawing a conclusion — see Status/TODO. 3. **Classes — roadmap #2 — rank second (182 files) but are almost entirely testbench/DV code** (`ibex/dv/uvm`, `vendor/google_riscv-dv`). - If vfmt's target is synthesizable RTL, this is much lower value than + If lucisv's target is synthesizable RTL, this is much lower value than its rank implies (34 RTL files); if the target includes UVM testbenches, it is the top item after macros. 4. **Three constructs missing from the roadmap outrank three that are on @@ -306,17 +306,17 @@ aborts. Two caveats for the recursion-limit work in TODO.md §1: `name|url|commit|sparse-paths` drives a `git init` + `git fetch --depth 1 origin ` + `checkout FETCH_HEAD` per repo. Pinning by SHA rather than tag means `--depth 1` still works (GitHub allows fetching a - reachable SHA) while nothing can drift. A `.vfmt-corpus-rev` stamp file + reachable SHA) while nothing can drift. A `.lucisv-corpus-rev` stamp file makes re-runs a no-op. Only opentitan uses the sparse path — blobless partial clone plus cone-mode sparse checkout — because it is the only repo where a full shallow clone would be unreasonable. -- **`corpus_check.sh`** (138 lines): one `vfmt --check ` per file +- **`corpus_check.sh`** (138 lines): one `lucisv --check ` per file (820 processes; the whole run is a few seconds, so batching was not worth the loss of per-file attribution). Per-file classification lives in one `check_one()` function; everything after it is reporting driven by `awk`/`sort`/`uniq` over the TSV, so the report can be recomputed - from a saved TSV without re-running vfmt. -- **Why per-file rather than one `vfmt --check corpus/`**: a single + from a saved TSV without re-running lucisv. +- **Why per-file rather than one `lucisv --check corpus/`**: a single invocation cannot attribute a crash to a file, and its exit code collapses "would reformat" and "error" into 2. Per-file also means one pathological file cannot take the run with it. @@ -327,7 +327,7 @@ aborts. Two caveats for the recursion-limit work in TODO.md §1: is what names the unsupported construct. Backtick-quoted keywords are never normalized in either. - **Read-only by construction**: `--check` is the only mode invoked, and - no other vfmt flag is passed. + no other lucisv flag is passed. - **Exit status is meaningful**: 0 = no verification errors and no crashes; 1 = at least one of either (formatter bug); 2 = usage/setup error (missing binary, missing corpus, no files found). @@ -348,7 +348,7 @@ aborts. Two caveats for the recursion-limit work in TODO.md §1: - [x] `tools/corpus_check.sh` — per-file outcome classification, summary table, message histogram, blocking-token histogram, explicit per-file listing of verification errors and crashes -- [x] Baseline recorded above at vfmt `9f1a6cf` +- [x] Baseline recorded above at lucisv `9f1a6cf` - [x] Top-10 unsupported constructs mapped against `README.md`'s roadmap, with an explicit verdict on the priority order - [x] Every verification-error file listed individually, grouped by root @@ -395,7 +395,7 @@ aborts. Two caveats for the recursion-limit work in TODO.md §1: common_cells got its real `v1.40.0` tag SHA. OpenTitan was *not* skipped — a blobless partial clone with a cone sparse checkout of `hw/ip/uart` and `hw/ip/gpio` makes it cheap (35 files). -- Built vfmt at `9f1a6cf1d2926358e2a804b33fb4de55bb9f04e7` and ran the +- Built lucisv at `9f1a6cf1d2926358e2a804b33fb4de55bb9f04e7` and ran the check over all 820 files. Verified afterwards that all four corpus working trees are clean. - **Key decision — two histograms.** The first run's message histogram @@ -425,7 +425,7 @@ aborts. Two caveats for the recursion-limit work in TODO.md §1: is where the four groups (A comma→`or`, B dropped comments, C merged header imports, D dropped empty `#()`) come from. - Fixed a real bug in `check_one()` while testing: `status` was a global - that persisted across files when vfmt exited 0 (`|| status=$?` simply + that persisted across files when lucisv exited 0 (`|| status=$?` simply does not fire), so a clean file following an error would have inherited the previous status. Now reset to 0 per call. - Deviation from the task brief: none material. `shellcheck` is not @@ -441,7 +441,7 @@ aborts. Two caveats for the recursion-limit work in TODO.md §1: Scope: `tools/corpus_fetch.sh`, `tools/corpus_check.sh`, this README. Did not touch `crates/` (a concurrent agent has in-flight recursion-limit changes there — `crates/vlog_parser/src/parser.rs`, -`crates/vfmt/tests/cli.rs`, new `crates/vlog_formatter/tests/deep_nesting.rs`; +`crates/lucisv/tests/cli.rs`, new `crates/vlog_formatter/tests/deep_nesting.rs`; left alone, `cargo build --release` only). No commit/push. **Pins and corpus (claim 1) — PASS.** `git -C corpus/ rev-parse @@ -457,7 +457,7 @@ skipping", 0.1s wall, no network hit, corpus untouched — the no-op/ re-runnable claim holds. **Re-run vs. baseline (claim 3) — PASS, zero delta.** Built -`target/release/vfmt` from the current tree (recursion-limit changes +`target/release/lucisv` from the current tree (recursion-limit changes in flight but not yet affecting this corpus) and re-ran `tools/corpus_check.sh corpus`. Result is byte-identical to the recorded baseline and to the pre-existing `corpus-check-results.tsv` @@ -469,7 +469,7 @@ doesn't hit deep expression nesting (README's own caveat under "Findings: crashes"). **Root-cause buckets A–D (claim 4) — PASS, confirmed refusal not -corruption.** Ran `vfmt --check` directly on one file per bucket: +corruption.** Ran `lucisv --check` directly on one file per bucket: `corpus/common_cells/src/sync.sv` (A, comma→`or`), `corpus/ibex/rtl/ibex_alu.sv` (B, `// Comparator OPs` dropped), `corpus/ibex/vendor/lowrisc_ip/ip/prim/fpv/tb/prim_alert_rxtx_tb.sv` @@ -512,7 +512,7 @@ macro call) over the TSV + corpus source: cross-call persistence the work log describes. Confirmed correct. - Exit-code bucketing (claim 2): would-reformat (exit 1) is correctly folded into `formatted = ok + reformat` and reported as "parsed & - formattable", matching vfmt's own frozen 0/1/2 contract in the root + formattable", matching lucisv's own frozen 0/1/2 contract in the root `README.md`. Confirmed by direct tests: missing binary → 2, missing corpus dir → 2, empty corpus (0 files found) → 2, verification-error present → script exit 1, crash present → script exit 1. @@ -522,7 +522,7 @@ macro call) over the TSV + corpus source: script's own exit code goes to 1. Confirmed. - **Gap (not a bug, a documented-but-worth-flagging design choice):** `other-error` does **not** contribute to the script's own exit - code. Reproduced with a chmod-000 file: vfmt exits 2 with + code. Reproduced with a chmod-000 file: lucisv exits 2 with `Permission denied (os error 13)` on stderr (no `parse error:`/`lex error:`/`verification failed` marker), `check_one()` correctly buckets it `other-error`, but `tools/corpus_check.sh`'s own exit diff --git a/docs/features/define-table/README.md b/docs/features/define-table/README.md index 53fc651..05841a7 100644 --- a/docs/features/define-table/README.md +++ b/docs/features/define-table/README.md @@ -17,7 +17,7 @@ defs.svh:12". > "defined as 8 in defs.svh:12" shipped with the server's hover card and was > narrowed to the include graph in M10 (`docs/features/include-nav/README.md`). > The **single-step expansion display** shipped in M14, 2026-08-25: -> `crates/vfmt_server/src/expand.rs` substitutes a call site's arguments into +> `crates/lucisv_server/src/expand.rs` substitutes a call site's arguments into > `Define::body` using `Define::params` exactly as recorded — defaults and all > — and adds an "expands to" section to the card. `defines.rs` is byte-identical > across that round: `params` "as written" and the LRM-literal body @@ -140,7 +140,7 @@ Design notes: - **Conditional compilation is not evaluated.** A `` `define`` inside an `` `ifdef``/`` `else`` is recorded exactly like any other, so both arms of a conditional pair appear in the table. Evaluating conditions needs a - preprocessor and a set of active defines, which vfmt deliberately does not + preprocessor and a set of active defines, which lucisv deliberately does not have; the ordered list plus the `` `undef`` events is the raw material a future position-aware resolver would need. - **One file.** No `` `include`` following, no cross-file merge. That is the @@ -194,12 +194,12 @@ changed, so they are stated here rather than left implicit: "the trimmed line ends in `\`". `defines.rs::continuation_len` mirrors it, trailing-whitespace tolerance included. -**Promised to future consumers (`vfmt_server`, `vlog_semantic`):** the API +**Promised to future consumers (`lucisv_server`, `vlog_semantic`):** the API above. Nothing depends on it yet, so it is free to change; the two things worth not changing casually are the body normalization rule (a hover string is user-visible) and "all definitions are kept". -> **No longer free to change (M14, 2026-08-25).** `vfmt_server`'s +> **No longer free to change (M14, 2026-08-25).** `lucisv_server`'s > `expand.rs` now reads `body` *and* `params` structurally: it splits a > parameter on its first `=` to get the name and the default, and it counts > `params` against the arguments at a call site, declining to expand on a @@ -537,4 +537,4 @@ respectively. With this, TODO §6's data foundations are complete: spans, error-tolerant parsing, define table. Next: `vlog_semantic` + the -workspace index, then `vfmt_server`. +workspace index, then `lucisv_server`. diff --git a/docs/features/directives-in-instances/README.md b/docs/features/directives-in-instances/README.md index 250e453..07c8009 100644 --- a/docs/features/directives-in-instances/README.md +++ b/docs/features/directives-in-instances/README.md @@ -21,7 +21,7 @@ read that README's Assumptions first. The ones specific to this round: lexer reads from `` `ifdef`` to end of line as one token. No corpus file writes it. - **Both arms contribute.** `` `ifdef``/`` `else`` arms are both ordinary - entries of the one list, in source order. vfmt does not evaluate conditions. + entries of the one list, in source order. lucisv does not evaluate conditions. - **A *comment* may share a directive's line, but a comma may not.** The lexer's directive capture stops before a `//` or `/*` (`crates/vlog_parser/src/lexer.rs:182`), so `` `endif // why`` round-trips as @@ -110,8 +110,8 @@ inside the enclosing item's span. `crates/vlog_parser/tests/spans.rs` now walks `inst.param_directives` and each `instance.conn_directives`, and two sources holding them were added to `SOURCES`. -**Not touched, by scope:** `crates/vfmt`, `crates/vfmt_core`, -`crates/vfmt_server`, `crates/vlog_linter`, `crates/vlog_semantic`, +**Not touched, by scope:** `crates/lucisv`, `crates/lucisv_core`, +`crates/lucisv_server`, `crates/vlog_linter`, `crates/vlog_semantic`, `crates/vlog_formatter/src/verify.rs`, `crates/vlog_formatter/src/fence.rs`, `editors/`, `tools/`, `corpus/`. `cargo fmt` was run per-package (`-p vlog_parser -p vlog_formatter`), never `--all`, so it could not rewrite the @@ -236,7 +236,7 @@ loop only continues past a comma — which is why no pre-existing case moved. Three runs, TSVs byte-identical (md5 `0a3dad76ad648af8494dca637dbba52b` each time). Corpus repos verified unmodified afterwards (`git status --porcelain` clean in -all four except the untracked `.vfmt-corpus-rev` stamp). +all four except the untracked `.lucisv-corpus-rev` stamp). The "before" column is **not** the previous round's published table: a second agent's work (`shared-fence-filter`, `server-lint`) landed in this working tree @@ -269,7 +269,7 @@ error.** The six are exactly the six named targets: | `corpus/picorv32/testbench_wb.v` | `parse-error` 110:1 `` `ifndef SYNTH_TEST`` | **would-reformat** | | `corpus/picorv32/scripts/torture/testbench.v` | `parse-error` 41:1 `` `include "config.vh"`` | **would-reformat** | -All six were re-run through `vfmt -` for three passes; every pass exited 0 +All six were re-run through `lucisv -` for three passes; every pass exited 0 (which already means `format_source`'s internal `verify_equivalence` + `verify_convergence` accepted it) and pass1 == pass2 == pass3 byte-for-byte. @@ -315,8 +315,8 @@ bucket. The payoff of this round is six files that format, not a bigger index. README.** `cargo test --workspace` was 568 (not the 563 the brief quotes — a second agent's `server-lint` tests had already landed), and the corpus TSV was md5 `31ffdb18c96d4e79057178f7de269756`, matching the previous round's - published "after". One `vfmt_server` e2e test - (`fix_all_edits_exactly_what_vfmt_check_fix_edits_inside_a_fence`) was + published "after". One `lucisv_server` e2e test + (`fix_all_edits_exactly_what_lucisv_check_fix_edits_inside_a_fence`) was failing mid-session; **verified it fails identically with this feature's three files stashed out**, so it was the other agent's in-flight `shared-fence-filter` work, not mine. It is green again in the final run. @@ -379,7 +379,7 @@ bucket. The payoff of this round is six files that format, not a bigger index. the previous round's — so every one of the 6 gains is attributable here. Ran the final corpus twice; identical md5. All four corpus repos confirmed unmodified. -- **Did not touch** `crates/vfmt`, `crates/vfmt_core`, `crates/vfmt_server`, +- **Did not touch** `crates/lucisv`, `crates/lucisv_core`, `crates/lucisv_server`, `crates/vlog_linter`, `crates/vlog_semantic`, `verify.rs`, `fence.rs`, `tools/`, `corpus/`. Ran `cargo fmt -p vlog_parser -p vlog_formatter`, never `--all`, so the concurrent agent's files could not be rewritten. Re-read @@ -434,7 +434,7 @@ both directions, connection-list-is-only-a-directive `.*` beside a directive, directive + trailing `//` comment, directive + comment before the closing `)` (the fixed bug's exact shape), multi-instance with a directive in one instance's list. All 18 in-scope shapes: pass1 == pass2 -== pass3 byte-for-byte, exit 0/0/0 (three separate `vfmt -` invocations via the +== pass3 byte-for-byte, exit 0/0/0 (three separate `lucisv -` invocations via the debug binary, not just one `--check`). The two out-of-scope shapes (gate instance with a directive between arguments; a directive between two instances of one declaration) both give a clean parse error and never emit output — @@ -447,7 +447,7 @@ directive lines survive formatting *by line number*: read each target at its originally-cited line (`ibex_lockstep.sv:518`, `ibex_top.sv:456`, `spec_instance.sv:65`, `testbench.v:164`, `testbench_wb.v:110`, `torture/testbench.v:41`) and grepped the same directive text in -`vfmt --stdout` output — present verbatim (only re-indented) in all six. +`lucisv --stdout` output — present verbatim (only re-indented) in all six. **Corpus (3).** `tools/corpus_check.sh corpus` release build, run twice: byte-identical TSVs, md5 `0a3dad76ad648af8494dca637dbba52b` both times — diff --git a/docs/features/directives-in-lists/README.md b/docs/features/directives-in-lists/README.md index 800ea05..bea88c4 100644 --- a/docs/features/directives-in-lists/README.md +++ b/docs/features/directives-in-lists/README.md @@ -7,7 +7,7 @@ Accept `` `ifdef``/`` `ifndef``/`` `else``/`` `elsif``/`` `endif``, *between the elements* of a module header's port list, its parameter port list, and an enum member list. They were already accepted wherever a module item or a statement belongs (`macro-items`); a port list was the one place -real RTL writes them that vfmt refused. This is README roadmap item 6, and +real RTL writes them that lucisv refused. This is README roadmap item 6, and its named payoff is the workspace index: `picorv32`, `picorv32_axi` and `picorv32_wb` were the index's biggest named gaps (570 external references) because their headers hold an `` `ifdef`` inside the port list, which swallowed @@ -20,7 +20,7 @@ and `verify.rs` is byte-identical to `HEAD`.** ## Assumptions -- **vfmt does not evaluate the condition, and this feature does not change +- **lucisv does not evaluate the condition, and this feature does not change that.** Both arms of an `` `ifdef``/`` `else`` contribute their elements to the one list, in source order, exactly as an `` `ifdef`` at item position already contributes both arms' items. The formatter is a text tool; a @@ -124,7 +124,7 @@ of which line breaks are data. **Format fences (`docs/features/format-fences/README.md`): unchanged.** `fence::scan_scope` walks item-level leading comments only, so a -`// vfmt: off` written before a list directive opens no region — exactly as it +`// lucisv: off` written before a list directive opens no region — exactly as it opened none when the same comment landed in the first port's `meta.leading`. `fence.rs`, `tests/fences.rs` and `fences.cases` are untouched and green. @@ -142,10 +142,10 @@ directives were added to its `SOURCES` table so `every_node_span_nests_inside_its_parent` and the token-coverage tests cover them. -**Not touched, by scope:** `crates/vfmt`, `crates/vfmt_core`, -`crates/vfmt_server`, `crates/vlog_linter`, `crates/vlog_semantic`, +**Not touched, by scope:** `crates/lucisv`, `crates/lucisv_core`, +`crates/lucisv_server`, `crates/vlog_linter`, `crates/vlog_semantic`, `crates/vlog_formatter/src/verify.rs`, `editors/`, `tools/`, `corpus/`. A -second agent was working in `vfmt_server` and `vlog_linter` concurrently; both +second agent was working in `lucisv_server` and `vlog_linter` concurrently; both crates compile and their tests pass against this diff unmodified. `cargo fmt` was run per-package (`-p vlog_parser -p vlog_formatter`) rather than `--all`, so it could not rewrite the other agent's files. @@ -164,7 +164,7 @@ directions: | `` `ifdef X`` ⏎ `input a` ⏎ `` `else`` ⏎ `input b` ⏎ `` `endif`` | `input a,` ⏎ `` `else`` ⏎ `input b` | a comma invented that the source never wrote | Both are token-stream changes, so both would be *refused* rather than -corrupting — but a file vfmt refuses is a file vfmt cannot format, and the +corrupting — but a file lucisv refuses is a file lucisv cannot format, and the second shape is ordinary RTL. A derivation rule that consults the gap's directives handles the first case and still fails the second, so it was rejected as clever-and-wrong. @@ -278,7 +278,7 @@ group open, and a flat `(a, `ifdef X, b)` would fuse three tokens into one. `./tools/corpus_check.sh corpus`, release build, script exit status **0**. Corpus verified unmodified afterwards (`git status --porcelain` clean in all -four repos except the untracked `.vfmt-corpus-rev` stamp). Two runs, TSVs +four repos except the untracked `.lucisv-corpus-rev` stamp). Two runs, TSVs byte-identical (deterministic). | outcome | before (`3a503e1`, the tree this work started from) | after | @@ -435,8 +435,8 @@ correction, not a loss. format, because of `restrict property`. The brief's stated payoff (the index) is delivered; the formatting half is blocked behind roadmap item 7 and saying otherwise would be a lie the numbers would catch. -- Did not touch `crates/vfmt_server`, `crates/vlog_linter`, - `crates/vlog_semantic`, `crates/vfmt*`, `tools/` or `corpus/`. Ran +- Did not touch `crates/lucisv_server`, `crates/vlog_linter`, + `crates/vlog_semantic`, `crates/lucisv*`, `tools/` or `corpus/`. Ran `cargo fmt -p vlog_parser -p vlog_formatter` rather than `--all` so the concurrent agent's files could not be rewritten. Did not run `git commit`/`git push`. @@ -468,8 +468,8 @@ clean. `git diff --quiet -- crates/vlog_formatter/src/verify.rs`: exit 0 `fences.cases`: all diff-clean. **Cross-crate untouched claim.** `git diff --stat crates/vlog_semantic -crates/vlog_linter crates/vfmt crates/vfmt_core crates/vfmt_server` is empty. -`crates/vfmt_server/` and `crates/vlog_linter/` are untracked (concurrent +crates/vlog_linter crates/lucisv crates/lucisv_core crates/lucisv_server` is empty. +`crates/lucisv_server/` and `crates/vlog_linter/` are untracked (concurrent agent's work per the README) so nothing to diff there either; both compiled and their tests passed as part of the 563. @@ -478,7 +478,7 @@ byte-identical TSVs, md5 `31ffdb18c96d4e79057178f7de269756` both times, exit 0 both times. Table matches exactly: 8 ok-unchanged, 462 would-reformat, 350 parse-error, 0 verification-error, 0 crash, 470/820 formattable. Corpus repos confirmed clean afterwards (`git status ---porcelain` in each of the four, only the untracked `.vfmt-corpus-rev` +--porcelain` in each of the four, only the untracked `.lucisv-corpus-rev` stamp). Spot-checked every by-path claim directly against the TSV and the source files: - `ibex_core.sv` → `would-reformat` ✓; `csmith/testbench.v` → `would-reformat` ✓. @@ -525,7 +525,7 @@ adjacent directives (`` `ifdef``+`` `define``); a `` `define`` with a `\` continuation inside a parameter list; an arm element carrying a trailing comment; an enum with `` `include`` + a macro invocation between members; a non-ANSI header with directives). Ran each through the debug binary via -`vfmt -` for 3 passes (`vfmt(vfmt(vfmt(x)))`); every pass exited 0 (which +`lucisv -` for 3 passes (`lucisv(lucisv(lucisv(x)))`); every pass exited 0 (which already means `format_source`'s internal `verify_equivalence` + `verify_convergence` accepted it — no corruption, no dropped comment/token possible on a 0 exit) and pass2==pass3 byte-for-byte on all 20. Eyeballed 6 @@ -560,7 +560,7 @@ survived, `` `define`` continuation stayed properly dedented/reindented, byte-identical to `run1.tsv`, same md5, corpus repos still clean. **`module m (a, );` still a parse error** — confirmed directly: -`./target/release/vfmt --check` on that exact input exits 2 with +`./target/release/lucisv --check` on that exact input exits 2 with `expected identifier (found ")")`. **Findings (both non-blocking, documentation only):** diff --git a/docs/features/dpi-export/README.md b/docs/features/dpi-export/README.md index 7519c91..3422872 100644 --- a/docs/features/dpi-export/README.md +++ b/docs/features/dpi-export/README.md @@ -164,7 +164,7 @@ of the existing function/task header (`Fmt::dpi_import_prefix`), so a DPI import lays out exactly like the prototype it is: header on one line, argument list a breakable group that goes one-per-line when it does not fit. The multi-line `import "DPI-C"` / `function ...` spelling the ibex DV files use -collapses onto one line, which is what every other multi-line header in vfmt +collapses onto one line, which is what every other multi-line header in lucisv does. Exports print flat. **Safety net.** `verify.rs` was not touched and did not need to be: every one @@ -199,7 +199,7 @@ Targeted attacks: - **`export *::*` → `ImportPath` with package `"*"`.** `package p; export *::*; endpackage` formats unchanged and is idempotent - (`target/release/vfmt --stdout` twice, `cmp` clean). + (`target/release/lucisv --stdout` twice, `cmp` clean). - **`is_prototype` doubling as "DPI import".** No case found where this conflation produces a wrong-but-plausible read; every DPI import/export diff --git a/docs/features/dv-statements/README.md b/docs/features/dv-statements/README.md index dc6ad2e..7d72196 100644 --- a/docs/features/dv-statements/README.md +++ b/docs/features/dv-statements/README.md @@ -52,13 +52,13 @@ its input bytes exactly is trivially token-equivalent. instead of formatting — the same trade every other reserved word makes. - **`with` is a postfix segment only when a `(` or `{` follows it.** That is what tells the two `with` grammars apart, and it is what keeps the stream - expression's `with [range]` — which vfmt does not model — failing exactly + expression's `with [range]` — which lucisv does not model — failing exactly where it always did. - **A `foreach`'s loop variables are the last bracket group**, the one the `)` follows; every earlier bracket is an ordinary select on the array. The LRM spells the multi-dimensional form `foreach (a[i, j])`, and the `foreach (a[i][j])` spelling real code writes is read as "loop over `j` - with `a[i]` as the array". vfmt only prints the header back, so the two + with `a[i]` as the array". lucisv only prints the header back, so the two readings emit the same tokens either way. - **Empty loop-variable slots (`foreach (a[, j])`) are not supported.** No corpus file writes one; it stays the parse error it was. @@ -68,7 +68,7 @@ its input bytes exactly is trivially token-equivalent. - **An omitted list element is recognized wherever a list element is parsed**, not only in call argument lists — the same call `parse_expr_item` already makes for named arguments and `[lo:hi]` value - ranges, for the reason its comment gives: vfmt checks legality nowhere + ranges, for the reason its comment gives: lucisv checks legality nowhere else either, and a wrong guess emits the same tokens. - **An omitted argument in a list that breaks gets a line with nothing but its `,` on it.** `create("x", , y)` when the list fits is one line, which @@ -423,7 +423,7 @@ if (a.randomize() with { z = 1; end ``` -`target/release/vfmt --stdout --line-length 40 with5.sv` keeps the whole +`target/release/lucisv --stdout --line-length 40 with5.sv` keeps the whole ` } && some_really_quite_long_flag_name_that_would_overflow_the_line_length_for_sure) begin` tail on one line (99 characters, well past the 40-column limit requested), where the *same* `if` condition without the `with`-block correctly wraps the diff --git a/docs/features/dynamic-types/README.md b/docs/features/dynamic-types/README.md index fbf92ed..5a02b9f 100644 --- a/docs/features/dynamic-types/README.md +++ b/docs/features/dynamic-types/README.md @@ -45,14 +45,14 @@ calls (`q.push_back(x)`, `q.size()`) are ordinary member calls. - **`$` is an ordinary primary expression, not a keyword.** In real code a bare `$` stands only where a queue bound belongs (`q[$]`, `[$:N]`, - `q[$-1]`), but vfmt does not check legality anywhere else either, and one + `q[$-1]`), but lucisv does not check legality anywhere else either, and one `ExprKind::Ident("$")` leaf makes every position — dims, indexes, ranges, arithmetic — work through the existing expression grammar. This follows the `new`/`this`/`super` precedent from the classes round. The lexer already emits a lone `$` as a one-char Symbol token; nothing lexes differently. - **`{}` is accepted as an empty concatenation** (`ExprKind::Concat(vec![])`) because SystemVerilog's empty queue literal is spelled that way - (`mem_states[$] = {};`). Plain Verilog forbids `{}`; vfmt is a formatter, + (`mem_states[$] = {};`). Plain Verilog forbids `{}`; lucisv is a formatter, not a compiler, and refusing it would keep a real corpus file blocked. - **A named call argument is recognized by `.` + identifier at an expression *element* start.** `parse_expr_item` is shared by call arguments, concats, @@ -63,7 +63,7 @@ calls (`q.push_back(x)`, `q.size()`) are ordinary member calls. labels need and no expression could previously start with. - **`case (x) inside` is the same statement with one extra token.** The `inside` flag is stored on `StmtKind::Case` and printed back; item labels - are the ordinary label list plus `[lo:hi]` ranges. vfmt does not restrict + are the ordinary label list plus `[lo:hi]` ranges. lucisv does not restrict range labels to inside-mode cases — a plain `case` with a `[1:2]:` label is not legal SV but parses; same tokens out, no corruption possible. - **A bare `@name;` (no parens) is printed back without parens.** Before this @@ -163,10 +163,10 @@ loop and label loop were already flat. `ValueRange`/`Bare` reuse existing walker arms; two dynamic-type sources were added to `SOURCES`. -**Not touched, by scope:** `crates/vfmt`, `crates/vfmt_core`, -`crates/vfmt_server`, `crates/vlog_linter`, `verify.rs`, `fence.rs`, +**Not touched, by scope:** `crates/lucisv`, `crates/lucisv_core`, +`crates/lucisv_server`, `crates/vlog_linter`, `verify.rs`, `fence.rs`, `editors/`, `tools/`, `corpus/`. A concurrent agent owns `vlog_linter` / -`vfmt` / `vfmt_server` this round; `cargo fmt` was run per-package +`lucisv` / `lucisv_server` this round; `cargo fmt` was run per-package (`-p vlog_parser -p vlog_formatter -p vlog_semantic`), never `--all`. ## Status / TODO @@ -241,7 +241,7 @@ added to `SOURCES`. build, exit 0. Three runs (two mid-round, one after the final `cargo fmt`): byte-identical TSVs, md5 `e6f12eb7964e22e452655cf517cae766`. All four corpus repos verified unmodified afterwards (`git status --porcelain` clean apart -from the pre-existing untracked `.vfmt-corpus-rev` stamps). +from the pre-existing untracked `.lucisv-corpus-rev` stamps). | metric | before | after | |---|---|---| @@ -371,12 +371,12 @@ assignment-operator fix exposed the named-arg-paren drop in the same file. corpus repos confirmed clean. The `` `else`` 13 and `with` 7 next-blockers were read at their sites and filed under Status/TODO with the evidence. - **Scope discipline:** did not touch `verify.rs`, `fence.rs`, - `crates/vfmt*`, `crates/vlog_linter` (its `visit.rs` needed no arm — it + `crates/lucisv*`, `crates/vlog_linter` (its `visit.rs` needed no arm — it has no expression walk and its `Case` matches use `..`), `tools/`, `corpus/`. The concurrent one-parse-two-tools agent's files churned in the same tree throughout; `cargo fmt` was run per-package (`-p vlog_parser -p vlog_formatter -p vlog_semantic`), never `--all`, and - the one transient `vfmt_server` test failure observed mid-round was + the one transient `lucisv_server` test failure observed mid-round was re-run and confirmed to be their in-flight edit, not this diff. Did not run `git commit` / `git push`. - **Session note:** the session was interrupted by a usage limit mid-way @@ -440,10 +440,10 @@ is uncommitted here too; its files were attributed, not flagged — see `scratchpad/head-wt`, provenance re-verified — `git rev-parse HEAD` = `e9008b680c2df86c7bea6d29095250958c132306`, `git status --porcelain` empty, `cargo build --release` a no-op (binary genuinely fresh at `e9008b6`, md5 -`feaa240d`). "New" binary: this tree's `target/release/vfmt` (md5 `957e2ad6`), +`feaa240d`). "New" binary: this tree's `target/release/lucisv` (md5 `957e2ad6`), also confirmed up to date. `corpus/` never written to; all four corpus repos `git status --porcelain` clean afterwards apart from the pre-existing -untracked `.vfmt-corpus-rev` stamps. +untracked `.lucisv-corpus-rev` stamps. **Claim-by-claim.** @@ -474,7 +474,7 @@ untracked `.vfmt-corpus-rev` stamps. `` `uvm_field_int`` 11, `'` 7, `with` 7, `"DPI-C"` 7, `$error` 6, `virtual` 4, `export` 4. - **Round-trip of all 636**, not sampled: copied to a scratch directory, - `vfmt format` in place (0 failures), then `vfmt --check` (0 failures) — + `lucisv format` in place (0 failures), then `lucisv --check` (0 failures) — every one a verified fixed point. - **Stronger than asked: all 578 previously-formattable files were compared byte-for-byte old-vs-new**, not a 20-file sample. @@ -499,9 +499,9 @@ untracked `.vfmt-corpus-rev` stamps. correct, they hold no expressions), and `ExprKind::NamedArg { value, .. }`. Nothing else in the crate changed. **Attribution:** `crates/vlog_linter/{src/context.rs,src/lib.rs,tests/rules.rs}`, - `crates/vfmt/src/lint.rs`, `crates/vfmt_server/{lint,state}.rs` are the + `crates/lucisv/src/lint.rs`, `crates/lucisv_server/{lint,state}.rs` are the one-parse round's own file list (its README §Handshakes / §Work log), and - `crates/vfmt_server/src/diagnostics.rs` is the lead's QA-1 fix recorded in + `crates/lucisv_server/src/diagnostics.rs` is the lead's QA-1 fix recorded in that round's Review §4. `git diff crates/vlog_linter/` contains **no** dynamic-types symbol (`DimKind`/`NamedArg`/`SensList`/`inside`/ `op_comments`) — this feature really did not touch it. @@ -524,7 +524,7 @@ succeeded, re-parsed by the net's own equivalence + convergence check).** are idempotent. **Illegal positions are accepted and round-trip losslessly**: `assign x = $;`, `x = $ + 1;`, `x = $$;`, `f($, $)`, `logic [$:0] w;` all emit the same tokens back. That is consistent with the documented - Assumption ("vfmt does not check legality anywhere else either") and cannot + Assumption ("lucisv does not check legality anywhere else either") and cannot corrupt. **No identifier collision:** `int $;` is a parse error (`expected identifier (found "$")`), so `$` cannot be declared. `$display`/`$bits(int)`/`$error`/`$time`/`$finish` are byte-unaffected. @@ -538,8 +538,8 @@ succeeded, re-parsed by the net's own equivalence + convergence check).** - *`NamedArg`.* `f(.a(x), .b())`, `.a()` empty, named-in-`$display` (`$display(.fmt("%d"), .v(x))`), scoped callees, and **mixed positional + named in both orders** (`g(x, .b(y))`, `h(.a(x), y)`) all parse — SV forbids - the mix, vfmt accepts it and emits the same tokens, matching the documented - "vfmt is not a legality checker" stance. A nested `k(.a(.b(x)))` is a parse + the mix, lucisv accepts it and emits the same tokens, matching the documented + "lucisv is not a legality checker" stance. A nested `k(.a(.b(x)))` is a parse error (refusal, safe). **Disambiguation holds:** `sub #(.W(8), .D()) u0 (.clk(clk), .d(), .q(q));`, `sub u1 (.*);` and `sub u2 (.a(1), .b);` are byte-identical old-vs-new — instantiation connections still take the @@ -583,9 +583,9 @@ succeeded, re-parsed by the net's own equivalence + convergence check).** `case … inside`, both bare event controls, the macro-then-`cov.` shape, and an `` `ifndef``/`` `endif`` wrapper: **format(format(format(x))) == format(x)**, and all six embedded comments present in the output. -- *Lint path over the new syntax.* `vfmt check` over the probe files runs +- *Lint path over the new syntax.* `lucisv check` over the probe files runs clean and `case-missing-default` correctly fires on `case … inside`. See - QA-7 for the corpus-wide `vfmt check` delta. + QA-7 for the corpus-wide `lucisv check` delta. **Sabotage (each applied, caught, reverted, and the revert proven by `cmp` against a pre-sabotage byte copy).** @@ -681,7 +681,7 @@ failed**. Handshakes promises — including its pre-existing limitation. The shapes that *do* work in a connection also work in a named argument (`.a(x /* post */)`, `.a(/* only */)`, `.a(x // line` ⏎ `)`). -- **QA-7 (INFORMATIONAL — cross-round note for the lead).** `vfmt check +- **QA-7 (INFORMATIONAL — cross-round note for the lead).** `lucisv check corpus` differs from the HEAD binary by **10 lines, net +6 findings** (7921 → 7927), entirely as a consequence of files that now parse: 7 new, correct `case-missing-default` findings on `case … inside` statements, and at @@ -692,7 +692,7 @@ failed**. Handshakes' "Required of `vlog_linter`: nothing" is correct *at the compilation level*. Flagged only because the concurrent one-parse round proved its lint output byte-identical against a tree that did not contain - this round: in the merged tree `vfmt check` output is no longer identical to + this round: in the merged tree `lucisv check` output is no longer identical to `e9008b6`'s, and those 10 lines are why. - **QA-8 (INFORMATIONAL).** A `[lo:hi]` value range is accepted at every expression-element position **except the first call argument**: diff --git a/docs/features/editor-packaging/README.md b/docs/features/editor-packaging/README.md index 807016a..8f0be30 100644 --- a/docs/features/editor-packaging/README.md +++ b/docs/features/editor-packaging/README.md @@ -2,7 +2,7 @@ ## Goal -`vfmt-server` has been a running binary since round 11, but a binary nobody can +`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 @@ -39,7 +39,7 @@ static snippet templates, which LSP has no channel for — see `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 `vfmt.serverPath`. A version handshake would be + `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` @@ -55,11 +55,11 @@ 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/vfmt-server/README.md`). A grammar would be a second, worse highlighter to keep in sync.")* | +| ~~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 `vfmt.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 vfmt-core-lift; lead trued up all three doc locations at review.) | +| 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`. | @@ -69,9 +69,9 @@ the same way: 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/vfmt_server/src/hover.rs:89,131`) and a +`` `define`` expansion (`crates/lucisv_server/src/hover.rs:89,131`) and a completion template's documentation panel -(`crates/vfmt_server/src/completion.rs:423`). All three have always been fenced +(`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. @@ -93,7 +93,7 @@ attached (diffs, git blame, walkthrough panes). `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: vfmt's own lexer has a single `KEYWORDS` +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. @@ -109,7 +109,7 @@ against VS Code's own shipped code rather than assumed. In 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/vfmt_server/tests/grammar.rs` asserts both entries keep +takes both ids. `crates/lucisv_server/tests/grammar.rs` asserts both entries keep naming the same path, so that stays true. ### Pattern inventory @@ -167,7 +167,7 @@ taxonomy here. ### The drift test, and why there is no regex-compile test -`crates/vfmt_server/tests/grammar.rs`, three tests: +`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 @@ -198,7 +198,7 @@ taxonomy here. | 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/vfmt-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`. | +| `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`, @@ -225,12 +225,12 @@ 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/vfmt_server/tests/e2e.rs`: +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 vfmt-server QA log's + 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 @@ -246,11 +246,11 @@ sequence, and is the thing to run when a user reports "nothing happens". ## Handshakes -**Consumed from `vfmt_server`** — and this is the whole interface, exactly as +**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 `vfmt-server`, resolved on `PATH` by default. +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` @@ -273,20 +273,20 @@ binary's name and its stdio contract, nothing else"): `tests/grammar.rs` pins the registration. **Consumed from `vlog_parser`:** `KEYWORDS` — the grammar's keyword alternation -is generated from it and `crates/vfmt_server/tests/grammar.rs` fails if the two +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 `vfmt_server`:** the spawn contract above. If the server ever +**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/vfmt`: lift `config.rs` into a library** (already filed by - `docs/features/vfmt-server/README.md`). Restated because it is now - *user-visible*: formatting from an editor ignores `vfmt.toml`, so a project +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 @@ -300,7 +300,7 @@ grows a required flag, a subcommand, or a stdio mode switch, `extension.js` and ## Status / TODO - [x] `editors/vscode/package.json` — language declarations, activation, - `vfmt.serverPath`, pinned `vscode-languageclient`. + `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, @@ -315,7 +315,7 @@ grows a required flag, a subcommand, or a stdio mode switch, `extension.js` and - [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/vfmt_server/tests/grammar.rs`: keyword drift, +- [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. @@ -338,10 +338,10 @@ grows a required flag, a subcommand, or a stdio mode switch, `extension.js` and 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/vfmt_core` lift - (config + walk out of the `vfmt` binary) landed in the tree *while this - round was being written*, and `crates/vfmt_server` already depends on it. - If that closes the "the server does not read `vfmt.toml`" gap, the caveat +- [ ] **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 @@ -418,7 +418,7 @@ grows a required flag, a subcommand, or a stdio mode switch, `extension.js` and `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/vfmt --version` → `vfmt 0.4.1`. + `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 @@ -432,14 +432,14 @@ grows a required flag, a subcommand, or a stdio mode switch, `extension.js` and |---|---| | `cargo fmt --all --check` | clean | | `cargo clippy --all-targets` | clean, no new warnings, no `#[allow]` added | -| `cargo test --workspace` | **34 test binaries, all green** (`vfmt_server`: 308 unit + 17 e2e + **3 new** grammar) | +| `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/vfmt-server` | `smoke: OK`, 8 messages, exit 0 | -| `target/debug/vfmt --version` | `vfmt 0.4.1` | +| `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 @@ -453,15 +453,15 @@ file **and** a `.v` file, and the Developer Tools console for the absence of an ### 2026-08-19 — dev agent - Read `CLAUDE.md`, `README.md`, TODO.md §6 and - `docs/features/vfmt-server/README.md` (all of it, including the QA log) before + `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 **`vfmt.toml` blindness** are user-visible + **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 - vfmt-server round, so it is restated here with its now-visible user + 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 @@ -502,11 +502,11 @@ file **and** a `.v` file, and the Developer Tools console for the absence of an 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 `vfmt_core` - round landed in the same tree — `crates/vfmt/src/{config,walk}.rs` moved to a - new `crates/vfmt_core`, and `crates/vfmt_server/Cargo.toml` gained a - dependency on it. That is exactly the Handshake `docs/features/vfmt-server` - filed and this feature restated, so the `vfmt.toml` caveat in the three +- **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 @@ -518,8 +518,8 @@ file **and** a `.v` file, and the Developer Tools console for the absence of an | Check | Result | |---|---| -| `cargo build --release -p vfmt_server` | exit 0, `target/release/vfmt-server` | -| `node smoke.js target/release/vfmt-server` | **`smoke: OK` — 3 messages, exit 0** | +| `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`) | @@ -538,7 +538,7 @@ file **and** a `.v` file, and the Developer Tools console for the absence of an 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 `vfmt` attached to the + 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 @@ -553,7 +553,7 @@ file **and** a `.v` file, and the Developer Tools console for the absence of an 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, `vfmt-server` advertises no colour capability, +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 @@ -583,7 +583,7 @@ entry is the only lasting write. | `cargo fmt --all --check` | clean | | `cargo clippy --all-targets` | clean, 0 warnings | | `cargo test --workspace` | all green | -| `cargo test -p vfmt_server` | **308 unit + 17 e2e + 3 grammar**, all passing — matches the claim exactly | +| `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` | @@ -720,23 +720,23 @@ session checked. **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 vfmt_server`, both times "Finished ... in 0.02s" — +(`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/vfmt-server`, 1,996,608 bytes, md5 `ed84f61d8c414e34d840571` +`target/release/lucisv-server`, 1,996,608 bytes, md5 `ed84f61d8c414e34d840571` `f8696191e`, mtime 09:26). This build **includes the concurrent -`vfmt_core` config/walk lift** (`crates/vfmt_core/src/{config,walk}.rs`, -`crates/vfmt_server` depends on it) — see the Finding below. Did not touch +`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 vfmt_core-lift +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 vfmt_server` (x2, bracketing the session) | exit 0 both times, binary unchanged between runs | -| `node smoke.js ../../target/release/vfmt-server` | `smoke: OK` — 3 messages, exit 0 (re-run at session end too) | -| Negative control: `node smoke.js /nonexistent/vfmt-server` | `FAIL — could not spawn ... ENOENT`, exit 1 | +| `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 | @@ -746,25 +746,25 @@ agent was doing its own final gate runs concurrently. | `.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 -`vfmt.toml`-blindness caveat is now false against the tested binary.** -The `vfmt_core` lift landed in the working tree (uncommitted) and -`crates/vfmt_server` already consumes it: `cargo test -p vfmt_server --release +`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_vfmt_toml_governs_the_buffer_it_sits_above`, both asserting `vfmt.toml` +`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 `vfmt.toml` containing +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 -`vfmt.toml` yet" is no longer true of the binary these docs describe. It +`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 -vfmt-server docs owner, not to this QA pass, so I have not edited any of +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 @@ -804,7 +804,7 @@ packaging regression if they hit this same scratchpad-path issue later. `["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 `vfmt.serverPath` default `"vfmt-server"`; + 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 @@ -813,13 +813,13 @@ packaging regression if they hit this same scratchpad-path issue later. `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 `vfmt.getConfiguration('vfmt').get('serverPath')` - with fallback `'vfmt-server'`; `serverOptions = {command, args: [], + `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('vfmt', 'vfmt', serverOptions, + 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 @@ -828,11 +828,11 @@ packaging regression if they hit this same scratchpad-path issue later. 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 `vfmt` output channel regardless of + 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 vfmt channel"); the README could + 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 @@ -841,7 +841,7 @@ packaging regression if they hit this same scratchpad-path issue later. 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 - `vfmt.toml`/`.vfmt.toml`/`.git` consistent across all four; the + `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` @@ -866,7 +866,7 @@ packaging regression if they hit this same scratchpad-path issue later. 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 `vfmt.toml` caveat, now confirmed +**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 @@ -900,10 +900,10 @@ Points reviewed and accepted: 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 vfmt.toml" caveat went - stale mid-round when vfmt-core-lift landed under it) was the lead's +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 - vfmt-server README's superseded Assumptions. Finding 2 (vsce's path + 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. diff --git a/docs/features/editor-scopes/README.md b/docs/features/editor-scopes/README.md index 37b8029..b9f494e 100644 --- a/docs/features/editor-scopes/README.md +++ b/docs/features/editor-scopes/README.md @@ -4,13 +4,13 @@ Three of the owner's five editor requests are the same question asked three ways — *which `end` belongs to this `begin`?* — so they get one answer: -`crates/vfmt_server/src/pairs.rs`, a stack matcher over the token stream the +`crates/lucisv_server/src/pairs.rs`, a stack matcher over the token stream the document already caches. On top of it sit three consumers: `textDocument/documentHighlight`, so the cursor on a `begin` highlights its own `end` (real matching, not a text search for the word), and a **missing-closer warning** that points at the `begin` which lost its `end` instead of leaving the user with one parse error at the bottom of the file. The -third consumer is the extension's rainbow: `vfmt/scopePairs` hands the client +third consumer is the extension's rainbow: `lucisv/scopePairs` hands the client every `begin`/`end` and `fork`/`join*` pair with its nesting depth — plus every block delimiter still waiting for its partner — and `extension.js` paints each depth in one of six colours the extension contributes itself, and each lonely @@ -69,13 +69,13 @@ keyword in an error red. colour bright red for error in syntax, but don't just hide them."* That rules out borrowing a theme colour whose default is `#00000000`, which is what 0.3.1 fixed, and it is why an unmatched keyword is painted rather than left - alone. A user or a theme may still override a `vfmt.rainbow*` id with + alone. A user or a theme may still override a `lucisv.rainbow*` id with anything they like — including transparent — and that is their decision, not a default of ours. - **Analysis is cheap enough to redo per request, and that now rests on `analyze` being linear rather than on real files being shallow.** `analyze` is one pass over the token vector with a small stack, so nothing is cached - and no invalidation rule can go stale. Measured, because `vfmt/scopePairs` + and no invalidation rule can go stale. Measured, because `lucisv/scopePairs` arrives on a debounce timer rather than on a user gesture: sweeping the corpus, the worst single `scope_pairs` call is **2.1 ms** (`picorv32.v`, the largest file), against a 250 ms debounce. Until 2026-08-25 the *shape* of the @@ -125,7 +125,7 @@ JSON `null` — deliberately not an empty array, because an empty array tells th editor there are no occurrences anywhere and suppresses its own word highlighting. -**Promised to `extension.js` — the `vfmt/scopePairs` wire shape.** This is the +**Promised to `extension.js` — the `lucisv/scopePairs` wire shape.** This is the contract; `the_scope_pairs_wire_shape_is_what_the_extension_reads` pins it as literal JSON so it cannot drift silently. @@ -133,7 +133,7 @@ Request — a custom method, so nothing advertises it and a client that does not know it simply never asks: ```json -{ "method": "vfmt/scopePairs", "params": { "textDocument": { "uri": "file:///…" } } } +{ "method": "lucisv/scopePairs", "params": { "textDocument": { "uri": "file:///…" } } } ``` Result: @@ -179,7 +179,7 @@ Result: Ordering is by opener position, though the extension does not depend on it. **Promised to `package.json` — the colour ids.** The extension contributes -`vfmt.rainbow1` … `vfmt.rainbow6` and `vfmt.rainbowUnmatched` under +`lucisv.rainbow1` … `lucisv.rainbow6` and `lucisv.rainbowUnmatched` under `contributes.colors`, and `extension.js` builds one `TextEditorDecorationType` per id. Renaming an id in either file without the other silently paints nothing: an unknown `ThemeColor` is not an error, it is simply no colour. See @@ -207,7 +207,7 @@ a construct with no closer: | `covergroup cg with function sample(...);` | the covergroup's sample method; `endgroup` closes the lot | **Request to the lead (outside this feature's scope):** -`docs/features/vfmt-server/README.md` carries the server's capability list and +`docs/features/lucisv-server/README.md` carries the server's capability list and `TODO.md` §6 carries the shipped/not-shipped list; both now understate the server by one capability (`textDocument/documentHighlight`) and one diagnostic source. Neither file belongs to this feature, so neither was touched. @@ -263,20 +263,20 @@ design: it is not an error, it is just no paint. So the extension contributes its own ids with `contributes.colors`, each with a default for `dark`, `light`, `highContrast` and `highContrastLight`. A theme -that knows nothing about vfmt gets our default; a theme or a -`workbench.colorCustomizations` entry that names `vfmt.rainbowN` still wins, +that knows nothing about lucisv gets our default; a theme or a +`workbench.colorCustomizations` entry that names `lucisv.rainbowN` still wins, which is the override story the borrowed ids gave us and the only thing worth keeping about them. | Id | Dark | Light | Why | |---|---|---|---| -| `vfmt.rainbow1` | `#FFD700` gold | `#0431FA` blue | VS Code's own level-1 bracket colours, both themes | -| `vfmt.rainbow2` | `#DA70D6` orchid | `#319331` green | VS Code's own level 2 | -| `vfmt.rainbow3` | `#179FFF` blue (`#87CEFA` on HC dark) | `#7B3814` brown | VS Code's own level 3, HC variant included | -| `vfmt.rainbow4` | `#87D96B` green | `#0E7490` teal | first free hue in each theme; ~11:1 on `#1E1E1E`, ~5.2:1 on white | -| `vfmt.rainbow5` | `#FF8C69` salmon | `#6D28D9` violet | warm against the dark greens/golds, cool against the light greens/browns | -| `vfmt.rainbow6` | `#4FD6D6` cyan | `#BE185D` magenta | closes the wheel without repeating 1–3 in either theme | -| `vfmt.rainbowUnmatched` | `#FF1212` red | `#B30000` dark red (`#A80000` HC light) | the error state, and the one colour that must read as *wrong* | +| `lucisv.rainbow1` | `#FFD700` gold | `#0431FA` blue | VS Code's own level-1 bracket colours, both themes | +| `lucisv.rainbow2` | `#DA70D6` orchid | `#319331` green | VS Code's own level 2 | +| `lucisv.rainbow3` | `#179FFF` blue (`#87CEFA` on HC dark) | `#7B3814` brown | VS Code's own level 3, HC variant included | +| `lucisv.rainbow4` | `#87D96B` green | `#0E7490` teal | first free hue in each theme; ~11:1 on `#1E1E1E`, ~5.2:1 on white | +| `lucisv.rainbow5` | `#FF8C69` salmon | `#6D28D9` violet | warm against the dark greens/golds, cool against the light greens/browns | +| `lucisv.rainbow6` | `#4FD6D6` cyan | `#BE185D` magenta | closes the wheel without repeating 1–3 in either theme | +| `lucisv.rainbowUnmatched` | `#FF1212` red | `#B30000` dark red (`#A80000` HC light) | the error state, and the one colour that must read as *wrong* | Two things about that table are decisions rather than transcription: @@ -311,21 +311,21 @@ saturated pure red, and only ever on screen while a block is half-typed. failed, capped at 20. - [x] e2e coverage over the wire (`tests/e2e.rs`). - [x] Corpus sweep for false positives (found one class; fixed). -- [x] `vfmt/scopePairs` in `server.rs` + `pairs::scope_pairs`, wire shape +- [x] `lucisv/scopePairs` in `server.rs` + `pairs::scope_pairs`, wire shape pinned by a literal-JSON test. - [x] The rainbow in `extension.js`: six theme decoration types, `depth % 6`, repaint on active-editor / visible-editors / document change (250 ms debounce), stale-answer guard. -- [x] `vfmt.rainbowBeginEnd` (default true), honoured live by a +- [x] `lucisv.rainbowBeginEnd` (default true), honoured live by a configuration-change listener. -- [x] `smoke.js` drives `vfmt/scopePairs` against a nested-begin + fork +- [x] `smoke.js` drives `lucisv/scopePairs` against a nested-begin + fork fixture and asserts the depths. - [x] **M5:** wire `depth` counts only enclosing rainbow pairs, so a scope the rainbow hides cannot shift the colour of one it shows. - [x] **0.3.1:** the rainbow's colours are the extension's own - (`vfmt.rainbow1..6`), opaque in every theme kind — `foreground4..6` + (`lucisv.rainbow1..6`), opaque in every theme kind — `foreground4..6` default to transparent and were painting depths 3–5 invisible. -- [x] **0.3.1:** `unmatched` on the wire, painted `vfmt.rainbowUnmatched`, so a +- [x] **0.3.1:** `unmatched` on the wire, painted `lucisv.rainbowUnmatched`, so a half-typed `begin` is bright red rather than uncoloured. - [x] **2026-08-25:** `analyze` is linear in nesting depth. Both quadratic scans — the depth scan at every push and the whole-stack search for a @@ -423,14 +423,14 @@ reading the LRM would not have caught it, running the corpus did. One guard declared, capability test extended. `server.rs`: one arm in the request match. `diagnostics.rs`: one line in `all()`, between the parse errors and the lint warnings, with the reason in the doc comment. Nothing else in the crate moved, -and no file outside `crates/vfmt_server/` was touched. +and no file outside `crates/lucisv_server/` was touched. -**Tests.** `cargo test -p vfmt_server`: 162 unit (was 130) + 7 e2e (was 6), all +**Tests.** `cargo test -p lucisv_server`: 162 unit (was 130) + 7 e2e (was 6), all green. Full workspace: 937 passed, 0 failed. `cargo fmt --all` clean, `cargo clippy --all-targets` clean. The one `#[allow]` in the new code is on `Pair::depth`, with a comment naming the milestone that removes it. -### 2026-08-24 — M3: `vfmt/scopePairs` and the extension's rainbow +### 2026-08-24 — M3: `lucisv/scopePairs` and the extension's rainbow **Server.** `Pair` gained a `keyword` field (the opener as written) so a consumer can take a subset without the engine having to know about subsets; @@ -466,7 +466,7 @@ through an `lsp_types::request` type because the method is ours. whatever the user's theme already uses for brackets — no colours invented here, nothing to clash. Repaint on active-editor change, visible-editors change (splits, tab drags) and document change on a 250 ms debounce. Turning -`vfmt.rainbowBeginEnd` off repaints with empty range lists, which is how a +`lucisv.rainbowBeginEnd` off repaints with empty range lists, which is how a decoration type is removed — so "off" takes effect immediately in both directions rather than "after a reload". Closing an editor needs no handler: VS Code disposes its decorations with it, and the types themselves are in @@ -489,7 +489,7 @@ Otherwise the milestone is as specified. **Verification.** `cargo fmt --all` clean, `cargo clippy --all-targets` clean (0 diagnostics), `cargo test --workspace` **944 passed, 0 failed** (168 unit in -this crate, up from 162; 7 e2e). `node smoke.js ../../target/debug/vfmt-server` +this crate, up from 162; 7 e2e). `node smoke.js ../../target/debug/lucisv-server` against a freshly built binary: OK. The smoke assertion was mutation-checked — changing the expected depths to `[9,9,9]` fails with `got [1,2,1]`, so it is live rather than vacuous. `npx @vscode/vsce ls` still @@ -580,7 +580,7 @@ not rescan. Mutation-checked (expecting 4 fails with `left: 3`). **Verification.** `cargo fmt --all` clean, `cargo clippy --all-targets` clean, `cargo test --workspace` green, `node smoke.js` against a freshly built -`target/debug/vfmt-server` OK. +`target/debug/lucisv-server` OK. ### 2026-08-24 — 0.3.1: the rainbow was painting with transparent colours @@ -590,7 +590,7 @@ and pressing Enter at line 34 made *both* that `begin` and the `end` below it colours. **Root cause, confirmed against the running server.** The server was right: its -`vfmt/scopePairs` answer put the new pair at depth 3, with correct ranges. The +`lucisv/scopePairs` answer put the new pair at depth 3, with correct ranges. The extension was wrong. It painted depth `d` with `ThemeColor('editorBracketHighlight.foreground' + (d % 6 + 1))`, and VS Code's colour registry gives visible defaults to only `foreground1..3`; `4`, `5` and @@ -607,7 +607,7 @@ downward, which moved a lot of real code from the safe 0–2 band into 3–5. **The fix, three parts.** 1. **Our own colours.** `contributes.colors` in `package.json` declares - `vfmt.rainbow1..6` and `vfmt.rainbowUnmatched`, each with a default for + `lucisv.rainbow1..6` and `lucisv.rainbowUnmatched`, each with a default for `dark`, `light`, `highContrast` and `highContrastLight`, and none of them transparent. `extension.js` builds its decoration types from those ids. The values and the reasoning are in *The palette* above; the short version is @@ -617,7 +617,7 @@ downward, which moved a lot of real code from the safe 0–2 band into 3–5. 2. **`unmatched` on the wire.** `ScopePairs` gained `unmatched: Vec` — the block delimiters `analyze` already knew were partnerless, filtered by the same `RAINBOW_KEYWORDS` as `pairs` and sorted - by position — and `extension.js` paints them `vfmt.rainbowUnmatched`. This + by position — and `extension.js` paints them `lucisv.rainbowUnmatched`. This is the owner's rule applied to the state that started it all: a `begin` you have just typed has no `end` yet, so it has no depth and no rainbow colour, and *"you can make their colour bright red for error in syntax, but don't @@ -635,8 +635,8 @@ interaction directly: in three nested `begin`s missing one `end`, the two that do close still report depths `[1, 2]`, because an unmatched frame is still an enclosing scope while it sits on the stack. -**Tests.** `vfmt_server`: **285 unit** (was 279; six new, all in the -`vfmt/scopePairs` section) and **16 e2e**. New unit tests: an opener that never +**Tests.** `lucisv_server`: **285 unit** (was 279; six new, all in the +`lucisv/scopePairs` section) and **16 e2e**. New unit tests: an opener that never closes is reported; a closer that opens nothing is reported; a balanced file reports nothing; a keyword is never both paired and unmatched (three pairs, one stray `end`, one unclosed `fork`, no range on both lists); `unmatched` carries @@ -670,7 +670,7 @@ reverted, md5 identical (`0ff5e46f51b9c7f2079d899104776ddb`). not mention: without it a high-contrast *light* theme falls back to the ordinary light value, which happens to be fine here, but stating all four is one line each and leaves nothing to inference. -- `vfmt.rainbowBeginEnd`'s description in `package.json` and the "Rainbow +- `lucisv.rainbowBeginEnd`'s description in `package.json` and the "Rainbow begin/end" section of `editors/vscode/README.md` both said the colours come from the theme's bracket palette. Both are now accurate and document the override recipe; they are this feature's own user-facing text, so they were @@ -680,13 +680,13 @@ reverted, md5 identical (`0ff5e46f51b9c7f2079d899104776ddb`). `cargo check --workspace`), `editors/vscode/package.json`, `editors/vscode/package-lock.json` (both places), plus the illustrative version strings in `tools/RELEASING.md` and `README.md`'s install example — the -same set M5 touched for 0.3.0. `target/debug/vfmt --version` → `vfmt 0.3.1`. +same set M5 touched for 0.3.0. `target/debug/lucisv --version` → `lucisv 0.3.1`. `CHANGELOG.md` has a `0.3.1 — 2026-08-24` section in the changelog's voice. **Verification.** `cargo fmt --all -- --check` clean; `cargo clippy --workspace --all-targets` **0 warnings**; `cargo test --workspace` **1268 passed, 0 failed**; `node --check` on `extension.js` and `smoke.js` clean; `node smoke.js -../../target/debug/vfmt-server` **OK** against a freshly built binary; +../../target/debug/lucisv-server` **OK** against a freshly built binary; `npx @vscode/vsce ls` still accepts the manifest with the new `contributes.colors` block. No new dependencies, no `unwrap`/`expect`/`panic!` outside `#[cfg(test)]`, no `#[allow]` added, and `TODO.md` and @@ -793,7 +793,7 @@ version of each. two did not cover a leaked `per_rule` count. **Mutation check** — five deliberate breakages, each run against the full -`vfmt_server` suite and then reverted (`pairs.rs` restored from a copy and +`lucisv_server` suite and then reverted (`pairs.rs` restored from a copy and `diff`-verified byte-identical after each): | mutation | caught by | @@ -807,7 +807,7 @@ version of each. The first row is the point of test 1, and the third row is why test 2 grew a third shape rather than staying at two. -**Scope.** Only `crates/vfmt_server/src/pairs.rs` and this README were touched; +**Scope.** Only `crates/lucisv_server/src/pairs.rs` and this README were touched; `inline.rs` and `docs/features/inline-templates/` were not. No new dependencies, no `unsafe`, no `unwrap`/`expect`/`panic!` outside `#[cfg(test)]`, no `#[allow]` added. `TODO.md` was not touched — this fixes a defect inside an @@ -816,7 +816,7 @@ went in this feature's own Status/TODO instead. **Verification.** `cargo fmt --all -- --check` clean; `cargo clippy --all-targets --workspace` **0 warnings**; `cargo test --workspace` **1616 -passed, 0 failed, 4 ignored** (was 1614 — the two new tests). `vfmt_server` +passed, 0 failed, 4 ignored** (was 1614 — the two new tests). `lucisv_server` alone: 533 unit + 29 e2e + 3 grammar, all green. ## QA log @@ -830,7 +830,7 @@ scope this round). Verdict: **PASS**, no blocking findings. the guard table in *Handshakes* above; ran the dev's own 162 unit + 7 e2e tests; then attacked with two throwaway additions to `pairs.rs`'s own `#[cfg(test)] mod tests` (same crate access as the real code, since -`vfmt_server` is bin-only and has no lib target for an external test to link +`lucisv_server` is bin-only and has no lib target for an external test to link against) — run, read, and **removed before this log was written**; nothing below is in the committed tree. @@ -871,7 +871,7 @@ produce a wrong warning. Filed as an FYI for whoever next touches the one of the two the dev's guard table doesn't already list — worth a line if the table is touched again, not worth blocking on.) -**4. `crates/vfmt_server/src/server.rs:109-121`** (`DocumentHighlightRequest` +**4. `crates/lucisv_server/src/server.rs:109-121`** (`DocumentHighlightRequest` handler): `self.offset(&uri, position)` internally calls `self.workspace.document(&uri)`, and the closure passed to `.and_then` calls `self.workspace.document(&uri)` a second time. Harmless — `Document::new` @@ -882,13 +882,13 @@ Non-blocking style nit, left as-is per "you verify, you don't redesign." **5. Invariants.** - `cargo test --workspace`: every crate green, 0 failures (162 unit + 7 e2e in - `vfmt_server` alone, matching the Work log's count exactly). + `lucisv_server` alone, matching the Work log's count exactly). - `cargo fmt --all -- --check`: clean. - `cargo clippy --all-targets --workspace`: clean, no warnings. - `git diff --stat` (working tree vs `HEAD`): only - `crates/vfmt_server/{diagnostics,main,server}.rs` and - `crates/vfmt_server/tests/e2e.rs`, plus the untracked new - `crates/vfmt_server/src/pairs.rs` and `docs/features/editor-scopes/`. No + `crates/lucisv_server/{diagnostics,main,server}.rs` and + `crates/lucisv_server/tests/e2e.rs`, plus the untracked new + `crates/lucisv_server/src/pairs.rs` and `docs/features/editor-scopes/`. No formatter, `verify.rs`, or `vlog_parser` files touched, confirmed by listing (`git status`) as well as the stat diff. - No `unwrap()`/`expect()`/`panic!` in `pairs.rs`, `server.rs`, or @@ -902,7 +902,7 @@ recorded above (a pre-existing `vlog_parser` grammar gap unrelated to this feature, and a redundant-but-harmless double document lookup in `server.rs`). -### 2026-08-24 — QA round 2 (M3): `vfmt/scopePairs` and the extension rainbow +### 2026-08-24 — QA round 2 (M3): `lucisv/scopePairs` and the extension rainbow Charter items 1, 4, 5 (repeat, unregressed) and 6 from `editor_features_plan.md` for this dispatch: the wire shape, `scope_pairs` correctness, `extension.js` @@ -911,9 +911,9 @@ review, `smoke.js`, invariants, and an M1/M2 unregression spot-check. Item 2 re-audited except where M3 touched shared code (it did not — `Pair::keyword` is additive). Verdict: **PASS**, no blocking findings. -**1. Wire shape.** Ran `cargo test -p vfmt_server`: 168 unit + 7 e2e, all +**1. Wire shape.** Ran `cargo test -p lucisv_server`: 168 unit + 7 e2e, all green. Read `the_scope_pairs_wire_shape_is_what_the_extension_reads` -(`crates/vfmt_server/src/pairs.rs:915`) — it pins the full response as literal +(`crates/lucisv_server/src/pairs.rs:915`) — it pins the full response as literal JSON (`open`/`close` LSP `Range`s over the keyword, `depth`), matching the Handshakes section word for word. Confirmed each documented property against its own test, not just the pinned one: @@ -935,8 +935,8 @@ its own test, not just the pinned one: - Unopened doc → `null`: no dedicated unit test exists for this specific handler (matches the pattern for every sibling handler in `server.rs` — none of them have one either, so this is not an M3-specific gap). Verified - directly against the built binary instead: spawned `vfmt-server`, sent - `vfmt/scopePairs` for a URI never opened via `didOpen`, got back + directly against the built binary instead: spawned `lucisv-server`, sent + `lucisv/scopePairs` for a URI never opened via `didOpen`, got back `{"jsonrpc":"2.0","id":2,"result":null}` with no error. Matches `server.rs:165-170`. @@ -986,8 +986,8 @@ against the round-2 charter's specific worry list: No defects found in `extension.js`. -**4. `smoke.js`.** Built `target/debug/vfmt-server` fresh (`cargo build -p -vfmt_server`), ran `node smoke.js ../../target/debug/vfmt-server` from +**4. `smoke.js`.** Built `target/debug/lucisv-server` fresh (`cargo build -p +lucisv_server`), ran `node smoke.js ../../target/debug/lucisv-server` from `editors/vscode/`: **OK**. Mutation check: changed the expected depths assertion from `[1, 2, 1]` to `[9, 9, 9]`, reran — failed as expected (`expected depths [1,2,1] ..., got [1,2,1]`, exit code 1), then reverted; @@ -997,15 +997,15 @@ was. `node --check` on both `extension.js` and `smoke.js`: clean. **5. Invariants.** - `cargo test --workspace`: 944 passed, 0 failed (168 unit + 7 e2e in - `vfmt_server`, matching the Work Log's count). + `lucisv_server`, matching the Work Log's count). - `cargo fmt --all -- --check`: clean. - `cargo clippy --all-targets`: clean, no warnings. -- `git diff --stat` vs `HEAD`: `crates/vfmt_server/{pairs,server}.rs`, - `crates/vfmt_server/tests/e2e.rs`, `docs/features/editor-scopes/README.md`, +- `git diff --stat` vs `HEAD`: `crates/lucisv_server/{pairs,server}.rs`, + `crates/lucisv_server/tests/e2e.rs`, `docs/features/editor-scopes/README.md`, `editors/vscode/{README.md,extension.js,package.json,smoke.js}`. No `vlog_formatter`/`vlog_parser`/`verify.rs` paths touched. - `node -e "JSON.parse(...)"` on `editors/vscode/package.json`: valid; the new - `vfmt.rainbowBeginEnd` setting and the M1 `contributes.snippets` block are + `lucisv.rainbowBeginEnd` setting and the M1 `contributes.snippets` block are both present and unchanged in shape. `npx @vscode/vsce ls` accepts the manifest and lists `package.json`, `extension.js`, `README.md`, `snippets/verilog.json`, `snippets/systemverilog.json` — no error. @@ -1014,13 +1014,13 @@ was. `node --check` on both `extension.js` and `smoke.js`: clean. `pairs.rs` — the dev's removal of the `Pair::depth` `#[allow(dead_code)]` is confirmed; nothing new was added in its place. -**6. M1/M2 unregression spot-check.** `cargo test -p vfmt_server` (168 unit) +**6. M1/M2 unregression spot-check.** `cargo test -p lucisv_server` (168 unit) includes the full M1 snippet-adjacent and M2 `pairs.rs`/`documentHighlight`/ missing-end suites from round 1, all still passing; `package.json`'s `contributes.snippets` block is byte-identical to what round 1 saw (verified by reading it directly, not diffed against round 1 since M1 was committed before this dispatch). No M2 test was touched by this diff except the two -lines the e2e test needed to add a `vfmt/scopePairs` frame after the existing +lines the e2e test needed to add a `lucisv/scopePairs` frame after the existing `documentHighlight` assertions. **Verdict: PASS.** No blocking findings, no non-blocking findings either — @@ -1034,7 +1034,7 @@ a gap specific to this work. Charter: `editor_features_plan.md`'s M5 section (the user-reported "invisible begin/end" bug fix) plus the M4 exclude-republish gap the lead accepted last round. Scope: uncommitted working tree only, diff vs `9a3a92c` — -`crates/vfmt_server/src/pairs.rs`, `crates/vfmt_server/tests/e2e.rs`, +`crates/lucisv_server/src/pairs.rs`, `crates/lucisv_server/tests/e2e.rs`, `editors/vscode/smoke.js`, `docs/features/editor-scopes/README.md`. Verdict: **PASS**, one non-blocking finding (item 2 below). @@ -1059,7 +1059,7 @@ the reported-bug fixture. Added four throwaway tests, all passed: (`docs/features/editor-scopes/README.md:415`, the `no_hidden_scope_...` case list) — the dev's own `generate` case is an *if*-generate with a single anonymous `begin` (`no_hidden_scope_counts_toward_the_depth`, - `crates/vfmt_server/src/pairs.rs:944`), which never exercises a *second* + `crates/lucisv_server/src/pairs.rs:944`), which never exercises a *second* begin nested inside a named generate-for block. No inconsistency between the dev's tests and the README, though: the depth logic is opener-keyword- based, not context-based, so a generate-for's named begin behaves @@ -1079,7 +1079,7 @@ times). claims. Non-blocking, filed as a finding rather than fixed directly** (it would mean rewriting the test's structure, past "small unambiguous fix"). `the_depth_counter_and_the_wire_filter_read_the_same_list` -(`crates/vfmt_server/src/pairs.rs:978-994`) has two parts: a loop over `RULES` +(`crates/lucisv_server/src/pairs.rs:978-994`) has two parts: a loop over `RULES` comparing `is_rainbow(rule.open)` against `RAINBOW_KEYWORDS.contains(&rule.open)` — which is **tautological**, since `is_rainbow` is defined as exactly that `.contains` call (`pairs.rs:74-76`); the loop can never fail regardless of @@ -1130,7 +1130,7 @@ that has ever caught anything. **3. Mutation-check the core depth line.** Reverted `stack.iter().filter(|f| is_rainbow(f.rule.open)).count()` (`pairs.rs:157`) -to `stack.len() as u32`. `cargo test -p vfmt_server` (unit): **exactly six** +to `stack.len() as u32`. `cargo test -p lucisv_server` (unit): **exactly six** failures, all depth assertions, names matching the dev's Work Log list exactly (`a_module_with_nested_begins_matches_every_pair`, `a_scope_the_rainbow_hides_does_not_shift_the_colour_of_one_it_shows`, @@ -1150,7 +1150,7 @@ that line. Reverted; `pairs.rs` `md5` confirmed unchanged. **4. M4 gap closure — the republish assertion.** `a_pushed_exclude_rebuilds_the_index_mid_session` -(`crates/vfmt_server/tests/e2e.rs`) passes as committed. Mutation-checked the +(`crates/lucisv_server/tests/e2e.rs`) passes as committed. Mutation-checked the new count: changed `assert_eq!(publishes, 3, ...)` to `4` (`tests/e2e.rs:766`) — failed as expected (`left: 3, right: 4`); reverted, `md5` confirmed unchanged (`ce62cbe2d094214d0e132cda9c252507` before and @@ -1168,8 +1168,8 @@ log. `pairs.rs` `md5` confirmed `975e8a4a80530309841415bd403cc71d` after removal, matching its state before the sweep test was added. **6. `smoke.js` and invariants.** -- Built `target/debug/vfmt-server` fresh (`cargo build -p vfmt_server`), ran - `node smoke.js ../../target/debug/vfmt-server`: **OK**. Mutation check: +- Built `target/debug/lucisv-server` fresh (`cargo build -p lucisv_server`), ran + `node smoke.js ../../target/debug/lucisv-server`: **OK**. Mutation check: changed the expected-depths literal from `[0, 1, 0]` to `[9, 9, 9]`, reran — failed as expected (`smoke: FAIL — expected depths [0,1,0] ..., got [0,1,0]`, exit code 1 confirmed separately from the pipeline's own exit @@ -1177,14 +1177,14 @@ removal, matching its state before the sweep test was added. (`2092dbb2331bd040932f3ccb76246398`). - `node --check` on both `smoke.js` and `extension.js`: clean. - `cargo test --workspace`: every crate green (194 unit + 9 e2e in - `vfmt_server`, matching the Work Log's count), 0 failures, both before any + `lucisv_server`, matching the Work Log's count), 0 failures, both before any mutation and again after every mutation was reverted. - `cargo fmt --all -- --check`: clean. `cargo clippy --workspace --all-targets`: clean, no warnings (re-checked after touching the two Rust files to defeat incremental-build caching). - `git diff --stat` vs `HEAD` (`9a3a92c`): exactly the four files in the - charter, same shape as at dispatch — `crates/vfmt_server/src/pairs.rs`, - `crates/vfmt_server/tests/e2e.rs`, `docs/features/editor-scopes/README.md`, + charter, same shape as at dispatch — `crates/lucisv_server/src/pairs.rs`, + `crates/lucisv_server/tests/e2e.rs`, `docs/features/editor-scopes/README.md`, `editors/vscode/smoke.js`. No `vlog_formatter`/`vlog_parser`/`verify.rs` path touched. - No `unwrap()`/`expect()`/`panic!` added outside `#[cfg(test)]` in the diff @@ -1204,7 +1204,7 @@ Charter: the owner-confirmed root cause (transparent `foreground4..6` defaults) and its fix — the extension's own opaque colour ids, `unmatched` on the wire, and the defensive reads in `paint`. Scope: uncommitted working tree, diff vs `HEAD` (`d8e3708`) — `CHANGELOG.md`, `Cargo.toml`, `Cargo.lock`, -`README.md`, `crates/vfmt_server/src/pairs.rs`, `crates/vfmt_server/tests/e2e.rs`, +`README.md`, `crates/lucisv_server/src/pairs.rs`, `crates/lucisv_server/tests/e2e.rs`, `docs/features/editor-scopes/README.md`, `editors/vscode/{README.md, extension.js, package-lock.json, package.json, smoke.js}`, `tools/RELEASING.md`. Verdict: **ship-after-fixes** — one fix applied directly (below), one @@ -1220,10 +1220,10 @@ describes. **1. Gates.** `cargo fmt --all -- --check`: clean. `cargo clippy --workspace --all-targets`: clean, 0 warnings. `cargo test --workspace`: **1268 passed, 0 failed** — summed the per-crate `test result:` lines independently rather than -trusting the dev's total; `vfmt_server` alone is **285 unit + 16 e2e**, an +trusting the dev's total; `lucisv_server` alone is **285 unit + 16 e2e**, an exact match to the Work Log. `node --check` on `extension.js` and `smoke.js`: -both clean. `node smoke.js ../../target/debug/vfmt-server` against a freshly -built (`cargo build -p vfmt_server`) binary: **OK**. +both clean. `node smoke.js ../../target/debug/lucisv-server` against a freshly +built (`cargo build -p lucisv_server`) binary: **OK**. **2. The real user scenario, end to end.** Drove the built debug server over stdio (a hand-rolled probe mirroring `smoke.js`'s framing, since the crate @@ -1255,9 +1255,9 @@ Findings, both exactly as claimed: that is genuinely alone rather than the one a naive "most recently typed" guess would name. -**3. Colour-id audit, programmatic.** Extracted every `vfmt.rainbow*` id -`extension.js` references (`vfmt.rainbow${index + 1}` for `index` 0–5, plus -the literal `vfmt.rainbowUnmatched`) and diffed against `package.json`'s +**3. Colour-id audit, programmatic.** Extracted every `lucisv.rainbow*` id +`extension.js` references (`lucisv.rainbow${index + 1}` for `index` 0–5, plus +the literal `lucisv.rainbowUnmatched`) and diffed against `package.json`'s `contributes.colors` array. All 7 declared, all 7 referenced, no orphans either direction. For each, checked all four `defaults` keys (`dark`/`light`/`highContrast`/`highContrastLight`) are present and parsed @@ -1283,7 +1283,7 @@ No probe found a false positive, a false negative, a panic, or a misattributed range. **5. `78eeef6`'s pinned depth tests, independently diffed rather than taken on -faith.** `git diff 78eeef6 -- crates/vfmt_server/src/pairs.rs`, checked for +faith.** `git diff 78eeef6 -- crates/lucisv_server/src/pairs.rs`, checked for each of the six tests the Work Log names as unedited: `a_module_with_nested_begins_matches_every_pair`, `a_scope_the_rainbow_hides_does_not_shift_the_colour_of_one_it_shows`, @@ -1350,19 +1350,19 @@ depths and the missing-`end` warnings are unchanged" — verified true by finding 5 above. One gap: `editors/vscode/README.md:49` and `:56` still read -`vfmt-0.3.0.vsix` in the install-example commands, while the parallel example -in the repo-root `README.md:584` correctly reads `vfmt-0.3.1.vsix`. This file +`lucisv-0.3.0.vsix` in the install-example commands, while the parallel example +in the repo-root `README.md:584` correctly reads `lucisv-0.3.1.vsix`. This file is not pristine — this very diff touches it for the rainbow-palette documentation (`git diff HEAD -- editors/vscode/README.md`, the `workbench.colorCustomizations` snippet and the "seven colours" rewrite) — but the two version strings were already stale at `0.3.0` before this diff -(`git show HEAD:editors/vscode/README.md` shows the same `vfmt-0.3.0.vsix` +(`git show HEAD:editors/vscode/README.md` shows the same `lucisv-0.3.0.vsix` text, so this is not a regression this diff introduced), and the Work Log's own version-bump list names only `tools/RELEASING.md` and (root) `README.md` as the "illustrative version strings" set, omitting this file even though it carries the same kind of string. A one-line-each, unambiguous doc fix per this role's charter — **fixed directly**, both occurrences now read -`vfmt-0.3.1.vsix`, no code or test changes involved. +`lucisv-0.3.1.vsix`, no code or test changes involved. **8. Invariants.** No `unwrap()`/`expect()`/`panic!()`/`#[allow]` added anywhere in the `pairs.rs` diff (grepped every added line of `git diff HEAD -- @@ -1387,8 +1387,8 @@ either be corrected or the code tightened next time this file is touched. Charter: the dev's claim that replacing the bare `Vec` stack with the counting `Stack` type makes `analyze` linear without changing any observable answer — bit-identical corpus fingerprint, 1616 tests green, two new tests. -Scope: uncommitted working tree, diff vs `HEAD` — `crates/vfmt_server/src/pairs.rs` -and this README only. `crates/vfmt_server/src/inline.rs` and +Scope: uncommitted working tree, diff vs `HEAD` — `crates/lucisv_server/src/pairs.rs` +and this README only. `crates/lucisv_server/src/inline.rs` and `docs/features/inline-templates/` were read for context (the motivating QA find lives there) but not touched, per charter. Verdict: **PASS**, no blocking findings, one non-blocking cross-feature finding (item 8). @@ -1407,7 +1407,7 @@ the usual add-run-remove-and-md5-verify pattern. defeat incremental caching, both before and after adding QA's own test). `cargo test --workspace`: **1617 passed, 0 failed** (summed every crate's `test result:` line independently — 1616 + the one new differential test); -`vfmt_server` alone: 530 unit + 4 ignored + 29 e2e + 3 grammar, matching the +`lucisv_server` alone: 530 unit + 4 ignored + 29 e2e + 3 grammar, matching the Work Log's 533 unit count plus QA's addition. Timed the dev's own scaling test in isolation: @@ -1422,7 +1422,7 @@ jitter a loaded CI runner typically adds. Judgment: **safe as written**. **2. Independent differential check — not just trusting the corpus fingerprint.** Added a full-fidelity oracle to `pairs.rs`'s test module, -transcribed verbatim from `git show HEAD:crates/vfmt_server/src/pairs.rs` +transcribed verbatim from `git show HEAD:crates/lucisv_server/src/pairs.rs` (the exact pre-`Stack` `analyze`/`close`, copied as `old_analyze`/`old_close` over a local `OldFrame` stack) — a second, independently-typed implementation of the algorithm being replaced, not a rederivation from @@ -1492,7 +1492,7 @@ the diff, not assumed — and reads `p.depth` straight off `analyze`'s output, so the field-for-field differential above (which includes `depth` in its `pairs` fingerprint) is a direct proof the wire value is unchanged. `editors/vscode/extension.js` is not in `git diff --stat` at all. Ran the -full `vfmt_server` suite's scope-pairs and depth tests +full `lucisv_server` suite's scope-pairs and depth tests (`scope_pairs_depths_nest_and_forks_are_included`, `only_begins_and_forks_stack_up_the_colours`, `no_hidden_scope_counts_toward_the_depth`, @@ -1517,7 +1517,7 @@ ballpark as the dev's own debug-build numbers (629.1 ms / 2.3 ms at n = 8000), close enough that the two runs are clearly measuring the same thing on similar hardware. -**6. Scope.** `git diff --stat` vs `HEAD`: `crates/vfmt_server/src/pairs.rs` +**6. Scope.** `git diff --stat` vs `HEAD`: `crates/lucisv_server/src/pairs.rs` and `docs/features/editor-scopes/README.md` only (plus this entry). Grepped every added line for `unwrap(`, `expect(`, `panic!`, `unsafe` — all six hits are inside `#[cfg(test)] mod tests` (five `tokenize(...).expect(...)` calls @@ -1536,7 +1536,7 @@ green tree — not this feature's `pairs::analyze`. The dev's claim that nothing in the backlog covers this fix holds. **8. Non-blocking, cross-feature finding — not fixed, `inline.rs` is out of -scope for this dispatch.** `crates/vfmt_server/src/inline.rs:514-519`, the +scope for this dispatch.** `crates/lucisv_server/src/inline.rs:514-519`, the doc comment on `a_deeply_nested_file_neither_crashes_nor_misses_the_trigger`, still reads: *"those flat loops are not all linear, though — `pairs::analyze` is @@ -1622,8 +1622,8 @@ Root cause was mine to confirm before the dev brief: the server's answers were correct, and the invisibility came from painting depth 3–5 with `editorBracketHighlight.foreground4..6`, whose VS Code defaults are transparent. The fix is the right shape — extension-contributed -`vfmt.rainbow1..6` colors that are never transparent in any theme variant, -plus `vfmt.rainbowUnmatched` bright red for genuinely unmatched tokens, +`lucisv.rainbow1..6` colors that are never transparent in any theme variant, +plus `lucisv.rainbowUnmatched` bright red for genuinely unmatched tokens, exactly the owner's never-hide/red-for-errors ruling. Dev's deviation (VS Code's real light-palette for 1–3 instead of gold-on-white) is approved: it avoids re-shipping the same bug in light themes. QA verified diff --git a/docs/features/editor-settings/README.md b/docs/features/editor-settings/README.md index 71bca89..583b9e0 100644 --- a/docs/features/editor-settings/README.md +++ b/docs/features/editor-settings/README.md @@ -2,21 +2,21 @@ ## Goal -Expose the three keys `vfmt.toml` supports — `line-length`, `indent`, -`exclude` — as VS Code settings (`vfmt.lineLength`, `vfmt.indent`, -`vfmt.exclude`), for the users who asked for them: people with no config file +Expose the three keys `lucisv.toml` supports — `line-length`, `indent`, +`exclude` — as VS Code settings (`lucisv.lineLength`, `lucisv.indent`, +`lucisv.exclude`), for the users who asked for them: people with no config file checked into the tree, who until now could set the indent only by accident (VS Code's `tabSize` leaked in through `FormattingOptions`) and could not set a line length **at all**, because LSP carries no line-length option. The settings are transported by `workspace/didChangeConfiguration`, validated at -the server, and folded in one rung below a `vfmt.toml` — which stays +the server, and folded in one rung below a `lucisv.toml` — which stays authoritative, so a project that checks one in keeps exactly one source of -truth and format-on-save cannot drift from CI's `vfmt --check`. +truth and format-on-save cannot drift from CI's `lucisv --check`. ## Assumptions -- **`vfmt.toml` has exactly three keys, and that is the whole surface.** - `vfmt_core::config::parse_entry` accepts `line-length`, `indent` and +- **`lucisv.toml` has exactly three keys, and that is the whole surface.** + `lucisv_core::config::parse_entry` accepts `line-length`, `indent` and `exclude` and rejects everything else by name. Rule selection (`--select`/`--ignore`) has no config key yet, so there is nothing to expose for the linter; when it grows one, it grows a setting here in the same shape. @@ -31,13 +31,13 @@ truth and format-on-save cannot drift from CI's `vfmt --check`. all dropped, leaving that rung silent. Same philosophy as the existing `tabSize` guard: honouring half of a nonsensical request is worse than ignoring it. -- **The accepted ranges must match `vfmt.toml`'s.** A value has to be exactly +- **The accepted ranges must match `lucisv.toml`'s.** A value has to be exactly as acceptable from the settings UI as it is in a config file, or the two - front ends would disagree about what is valid. `vfmt_core` exports no + front ends would disagree about what is valid. `lucisv_core` exports no constant for its bounds, so `settings.rs` copies them **and** - `the_accepted_ranges_are_the_ones_vfmt_toml_accepts` checks the copy against - the real parser (`vfmt_core::config::parse`) rather than against another - hard-coded number. If a range ever widens in `vfmt_core`, that test fails. + `the_accepted_ranges_are_the_ones_lucisv_toml_accepts` checks the copy against + the real parser (`lucisv_core::config::parse`) rather than against another + hard-coded number. If a range ever widens in `lucisv_core`, that test fails. - **Only `exclude` can invalidate anything.** `lineLength` and `indent` are read afresh by every formatting request, so a change to them needs no cache work at all. `exclude` changes which files exist as far as the workspace @@ -45,9 +45,9 @@ truth and format-on-save cannot drift from CI's `vfmt --check`. - **A non-integral number cannot arrive from VS Code.** JavaScript serializes `4.0` as `4`, so `serde_json`'s `as_u64` rejecting fractions costs nothing real; there is no "close enough" case worth forgiving. -- **The `vfmt.exclude` patterns are matched by the same engine as the +- **The `lucisv.exclude` patterns are matched by the same engine as the config's.** They are appended to the same `Vec` that reaches - `vfmt_core::walk::collect_files`, so the glob syntax, the trailing-component + `lucisv_core::walk::collect_files`, so the glob syntax, the trailing-component matching and the `.gitignore` interaction are whatever the CLI already does. An empty-string pattern is harmless (`walk::matches` returns false for one), so it is not filtered out. @@ -57,13 +57,13 @@ truth and format-on-save cannot drift from CI's `vfmt --check`. ### The precedence ladder (the contract this feature is) Highest first. Each rung applies only where every rung above it is silent, and -**each key climbs independently** — a `vfmt.toml` naming only `indent` leaves -`vfmt.lineLength` in charge of the width. +**each key climbs independently** — a `lucisv.toml` naming only `indent` leaves +`lucisv.lineLength` in charge of the width. | # | Source | Why here | |---|---|---| -| 1 | `vfmt.toml` | The project speaking. Must stay authoritative or format-on-save disagrees with `vfmt --check` in CI — the divergence that lifting the config into `vfmt_core` exists to remove. | -| 2 | `vfmt.lineLength` / `vfmt.indent` | Typed on purpose into a settings UI, so more deliberate than a tab size — but it is one user's editor, and the repository outranks it. | +| 1 | `lucisv.toml` | The project speaking. Must stay authoritative or format-on-save disagrees with `lucisv --check` in CI — the divergence that lifting the config into `lucisv_core` exists to remove. | +| 2 | `lucisv.lineLength` / `lucisv.indent` | Typed on purpose into a settings UI, so more deliberate than a tab size — but it is one user's editor, and the repository outranks it. | | 3 | `FormattingOptions::tab_size` | Sent on every request whether or not the user ever chose it (it is the editor's default, or its guess from the file). The weakest thing that is still a signal. | | 4 | Built-in defaults | indent 2, width 100. | @@ -75,7 +75,7 @@ Two paths use a shortened ladder, and both are unchanged in spirit: discover a config from. Such a buffer therefore honours rung 2 now, where before it had only the tab size. -A **broken** `vfmt.toml` contributes nothing at all (as before), so rung 2 is +A **broken** `lucisv.toml` contributes nothing at all (as before), so rung 2 is what answers under it — the user still gets the warning, and still gets their settings. @@ -84,10 +84,10 @@ settings. Consumed: `workspace/didChangeConfiguration`, whose `settings` field carries ```json -{ "settings": { "vfmt": { "lineLength": 120, "indent": 4, "exclude": ["vendor"] } } } +{ "settings": { "lucisv": { "lineLength": 120, "indent": 4, "exclude": ["vendor"] } } } ``` -`settings.rs::from_payload` reads `settings.vfmt` and nothing else. A payload +`settings.rs::from_payload` reads `settings.lucisv` and nothing else. A payload without that section — including the `{"settings": null}` form — means "no opinion about anything" and resets every key. Keys may be absent, `null`, or garbage; each is dropped independently. @@ -101,18 +101,18 @@ with an unconditional `this.onDidChangeConfiguration(section, undefined)` — with `event === undefined` the `affectsConfiguration` filter is skipped, so **the notification is sent immediately at startup** as well as on every later change. No `initializationOptions` fallback is needed, and none was added. -`extractSettingsInformation(['vfmt'])` calls -`workspace.getConfiguration(undefined).get('vfmt')`, which returns the whole +`extractSettingsInformation(['lucisv'])` calls +`workspace.getConfiguration(undefined).get('lucisv')`, which returns the whole section with every key at its effective value — so the server sees `serverPath` and `rainbowBeginEnd` in the payload too, and ignores them. Other editors: anything that can send `workspace/didChangeConfiguration` with that `settings` shape works. Neovim's `vim.lsp.config` sends its `settings` -table verbatim, so `settings = { vfmt = { indent = 4 } }` is the whole setup. +table verbatim, so `settings = { lucisv = { indent = 4 } }` is the whole setup. ### Within the server -- **Consumed from `vfmt_core`:** `config::parse` (in a test, to pin the +- **Consumed from `lucisv_core`:** `config::parse` (in a test, to pin the ranges), `config::FileConfig`, `walk::collect_files`'s `exclude` parameter. - **Promised to `state.rs`:** `Workspace::client_settings()` and `set_client_settings()`, the latter returning `true` exactly when the caller @@ -125,12 +125,12 @@ table verbatim, so `settings = { vfmt = { indent = 4 } }` is the whole setup. `format::config_from(file, client, options)`. **Request to the lead (outside this feature's scope, unchanged from M2/M3):** -`docs/features/vfmt-server/README.md` and `TODO.md` §6 still understate the -server (`documentHighlight`, the missing-closer diagnostics, `vfmt/scopePairs`, +`docs/features/lucisv-server/README.md` and `TODO.md` §6 still understate the +server (`documentHighlight`, the missing-closer diagnostics, `lucisv/scopePairs`, and now these settings). Separately, `docs/features/editor-packaging/README.md`'s *What was deliberately left out* table has a row reading "Settings beyond `serverPath` — formatter options -belong in `vfmt.toml`, one source of truth", which this feature supersedes: the +belong in `lucisv.toml`, one source of truth", which this feature supersedes: the one-source-of-truth rule is now enforced by *precedence* rather than by absence. `editors/vscode/README.md` said the same thing and was updated here, because this feature owns that file's settings table. @@ -143,7 +143,7 @@ this feature owns that file's settings table. - [x] Folded into `settings_for` / `config_from` / `indent_width`. - [x] `exclude` appended to the workspace scan's excludes; a change rebuilds the index and republishes. -- [x] `extension.js` `synchronize.configurationSection: 'vfmt'`; initial-push +- [x] `extension.js` `synchronize.configurationSection: 'lucisv'`; initial-push behaviour verified against the library source. - [x] Three settings in `package.json` with schema bounds. - [x] `editors/vscode/README.md` settings table and precedence ladder. @@ -151,18 +151,18 @@ this feature owns that file's settings table. change (e2e), untitled buffers, `smoke.js`. - [ ] Not done, deliberately: no per-language or per-folder override (`[verilog]`-scoped settings). VS Code resolves those per resource, and - the server holds one workspace-wide `ClientSettings`; a `vfmt.toml` is + the server holds one workspace-wide `ClientSettings`; a `lucisv.toml` is the per-directory mechanism and it already works. - [ ] Not done, deliberately: no `workspace/configuration` *pull*. The push arrives at startup and on every change, which is all that is needed; pulling would add a request per document to answer the same question. - [ ] Not done, deliberately: no setting for lint rule selection — there is no - `vfmt.toml` key for it yet, and inventing one here would put the editor + `lucisv.toml` key for it yet, and inventing one here would put the editor ahead of the CLI. ## Work log -### 2026-08-24 — M4: `vfmt.toml`'s three keys as VS Code settings +### 2026-08-24 — M4: `lucisv.toml`'s three keys as VS Code settings **The thing that had to be checked first.** The plan said to verify, not assume, whether `vscode-languageclient@9.0.1`'s `synchronize` emits an initial @@ -189,18 +189,18 @@ left to rot. **Two decisions worth recording.** -1. *Settings sit below `vfmt.toml`, not above.* This is the opposite of the +1. *Settings sit below `lucisv.toml`, not above.* This is the opposite of the CLI's flag-beats-config order, and it is the same call `settings_for` already made for `tabSize`, for the same reason: a CLI flag is typed for one run, while an editor setting persists silently and belongs to one machine. - If a `vfmt.lineLength` of 80 could override a project's `line-length = 120`, + If a `lucisv.lineLength` of 80 could override a project's `line-length = 120`, every save would reflow files that CI then rejects. Pinned by `rung_1_a_config_file_beats_a_pushed_setting`. 2. *Ranges are checked against the real config parser.* Copying `40..=400` and - `1..=8` into `settings.rs` is a duplication hazard —`vfmt_core` exports no + `1..=8` into `settings.rs` is a duplication hazard —`lucisv_core` exports no constant, and CLAUDE.md says not to reach into another module for this feature's convenience. Rather than leave the copy unguarded, the test asks - `vfmt_core::config::parse` whether each edge is accepted. That is strictly + `lucisv_core::config::parse` whether each edge is accepted. That is strictly better than a shared constant would have been: it tests the behaviour, not the number. @@ -213,7 +213,7 @@ left to rot. asserts the text actually reflows, not just that a number was stored. - `settings.rs` — the exact VS Code payload shape at its defaults (must be "no opinion"), out-of-range numbers, wrong types, a non-array `exclude`, a mixed - array, a payload with no `vfmt` section, `settings: null`, and the range + array, a payload with no `lucisv` section, `settings: null`, and the range cross-check above. - `state.rs` — a pushed `exclude` hiding a file from the index; **appended, not substituted**, so a user's setting cannot put the project's vendored code @@ -242,7 +242,7 @@ it was conditioned on came back negative-for-need (the library does push). **Verification.** `cargo fmt --all` clean, `cargo clippy --all-targets` clean, `cargo test --workspace` green, `node smoke.js` against a freshly built -`target/debug/vfmt-server` OK, `npx @vscode/vsce ls` still accepts the +`target/debug/lucisv-server` OK, `npx @vscode/vsce ls` still accepts the manifest, `node --check` on both JS files. ## QA log @@ -261,16 +261,16 @@ everything through `aa26e5e` already QA'd). Verified `settings.rs`, named is present and passes: toml-names-indent-only + settings-names-lineLength- only (`each_key_climbs_the_ladder_independently`); settings-indent vs. differing tabSize (`rung_2_a_pushed_setting_beats_the_editors_tab_size`); a broken -`vfmt.toml` falls through to the pushed settings (rung 2), not straight to +`lucisv.toml` falls through to the pushed settings (rung 2), not straight to default — pinned by `format.rs:499` and **documented**, not just tested: the -Handshakes section states it explicitly ("A broken `vfmt.toml` contributes +Handshakes section states it explicitly ("A broken `lucisv.toml` contributes nothing at all... so rung 2 is what answers under it"). No undocumented hole found. **2. Validation hostility.** Every value the charter listed (indent 0, 9, -1, 400.5-equivalent via 4.5, "4" string; lineLength 39, 401, 39.9-equivalent; exclude as a string, exclude with non-string entries; `settings: null`; missing -`vfmt` section; extra unknown keys) is covered in `settings.rs`'s unit tests. +`lucisv` section; extra unknown keys) is covered in `settings.rs`'s unit tests. Went further and hand-drove the **built binary** (not just unit tests) with a script sending all of the above plus `indent: 400.5`, `lineLength: 39.9`, `exclude: [1,2,3]`, a `params` with no `settings` key at all, and a payload @@ -287,7 +287,7 @@ not just `from_payload`). and the "only exclude triggers rescan" contract. **Finding (non-blocking, test-coverage gap):** -`crates/vfmt_server/tests/e2e.rs:690-746` +`crates/lucisv_server/tests/e2e.rs:690-746` (`a_pushed_exclude_rebuilds_the_index_mid_session`) opens **no document** — it only drives `workspace/symbol` queries before/after the exclude push. That proves the *scan* half of `reindex()` (`server.rs:319-324`) ran, but nothing in @@ -327,17 +327,17 @@ languageclient/package.json`). `SyncConfigurationFeature.initialize()` (line `this.onDidChangeConfiguration(data.registerOptions.section, undefined)` — the `event === undefined` case skips the `affectsConfiguration` filter, so the notification is sent immediately. Confirmed: the dev's claim is accurate, and -so is the wire shape claim — `extractSettingsInformation(['vfmt'])` -(line 174-207) calls `workspace.getConfiguration(undefined).get('vfmt')` and -wraps it under `result.vfmt`, i.e. exactly `{settings: {vfmt: {...every +so is the wire shape claim — `extractSettingsInformation(['lucisv'])` +(line 174-207) calls `workspace.getConfiguration(undefined).get('lucisv')` and +wraps it under `result.lucisv`, i.e. exactly `{settings: {lucisv: {...every declared key at its effective value...}}}`, matching `settings.rs`'s `vscode_payload()` test helper and the README's documented shape. -`extension.js`'s `synchronize: { configurationSection: 'vfmt' }` and -`package.json`'s three new properties are all spelled `vfmt.lineLength` / -`vfmt.indent` / `vfmt.exclude` — the prefix matches. No mismatch found. +`extension.js`'s `synchronize: { configurationSection: 'lucisv' }` and +`package.json`'s three new properties are all spelled `lucisv.lineLength` / +`lucisv.indent` / `lucisv.exclude` — the prefix matches. No mismatch found. -**5. smoke.js.** Built fresh with `cargo build -p vfmt_server`, ran -`node smoke.js ../../target/debug/vfmt-server` — OK. Mutation-checked the +**5. smoke.js.** Built fresh with `cargo build -p lucisv_server`, ran +`node smoke.js ../../target/debug/lucisv-server` — OK. Mutation-checked the pushed-indent assertion: changed `indent: 4` to `indent: 2` in the `didChangeConfiguration` push, reran — got a clean `FAIL` reporting the 2-space (tabSize) output instead of 4-space, confirming the assertion is live; @@ -345,11 +345,11 @@ restored the edit and reran — `OK` again, and `md5sum` before/after the round-trip matched byte-for-byte (`a33792c93538b89b8d64debe117f2ab1`). **6. Untitled buffers.** `format.rs`'s -`an_untitled_buffer_honours_pushed_settings` pins both `vfmt.indent` and -`vfmt.lineLength` applying with no path and no toml. Confirmed. +`an_untitled_buffer_honours_pushed_settings` pins both `lucisv.indent` and +`lucisv.lineLength` applying with no path and no toml. Confirmed. **7. Invariants.** -- `cargo test --workspace`: all green, including `vfmt_server`'s 190 unit + 9 +- `cargo test --workspace`: all green, including `lucisv_server`'s 190 unit + 9 e2e (matches the work log's claimed counts). - `cargo fmt --all -- --check`: clean. - `cargo clippy --all-targets`: clean (touched `settings.rs` to force a @@ -363,10 +363,10 @@ round-trip matched byte-for-byte (`a33792c93538b89b8d64debe117f2ab1`). `#[cfg(test)]` marker). - package.json schema bounds (`minimum`/`maximum` 40/400 and 1/8) cross-checked against `settings.rs`'s `LINE_LENGTH_RANGE`/`INDENT_RANGE` and against - `vfmt_core::config::parse_entry` (`crates/vfmt_core/src/config.rs:56-57`, + `lucisv_core::config::parse_entry` (`crates/lucisv_core/src/config.rs:56-57`, which is the real source of truth) — all three agree. - Cross-checked the "exclude append mirrors the CLI" claim in Assumptions - against `crates/vfmt/src/args.rs:103-107` (`exclude_with`) — the CLI does + against `crates/lucisv/src/args.rs:103-107` (`exclude_with`) — the CLI does extend its own `--exclude` with the config's, same append-not-replace pattern. Accurate. @@ -383,14 +383,14 @@ to close a documented required test, not a functional defect. Read `settings.rs` in full plus the `format.rs`, `server.rs`, `state.rs` and `extension.js` diffs. Approved and committed. Notes: -- Settings-below-`vfmt.toml` is the right call and the rewritten +- Settings-below-`lucisv.toml` is the right call and the rewritten `settings_for` ladder doc states it well; the - `the_accepted_ranges_are_the_ones_vfmt_toml_accepts` test (asking the + `the_accepted_ranges_are_the_ones_lucisv_toml_accepts` test (asking the real parser about the copied bounds) is a pattern worth reusing. - QA's non-blocking finding stands: the exclude e2e proves the rescan but not the republish half of `reindex()`. Functionally moot today (nothing in `diagnostics::all` reads the index), so accepted as-is; the next round touching `e2e.rs` should close it per QA's suggested fix. -- `extractSettingsInformation` sending the whole `vfmt` section (so the +- `extractSettingsInformation` sending the whole `lucisv` section (so the server sees and ignores `serverPath`/`rainbowBeginEnd`) is correctly mirrored in the tests' payload shape rather than an idealized one. diff --git a/docs/features/editor-snippets/README.md b/docs/features/editor-snippets/README.md index 18457ad..6b87af1 100644 --- a/docs/features/editor-snippets/README.md +++ b/docs/features/editor-snippets/README.md @@ -10,7 +10,7 @@ of the five editor features the owner asked for, and the only one that needs no server work at all: VS Code's `contributes.snippets` is a static JSON contribution the editor reads from `package.json` without ever activating the extension, so the feature costs two data files, ten lines of manifest, and no -new code path in `extension.js` or `vfmt-server`. Two files, one per language +new code path in `extension.js` or `lucisv-server`. Two files, one per language id, because the same prefix wants a different body per dialect: `module` gives `input wire` in Verilog and `input logic` in SystemVerilog, `function` gives a `begin`/`end` return-assignment in Verilog and `automatic` + `return` in @@ -35,11 +35,11 @@ SystemVerilog. - **Placeholder *text* may be prose (`value`, `statement`, `antecedent`) even where prose is not an expression.** Those are selected on insert and typed over; they are labels, not code. The line above is about the code the user - keeps, not about placeholder labels — and in practice vfmt's parser accepts + keeps, not about placeholder labels — and in practice lucisv's parser accepts the two we ship (`value: statement;`) as an identifier statement anyway. - **Two-space indent matches the formatter.** `vlog_formatter::Config::default` is `indent_width: 2` (`crates/vlog_formatter/src/format.rs:27`), so a - snippet body inserted into a file with no `vfmt.toml` is not immediately + snippet body inserted into a file with no `lucisv.toml` is not immediately re-indented on the next format-on-save. - **Prefixes are unique within a language and are not reserved.** VS Code offers a snippet whose prefix matches the typed word alongside ordinary @@ -56,9 +56,9 @@ SystemVerilog. ## Handshakes -- **Consumes** nothing from `vfmt-server`. This is deliberate: snippets are a +- **Consumes** nothing from `lucisv-server`. This is deliberate: snippets are a static manifest contribution, so they work before the server starts, if the - server is missing, and if `vfmt.serverPath` is wrong. Nothing in + server is missing, and if `lucisv.serverPath` is wrong. Nothing in `extension.js` reads or registers them. - **Consumes** the two language ids declared in `editors/vscode/package.json` → `contributes.languages` (`verilog`, @@ -123,11 +123,11 @@ committed — they check data files, and nothing in the repo runs `node` in CI): Result after the fixes below: **ALL OK**, 30 snippets, no failures. The rendered `assertp` contains a literal `else $error("…")`, the two `tb` snippets a literal `$finish;`, the Verilog `tb` a literal `$display("done")`. -2. The rendered text of all 30 was then fed through **vfmt's own parser** - (`target/debug/vfmt --check`), wrapping statement-level snippets in +2. The rendered text of all 30 was then fed through **lucisv's own parser** + (`target/debug/lucisv --check`), wrapping statement-level snippets in `module wrapper_m; … endmodule` and expression-level ones additionally in `initial begin … end`. Result: **30/30 parse.** Every "would be reformatted" - diff among them is the empty `$0` line or vfmt collapsing a two-port module + diff among them is the empty `$0` line or lucisv collapsing a two-port module onto one line, never an indentation mismatch. **Three fixes, all found by check 2 or by the dialect review:** diff --git a/docs/features/error-recovery/README.md b/docs/features/error-recovery/README.md index 0d099e1..840c286 100644 --- a/docs/features/error-recovery/README.md +++ b/docs/features/error-recovery/README.md @@ -284,7 +284,7 @@ signatures. then every byte prefix of every fixture) before writing any assertions, so the tests encode measured behavior rather than hoped-for behavior. The example was deleted; it is not part of the diff. -- Did not touch `verify.rs`, `tools/`, `corpus/`, or `crates/vfmt`. Did not +- Did not touch `verify.rs`, `tools/`, `corpus/`, or `crates/lucisv`. Did not run `git commit`/`git push`. - **Concurrency note:** another agent's format-off-fence work (`crates/vlog_formatter/src/fence.rs`, `doc.rs`, `format.rs`, `printer.rs`, diff --git a/docs/features/expressions-2/README.md b/docs/features/expressions-2/README.md index d532d41..59aba61 100644 --- a/docs/features/expressions-2/README.md +++ b/docs/features/expressions-2/README.md @@ -3,7 +3,7 @@ ## Goal Empty the corpus's `expressions` bucket — 21 files, every one of them blocked -on a piece of expression grammar vfmt did not have — plus the one `other` file +on a piece of expression grammar lucisv did not have — plus the one `other` file blocked on a `const ref` argument. Eight independent shapes, each taken from a real corpus file and cited below. All eight are **structural**: real AST nodes with a canonical layout, no new verbatim pass-through and no new normalization, @@ -73,12 +73,12 @@ sub u ( - **The `with [range]` form of a stream expression is not supported.** No corpus file writes it; a file that does keeps its old `expected expression` error rather than getting a half-modelled node. -- **A `` `MACRO`` on the right of `inside` is passed through verbatim.** vfmt +- **A `` `MACRO`` on the right of `inside` is passed through verbatim.** lucisv does not expand macros, so it cannot know the set the macro produces; the invocation is one token and is printed back as that token. - **A comment written immediately before a replication count is not kept.** `'{ /* c */ N{0}}` (and, unchanged from before this round, - `{ /* c */ N{0}}`) makes the safety net reject the output and vfmt reports a + `{ /* c */ N{0}}`) makes the safety net reject the output and lucisv reports a clean error — never a dropped comment in a written file. The count has no comment slot in either AST node; adding one is the same fix for both and is left for whoever needs it. @@ -117,7 +117,7 @@ sub u ( — a macro invocation followed by an operand in expression position. The score script now classifies it as **macro-items**, not `expressions`. Left for that feature: reading `` `MACRO expr`` as anything other than two - adjacent primaries needs the macro's definition, which vfmt does not have. + adjacent primaries needs the macro's definition, which lucisv does not have. - `corpus/picorv32/scripts/smtbmc/mulcmp.v` (`other`) is a trailing comma in a connection list — invalid Verilog. Left alone, as briefed. diff --git a/docs/features/file-watching/README.md b/docs/features/file-watching/README.md index 1ac4a08..0fa4cb4 100644 --- a/docs/features/file-watching/README.md +++ b/docs/features/file-watching/README.md @@ -23,7 +23,7 @@ per notification. Neovim's built-in client both do; `editors/vscode/smoke.js` deliberately sends `capabilities: {}`) keeps exactly the save-only model it had before. That is the honest remaining staleness window, and it is stated in - `docs/features/vfmt-server/README.md` as well as here. + `docs/features/lucisv-server/README.md` as well as here. - **The registration is sent from `Server::new`, not from an `initialized` handler.** `lsp-server`'s `initialize_finish` *consumes* the client's `initialized` notification before returning, so the request loop never sees @@ -39,20 +39,20 @@ per notification. carries a *list*, and a branch checkout fills it. The handler asks one question of the whole list and rebuilds at most once. There is **no time-based debouncing**: that needs a timer, the server is single-threaded - and synchronous by design (`docs/features/vfmt-server/README.md`), and + and synchronous by design (`docs/features/lucisv-server/README.md`), and adding a thread to save part of a 0.7 s corpus rebuild is not a trade worth making. A burst of several notifications therefore costs several rebuilds; in practice VS Code and Neovim both coalesce a checkout into very few. - **Events are filtered by extension, cheaply.** The registered globs already filter client-side, but a client is free to forward more than it was asked for, so `touches_scope` drops a notification whose every path is neither a - source extension (`vfmt_core::walk::EXTENSIONS`) nor the configured + source extension (`lucisv_core::walk::EXTENSIONS`) nor the configured filelist. It does **not** try to decide whether a source file is *in* the current scope: the scope ladder re-applies during the rebuild anyway, and one rebuild for a stray in-tree `.sv` is much cheaper than duplicating the ladder's logic per event and getting it subtly wrong. - **Only the root filelist is watched, not its nested `-f` targets.** - `vfmt_core::filelist::Filelist` reports the files a filelist names but not + `lucisv_core::filelist::Filelist` reports the files a filelist names but not the filelists it *read*, and adding that field is a change to another module for one caller. So editing a nested `.f` outside the editor is still invisible until the next save or root-filelist touch. Saving a nested @@ -63,13 +63,13 @@ per notification. enough for every name would also fire on every unrelated `.f` in the tree. A path that is not valid UTF-8 cannot be written as a glob and is simply not watched — the same restriction `uri.rs` already lives under. -- **`vfmt.toml` itself is not watched.** Its `exclude` and `filelist` keys do +- **`lucisv.toml` itself is not watched.** Its `exclude` and `filelist` keys do change the index's scope, so editing one outside the editor is still invisible until the next save — but it is read afresh on every rebuild, so the very next rebuild from any cause picks it up, and saving it from inside the editor already rebuilds. Watching it would mean a third watcher and a second re-registration trigger for a file people edit once a quarter. -- **A changed `vfmt.filelist` re-registers.** The watched path is *inside* the +- **A changed `lucisv.filelist` re-registers.** The watched path is *inside* the registration, so a new path needs a new registration: the old one is unregistered by id and a fresh one sent. The alternative — a static watcher wide enough that no re-registration is ever needed — would mean watching @@ -85,7 +85,7 @@ per notification. ## Handshakes -### `vfmt_server::watch` (new module) +### `lucisv_server::watch` (new module) ```rust pub const SOURCE_GLOB: &str = "**/*.{v,vh,sv,svh}"; @@ -96,11 +96,11 @@ pub fn unregistration(id: String) -> Unregistration; pub fn touches_scope(changes: &[FileEvent], filelist: Option<&Path>) -> bool; ``` -`SOURCE_GLOB` is pinned to `vfmt_core::walk::EXTENSIONS` by a test: a file the +`SOURCE_GLOB` is pinned to `lucisv_core::walk::EXTENSIONS` by a test: a file the walk indexes but the glob does not name is a file whose external changes are invisible, and the reverse is wasted rebuilds. -### `vfmt_server::server` +### `lucisv_server::server` - `Server::new` now takes a `ClientAbilities { snippets, file_watching }` instead of a bare `snippets: bool` — two adjacent bools at a call site is a @@ -114,10 +114,10 @@ invisible, and the reverse is wasted rebuilds. reporting. - `workspace/didChangeConfiguration` re-registers the watchers when the resolved filelist path changed. -- Outgoing request ids are `vfmt-`; registration ids are - `vfmt-watched-files-`. Responses to them are ignored in `run`. +- Outgoing request ids are `lucisv-`; registration ids are + `lucisv-watched-files-`. Responses to them are ignored in `run`. -### `vfmt_server::state` +### `lucisv_server::state` `Workspace::filelist_path()` is now **public** (it was private). It is what the watcher registration names and what `touches_scope` compares against; the @@ -134,14 +134,14 @@ no new setting. ## Status / TODO -- [x] `crates/vfmt_server/src/watch.rs`: capability probe, registration and +- [x] `crates/lucisv_server/src/watch.rs`: capability probe, registration and unregistration builders, per-notification event filter - [x] `client/registerCapability` sent after the handshake, guarded on the client capability - [x] `workspace/didChangeWatchedFiles` handled: one `reindex()` per notification, warnings surfaced exactly as on save - [x] Filelist watched by path when one is configured; re-registered when - `vfmt.filelist` resolves somewhere else + `lucisv.filelist` resolves somewhere else - [x] `Workspace::filelist_path` made public for the two callers above - [x] Unit tests (11 in `watch.rs`, 13 in `server.rs` driving a real `Server` over `Connection::memory()`), 2 new e2e stdio sessions @@ -150,7 +150,7 @@ no new setting. - [ ] Not done, deliberately: no time-based debouncing (needs a timer and a thread; per-notification coalescing only — see Assumptions). - [ ] Not done, deliberately: nested `-f` filelists are not watched (needs a - new field on `vfmt_core::filelist::Filelist` — see Assumptions). + new field on `lucisv_core::filelist::Filelist` — see Assumptions). - [ ] Not done, deliberately: no `workspace/didChangeWorkspaceFolders`. Adding or removing a folder mid-session still needs a restart; that is its own change, with its own question about re-registering the watchers. @@ -193,11 +193,11 @@ wiring, then the tests, then the docs. Decisions worth recording: **Files touched outside this feature's module**, all minimal: -- `crates/vfmt_server/src/state.rs` — `filelist_path` private → public, with +- `crates/lucisv_server/src/state.rs` — `filelist_path` private → public, with a doc comment saying why. No logic change. -- `crates/vfmt_server/src/main.rs` — `mod watch;`, and `ClientAbilities` at +- `crates/lucisv_server/src/main.rs` — `mod watch;`, and `ClientAbilities` at the `Server::new` call site. -- `crates/vfmt_server/tests/e2e.rs` — the `Live` harness and the +- `crates/lucisv_server/tests/e2e.rs` — the `Live` harness and the `unframe`/`read_message` split, plus the two new sessions. **Not touched, per the brief**: `TODO.md` §8's M9 checkbox and the umbrella @@ -209,20 +209,20 @@ than as a hope. No version bump, no CHANGELOG entry, no new dependency, no threads. **Verification.** `cargo fmt --all -- --check` clean; `cargo clippy ---all-targets` silent; `cargo test --workspace` green. `vfmt_server` went +--all-targets` silent; `cargo test --workspace` green. `lucisv_server` went from 372 to 396 unit tests (+24: 11 in `watch.rs`, 13 in `server.rs`) and from 19 to 21 e2e sessions (+2). `node editors/vscode/smoke.js -target/debug/vfmt-server` → OK, 8 messages, unchanged. +target/debug/lucisv-server` → OK, 8 messages, unchanged. ## QA log ### 2026-08-24 — QA agent, M9 **Gates.** `cargo fmt --all -- --check` clean. `cargo clippy --all-targets` -silent. `cargo test -p vfmt_server`: **394 passed + 2 ignored (= 396 unit) + +silent. `cargo test -p lucisv_server`: **394 passed + 2 ignored (= 396 unit) + 21 e2e + 3 grammar**, matching the Work log's counts exactly. `cargo test --workspace`: green, no failures anywhere. `node editors/vscode/smoke.js -target/debug/vfmt-server` → OK, 8 messages, unchanged (capabilities `{}` → +target/debug/lucisv-server` → OK, 8 messages, unchanged (capabilities `{}` → never registered, confirmed both by the new `a_client_that_cannot_watch_files_is_never_asked_to` e2e test and by running smoke.js itself). No `unwrap`/`expect`/`panic!` outside `#[cfg(test)]` in @@ -245,7 +245,7 @@ something *other* than `initialized` as its very next message makes `Server::new` is ever called — pre-existing behavior, not a new race this feature introduces.) -**Adversarial testing, real `target/release/vfmt-server` binary over stdio** +**Adversarial testing, real `target/release/lucisv-server` binary over stdio** (hand-rolled Python framing client, one message at a time — the same write-then-wait-for-reply shape `tests/e2e.rs`'s `Live` harness uses, not a threaded reader, per the prior QA note about that class of harness hang). @@ -259,7 +259,7 @@ Scripts are in the scratchpad, not the repo. All of the following **PASS**: path indexes it, and `workspace/symbol` finds it on the very next query with the location URI round-tripping back to the same path. This is `uri_to_path`'s existing percent-decoding - (`crates/vfmt_server/src/uri.rs:36-53`) doing exactly what it already did + (`crates/lucisv_server/src/uri.rs:36-53`) doing exactly what it already did for `didOpen`/`hover`/etc — `watch::touches_scope` and the reindex path route every event through the same helper, so there was no new surface for this to go wrong on, and none did. @@ -272,7 +272,7 @@ Scripts are in the scratchpad, not the repo. All of the following **PASS**: what the README says it costs, not more. The server answered a *correct* follow-up query (`workspace/symbol("clk")`, non-empty, right after the burst) every time — never wedged, never stale past the burst. This is - faster than the vfmt-server README's own 0.68 s/rebuild debug-build + faster than the lucisv-server README's own 0.68 s/rebuild debug-build baseline (release build, as expected) — the honest-gaps assessment below updates the number for a release binary. - **Delete the open file.** Deleted the file backing an open buffer on disk, @@ -288,7 +288,7 @@ Scripts are in the scratchpad, not the repo. All of the following **PASS**: - **`didChangeWatchedFiles` before any `didOpen`.** Sent straight after the registration handshake, zero open buffers: no panic, and the created file is indexed on the next `workspace/symbol` query. The "no shared mutable - state, no locks" design (`docs/features/vfmt-server/README.md`) leaves + state, no locks" design (`docs/features/lucisv-server/README.md`) leaves nothing that startup ordering could race here, and the run confirms it. - **Filelist emptied.** Rewrote the configured filelist to zero bytes, sent the matching `Changed` event: the index shrinks to what the now-empty @@ -305,17 +305,17 @@ Scripts are in the scratchpad, not the repo. All of the following **PASS**: path specifically** (not just `didSave`, which the filelist feature's own QA already covered): a filelist with an unsupported flag and three missing files, touched via a watched-files event, produced **exactly one** - `window/showMessage` ("... and 4 more — see the vfmt log") and **five** + `window/showMessage` ("... and 4 more — see the lucisv log") and **five** `window/logMessage`s — the "first warning shown, all of them logged" rule holds on this new trigger, not just the old ones. -- **Re-registration.** Changed `vfmt.filelist` three times in a row: to a +- **Re-registration.** Changed `lucisv.filelist` three times in a row: to a path containing a space (watched verbatim, not escaped or broken — the glob pattern is a literal path string, not a real glob, so a raw space is correct), to a nonexistent path (still unregisters/re-registers cleanly, still answers requests afterward via the workspace-walk fallback), and back to the same value as immediately before (no re-registration at all — `set_client_settings`'s equality check holds). Registration ids across all - three changes were `vfmt-watched-files-0/1/2/3` in strict sequence, never + three changes were `lucisv-watched-files-0/1/2/3` in strict sequence, never repeated, and each `client/unregisterCapability` named exactly the id the registration immediately before it carried — confirmed against the wire messages, not just the unit tests already pinning this in `server.rs`. @@ -343,7 +343,7 @@ Work log checks out against the real binary, not only its own test suite. **Honest-gaps assessment (item 4 of the brief).** All three disclosed gaps are stated where a user/maintainer would actually look — the feature README's own Assumptions *and* Status/TODO, and restated in -`docs/features/vfmt-server/README.md`'s "State and staleness" section (the +`docs/features/lucisv-server/README.md`'s "State and staleness" section (the file most likely to be read for "why is my index stale"): - **No debounce.** Measured above: 3×~0.32 s ≈ 0.98 s for a burst on the full @@ -356,7 +356,7 @@ file most likely to be read for "why is my index stale"): a non-coalescing client would be testing a hypothetical client, not this one), but the linear cost model documented ("a burst … costs several rebuilds") is exactly what was measured, no worse. Acceptable as shipped. -- **Nested `-f` filelists unwatched, and `vfmt.toml` unwatched.** Read-only +- **Nested `-f` filelists unwatched, and `lucisv.toml` unwatched.** Read-only confirmed against the Assumptions section's own reasoning (the missing `Filelist`-reads-filelists field, and "re-read every rebuild" respectively) — both are stated, reasoned, and cheap to work around (save inside the diff --git a/docs/features/filelist/README.md b/docs/features/filelist/README.md index 63bd082..d481198 100644 --- a/docs/features/filelist/README.md +++ b/docs/features/filelist/README.md @@ -2,22 +2,22 @@ ## Goal -Teach vfmt the EDA world's own project file. A `.f` filelist — one source +Teach lucisv the EDA world's own project file. A `.f` filelist — one source path per line, `-f` nesting, `+incdir+`, `+define+`, comments and `$VAR` expansion — is what every Verilog build already has, so it is the honest answer to rope's `.ropeproject`: when a project has one, it defines *exactly* the set of files the server indexes, and the guesswork of walking a workspace folder disappears. This is M1 of -`docs/features/refactor/README.md`: the parser lives in `vfmt_core` (next +`docs/features/refactor/README.md`: the parser lives in `lucisv_core` (next to config and walk, so a future CLI `-f` reuses it unchanged), the scope -precedence lives in `vfmt_server`, and the two front doors that name a -filelist are a `filelist` key in `vfmt.toml` and the VS Code setting -`vfmt.filelist`. +precedence lives in `lucisv_server`, and the two front doors that name a +filelist are a `filelist` key in `lucisv.toml` and the VS Code setting +`lucisv.filelist`. ## Assumptions - **The filelist is a *scope*, not a build description.** M1 recorded - `+incdir+` and `+define+` and used neither: vfmt does not preprocess, so + `+incdir+` and `+define+` and used neither: lucisv does not preprocess, so an include path and a macro value change nothing about what the index contains. They were parsed anyway because a filelist that silently dropped them would have to be re-parsed later, and because "unknown flag" warnings @@ -38,7 +38,7 @@ filelist are a `filelist` key in `vfmt.toml` and the VS Code setting itself was named relatively) so the index sees one spelling per file. Symlinks are deliberately **not** resolved, matching `config-discovery`'s "lexical, not symlink-aware" rule. -- **An unknown flag is skipped alone, not with its argument.** vfmt has no +- **An unknown flag is skipped alone, not with its argument.** lucisv has no table of which EDA flags take a value, and inventing one would be a guess. So `-y lib/` warns about `-y` and then reports `lib/` as a missing source file (a directory is not a file). Two warnings for one line is @@ -69,13 +69,13 @@ filelist are a `filelist` key in `vfmt.toml` and the VS Code setting - **Reading a filelist is I/O the server does on every index rebuild.** No caching, no watching: `rebuild_index` already re-reads the whole workspace on save, and one extra small file is nothing next to that. -- **`vfmt.toml`'s `filelist` value is a path, not a glob.** It is resolved +- **`lucisv.toml`'s `filelist` value is a path, not a glob.** It is resolved against the config file's own directory when the config is loaded, so the `FileConfig` a caller receives already carries a usable path. ## Handshakes -### `vfmt_core::filelist` (new module) +### `lucisv_core::filelist` (new module) ```rust pub const MAX_NESTING_DEPTH: usize = 256; // how deep `-f` may nest @@ -97,18 +97,18 @@ variable, a repeated filelist, a chain nested past `MAX_NESTING_DEPTH`) is a warning on an otherwise usable result. `read` neither panics nor aborts: on any input, including an adversarial one, it returns. -### `vfmt_core::config` +### `lucisv_core::config` -`FileConfig` gains `filelist: Option`, from the new `vfmt.toml` key +`FileConfig` gains `filelist: Option`, from the new `lucisv.toml` key `filelist = "path"`. `parse` records the path **as written** (it has no idea where the file lives); `Discovery` resolves it against the config file's directory, so every `FileConfig` handed out by `Discovery` carries a resolved path. Same strictness as the other keys: a non-string value, a duplicate, or any unknown key is still a hard error naming file and line. -### `vfmt_server` +### `lucisv_server` -- `ClientSettings` gains `filelist: Option` from `vfmt.filelist`. +- `ClientSettings` gains `filelist: Option` from `lucisv.filelist`. An empty string means "unset", which is what the VS Code default is. - `Workspace::set_client_settings` now returns `true` for a `filelist` change as well as an `exclude` change — both change *which files exist*. @@ -126,7 +126,7 @@ Highest first, resolved on every index rebuild: | # | Scope | When | |---|---|---| -| 1 | The files a **filelist** names | `vfmt.filelist` is set (absolute, or relative to the first workspace root), else the workspace root's `vfmt.toml` has a `filelist` key | +| 1 | The files a **filelist** names | `lucisv.filelist` is set (absolute, or relative to the first workspace root), else the workspace root's `lucisv.toml` has a `filelist` key | | 2 | The **workspace-folder walk** | there is a workspace root — unchanged from before this feature | | 3 | Each **open file's own directory**, non-recursive | there is no workspace root at all (a single file opened) | @@ -138,41 +138,41 @@ index. ### `editors/vscode` -New setting `vfmt.filelist` (string, default `""`), forwarded by the -existing `synchronize.configurationSection: 'vfmt'` machinery — no +New setting `lucisv.filelist` (string, default `""`), forwarded by the +existing `synchronize.configurationSection: 'lucisv'` machinery — no extension code change. ## Status / TODO -- [x] `crates/vfmt_core/src/filelist.rs`: parser + `Filelist` + `read` +- [x] `crates/lucisv_core/src/filelist.rs`: parser + `Filelist` + `read` - [x] comments (`//`, `#`), blank lines, `-f` nesting with cycle/repeat detection and a 256-level depth limit, `+incdir+` (multi-`+`), `+define+NAME[=VAL]` (multi-`+`), `$VAR`/`${VAR}` expansion, unknown `+arg`/`-flag` warnings, missing files warned and skipped, relative resolution against the naming filelist -- [x] `vfmt.toml` key `filelist`, resolved against the config's directory -- [x] `vfmt.filelist` client setting, and the rescan it forces +- [x] `lucisv.toml` key `filelist`, resolved against the config's directory +- [x] `lucisv.filelist` client setting, and the rescan it forces - [x] Server scope ladder (filelist ⊃ workspace walk ⊃ open-file directory) with warnings surfaced once per rebuild -- [x] `vfmt.filelist` in `editors/vscode/package.json` + README; root +- [x] `lucisv.filelist` in `editors/vscode/package.json` + README; root README config and editor sections -- [x] Unit tests in `vfmt_core` and `vfmt_server`; `cargo fmt`, `cargo +- [x] Unit tests in `lucisv_core` and `lucisv_server`; `cargo fmt`, `cargo clippy --all-targets`, `cargo test` all clean - [x] ~~Not done, deliberately: the CLI does not consume `filelist` yet - (M1 is config-level plumbing plus the server; a `vfmt -f` flag is its + (M1 is config-level plumbing plus the server; a `lucisv -f` flag is its own change with its own exit-code questions).~~ **M13** is that change: - `vfmt -f project.f` reuses `read` unchanged and answers the exit-code + `lucisv -f project.f` reuses `read` unchanged and answers the exit-code questions this line predicted (warnings never move the exit code, an unreadable root filelist is exit 2) — - `docs/features/cli-filelist/README.md`. The `vfmt.toml` **key** is still + `docs/features/cli-filelist/README.md`. The `lucisv.toml` **key** is still read by the server only, now on purpose rather than for want of a flag. - [x] ~~Not done, deliberately: `+incdir+`/`+define+` feed nothing.~~ `` `include`` resolution arrived in M10 and consumes `Filelist::incdirs` unchanged, exactly as this line predicted — resolved, in filelist order, nested `-f` incdirs flattened in place (`docs/features/include-nav/README.md`). `+define+` still feeds - nothing: vfmt does not preprocess. + nothing: lucisv does not preprocess. - [ ] Not done, deliberately: no file watching. The filelist is re-read on every index rebuild (save, settings change, open with no root). @@ -218,13 +218,13 @@ editor setting. Decisions worth recording: **Files touched outside the brief's scope**, all forced by the new field and kept to the minimum: -- `crates/vfmt/src/args.rs` — two `FileConfig`/help edits. Adding a public +- `crates/lucisv/src/args.rs` — two `FileConfig`/help edits. Adding a public field breaks every struct literal, so the two test literals became `..Default::default()`; and `--help`'s CONFIGURATION paragraph lists the recognized keys by name, which would have been a lie the moment the parser - accepted a fourth. The new line says `filelist` is read by `vfmt-server` + accepted a fourth. The new line says `filelist` is read by `lucisv-server` only, so nobody expects the CLI to act on it. -- `crates/vfmt_server/src/format.rs` — the same struct-literal fix in two +- `crates/lucisv_server/src/format.rs` — the same struct-literal fix in two tests. No behavior in that module changed. **Deviations from the brief.** Two, both narrowing: @@ -241,19 +241,19 @@ kept to the minimum: Also noted and **not** touched, being outside this feature's scope: the root `README.md`'s editor section still says "the server does **not** read -`vfmt.toml` yet", which the `editor-settings` feature already made false. +`lucisv.toml` yet", which the `editor-settings` feature already made false. Flagged for the lead rather than fixed here. (The neighbouring sentence -"One setting, `vfmt.serverPath`" *was* rewritten, because this feature adds +"One setting, `lucisv.serverPath`" *was* rewritten, because this feature adds a setting and leaving a count that is now wrong by three would have been worse than the one-line edit.) **Verification.** `cargo fmt --all -- --check` clean; `cargo clippy --all-targets` silent; `cargo test --workspace` green — 1007 tests, of -which 34 are new: 23 in `vfmt_core` (20 `filelist` + 3 `config`), 9 in -`vfmt_server` (2 `settings`, 7 `state`) and 2 e2e sessions against the real +which 34 are new: 23 in `lucisv_core` (20 `filelist` + 3 `config`), 9 in +`lucisv_server` (2 `settings`, 7 `state`) and 2 e2e sessions against the real binary (a filelist pushed, narrowed and broken mid-session; a file opened with no workspace folder). `node editors/vscode/smoke.js -target/debug/vfmt-server` OK, `node --check` on both JS files, and +target/debug/lucisv-server` OK, `node --check` on both JS files, and `package.json` parses. ### 2026-08-24 — dev agent, QA round 1 fixes @@ -295,7 +295,7 @@ exactly QA's reproduction. Restored the constant and the file; the probe test is not in the tree. **Re-verified on the real binary, as QA asked.** Built -`target/release/vfmt-server`, gave it a scratch workspace whose `vfmt.toml` +`target/release/lucisv-server`, gave it a scratch workspace whose `lucisv.toml` names a 20 000-level chain, and drove a raw stdio LSP session (`initialize` + `workspace/symbol` + `shutdown`/`exit`): exit code 0, both requests answered, the package declared in the chain found in the index, and @@ -314,7 +314,7 @@ work log above. **Gates after the fix.** `cargo fmt --all -- --check` clean, `cargo clippy --all-targets` silent, `cargo test --workspace` green — 1008 tests (one new -regression test), `vfmt_core` at 69 unit tests. +regression test), `lucisv_core` at 69 unit tests. ## QA log @@ -323,8 +323,8 @@ regression test), `vfmt_core` at 69 unit tests. **Verification of the dev's claims.** `cargo fmt --all -- --check` clean, `cargo clippy --all-targets --workspace` silent, `cargo test --workspace` green — 1007 tests, matching the Work log's count exactly. Built -`target/debug/vfmt-server` and `target/release/vfmt-server` and ran `node -editors/vscode/smoke.js target/debug/vfmt-server` — OK. `node --check` on +`target/debug/lucisv-server` and `target/release/lucisv-server` and ran `node +editors/vscode/smoke.js target/debug/lucisv-server` — OK. `node --check` on `editors/vscode/extension.js` and `smoke.js`, and `package.json` parses as JSON. Read `filelist.rs`, the `config.rs` diff, `state.rs`, `server.rs` and `settings.rs` in full; every claim in the Handshakes/Status sections checks @@ -336,11 +336,11 @@ in any changed file (`grep` over the diffs and over `filelist.rs`), no comments (`Filelist`, `read`, the new `FileConfig::filelist`, `ClientSettings::filelist`, `Workspace::has_roots`, etc.). -**Adversarial testing.** Built a throwaway `vfmt_core` example (`cargo run -p -vfmt_core --example `, deleted afterwards — not committed) to drive +**Adversarial testing.** Built a throwaway `lucisv_core` example (`cargo run -p +lucisv_core --example `, deleted afterwards — not committed) to drive `filelist::read` directly, plus a small Node script driving the real -`vfmt-server` binary over stdio the way `smoke.js` does, against a -`vfmt.toml`-configured filelist. Tried: a filelist that `-f`s itself, two +`lucisv-server` binary over stdio the way `smoke.js` does, against a +`lucisv.toml`-configured filelist. Tried: a filelist that `-f`s itself, two filelists that `-f` each other, `-f` with no argument, a bare `+define+` line, `+define+N=a=b`, an unterminated `${VAR`, CRLF line endings, a path naming a directory, an empty filelist, a path containing a space, a `$` alone @@ -376,8 +376,8 @@ ones. A straight chain of uniquely-named filelists, each `-f`-ing the next aborting` (SIGABRT) once it's deep enough: - `filelist::read` alone: overflows around 1500–3000 levels in a debug build, and somewhere between 10 000 and 30 000 in `--release`. - - The **real `target/release/vfmt-server` binary**, given a workspace - whose `vfmt.toml` names such a filelist, crashes the same way on + - The **real `target/release/lucisv-server` binary**, given a workspace + whose `lucisv.toml` names such a filelist, crashes the same way on `initialize` (confirmed via a raw stdio LSP session): `closed: code=null signal=SIGABRT`. This takes down the whole language-server process for every open file, not just a diagnostic on one buffer. @@ -404,7 +404,7 @@ aborting` (SIGABRT) once it's deep enough: **Finding 2 (Low) — no quoting, so a path containing a space cannot be listed.** The tokenizer is `raw.split_whitespace()` -(`crates/vfmt_core/src/filelist.rs:76`); a filelist line like `sp ace/file.sv` +(`crates/lucisv_core/src/filelist.rs:76`); a filelist line like `sp ace/file.sv` splits into two tokens and neither resolves, producing two spurious "no such file" warnings instead of one correct entry. Real EDA tools vary here (some support `"quoted paths"`, some don't support spaces at all), so @@ -441,7 +441,7 @@ worklist) to `Reader::nested`/`Reader::filelist` before this ships, with a masked-corruption-style regression test pinning that a filelist nested past the guard still returns a usable `Filelist` with a warning rather than aborting — and re-run the same deep-chain probe against the real -`vfmt-server` binary as part of that fix's verification, since that's where +`lucisv-server` binary as part of that fix's verification, since that's where the failure is actually user-visible. ## Review diff --git a/docs/features/format-cache/README.md b/docs/features/format-cache/README.md index 84b9826..fbbd89c 100644 --- a/docs/features/format-cache/README.md +++ b/docs/features/format-cache/README.md @@ -2,11 +2,11 @@ ## Goal -Make a repeat `vfmt` run over an unchanged tree do (almost) no work. +Make a repeat `lucisv` run over an unchanged tree do (almost) no work. `TODO.md` §3's content-hash cache item: remember, per file, that *this -exact content, under these settings, on this vfmt version* was already +exact content, under these settings, on this lucisv version* was already formatted, and skip the whole read-parse-format-verify pipeline on the -next run. Monorepo RTL trees are the case that matters — vfmt's per-file +next run. Monorepo RTL trees are the case that matters — lucisv's per-file cost is dominated by parse + format + the two runtime safety checks (equivalence and convergence), all of which are pure functions of `(content, config)`, so a cache hit is exactly as trustworthy as the run @@ -24,29 +24,29 @@ what they would have been anyway (modulo one extra summary segment). true (a formatter that reads the file's *name*, or another file), this cache silently goes wrong and the assumption must be revisited here. - **`line-length` and `indent` are the whole config surface.** They are - the only two things `vfmt_core::config::FileConfig` can put into + the only two things `lucisv_core::config::FileConfig` can put into `vlog_formatter::Config`. The key stores the *resolved values*, not the - config file's path or mtime — so moving a `vfmt.toml` around, or + config file's path or mtime — so moving a `lucisv.toml` around, or switching from a file to an equivalent `--line-length` flag, correctly does **not** invalidate anything, while a real value change does. `exclude` is not part of the key: it changes *which* files are visited, never how one is formatted. - **The version string is the workspace version** (`env!("CARGO_PKG_VERSION")` - read inside `vfmt_core`, whose `version.workspace = true` makes it the + read inside `lucisv_core`, whose `version.workspace = true` makes it the same string for every crate here). This is a coarse proxy for "the formatter's behavior": two builds of the same version with different code — a `cargo build` in the middle of development — share a version - and therefore share cache entries. **Developers of vfmt itself should + and therefore share cache entries. **Developers of lucisv itself should use `--no-cache`** (the test suite does); released binaries are fine. - **Paths are keys, byte-for-byte as processed.** No canonicalization, no symlink resolution (config discovery is lexical for the same reason). - `vfmt .` and `vfmt /abs/path/to/tree` therefore do not share entries; + `lucisv .` and `lucisv /abs/path/to/tree` therefore do not share entries; they just each build their own. A path that is not valid UTF-8, or that contains a tab or a newline, is never cached (it cannot be written to the line-based store) — those files are simply always re-formatted. -- **The cache is not a lock.** Two vfmt processes may write it +- **The cache is not a lock.** Two lucisv processes may write it concurrently; see "Concurrency". -- **`vfmt check` (the linter) is not cached.** `--no-cache` / +- **`lucisv check` (the linter) is not cached.** `--no-cache` / `--cache-dir` are accepted there and do nothing, so a wrapper script can pass them unconditionally. Lint results depend on the rule selection, the waiver comments and the fix mode; caching them is a @@ -56,7 +56,7 @@ what they would have been anyway (modulo one extra summary segment). ### The key -Per file: **(content hash, line-length, indent, vfmt version)**, keyed on +Per file: **(content hash, line-length, indent, lucisv version)**, keyed on the file path. - **Content hash: hand-rolled FNV-1a, 64-bit**, over the file's bytes @@ -69,12 +69,12 @@ the file path. stable within one version. FNV-1a is ~15 lines, has no dependency, and is byte-exactly specified. It is not cryptographic and does not need to be (see collision posture). -- Hashing costs one pass over bytes vfmt has already read into memory; +- Hashing costs one pass over bytes lucisv has already read into memory; it is noise next to parsing. ### Collision posture (stated honestly) -A 64-bit content hash means a collision could make vfmt skip a file that +A 64-bit content hash means a collision could make lucisv skip a file that actually changed — a wrong "clean" verdict, the only way this feature can produce a wrong result. Two things bound it: @@ -90,9 +90,9 @@ produce a wrong result. Two things bound it: It is *not* collision-resistant against an adversary who can choose the file contents: FNV-1a is trivially invertible, so someone able to write -files in your tree can craft two files with the same hash and make vfmt +files in your tree can craft two files with the same hash and make lucisv skip the second. That threat model (an attacker with write access to your -source tree, trying to get past a formatter) is not one vfmt defends +source tree, trying to get past a formatter) is not one lucisv defends against; `--no-cache` removes the cache from the picture entirely if it ever matters. This is documented rather than fixed because the fix (a cryptographic hash) is a dependency or ~200 lines of SHA-256 for a threat @@ -118,13 +118,13 @@ the hash of **the bytes that were written** goes in. | Miss, in-place write failed (I/O) | — | **nothing** | error, exit 2 | | Parse error / failed safety check / contained panic | — | **nothing** | error, exit 2 | | `--stdout` | cache off for the run | nothing | printed | -| stdin (`vfmt -`) | never | never | as before | +| stdin (`lucisv -`) | never | never | as before | Why "would reformat" and errors are never cached: the fix for both is -**external** to vfmt. A dirty file gets fixed by an editor or by -`vfmt` without `--check`; a parse error gets fixed by editing the source +**external** to lucisv. A dirty file gets fixed by an editor or by +`lucisv` without `--check`; a parse error gets fixed by editing the source or by teaching the parser new syntax. If either verdict were cached, a CI -`vfmt --check` would keep reporting a stale complaint (or, worse, stop +`lucisv --check` would keep reporting a stale complaint (or, worse, stop reporting a real one) until someone thought to clear the cache. Caching only the fixed-point verdict also means the cache can never *invent* work or *suppress* a diagnostic: the worst a stale, wrong or missing entry can @@ -148,10 +148,10 @@ interesting characters. Lines are sorted by path, so the file is stable and diffable and two runs over the same tree produce byte-identical cache files. -**No serde, no TOML, no JSON.** `vfmt` and `vfmt_core` have exactly one -third-party dependency between them (`rayon`, in `vfmt`). `serde` exists -in the workspace only because `vfmt_server` needs it for LSP wire -messages — `vfmt`/`vfmt_core` do not depend on it, and taking it here +**No serde, no TOML, no JSON.** `lucisv` and `lucisv_core` have exactly one +third-party dependency between them (`rayon`, in `lucisv`). `serde` exists +in the workspace only because `lucisv_server` needs it for LSP wire +messages — `lucisv`/`lucisv_core` do not depend on it, and taking it here would put a proc-macro build step into the CLI's dependency graph to encode five fields. Five fields on a line need no schema; CLAUDE.md's "standard library first" says so. @@ -165,8 +165,8 @@ Loading, corruption and staleness: starts empty. A file we cannot fully parse is not a file we can prove we wrote; partial trust is not worth the branch. - A well-formed line whose *version* is not this binary's is dropped - silently (that is not corruption, just another vfmt's entry). It is not - carried forward on write, so alternating between two vfmt versions + silently (that is not corruption, just another lucisv's entry). It is not + carried forward on write, so alternating between two lucisv versions rebuilds the cache each time. - **Writing is atomic**: the new text goes to `/cache..tmp` and is `rename`d over `cache`. A reader therefore sees the old file or @@ -183,7 +183,7 @@ Loading, corruption and staleness: The cache directory gets a self-ignoring `.gitignore` containing `*` written into it when it is created, the same trick cargo uses for -`target/`; `/.vfmt_cache` is also listed in this repo's root +`target/`; `/.lucisv_cache` is also listed in this repo's root `.gitignore`. ### Flags @@ -191,16 +191,16 @@ written into it when it is created, the same trick cargo uses for | Flag | Meaning | |---|---| | `--no-cache` | do not read and do not write the cache. Nothing is created on disk | -| `--cache-dir ` | use this directory instead of `.vfmt_cache` | +| `--cache-dir ` | use this directory instead of `.lucisv_cache` | -**Where the default lives: the current directory.** `.vfmt_cache` is +**Where the default lives: the current directory.** `.lucisv_cache` is resolved relative to the cwd, not to the input paths and not to the config file's directory. This is wrong for the multi-project invocation -(`vfmt ~/a/rtl ~/b/rtl` from a third directory writes one cache in that +(`lucisv ~/a/rtl ~/b/rtl` from a third directory writes one cache in that third directory, and running the same command from elsewhere starts a new one), and it is what ruff did for years before growing a per-project resolution. The honest v1 rule is "one cwd, one cache", which is exactly -right for the overwhelmingly common `cd repo && vfmt --check .` in CI and +right for the overwhelmingly common `cd repo && lucisv --check .` in CI and in a pre-commit hook, and `--cache-dir` covers everything else. Making the default follow the config-file root is the natural next step and is deliberately not guessed at here. @@ -230,7 +230,7 @@ is only mutated in the serial loop afterwards; the file is written once, single-threaded, at the end of the run. There is no lock and no shared mutable state. -Two vfmt processes running at once: last writer wins the `rename`, so one +Two lucisv processes running at once: last writer wins the `rename`, so one process's entries can be lost. That is self-healing and safe: - An entry only ever asserts *content that this process verified*, so a @@ -255,18 +255,18 @@ the only writer of an entry is the code path that just observed re-tested with the cache on. - **Consumes `docs/features/config-discovery/README.md`'s promise** that the cache key "must include the resolved per-file settings … not just - file content + vfmt version". Done, with the *values* + file content + lucisv version". Done, with the *values* (`Config::max_width`, `Config::indent_width`) rather than the config - file's identity, so two trees governed by different `vfmt.toml` files + file's identity, so two trees governed by different `lucisv.toml` files that happen to say the same thing share entries correctly. - **Consumes `vlog_formatter::Config`** read-only, for its two fields. Nothing in `vlog_parser` / `vlog_formatter` / `vlog_linter` was touched. -- **Where the module lives: `vfmt_core::cache`,** next to `config` and - `walk`. `vfmt_core` is by its own doc comment "the parts of vfmt that +- **Where the module lives: `lucisv_core::cache`,** next to `config` and + `walk`. `lucisv_core` is by its own doc comment "the parts of lucisv that decide *which* files are processed and *with what settings*", and "this file is already formatted, skip it" is the third member of that family. - It also keeps the door open for `vfmt_server`: a language server that + It also keeps the door open for `lucisv_server`: a language server that wanted to avoid re-formatting an unedited buffer on save would want the same predicate, and would otherwise have to duplicate the file format. Nothing in the module is CLI-specific — it takes paths, `u64`s and two @@ -276,7 +276,7 @@ the only writer of an entry is the code path that just observed or every user with a warm cache keeps their old formatting on files that did not otherwise change. This is the same discipline ruff and black need. Within-version development builds must use `--no-cache`. -- **Promises to `crates/vfmt/tests/cli.rs`:** the shared `run` helper +- **Promises to `crates/lucisv/tests/cli.rs`:** the shared `run` helper appends `--no-cache`, so the pre-existing tests keep running with the cache out of the picture (they share one cwd — the crate root — and would otherwise share one cache directory *and* pollute the repo with @@ -285,13 +285,13 @@ the only writer of an entry is the code path that just observed ## Status / TODO -- [x] `vfmt_core::cache`: FNV-1a `content_hash`, `Entry`, `Cache` +- [x] `lucisv_core::cache`: FNV-1a `content_hash`, `Entry`, `Cache` (`load` / `disabled` / `is_clean` / `record` / `store`). - [x] Hand-rolled tab-separated store, sorted by path, atomic temp+rename write, self-ignoring `.gitignore` in the cache dir. - [x] Corrupt / unreadable / wrong-version entries ignored, never fatal. - [x] `--no-cache` and `--cache-dir ` in `args.rs` and `--help`, - accepted (and inert) for `vfmt check`. + accepted (and inert) for `lucisv check`. - [x] Lookup at the top of `process_file`; entries collected through the indexed `par_iter` results and recorded serially in input order. - [x] Only clean verdicts recorded; `--check`/`--diff`/errors/`--stdout` @@ -299,7 +299,7 @@ the only writer of an entry is the code path that just observed - [x] `N files from cache` summary segment. - [x] Unit tests in `cache.rs` (hash stability, round-trip, corruption, version filtering, pruning, atomicity of the rename). -- [x] CLI tests in `crates/vfmt/tests/cli.rs` (warm run does no work, +- [x] CLI tests in `crates/lucisv/tests/cli.rs` (warm run does no work, content change invalidates, indent change invalidates, wrong version ignored, `--no-cache`, corrupt file tolerated, `--check` exit codes, `--threads` determinism with a warm cache, default @@ -315,18 +315,18 @@ the only writer of an entry is the code path that just observed - Read CLAUDE.md, `TODO.md` §3, `docs/features/parallel-files/README.md` (whose Handshakes section pre-specifies where the lookup goes) and `docs/features/config-discovery/README.md` (whose Handshakes section - pre-specifies the key), then all of `crates/vfmt/src` and - `crates/vfmt_core/src`. + pre-specifies the key), then all of `crates/lucisv/src` and + `crates/lucisv_core/src`. -**Module placement.** `vfmt_core::cache`, reasoning in Handshakes. It -costs nothing today (`vfmt` is the only caller) and keeps `vfmt_core` +**Module placement.** `lucisv_core::cache`, reasoning in Handshakes. It +costs nothing today (`lucisv` is the only caller) and keeps `lucisv_core` dependency-free — `Entry` carries two bare `usize`s rather than a `vlog_formatter::Config`, so the crate still has an empty `[dependencies]`. **The store format.** Tab-separated, path last, sorted, one line per entry. Rejected alternatives: (a) `serde`+`serde_json` — real dependency -for five fields, and `vfmt`/`vfmt_core` currently have one dependency +for five fields, and `lucisv`/`lucisv_core` currently have one dependency total; (b) a binary format — unreadable when debugging exactly the kind of "why did it skip that file?" question a cache creates; (c) one file per cached path (ruff's older layout) — thousands of tiny files, and the @@ -347,14 +347,14 @@ forever in a tree where files get renamed. **Test isolation.** Integration tests run with cwd = the crate directory, so a default-on cache would (a) create -`crates/vfmt/.vfmt_cache/` in the working tree and (b) make tests +`crates/lucisv/.lucisv_cache/` in the working tree and (b) make tests interfere: `thread_count_changes_nothing_but_speed` runs the same tree twice and compares stderr byte-for-byte, which a warm cache would change. The `run` helper therefore appends `--no-cache`, and the cache tests use a new `run_raw` with an explicit `--cache-dir` (or a set cwd for the default-location test). Recorded as a handshake so nobody removes it. -**Measured.** Release build, 10 logical cores, `vfmt --check` over the +**Measured.** Release build, 10 logical cores, `lucisv --check` over the corpus, best of 10 runs (mean in the work log's raw numbers was within 10 %). The corpus was formatted first, since a tree that is already clean is exactly the case the cache exists for; the "612 files" column @@ -394,7 +394,7 @@ correctness risk. Not taken. **Attacked before handing over** (release binary, outside the test suite; every one of these degrades quietly, none changes an exit code): -- **Eight vfmt processes at once** over the same 612-file tree and the +- **Eight lucisv processes at once** over the same 612-file tree and the same cache directory: all eight exit 0, no leftover `*.tmp`, the resulting file has 612 well-formed lines (`awk -F'\t' 'NF!=5'` finds none), and the next run is `612 files from cache`. Last-writer-wins, @@ -412,7 +412,7 @@ suite; every one of these degrades quietly, none changes an exit code): as cached and exits 0, which is the proof that a hit skips the *whole* pipeline rather than doing the work and agreeing. That is now the CLI test `a_hit_skips_the_work_entirely`; the same trick with the wrong - version stamp is `an_entry_from_another_vfmt_version_is_ignored`. + version stamp is `an_entry_from_another_lucisv_version_is_ignored`. **Blocked by the workspace, as parallel-files was.** A concurrent agent is mid-landing alignment inference in `vlog_formatter` (`align.rs` plus @@ -420,23 +420,23 @@ is mid-landing alignment inference in `vlog_formatter` (`align.rs` plus gates were therefore run in a scratchpad copy of the workspace with *only* their three crates reverted to `HEAD` (`git checkout -- crates/vlog_{formatter,parser,semantic}`); my own files were copied in -from the real tree. Nothing outside `crates/vfmt`, `crates/vfmt_core`, +from the real tree. Nothing outside `crates/lucisv`, `crates/lucisv_core`, `docs/features/format-cache`, `README.md`, `TODO.md` and `.gitignore` -was edited, and `cargo fmt` was run scoped (`-p vfmt -p vfmt_core`) so +was edited, and `cargo fmt` was run scoped (`-p lucisv -p lucisv_core`) so no file of theirs was touched. Re-run everything on the merged tree once their work lands. **Gates** (scratchpad tree, described above): -- `cargo test -p vfmt -p vfmt_core`: 28 unit (`vfmt`) + **63** CLI - (`vfmt`) + **45** unit (`vfmt_core`), all green. New: 15 CLI tests, 14 +- `cargo test -p lucisv -p lucisv_core`: 28 unit (`lucisv`) + **63** CLI + (`lucisv`) + **45** unit (`lucisv_core`), all green. New: 15 CLI tests, 14 `cache.rs` unit tests, 1 `args.rs` test. - `cargo test --workspace`: green, no churn in any other crate's tests — this feature changes no formatter output. - `cargo clippy --workspace --all-targets`: silent. -- `cargo fmt -p vfmt -p vfmt_core -- --check`: clean. +- `cargo fmt -p lucisv -p lucisv_core -- --check`: clean. - No `Cargo.toml` / `Cargo.lock` change: no new dependency, and - `vfmt_core` still has an empty `[dependencies]`. + `lucisv_core` still has an empty `[dependencies]`. ## QA log @@ -454,12 +454,12 @@ was reverted). All cargo commands below ran in that copy; the real tree was touched only to append this entry. No commit/push. **Gates, reproduced from scratch in the copy:** -- `cargo build -p vfmt -p vfmt_core --release` — clean. -- `cargo test -p vfmt -p vfmt_core`: 28 (`vfmt` unit) + 63 (`cli.rs`) + 45 - (`vfmt_core` unit) = 136, all green, matching the claimed counts exactly. +- `cargo build -p lucisv -p lucisv_core --release` — clean. +- `cargo test -p lucisv -p lucisv_core`: 28 (`lucisv` unit) + 63 (`cli.rs`) + 45 + (`lucisv_core` unit) = 136, all green, matching the claimed counts exactly. - `cargo test --workspace`: every crate green, no churn elsewhere. - `cargo clippy --workspace --all-targets`: silent. -- `cargo fmt -p vfmt -p vfmt_core -- --check`: clean. +- `cargo fmt -p lucisv -p lucisv_core -- --check`: clean. - `git diff --stat HEAD -- Cargo.toml Cargo.lock crates/*/Cargo.toml`: empty — no dependency added, confirmed. @@ -476,7 +476,7 @@ the corrupt-file/version unit tests, all passing). Confirmed by hand: - `--cache-dir` pointing at an existing plain file, and a `chmod 500` cache directory: both exit 0, run output unaffected, nothing written — matches "silent write failures." -- 8 parallel `vfmt --check` processes over a shared 200-file tree and +- 8 parallel `lucisv --check` processes over a shared 200-file tree and cache dir: all exit 0, zero `*.tmp` leftovers, exactly 200 well-formed lines afterward (`awk -F'\t' 'NF!=5'` empty), next run is a clean 200-file hit. @@ -491,11 +491,11 @@ independent repro: file gives `would reformat: ...`/exit 1 on three consecutive `--check` runs, never "from cache" — the stale-CI-verdict failure mode does not occur. -- `--stdout` never creates `.vfmt_cache` even with a warm entry present +- `--stdout` never creates `.lucisv_cache` even with a warm entry present for the same file (prints every time, does not read or write the cache) — matches `cache_enabled() == !no_cache && !stdout` in `args.rs`. -- `vfmt check --no-cache --cache-dir X`: exits normally (lint +- `lucisv check --no-cache --cache-dir X`: exits normally (lint verdict, unrelated to formatting), creates no cache artifact under either name — accepted-but-inert confirmed. - `run_stdin` in `main.rs` never references `Cache` at all — stdin mode @@ -505,11 +505,11 @@ independent repro: chmod-000-after-caching repro below) proves the lookup happens before `format_contained` is ever called. -**Claim 3 (flags).** `--no-cache`: no `.vfmt_cache` appears for either a -`vfmt ` or `vfmt --stdout ` run — checked directly with `ls`. +**Claim 3 (flags).** `--no-cache`: no `.lucisv_cache` appears for either a +`lucisv ` or `lucisv --stdout ` run — checked directly with `ls`. `--cache-dir`: exercised throughout. Default cwd-relative location and self-ignoring `.gitignore`: reproduced outside the test suite too -(`vfmt --check .` from a fresh dir leaves exactly `.vfmt_cache/{cache, +(`lucisv --check .` from a fresh dir leaves exactly `.lucisv_cache/{cache, .gitignore}`, the latter reading `*\n`). The README's own "Where the default lives" paragraph states the multi-root limitation honestly. @@ -568,10 +568,10 @@ strictly warm < cold < `--no-cache` on every run observed. file that is actually dirty): the run trusts it and exits 0. This is exactly the collision/tamper posture the README's "Collision posture" section states outright — "an attacker with write access to your - source tree ... is not one vfmt defends against" — so this is + source tree ... is not one lucisv defends against" — so this is documentation matching behavior, not an undisclosed hole. - **Two directories with differently-formatted-but-equal-valued - `vfmt.toml`** (`indent = 2` vs `indent = 2 # comment`), same + `lucisv.toml`** (`indent = 2` vs `indent = 2 # comment`), same file path: still a hit — confirms the key is the resolved *value*, not the config file's text or identity. - **CRLF file**: never reaches a clean fixed point (always "would @@ -620,7 +620,7 @@ Points reviewed and accepted: small touch, right instinct. The whole-file-discard-on-any-malformed- line rule is the right paranoia for a value store. 4. **Value-keyed config** (not config-file identity) means two - differently-written-but-equal vfmt.tomls share hits — QA probed it. + differently-written-but-equal lucisv.tomls share hits — QA probed it. The cwd-relative default cache location is the honest v1 limitation, stated. 5. **Both agents' isolation discipline under the concurrent alignment diff --git a/docs/features/format-fences/README.md b/docs/features/format-fences/README.md index 5b8d56a..9b1c34f 100644 --- a/docs/features/format-fences/README.md +++ b/docs/features/format-fences/README.md @@ -4,7 +4,7 @@ Let an author switch the formatter off for a stretch of code with `// verilog_format: off` … `// verilog_format: on` (Verible's spelling, plus a -short `// vfmt: off` / `// vfmt: on` alias) and get those bytes back exactly +short `// lucisv: off` / `// lucisv: on` alias) and get those bytes back exactly as they were written. Hand-aligned lookup tables, generated blocks, and column-aligned instance connections are the cases every RTL codebase has; without an escape hatch they are the reason a formatter never gets adopted. @@ -19,18 +19,18 @@ A fence is a **line comment** whose text, after stripping the leading `//` and trimming whitespace on both sides, is *exactly* one of: ``` -verilog_format: off vfmt: off -verilog_format: on vfmt: on +verilog_format: off lucisv: off +verilog_format: on lucisv: on ``` Consequences, all deliberate and all tested: -- `//verilog_format: off` (no space) and `// vfmt: on ` are fences — +- `//verilog_format: off` (no space) and `// lucisv: on ` are fences — the text is trimmed. `// verilog_format:off` is **not** (no space after the colon; the match is exact, not fuzzy). -- **A fence with trailing text is not a fence.** `// vfmt: off (for now)` +- **A fence with trailing text is not a fence.** `// lucisv: off (for now)` formats as an ordinary comment. Rationale: the alternative — prefix - matching — silently turns `// vfmt: off-by-one bug here` into a formatting + matching — silently turns `// lucisv: off-by-one bug here` into a formatting switch, and a fence that fires by accident is worse than one that does not fire at all. If the author wants a note, it goes on its own line. - **Block comments are not fences.** `/* verilog_format: off */` is an @@ -40,7 +40,7 @@ Consequences, all deliberate and all tested: but whitespace, or another comment, before it on that line). A comment on the same line as preceding *code* is attached to that code as *trailing* trivia, and `Meta.trailing` is an `Option` with no span — there is - nothing to splice from. So `wire a; // vfmt: off` is an ordinary comment. + nothing to splice from. So `wire a; // lucisv: off` is an ordinary comment. See Handshakes for the parser change that would lift this. - The alias and the long form are interchangeable: an `off` in either spelling is closed by an `on` in either spelling. @@ -143,11 +143,11 @@ either, so no stray blank lines appear where the region swallowed items. - **Before the region**: the usual item separator, blank-line-aware, driven by the `off` fence comment's own `blank_before` flag (which is also the item's, since a `Meta`'s `blank_before` is its first leading comment's). - A blank line before `// vfmt: off` survives; two or more collapse to one, + A blank line before `// lucisv: off` survives; two or more collapse to one, as everywhere else. - **First line of the region**: byte-exact, because the region starts at the line start, not at the `//`. The exception is a fence preceded on its own - line by *another comment* (`/* a */ // vfmt: off`): there the region starts + line by *another comment* (`/* a */ // lucisv: off`): there the region starts at the `//`, and the other comment is formatted onto the line above. Still idempotent — on the next pass the fence does start its line. - **Inside the region**: nothing is touched, trailing whitespace on interior @@ -272,7 +272,7 @@ after a line break or at the very start of the output, which is where the fact rather than a claim, and it is what makes the safety net green by construction instead of by argument. - **Chose exact-match fence text over prefix matching.** A prefix match makes - `// vfmt: off-by-one` a formatting switch. Exact match's failure mode is a + `// lucisv: off-by-one` a formatting switch. Exact match's failure mode is a fence that does not fire, which the author sees immediately in the diff. - **Fences are leading comments only, and only line comments.** The leading restriction is forced: `Meta.trailing` is an `Option` and carries no @@ -336,7 +336,7 @@ after a line break or at the very start of the output, which is where the `HardLine` after each comment and then a `BlankLine` before the next. Reproduced on the pre-change binary; not touched here because fixing it churns snapshots. -- Did not touch `crates/vlog_parser`, `crates/vfmt`, `verify.rs`, or +- Did not touch `crates/vlog_parser`, `crates/lucisv`, `verify.rs`, or `tools/`. Did not run `git commit`/`git push`. **Results:** `cargo test -p vlog_formatter` **53 passed** (was 42: +5 matcher @@ -355,7 +355,7 @@ baseline. No `.sv`/`.v` corpus file contains a fence comment (`grep -rl` over all 820: 0 hits; the only two `verilog_format` matches in the tree are a CI YAML comment and a Verible build script), so the feature is inert there, as expected. Corpus repos `git status --porcelain` clean apart from the -pre-existing untracked `.vfmt-corpus-rev` stamps. +pre-existing untracked `.lucisv-corpus-rev` stamps. Files touched: `crates/vlog_formatter/src/fence.rs` (new), `crates/vlog_formatter/src/{lib,doc,printer,format}.rs`, @@ -380,7 +380,7 @@ identical). — 5 in `fence.rs` + 3 pre-existing in `printer.rs` — 1+4+6+2+32 across `cases.rs`/`deep_nesting.rs`/`fences.rs`/`fixtures.rs`/`verification.rs`). Matches the claimed 42→53. -- `cargo test --workspace`: **194 passed, 0 failed** (40+21 in `vfmt`, 53 in +- `cargo test --workspace`: **194 passed, 0 failed** (40+21 in `lucisv`, 53 in `vlog_formatter`, 49+19+12 in `vlog_parser` — the last three carry the concurrent error-recovery agent's work, not this feature's). - `cargo clippy -p vlog_formatter --all-targets`: 0 warnings. @@ -401,14 +401,14 @@ identical). - `tools/corpus_check.sh corpus`: 820 files, **0 verification errors, 0 crashes**, TSV md5 `3fab114f4f00626b254259e9dafe0ed7` — **matches** the claimed baseline exactly (byte-identical results file). `grep -rl` for - `verilog_format|vfmt:` across all `.sv/.v/.svh/.vh` in `corpus/`: **0 + `verilog_format|lucisv:` across all `.sv/.v/.svh/.vh` in `corpus/`: **0 hits**, confirming the feature is inert on the corpus as claimed. **Claim 1 (fence grammar) — PASS.** Direct `fence_of()` probes: -`// vfmt: off ` (single trailing space) *is* a fence — correctly so, the +`// lucisv: off ` (single trailing space) *is* a fence — correctly so, the grammar trims surrounding whitespace and only disqualifies non-whitespace trailing text; my first pass at this check used the wrong expectation and -was self-corrected. `// VFMT: off` (case), `// vfmt: off` (inner double +was self-corrected. `// LUCISV: off` (case), `// lucisv: off` (inner double space), `// verilog_format:off` (no space after colon) are all correctly rejected — matches the documented grammar exactly, no drift between prose and code. Block comments and same-line trailing comments confirmed inert @@ -541,7 +541,7 @@ zero region byte changes and zero new verification failures. Points reviewed and accepted: 1. **Exact-match fence grammar** (trailing text disqualifies, no-space - `vfmt:off` disqualifies): strict grammars over lenient ones is the + `lucisv:off` disqualifies): strict grammars over lenient ones is the config-discovery lesson applied again — a fence that half-matches silently doing nothing would be the worst outcome, and the current rule makes it at least predictable. Verible-compatible spelling plus diff --git a/docs/features/formatter-bug-fixes/README.md b/docs/features/formatter-bug-fixes/README.md index d42346e..a7f499d 100644 --- a/docs/features/formatter-bug-fixes/README.md +++ b/docs/features/formatter-bug-fixes/README.md @@ -3,7 +3,7 @@ ## Goal Fix the five confirmed formatter/parser bugs the case-tables and safety-net -features found and parked. All five made `vfmt` refuse to write output (exit 2) +features found and parked. All five made `lucisv` refuse to write output (exit 2) because the runtime safety net caught them as token loss, comment motion or non-convergence — so every one of them was a file the formatter could not format at all. Each fix lands with its parked `#SKIP` case turned into a live @@ -98,7 +98,7 @@ The five: - `Meta.trailing` is still a bare `String`: several trailing comments merge into one there, and it is printed verbatim on one line, so it needs no position. -- Nothing outside `vlog_parser` / `vlog_formatter` was touched. `crates/vfmt` +- Nothing outside `vlog_parser` / `vlog_formatter` was touched. `crates/lucisv` and the top-level `README.md` (another agent's scope) are untouched; `cargo fmt` was run and left those files byte-identical. @@ -235,7 +235,7 @@ reader). `cargo clippy --all-targets` is now completely silent. **Verification.** Beyond the suite: a hand-written stress file combining all five constructs (labeled package/function/task/fork, a starred sensitivity list with a comment, a commented concatenation, a multi-instance declaration, -an indented banner comment) formats cleanly, and `vfmt` on its own output is +an indented banner comment) formats cleanly, and `lucisv` on its own output is byte-identical. Every bug's original repro from the two feature READMEs was re-run through the built CLI and now exits 0. @@ -254,7 +254,7 @@ and all 4 `tests/fixtures/*.sv` files through 3 passes independently of scripts left at `/private/tmp/claude-501/-Users-guoliangchen-repo-verilogrustformatter/9ecac3b9-8a0e-4065-85de-23cc2a396bad/scratchpad/{stress,stress3.py,regress3.py}` for reference (outside the repo). **Tool chain** (workspace root): -- `cargo test --workspace`: **70/70 pass**, 0 failed (18 `vfmt` unit + 12 +- `cargo test --workspace`: **70/70 pass**, 0 failed (18 `lucisv` unit + 12 `cli.rs` + 3 `vlog_formatter` unit + 1 `cases.rs` (covering all 200 cases internally) + 2 `fixtures.rs` + 19 `verification.rs` + 15 `vlog_parser` unit). Confirmed 200 cases / 0 `#SKIP` two ways: `grep -c '^====' ` per @@ -360,7 +360,7 @@ scripts left at `/private/tmp/claude-501/-Users-guoliangchen-repo-verilogrustfor third code path exists for either type. 7. **200 cases / 0 `#SKIP` / green workspace / silent clippy / clean fmt / self-format-stable — PASS**, all independently reproduced above. - Additionally ran vfmt-on-its-own-output beyond the work log's one + Additionally ran lucisv-on-its-own-output beyond the work log's one hand-written file: **every one of the 200 committed cases' expected outputs plus all 4 real fixture files** (204 total) through 3 passes via `regress3.py` — 0 failures, 0 cases where pass1's output differs from @@ -399,7 +399,7 @@ scripts left at `/private/tmp/claude-501/-Users-guoliangchen-repo-verilogrustfor unchanged context, not new. - No new dependencies (`git diff` on all three `Cargo.toml` + `Cargo.lock`: empty). No `#[allow]` added anywhere. `TODO.md`, top-level `README.md`, - and `crates/vfmt/` are all byte-identical to `HEAD` (`git diff --stat` + and `crates/lucisv/` are all byte-identical to `HEAD` (`git diff --stat` empty for all three) — matches the Handshakes claim that nothing outside `vlog_parser`/`vlog_formatter` was touched. @@ -408,7 +408,7 @@ scripts left at `/private/tmp/claude-501/-Users-guoliangchen-repo-verilogrustfor Specifically tried to break something that used to work. Constructed and fixed (after finding my own test-file bugs, not formatter bugs — `initial` inside a function, `always` inside a function, `fork` at package scope are -all illegal Verilog, not vfmt defects) a combined-stress file +all illegal Verilog, not lucisv defects) a combined-stress file (`12_combo_stress.sv`: banner comment + labeled package/function/nested begin + `@( /* c */ * )` + commented concatenation + multi-instance, all in one file) — 3-pass stable, matches the work log's own combined-stress claim. @@ -482,7 +482,7 @@ the exact 100/101-column multi-instance boundary, and mixed sensitivity-list spellings). The three documented remaining refusals all still refuse cleanly with an accurate error and leave the file byte-identical. CLAUDE.md compliance (no unwrap/expect/panic in library paths, no new deps, no -un-explained `#[allow]`, TODO.md/README.md/`vfmt` untouched) all confirmed +un-explained `#[allow]`, TODO.md/README.md/`lucisv` untouched) all confirmed by direct inspection, not just by trusting the work log's claims. ## Review diff --git a/docs/features/hierarchy/README.md b/docs/features/hierarchy/README.md index 1be9fd8..8f88816 100644 --- a/docs/features/hierarchy/README.md +++ b/docs/features/hierarchy/README.md @@ -7,7 +7,7 @@ M11 of the refactoring plan (`docs/features/refactor/README.md`), TODO.md §8: "Who instantiates this module?" and "what does this module instantiate?" are the two questions a hardware engineer asks about a design they did not write, -and until now vfmt could answer neither without a grep. LSP already has the +and until now lucisv could answer neither without a grep. LSP already has the shape for both: its call hierarchy is a graph of callers and callees, and a design's module hierarchy is that same graph under different names — the modules are the nodes and an instantiation is the call. So @@ -78,7 +78,7 @@ pair unrolls as far as the user keeps clicking. ever really built. This is not the same failure `inlay.rs` guards against: a hint draws one confident, potentially-wrong label, where a hierarchy edge is a fact about the *text* ("this instantiation exists, guarded"), and - showing both is the honest answer to a question vfmt cannot resolve without + showing both is the honest answer to a question lucisv cannot resolve without evaluating defines. Found in QA (2026-08-25); pinned by `hierarchy::tests::qa_ifdef_instantiation_both_arms_are_reported_undisclosed_in_the_readme`. @@ -104,7 +104,7 @@ pair unrolls as far as the user keeps clicking. - **Consumes `crate::state::Workspace`** — `document`, `index`, `text_of`, `sources`. Nothing in `state.rs` was changed; the workspace stays immutable through all three handlers, and no cache was added. -- **Promises `vfmt_server`** — `hierarchy::{prepare, incoming, outgoing}` +- **Promises `lucisv_server`** — `hierarchy::{prepare, incoming, outgoing}` never panic, never return an item whose `selectionRange` is outside its `range`, and never return a `to`/`from` item for a module the workspace does not really declare. @@ -180,16 +180,16 @@ declared), and still not a hang, but the speed claim is a property of the Real single- or two-letter module names are not a corpus pattern seen so far; recorded here rather than in the backlog because it is a measurement, not a design gap. See `hierarchy::tests::qa_perf_worst_case_common_word_module_name` -(`#[ignore]`d, run with `cargo test --release -p vfmt_server --bin -vfmt-server qa_perf_worst_case -- --ignored --nocapture`). +(`#[ignore]`d, run with `cargo test --release -p lucisv_server --bin +lucisv-server qa_perf_worst_case -- --ignored --nocapture`). ## Status / TODO -- [x] `crates/vfmt_server/src/instantiations.rs`: the shared walk, lifted out +- [x] `crates/lucisv_server/src/instantiations.rs`: the shared walk, lifted out of `inlay.rs` with the enclosing declaration threaded through it -- [x] `crates/vfmt_server/src/inlay.rs`: reads the shared walk, behavior +- [x] `crates/lucisv_server/src/inlay.rs`: reads the shared walk, behavior unchanged (its own 34 tests re-run green untouched) -- [x] `crates/vfmt_server/src/hierarchy.rs`: `prepare`, `incoming`, `outgoing` +- [x] `crates/lucisv_server/src/hierarchy.rs`: `prepare`, `incoming`, `outgoing` - [x] `callHierarchyProvider` in `main.rs`; three dispatch arms in `server.rs` - [x] `prepare` on a declaration / on an instantiation / on anything else (`null`), including an instance name, a connected expression, a keyword, @@ -207,7 +207,7 @@ vfmt-server qa_perf_worst_case -- --ignored --nocapture`). - [x] Cost measured over the 860-file corpus, with the I/O split out - [x] `cargo fmt --all -- --check`, `cargo clippy --all-targets`, `cargo test --workspace`, `editors/vscode/smoke.js` -- [x] `docs/features/vfmt-server/README.md` capability table + work log +- [x] `docs/features/lucisv-server/README.md` capability table + work log - [ ] Not done, backlog: an **instantiation edge table in `WorkspaceIndex`**, built with the index, which would make `incomingCalls` a map lookup and cost one extra tree walk per file at index time. Worth doing when @@ -221,7 +221,7 @@ vfmt-server qa_perf_worst_case -- --ignored --nocapture`). ## Work log -- **2026-08-25 (dev)** — read `workspace-index`, `vfmt-server`, +- **2026-08-25 (dev)** — read `workspace-index`, `lucisv-server`, `references-nav` and `inlay-hints` READMEs, then `nav.rs`, `inlay.rs` and `workspace.rs` before writing anything. @@ -272,14 +272,14 @@ vfmt-server qa_perf_worst_case -- --ignored --nocapture`). attribution has to get right — plus one test that both names are found however the nested form parses. - **Files touched.** New: `crates/vfmt_server/src/instantiations.rs`, - `crates/vfmt_server/src/hierarchy.rs`, this README. Edited: - `crates/vfmt_server/src/inlay.rs` (its private walk removed, the shared one - called; no behavior change), `crates/vfmt_server/src/main.rs` (two module + **Files touched.** New: `crates/lucisv_server/src/instantiations.rs`, + `crates/lucisv_server/src/hierarchy.rs`, this README. Edited: + `crates/lucisv_server/src/inlay.rs` (its private walk removed, the shared one + called; no behavior change), `crates/lucisv_server/src/main.rs` (two module declarations, the capability, two tests), - `crates/vfmt_server/src/server.rs` (three dispatch arms and their imports), - `crates/vfmt_server/tests/e2e.rs` (one new test), - `docs/features/vfmt-server/README.md` (capability table and work log). + `crates/lucisv_server/src/server.rs` (three dispatch arms and their imports), + `crates/lucisv_server/tests/e2e.rs` (one new test), + `docs/features/lucisv-server/README.md` (capability table and work log). **Not touched, deliberately:** `TODO.md` and the umbrella checklist in `docs/features/refactor/README.md` (the lead's, per the brief), `nav.rs`, @@ -289,7 +289,7 @@ vfmt-server qa_perf_worst_case -- --ignored --nocapture`). zero warnings, `cargo test --workspace` green at **1463 passed, 0 failed** (1429 before; +34 = 25 in `hierarchy.rs`, 7 in `instantiations.rs`, 1 in `main.rs`, 1 e2e round trip). `node editors/vscode/smoke.js - target/release/vfmt-server`: OK. No new dependencies. No commits. + target/release/lucisv-server`: OK. No new dependencies. No commits. ## QA log @@ -301,12 +301,12 @@ vfmt-server qa_perf_worst_case -- --ignored --nocapture`). --workspace`, `cargo test --workspace` all clean before any QA change — **1463 passed, 0 failed**, matching the dev's number exactly (summed the per-crate `test result` lines by hand to be sure). `node - editors/vscode/smoke.js target/release/vfmt-server` — OK, against a + editors/vscode/smoke.js target/release/lucisv-server` — OK, against a freshly rebuilt release binary. Independently re-ran the dev's own corpus perf test in release: **25 callers, 63.7 ms** — same order as the claimed 56 ms (normal run-to-run variance), same caller count. - **Factoring check.** `git diff HEAD -- crates/vfmt_server/src/inlay.rs`: + **Factoring check.** `git diff HEAD -- crates/lucisv_server/src/inlay.rs`: the private `instantiations`/`walk`/`block` functions (previously at the bottom of the file) are deleted in full; the only other change is the call site (`instantiations(&doc.tree)` → `instantiations::sites(&doc.tree.items)`, @@ -336,7 +336,7 @@ vfmt-server qa_perf_worst_case -- --ignored --nocapture`). file: `incoming(chk)` names `harness` as the caller, not `top`. This is the honest answer given the feature's own "instantiation is the call, enclosing module is the caller" assumption — `bind`'s *effect* targets - `top`, but the *instantiation text* sits in `harness`, and vfmt only ever + `top`, but the *instantiation text* sits in `harness`, and lucisv only ever reads text. Not a bug; not previously tested at this granularity (the dev's own bind test has target == owner, which cannot distinguish the two). @@ -353,7 +353,7 @@ vfmt-server qa_perf_worst_case -- --ignored --nocapture`). parser does not evaluate `` `ifdef`` at the item level (confirmed against `vlog_parser::parser::parse_item_kind`; both arms become ordinary `Instantiation` items in source order). This is arguably the - honest answer — vfmt cannot know which arm is live and showing both is + honest answer — lucisv cannot know which arm is live and showing both is not a single wrong claim the way a mis-ordered inlay hint would be — but it was **undisclosed**: no Assumption, Handshake, or test mentioned `` `ifdef`` anywhere in this feature, despite `inlay-hints/README.md` diff --git a/docs/features/include-nav/README.md b/docs/features/include-nav/README.md index cb9a8c9..9917125 100644 --- a/docs/features/include-nav/README.md +++ b/docs/features/include-nav/README.md @@ -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 (``) 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` diff --git a/docs/features/inlay-hints/README.md b/docs/features/inlay-hints/README.md index cc3f87e..4e10034 100644 --- a/docs/features/inlay-hints/README.md +++ b/docs/features/inlay-hints/README.md @@ -9,7 +9,7 @@ An ordered connection list writes the *values* and leaves the *names* to the reader's memory: `u1 (clk, rst_n, data)` says nothing about which port each expression lands on, and getting that wrong is one of the classic ways to break a design without breaking the build. The module's own declaration knows, -and vfmt's workspace index knows where that declaration lives, so +and lucisv's workspace index knows where that declaration lives, so `textDocument/inlayHint` draws each port's name as a ghost label before the expression it belongs to — `clk:`, `rst_n:`, `data:` — and does the same for a positional `#( ... )` override against the module's parameters. Nothing is @@ -79,11 +79,11 @@ has no way to tell it is wrong. `Connections`, `OrderedConn`, `Connection`, and the generate-block nodes the walk descends through. Read-only; `Expr::span` is what a hint's position is computed from. -- **Consumes `vfmt_server::state`** — `Workspace::document` for the buffer's +- **Consumes `lucisv_server::state`** — `Workspace::document` for the buffer's tree, `Workspace::index`/`text_of` for the defining file, exactly as `signature.rs` does. Nothing in `state.rs` was changed: no cross-request cache was added, so the workspace stays immutable through this handler. -- **Promises `vfmt_server`** — `inlay::inlay_hints` never panics, never +- **Promises `lucisv_server`** — `inlay::inlay_hints` never panics, never returns a hint outside the requested range, and never returns a hint whose label is not a port or parameter name the module's declaration actually writes. @@ -162,7 +162,7 @@ buffer) that is not worth paying for today. ## Status / TODO -- [x] `crates/vfmt_server/src/inlay.rs`: `inlay_hints`, the ordered-list site +- [x] `crates/lucisv_server/src/inlay.rs`: `inlay_hints`, the ordered-list site collection for both ports and parameters, the per-request `Plans` cache, the instantiation walk - [x] `inlayHintProvider` in `main.rs`, no `resolveProvider`; the dispatch arm @@ -180,7 +180,7 @@ buffer) that is not worth paying for today. and deleted - [x] `cargo fmt --all -- --check`, `cargo clippy --all-targets`, `cargo test --workspace`, `editors/vscode/smoke.js` -- [x] `docs/features/vfmt-server/README.md` capability table + work log +- [x] `docs/features/lucisv-server/README.md` capability table + work log - [ ] Not done, backlog: a cross-request plan cache keyed on the index generation (see *Cost*); type hints, value hints and any other hint kind (deliberately out of scope — this milestone is exactly the two). @@ -218,18 +218,18 @@ buffer) that is not worth paying for today. **A mixed parameter list is silent, which is a judgement call.** The brief says "mixed illegal lists → sane". Hinting the positional half of `#(8, .DEPTH(16))` was the alternative; it is exactly the case where the - reader cannot tell whether the author meant the entries to shift, so vfmt + reader cannot tell whether the author meant the entries to shift, so lucisv says nothing rather than something confident. **`bind` is included.** `bind u_dut sub u_chk (a, b);` carries an ordinary instantiation, connection list and all, so the walk descends into it. One match arm; nothing else about `bind` is touched. - **Files touched.** New: `crates/vfmt_server/src/inlay.rs`, this README. - Edited: `crates/vfmt_server/src/main.rs` (the module declaration, the - capability, two tests), `crates/vfmt_server/src/server.rs` (one dispatch - arm and its imports), `crates/vfmt_server/tests/e2e.rs` (one new test), - `docs/features/vfmt-server/README.md` (capability table and work log). + **Files touched.** New: `crates/lucisv_server/src/inlay.rs`, this README. + Edited: `crates/lucisv_server/src/main.rs` (the module declaration, the + capability, two tests), `crates/lucisv_server/src/server.rs` (one dispatch + arm and its imports), `crates/lucisv_server/tests/e2e.rs` (one new test), + `docs/features/lucisv-server/README.md` (capability table and work log). **Not touched, deliberately:** `TODO.md`, the umbrella checklist in `docs/features/refactor/README.md`, `signature.rs`, `completion.rs`, @@ -243,7 +243,7 @@ buffer) that is not worth paying for today. binary: OK. No new dependencies. No commits. - **2026-08-25 (dev, M11 hierarchy)** — the private instantiation walk at the - bottom of `inlay.rs` moved to `crates/vfmt_server/src/instantiations.rs`, so + bottom of `inlay.rs` moved to `crates/lucisv_server/src/instantiations.rs`, so the call hierarchy can read the same one instead of writing a second (`docs/features/hierarchy/README.md`). The lifted version threads the innermost enclosing module declaration through the recursion; `inlay_hints` @@ -264,7 +264,7 @@ buffer) that is not worth paying for today. **Gates.** `cargo fmt --all -- --check`, `cargo clippy --all-targets --workspace`, `cargo test --workspace` all clean before any QA change — **1358 passed, 0 failed**, matching the dev's number exactly. `node - editors/vscode/smoke.js target/release/vfmt-server` — OK; confirmed the + editors/vscode/smoke.js target/release/lucisv-server` — OK; confirmed the script's fixed capability list (`main.rs`'s check, mirrored in the smoke script) does not include `inlayHintProvider`, matching the disclosed, deliberate handshake gap. @@ -272,7 +272,7 @@ buffer) that is not worth paying for today. **Finding — HIGH, fixed.** A module whose port or parameter list carries `` `ifdef``/`` `else`` directives got hints built from `InstantiationPlan`'s **union of every arm**, which is a shape no single - build configuration ever has. Repro: `crates/vfmt_server/src/inlay.rs`, + build configuration ever has. Repro: `crates/lucisv_server/src/inlay.rs`, test `an_ifdef_carrying_declaration_gets_no_hints_rather_than_a_wrong_one` — `module sub (`ifdef CFG_A input logic a, `else input logic b, `endif input logic clk);` gives `plan.ports == [a, b, clk]` (verified directly @@ -286,7 +286,7 @@ buffer) that is not worth paying for today. all, despite `instantiation_plan` warning about exactly this (`plan.warnings`) and M4's own README treating the same directive shape as a first-class case worth a warning. `Plans::read` - (`crates/vfmt_server/src/inlay.rs:192`) called + (`crates/lucisv_server/src/inlay.rs:192`) called `vlog_refactor::instantiation_plan(...).ok()` and discarded `plan.warnings` without ever inspecting it. **Fix applied**: `Plans::read` now returns `None` when `plan.warnings` is non-empty, so a directive-carrying list is @@ -346,7 +346,7 @@ buffer) that is not worth paying for today. **Perf.** Rebuilt a cheap harness (`inlay::tests::qa_perf`, `#[ignore]`d, not part of the default suite — run with `cargo test --release -p - vfmt_server --bin vfmt-server qa_perf -- --ignored --nocapture`) rather + lucisv_server --bin lucisv-server qa_perf -- --ignored --nocapture`) rather than driving the real binary over stdio, since the library call is what the dev's own numbers measure too: - 40 distinct ~90-line ordered modules, one 40-line screen, 840 hints: diff --git a/docs/features/inline-templates/README.md b/docs/features/inline-templates/README.md index 7181364..c8db222 100644 --- a/docs/features/inline-templates/README.md +++ b/docs/features/inline-templates/README.md @@ -7,7 +7,7 @@ Ghost text that finishes a block as you open it. Type `if (` and grey inserted with the cursor inside the parens, a second Tab jumping to the indented body line. Type `begin` at the end of a line and the matching `end` appears the same way. This is LSP 3.18's -`textDocument/inlineCompletion`, served by `vfmt-server` and opted into by +`textDocument/inlineCompletion`, served by `lucisv-server` and opted into by the VS Code extension. It is the completion-templates tier without the completion widget: the same skeletons, offered at the moment the user has already committed to the construct, so accepting one costs a single key. @@ -40,11 +40,11 @@ constructs an RTL designer opens all day. See *The triggers* below. - **The snippet is indented relative to the trigger line, and the editor supplies the rest.** One `\t` per indent step, no `base` — see *The indentation contract* below for the VS Code source this is read off, and - for what it costs. Consequence worth naming twice: **`vfmt.indent` does + for what it costs. Consequence worth naming twice: **`lucisv.indent` does not decide the width of an accepted ghost snippet.** The editor's own `editor.tabSize`/`editor.insertSpaces` do, because the editor rewrites the leading whitespace of every inserted line whatever the server sent. - `vfmt.inlineTemplates`'s setting description says so. + `lucisv.inlineTemplates`'s setting description says so. - **There is no position gate**, unlike the completion tier's `at_statement` / `at_item`. Having just typed `if (` or `begin` at the end of a line is already a far stronger signal than a two-letter prefix @@ -74,7 +74,7 @@ constructs an RTL designer opens all day. See *The triggers* below. flop. Everything else answers with exactly one item, and that shape is pinned so a future trigger cannot quietly turn a single offer into a menu. -- **`vfmt.inlineTemplates` unset means on.** Every other `vfmt.*` setting +- **`lucisv.inlineTemplates` unset means on.** Every other `lucisv.*` setting is "no opinion until a client says otherwise"; this one's absence resolves to `true`, which is what the VS Code default declares. @@ -191,7 +191,7 @@ contract*. the completion tier already uses, read for the `for (` split and the `always_ff @(` refusal. Nothing in `templates.rs` changed for this. - `crate::settings::ClientSettings::inline_templates` — **new field**, - `Option` from `vfmt.inlineTemplates`. Nothing else reads it; + `Option` from `lucisv.inlineTemplates`. Nothing else reads it; `Workspace::set_client_settings` does not treat it as a scope change, so toggling it rebuilds no index. `ClientSettings::indent` is **no longer read here** (see *The indentation contract*). @@ -227,20 +227,20 @@ contract*. ## Status / TODO -- [x] `crates/vfmt_server/src/inline.rs`: the data-driven trigger table, +- [x] `crates/lucisv_server/src/inline.rs`: the data-driven trigger table, detection over the token stream, the suppression check, the renderer and the hand-rolled wire types - [x] `if (` trigger (and `else if (`, which is the same two tokens) - [x] `begin` trigger - [x] Suppression: unclosed `(` for the paren trigger, `pairs.rs` says "this opener never closed" for the scope trigger -- [x] `vfmt.inlineTemplates` in `settings.rs` and in the extension's +- [x] `lucisv.inlineTemplates` in `settings.rs` and in the extension's `package.json` - [x] Capability in `main.rs`, dispatch in `server.rs` - [x] VS Code opt-in: `client.registerFeatures(ProposedFeatures.createAll(client))` - [x] `editors/nvim/README.md` note - [x] Unit tests: triggers, negatives, indentation, the serialized shape -- [x] End-to-end test in `crates/vfmt_server/tests/e2e.rs` +- [x] End-to-end test in `crates/lucisv_server/tests/e2e.rs` - [x] `cargo fmt` / `cargo clippy --all-targets` / `cargo test` green ### Round 2 — 2026-08-25 @@ -264,8 +264,8 @@ contract*. - [x] Wire pins updated: `inline.rs` unit tests, `tests/e2e.rs` (including a new multi-item round trip and the popup's `insertTextMode`), `editors/vscode/smoke.js`. -- [x] `vfmt.inlineTemplates`'s setting description names the new triggers and - says the editor's indent settings, not `vfmt.indent`, size the result. +- [x] `lucisv.inlineTemplates`'s setting description names the new triggers and + says the editor's indent settings, not `lucisv.indent`, size the result. - [ ] Not done, deliberately: no `function`/`task` triggers — see *The triggers*. @@ -393,7 +393,7 @@ indentation where twice a small number still looks plausible. that path: it fixes the snippet *and* the plain-text spelling with one field, it leaves `Template::render`'s single renderer for both spellings intact (`the_two_spellings_of_a_body_are_the_same_text` still holds), it - keeps `vfmt.indent` meaningful for the popup, and it is the protocol saying + keeps `lucisv.indent` meaningful for the popup, and it is the protocol saying what we mean — "this text is already positioned" — rather than a guess about what the client will do. The same field went on the module-instantiation skeleton (`completion.rs`'s `item`), which is laid out by the same `Layout` @@ -403,8 +403,8 @@ indentation where twice a small number still looks plausible. caller. **Consequence, documented in three places** (Assumptions here, the -`vfmt.inlineTemplates` setting description, the module doc comment): -`vfmt.indent` no longer sizes an accepted ghost snippet. The editor does. +`lucisv.inlineTemplates` setting description, the module doc comment): +`lucisv.indent` no longer sizes an accepted ghost snippet. The editor does. That is more correct — it matches whatever the user's tab settings are — but it is a visible behaviour change. The **preview** is now drawn one tab from column zero instead of at its final column, since no adjustment runs before @@ -457,7 +457,7 @@ in a list. **Gates:** `cargo fmt --all -- --check` clean; `cargo clippy --all-targets --workspace` zero warnings; `cargo test --workspace` 1633 passed / 0 failed / -4 ignored (up from 1614); `node editors/vscode/smoke.js target/debug/vfmt-server` +4 ignored (up from 1614); `node editors/vscode/smoke.js target/debug/lucisv-server` → `smoke: OK`; `node --check editors/vscode/smoke.js` and a `JSON.parse` of `package.json` both clean. No commit, no push. @@ -478,7 +478,7 @@ under adversarial input except for one true-EOF edge case, fixed below. (up from the dev's 1607 — this log's new tests). Full tail at the bottom. - `node editors/vscode/smoke.js `: OK against both a fresh debug and a fresh release build. **Caveat, not a code defect:** running it with no - argument picks up whatever `vfmt-server` is on `$PATH` — on this machine an + argument picks up whatever `lucisv-server` is on `$PATH` — on this machine an Aug-24 build predating this feature, which fails with `capability missing: inlineCompletionProvider`. Anyone re-running the dev's "smoke.js against debug and release" claim should pass the binary path explicitly, the way @@ -565,7 +565,7 @@ tried; results: confirmed by reading `inline.rs:130` (`doc.positions().offset(position)`). **Finding 1 (fixed directly) — true-end-of-file trigger silently declined.** -`crates/vfmt_server/src/inline.rs:159` (before fix): +`crates/lucisv_server/src/inline.rs:159` (before fix): `doc.tokens.iter().rposition(|token| token.span.end <= offset)`. `tokenize` (`vlog_parser::lexer::tokenize`) appends a zero-width `Eof` sentinel token whose span starts *and* ends at `text.len()`. When the buffer's very last @@ -588,7 +588,7 @@ suite re-run clean after the fix (fmt/clippy/`cargo test --workspace`). **Finding 2 (filed, not fixed — out of scope for this feature) — `pairs::analyze` is O(depth²) in nesting depth, and this feature is a new caller that hits it -per keystroke.** `crates/vfmt_server/src/pairs.rs:157`: +per keystroke.** `crates/lucisv_server/src/pairs.rs:157`: `let depth = stack.iter().filter(|f| is_rainbow(f.rule.open)).count() as u32;` runs once per opener *push*, scanning the whole current stack every time. For `n` consecutively nested rainbow openers (`begin`/`fork`) with none closed, @@ -606,13 +606,13 @@ for one request (isolated with `Instant` timers around `asking()` vs `pairs::analyze`). This bug predates this feature and lives entirely in `pairs.rs`, which is not -on this feature's file list (`crates/vfmt_server/src/pairs.rs` — CLAUDE.md +on this feature's file list (`crates/lucisv_server/src/pairs.rs` — CLAUDE.md scope rule), so I have not touched it; `git diff --stat` confirms it is untouched by this change. What *is* this feature's business: `inline.rs`'s `Unclosed::Scope` gate (`inline.rs:190-198`) is a **new caller** of `pairs::analyze` that runs it fresh on every `textDocument/inlineCompletion` request — i.e., potentially every keystroke — where the existing callers -(`documentHighlight`, the missing-closer diagnostic, `vfmt/scopePairs`) fire +(`documentHighlight`, the missing-closer diagnostic, `lucisv/scopePairs`) fire on click, on save/open, and on hover respectively, all far less frequently. So this feature doesn't introduce the bug but does meaningfully raise its real-world exposure. Filed as a background task (see below) rather than @@ -632,7 +632,7 @@ construction (`layout_at` reads it from the buffer, not from a config value). **Setting (item 5)** — unit-level was already covered -(`the_setting_turns_the_whole_feature_off`), but every other `vfmt.*` +(`the_setting_turns_the_whole_feature_off`), but every other `lucisv.*` setting's e2e coverage in `tests/e2e.rs` goes over the wire via `workspace/didChangeConfiguration` (`pushed_settings_reach_the_formatter_and_can_change_mid_session`, @@ -641,8 +641,8 @@ that. Added `the_inline_templates_setting_is_honoured_over_the_wire` to `tests/e2e.rs`: default-on with nothing pushed, `false` suppresses mid-session with no restart, `true` turns it back on — all over real `workspace/didChangeConfiguration` notifications against a spawned server. -`package.json`'s `vfmt.inlineTemplates` (default `true`) and `settings.rs`'s -`vfmt.get("inlineTemplates")` spell the same key. +`package.json`'s `lucisv.inlineTemplates` (default `true`) and `settings.rs`'s +`lucisv.get("inlineTemplates")` spell the same key. **Capability / registration (item 6)** — see wire-contract section above; all confirmed by reading the vendored client source, not just by running the @@ -652,7 +652,7 @@ tests. against the stated file list: exact match (`Cargo.toml`, `completion.rs`, `main.rs`, `server.rs`, `settings.rs`, `tests/e2e.rs`, `editors/nvim/README.md`, `editors/vscode/{extension.js, -package.json, smoke.js}`, new `crates/vfmt_server/src/inline.rs`, new +package.json, smoke.js}`, new `crates/lucisv_server/src/inline.rs`, new `docs/features/inline-templates/`). `crates/vlog_formatter/` and `verify.rs` untouched — confirmed by their absence from the diff. (An unrelated `.DS_Store` sits untracked in the repo root; not this feature's @@ -664,10 +664,10 @@ checked every line of `inline.rs` above its `#[cfg(test)]` boundary and the **What I changed** -- Fixed directly: `crates/vfmt_server/src/inline.rs` — `triggered` now +- Fixed directly: `crates/lucisv_server/src/inline.rs` — `triggered` now excludes the lexer's `Eof` sentinel from the "last token ending at the cursor" scan (Finding 1). -- Tests added, all in `crates/vfmt_server/src/inline.rs` unless noted: +- Tests added, all in `crates/lucisv_server/src/inline.rs` unless noted: `a_trigger_at_the_true_end_of_file_still_offers_a_ghost`, `a_deeply_nested_file_neither_crashes_nor_misses_the_trigger`, `an_empty_file_at_zero_zero_offers_nothing_and_does_not_panic`, @@ -675,7 +675,7 @@ checked every line of `inline.rs` above its `#[cfg(test)]` boundary and the `crlf_line_endings_still_trigger_and_indent_correctly`, `no_space_between_the_keyword_and_the_paren_still_triggers`, and `the_inline_templates_setting_is_honoured_over_the_wire` in - `crates/vfmt_server/tests/e2e.rs`. + `crates/lucisv_server/tests/e2e.rs`. - Filed, not fixed (out of scope): a `spawn_task` chip for Finding 2 (`pairs.rs:157`'s O(depth²) scan). - Nothing else touched. No commit, no push. @@ -710,9 +710,9 @@ asked for a wider net than the dev's own suite cast. No fix was needed. - `cargo test --workspace`: **1644 passed / 0 failed / 4 ignored** (up from the round-2 dev's 1633 — my 11 new tests, all in `inline.rs`; full tail below). -- `cargo build -p vfmt_server && node editors/vscode/smoke.js - target/debug/vfmt-server`: `smoke: OK`. Ran with the debug binary's - explicit path, not a bare `vfmt-server`, for the reason round 1's QA log +- `cargo build -p lucisv_server && node editors/vscode/smoke.js + target/debug/lucisv-server`: `smoke: OK`. Ran with the debug binary's + explicit path, not a bare `lucisv-server`, for the reason round 1's QA log already flagged (a stale `$PATH` binary predating this feature answers `capability missing`). - `node --check editors/vscode/smoke.js` and a `JSON.parse` of @@ -723,7 +723,7 @@ round exists for, so it got the most independent work: a *second*, from-source re-implementation of `TextModel.normalizeIndentation`/ `normalizeIndentationFromWhitespace` and `SnippetSession.adjustWhitespace` (`normalize_indentation_from_whitespace`, `normalize_indentation`, -`accepted_faithful` — `crates/vfmt_server/src/inline.rs:1108-1177`), built +`accepted_faithful` — `crates/lucisv_server/src/inline.rs:1108-1177`), built straight from the quoted VS Code source rather than from the dev's `accepted()` shortcut, so a divergence in the shortcut would have somewhere independent to show up. @@ -799,7 +799,7 @@ against the `lsp-types` 0.97.0 source directly: Both `tests/e2e.rs` pins (`:1258` template item, `:1625` module skeleton) assert `insertTextMode == 1`, correctly. Confirmed `insert_text_mode` is set on exactly the two multi-line item builders -(`grep -n "insert_text_mode" crates/vfmt_server/src/completion.rs` → two +(`grep -n "insert_text_mode" crates/lucisv_server/src/completion.rs` → two hits) and that `Items::simple` — the keyword/word/index tiers' single-line items — builds with `..Default::default()`, leaving it `None`; no leak. Client capability path (`insertTextModeSupport` in the vendored @@ -823,15 +823,15 @@ commit is not part of this round's uncommitted diff (it is not — `git log` shows it landed before round 2 started). **Item 6 — scope check.** `git diff --stat` against the claimed file list: -exact match — `crates/vfmt_server/src/{inline.rs,completion.rs}`, -`crates/vfmt_server/tests/e2e.rs`, `editors/vscode/{smoke.js,package.json}`, +exact match — `crates/lucisv_server/src/{inline.rs,completion.rs}`, +`crates/lucisv_server/tests/e2e.rs`, `editors/vscode/{smoke.js,package.json}`, and the two feature READMEs. `templates.rs` is untouched (absent from the diff), confirming the dev's "no new popup templates" claim structurally, not just by reading the work log. No `unwrap()`/`expect()`/`panic!` in non-test code: checked every `+` line of `completion.rs`'s diff and every line of `inline.rs` above its `#[cfg(test)]` boundary — none found. `Layout` removal from `inline.rs` left no dead code: `grep -n Layout -crates/vfmt_server/src/inline.rs` — zero hits outside doc comments; +crates/lucisv_server/src/inline.rs` — zero hits outside doc comments; `layout_at` is `fn` (private) in `completion.rs`, called only from within that same file (`completion.rs:211` and `:293`, both inside `completion.rs` itself), matching the "no second caller left" claim — @@ -843,7 +843,7 @@ either README. **What I changed** - No fixes — nothing broken was found. -- Tests added, all in `crates/vfmt_server/src/inline.rs`: +- Tests added, all in `crates/lucisv_server/src/inline.rs`: `the_accepted_helper_matches_vscodes_own_algorithm_for_a_self_consistent_buffer`, `every_bodys_first_line_is_stable_under_normalization`, `every_bodys_closer_lands_level_with_the_trigger_and_its_interior_one_step_in`, @@ -870,7 +870,7 @@ test result: ok. 29 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; fin 1644 passed / 0 failed / 4 ignored across the workspace (1633 + my 11). `cargo fmt --all -- --check` and `cargo clippy --all-targets --workspace` -both clean. `node editors/vscode/smoke.js target/debug/vfmt-server` → +both clean. `node editors/vscode/smoke.js target/debug/lucisv-server` → `smoke: OK`. ## Review @@ -902,7 +902,7 @@ both clean. `node editors/vscode/smoke.js target/debug/vfmt-server` → directly (`every_bodys_closer_lands_level_with_the_trigger_...`). - The asymmetric fix is right: relative `\t` bodies where the protocol has no opt-out (inline), `insertTextMode: asIs` where it does (popup), each - documented as the sibling of the other. `vfmt.indent` no longer sizing + documented as the sibling of the other. `lucisv.indent` no longer sizing ghost snippets is the correct trade and is stated in the setting text. - Trigger-table review: all twelve designer constructs check out; the two case-arm and case-gate deviations from the brief are both improvements diff --git a/docs/features/interfaces/README.md b/docs/features/interfaces/README.md index 8daa919..0d3b4c8 100644 --- a/docs/features/interfaces/README.md +++ b/docs/features/interfaces/README.md @@ -41,7 +41,7 @@ At the start of this round `interface` was the corpus's top blocker at not supported — a bare `import drive_task, check_task;` is. Neither prototype form occurs in the corpus. - A clocking skew is kept as **text as written** (`#2`, `#1step`, - `negedge`), not as an expression: it is a delay or an edge and vfmt + `negedge`), not as an expression: it is a delay or an edge and lucisv never re-lays-out either. The `#(min:typ:max)` skew spelling is not supported (0 corpus uses). - A clocking item's optional `= expression` (`input data = top.dut.d;`, @@ -81,7 +81,7 @@ Promised / changed for others: `Clocking(ClockingDecl)`. Minimal arms were added where the match had to stay exhaustive: `vlog_semantic::bind::bind_item` (both are opaque leaves) and `vlog_parser/tests/spans.rs`. `vlog_linter::visit`, - `fence.rs`, `range.rs` and `vfmt_server` all have catch-all arms and + `fence.rs`, `range.rs` and `lucisv_server` all have catch-all arms and needed no change. - **`clocking` and `endclocking` are now reserved words** (`token.rs`). A design that used either as an identifier would change meaning; no @@ -100,7 +100,7 @@ Requests to other owners (not done here): interface *instantiation* work today for free (an instantiation resolves its module name against the same index). Whether interfaces deserve their own `SymbolKind::Interface` — and with it - `vfmt_server`'s `LspKind::INTERFACE` in `symbols.rs` instead of + `lucisv_server`'s `LspKind::INTERFACE` in `symbols.rs` instead of `LspKind::CLASS` — is the semantic owner's call; it is a mechanical change across `model.rs`, `symbols.rs`, `hover.rs` and `workspace.rs`, which is why it is not made here. Likewise, a `modport` name and a @@ -185,7 +185,7 @@ Key decisions: code path. A case for the module spelling was added to lock that in. 2. **`modport` port lists reuse `delimited_dangling`**, so they collapse onto one line when they fit and break one direction group per line - when they do not — the same rule every other bracketed list in vfmt + when they do not — the same rule every other bracketed list in lucisv follows. `interface STREAM_DV`'s three modports collapse; a 100-column one breaks. 3. **Clocking blocks are parsed structurally**, not kept verbatim: the diff --git a/docs/features/item-misc/README.md b/docs/features/item-misc/README.md index a69ab65..1456db6 100644 --- a/docs/features/item-misc/README.md +++ b/docs/features/item-misc/README.md @@ -66,7 +66,7 @@ belongs, and that the corpus loop bucketed into `macro-items` (18 files) and (`ExprKind::Call`). `docs/features/lexer-cleanup/README.md` established why: whether `(b)` is `` `A ``'s argument list or an independent parenthesized value depends on whether the macro was `` `define``d with formals (IEEE 1800 - §22.5.1), and that definition routinely lives in an `` `include``d file vfmt + §22.5.1), and that definition routinely lives in an `` `include``d file lucisv never reads — `` `define NOT ~ `` plus `` `NOT (a) `` is the counterexample. At *item* position that ambiguity does not exist: neither reading is a legal item on its own, so accepting the invocation cannot take a valid parse away @@ -208,7 +208,7 @@ from — both are files arriving from my buckets, not regressions.) *Shape 1, parser not lexer.* `docs/features/lexer-cleanup/README.md` assessed the lexer glue and parked it, correctly: in expression position the reading -depends on a `` `define`` vfmt cannot see. That analysis is entirely about +depends on a `` `define`` lucisv cannot see. That analysis is entirely about expression position, so the fix is the same predicate applied only where an item or a statement belongs. `Parser::at_spaced_macro_call` is deliberately a *separate* predicate from `at_macro_item` rather than a clause inside it, diff --git a/docs/features/lexer-cleanup/README.md b/docs/features/lexer-cleanup/README.md index 0530ee9..242f392 100644 --- a/docs/features/lexer-cleanup/README.md +++ b/docs/features/lexer-cleanup/README.md @@ -9,8 +9,8 @@ lex because `(*` was unconditionally the start of an attribute (TODO §1); message (`unexpected character 'ï'` — one byte of the BOM's encoding, error-recovery QA log); (3) a non-ASCII character produced the same one-byte mojibake (`'Ã'` for `é`), and — the sneaky half — because the -lexer is all-or-nothing, `vfmt check` on such a file reported *nothing* -and exited 0 while `vfmt format` correctly refused (lint-rules-2 QA log). +lexer is all-or-nothing, `lucisv check` on such a file reported *nothing* +and exited 0 while `lucisv format` correctly refused (lint-rules-2 QA log). The fixes make the lexer's answers honest: real spellings lex, real errors name the actual character and position, and a file the linter could not tokenize is a loud per-file error instead of a silent pass. @@ -28,7 +28,7 @@ tokenize is a loud per-file error instead of a silent pass. - **A leading BOM is treated like leading whitespace and is not preserved.** The formatter's output starts at the first token, so formatting a BOM'd file drops the BOM — a deliberate normalization, the - same one `vfmt_core`'s config parser already applies to `vfmt.toml`. A + same one `lucisv_core`'s config parser already applies to `lucisv.toml`. A BOM anywhere else in the file stays a lex error, now with a message that names it (`byte order mark (U+FEFF) is only allowed at the start of the file`). @@ -42,8 +42,8 @@ tokenize is a loud per-file error instead of a silent pass. Verilog source`) instead of the first byte of its encoding. The decode is defensive (`from_utf8_lossy` over at most 4 bytes) even though `tokenize` takes `&str` and the cursor always sits on a char boundary. -- **A lex error under `vfmt check` is a per-file error (exit 2), matching - `vfmt format` on the same file** — the frozen exit-code contract's +- **A lex error under `lucisv check` is a per-file error (exit 2), matching + `lucisv format` on the same file** — the frozen exit-code contract's "error" class. Text-level findings (tabs, trailing whitespace, line length) are still reported for such a file, because those rules really did run; the error says the token- and AST-level rules saw nothing, so @@ -81,20 +81,20 @@ rule at all. Probed end to end: full format, format-twice fixed point, and `format_range` (verbatim splice starts at the first item's span, past the BOM) all converge. -**Changed in `vlog_linter::ParsedSource` (consumed by `vfmt check`):** a +**Changed in `vlog_linter::ParsedSource` (consumed by `lucisv check`):** a new field + accessor, `lex_error() -> Option<&LexError>`, kept from the `tokenize` failure that previously vanished into the error-tree fallback. -Additive: `vfmt_server` builds contexts via `from_parse` with its own +Additive: `lucisv_server` builds contexts via `from_parse` with its own products and is untouched. -**Changed in `crates/vfmt/src/lint.rs`:** `run_rules` now also returns +**Changed in `crates/lucisv/src/lint.rs`:** `run_rules` now also returns the rendered lex error; `check_one`/`check_stdin` put it in the report's `error` slot — the same slot unreadable files and panics use — so it prints `error: : lex error: :: ` on stderr, counts into "N files could not be checked", and exits 2. Violations found by text rules on the same file are still printed. -**Requested of nobody.** The `vfmt_server` publishes lex errors through +**Requested of nobody.** The `lucisv_server` publishes lex errors through its own diagnostics path already; no change needed there. ## The macro space-before-paren item: assessed, PARKED @@ -125,7 +125,7 @@ in the lexer anyway. **Verdict: not safe; parked.** The analysis: verbatim, internal spacing included, so under the hypothetical glue there is no text rewrite for the net to miss). The park does not rest on this argument — arguments 1, 2 and 4 carry it: the reading depends - on a definition vfmt cannot see, a fixed answer is provably wrong for + on a definition lucisv cannot see, a fixed answer is provably wrong for one population, and today's behavior fails safe.* 4. **Today's behavior fails safe.** Item position: clean parse error (documented in macro-items). Expression position: the call parses, the @@ -152,9 +152,9 @@ in the lexer anyway. **Verdict: not safe; parked.** The analysis: the leading BOM and BOM'd sources joined `SOURCES`; mid-file BOM is a clear, named error. - [x] Non-ASCII lex error names the character and codepoint. -- [x] `vfmt check` on a file that does not lex: exit 2, stderr error, +- [x] `lucisv check` on a file that does not lex: exit 2, stderr error, "could not be checked" summary; text-rule findings still reported. - (`ParsedSource::lex_error` + `crates/vfmt/src/lint.rs`.) + (`ParsedSource::lex_error` + `crates/lucisv/src/lint.rs`.) - [x] BOM'd file through format AND check (CLI tests); non-ASCII file through both (CLI test pins the no-longer-silent behavior). - [x] Losslessness/spans suites green with the BOM decision; error-recovery @@ -169,7 +169,7 @@ in the lexer anyway. **Verdict: not safe; parked.** The analysis: - Read CLAUDE.md, TODO §1, the error-recovery and lint-rules-2 QA logs, the macro-items Assumption, `lexer.rs`, `spans.rs`, `verify.rs`'s - `@`-collapse, and `vfmt`'s check driver before touching code. Baseline: + `@`-collapse, and `lucisv`'s check driver before touching code. Baseline: `cargo test --workspace` **791 passed**. - **Probed before designing** (scratchpad harness, deleted): `@( * )` and `@( *)` already lexed — only the adjacent-`(*` spellings (`@(* )`, @@ -183,7 +183,7 @@ in the lexer anyway. **Verdict: not safe; parked.** The analysis: the lookahead (`peek_at` returns 0) keeps the old "unterminated attribute" error. - **BOM: option (a) — accept it — chosen over erroring.** Consistency - (`vfmt_core` already strips it from config files; editors add it + (`lucisv_core` already strips it from config files; editors add it silently; the LSP will see such buffers constantly) beat strictness. The losslessness invariant stays meaningful: the gap rule now reads "whitespace, or the file's leading BOM" — one named exception, only @@ -198,7 +198,7 @@ in the lexer anyway. **Verdict: not safe; parked.** The analysis: over a synthetic violation. Reasons: it matches how check already reports unreadable files and panics (same `Report.error` slot, same stderr line shape, same "could not be checked" summary), it matches - `vfmt format` on the same file (frozen contract: errors are exit 2), + `lucisv format` on the same file (frozen contract: errors are exit 2), and a violation-shaped entry would imply a rule name and a waiver path that make no sense for "the file did not tokenize". The linter crate's only change is keeping the `LexError` it already caught @@ -217,21 +217,21 @@ in the lexer anyway. **Verdict: not safe; parked.** The analysis: scoped to the four crates this feature touches; `cargo test --workspace` is re-run at the end only if their tree compiles. Nothing in this feature's scope overlaps theirs. -- Did not touch `verify.rs`, `vfmt_server`, `vlog_semantic`. Did not run +- Did not touch `verify.rs`, `lucisv_server`, `vlog_semantic`. Did not run `git commit`/`git push`. **Results:** `cargo test -p vlog_parser -p vlog_linter -p vlog_formatter --p vfmt`: **589 passed, 0 failed** (+11 tests: 7 lexer unit, 1 +-p lucisv`: **589 passed, 0 failed** (+11 tests: 7 lexer unit, 1 error-recovery, 1 linter context, 2 CLI; plus 3 new spans sources and 6 new `.cases` pairs inside existing tests). `cargo clippy -p vlog_parser --p vlog_linter -p vlog_formatter -p vfmt --all-targets` silent. `cargo +-p vlog_linter -p vlog_formatter -p lucisv --all-targets` silent. `cargo fmt --check` clean on the same four crates. Corpus: 820 files, 77.6% formattable, 0 verification errors, 0 crashes, TSV byte-identical to the recorded baseline. Files touched: `crates/vlog_parser/src/lexer.rs`, `crates/vlog_parser/tests/{spans,error_recovery}.rs`, `crates/vlog_formatter/tests/cases/statements.cases`, -`crates/vlog_linter/src/context.rs`, `crates/vfmt/src/lint.rs`, -`crates/vfmt/tests/cli.rs`, `TODO.md` (§1 checkbox), two QA-log +`crates/vlog_linter/src/context.rs`, `crates/lucisv/src/lint.rs`, +`crates/lucisv/tests/cli.rs`, `TODO.md` (§1 checkbox), two QA-log annotations, this README. ## QA log @@ -239,18 +239,18 @@ annotations, this README. ### 2026-08-20 — QA agent Verified against the working tree (four-crate scope; the concurrent -class-semantics work in `vlog_semantic`/`vfmt_server` was finished and +class-semantics work in `vlog_semantic`/`lucisv_server` was finished and compiling by the end of the session, so the workspace gate was run too). All mutation experiments ran in a scratchpad copy of `crates/`; nothing outside this QA log was written. **Gates (reproduced, not taken on trust)** -- `cargo test -p vlog_parser -p vlog_formatter -p vlog_linter -p vfmt`: +- `cargo test -p vlog_parser -p vlog_formatter -p vlog_linter -p lucisv`: **589 passed, 0 failed** — exactly the dev's number. - `cargo test --workspace`: **825 passed, 0 failed** (class-semantics landed in between; recorded for the lead, not claimed for this feature). -- `cargo clippy -p vlog_parser -p vlog_formatter -p vlog_linter -p vfmt +- `cargo clippy -p vlog_parser -p vlog_formatter -p vlog_linter -p lucisv --all-targets` after touching the three changed sources to defeat the cache: **0 warnings, 0 errors**. `cargo fmt --check` on the same four: clean. @@ -379,9 +379,9 @@ outside this QA log was written. - `--output-format json`: stdout is still a single valid JSON array (parsed with `json.load`) containing only the real violations; the lex error goes to stderr and exit 2. See F5. -- stdin: `vfmt check -` on non-lexing input → `error: : lex error: +- stdin: `lucisv check -` on non-lexing input → `error: : lex error: …`, exit 2. -- LSP spot-check (cheap, over stdio against `vfmt-server`): a BOM'd +- LSP spot-check (cheap, over stdio against `lucisv-server`): a BOM'd document containing `élan` publishes the new decoded message with a sane range on the right line, alongside the `no-tabs` warning; `textDocument/formatting` on it returns `[]` (fail-safe, no edit), and @@ -457,13 +457,13 @@ attribute or on legal expression code, no BOM position skew. - **F3 (should-note, contract nuance).** `--lines`/`format_range` on a BOM'd file drops the BOM even when line 1 is not in any selected range (probed: `--lines 2-2` on a BOM'd file rewrote line 2 *and* removed the - BOM). `vfmt --help`'s range-formatting text promises "emit every other + BOM). `lucisv --help`'s range-formatting text promises "emit every other byte exactly as written"; the leading BOM is now an unstated exception. Nothing corrupts (converges, verifies, idempotent), but an LSP range format will return an edit touching offset 0. One sentence in the help text or in Assumptions would close it. -- **F4 (info).** `vfmt check` prints `error: : lex error: …`; - `vfmt format` prints `: lex error: …` (no `error: ` prefix). Each +- **F4 (info).** `lucisv check` prints `error: : lex error: …`; + `lucisv format` prints `: lex error: …` (no `error: ` prefix). Each is internally consistent with how that command reports its other per-file errors, and the exit class matches as the Assumptions claim — recorded only so the difference is not mistaken for a bug later. diff --git a/docs/features/lint-harness/README.md b/docs/features/lint-harness/README.md index e73cba0..750f79f 100644 --- a/docs/features/lint-harness/README.md +++ b/docs/features/lint-harness/README.md @@ -20,7 +20,7 @@ a data file, zero Rust. report are the case's own and the source stays valid Verilog. The linter never interprets `//^` (verified: no rule or waiver grammar matches it). - **Markers carry the CLI's coordinates.** `` is the 1-based column - `vfmt check` prints (`LineIndex::line_col` of the violation's span start), + `lucisv check` prints (`LineIndex::line_col` of the violation's span start), so a marker can be written by copying a diagnostic. A caret positioned *under* the span was rejected deliberately: tabs in the offending line are themselves test content, so visual caret alignment lies, and a `//`-prefixed @@ -35,9 +35,9 @@ a data file, zero Rust. still offers a Safe fix.** Violations without a fix (or with an Unsafe one) may survive — they are findings, not failures. - **Fences are out of the harness's scope.** `--fix` declining to edit inside - `// vfmt: off` is `crates/vfmt/src/lint.rs`'s behavior, not + `// lucisv: off` is `crates/lucisv/src/lint.rs`'s behavior, not `vlog_linter`'s; it stays tested by the CLI tests in - `crates/vfmt/tests/cli.rs`. + `crates/lucisv/tests/cli.rs`. - **Unsafe fixes are untested here because none exist.** When the first rule ships one, the fix loop needs an opt-in header (a `#unsafe-fixes` analog of `--unsafe-fixes`) — noted so it is a case-format extension, not a redesign. @@ -77,7 +77,7 @@ the case. Four headers are special: ``` #SKIP known-bad case: must still fail; passing demands the marker's removal #path rtl/foo.sv lint the source as if read from this path (module-filename, wire-reg-mixup) -#select a,b vfmt check --select semantics: replaces the default rule set +#select a,b lucisv check --select semantics: replaces the default rule set #tolerant fix case whose input the formatter refuses; must be true (see below) ``` @@ -240,7 +240,7 @@ are API tests, not case tests, per the migration rule. not run on these files": tabs in offending lines are content, so a visually-aligned caret lies under any tab width; and a `//`-prefixed line can never point at columns 1–2, where `no-tabs` — the highest-volume rule — - fires. The column is the one `vfmt check` prints, so writing a marker is + fires. The column is the one `lucisv check` prints, so writing a marker is copying the diagnostic. - **Columns were verified by the harness, not trusted**: all 76 cases' hand-computed columns passed on the first full run (the one failure in @@ -307,7 +307,7 @@ Counts re-derived from the files, all matching the table: 76 cases across 14 case data, 547 LOC of harness, 523 LOC in the deleted `rules.rs` with 55 `#[test]` fns. -**Claim 1 — markers carry `vfmt check`'s coordinates.** Verified by copying +**Claim 1 — markers carry `lucisv check`'s coordinates.** Verified by copying five case bodies to disk and running the real CLI. Every marker column is the diagnostic's column, verbatim: @@ -321,7 +321,7 @@ diagnostic's column, verbatim: The copy-the-diagnostic property holds. The caret-rejection reasoning also holds *empirically*, not just rhetorically — see the attacks below. -**Claim 2 — fix cases.** The loop is CLI-equivalent: `crates/vfmt/src/lint.rs` +**Claim 2 — fix cases.** The loop is CLI-equivalent: `crates/lucisv/src/lint.rs` has `MAX_FIX_ROUNDS = 10` and the same fix→re-lint shape; the harness allows rounds 0..=9 (10 applications, same as the CLI) and *errors* on an 11th instead of silently stopping, which is the right strictness for a test. The @@ -421,7 +421,7 @@ is a workspace-internal path crate, dev-only, pulling in zero external code was. A workspace-internal dev-dep is a *test-wiring* decision, not a dependency decision, and I do not think it should be held to the same bar as an external runtime dep. The one alternative worth naming for the lead: -the cross-tool assertion could have lived in `crates/vfmt`, which already +the cross-tool assertion could have lived in `crates/lucisv`, which already depends on both — but that would have split the case format across two crates to avoid a dependency that costs nothing. The dev chose correctly. @@ -513,7 +513,7 @@ the scratch test file deleted, `no_tabs.lint`, `lint_cases.rs` and ## Review **2026-08-20 — lead. Verdict: accepted and committed. The owner's final -sequence item lands: writing a lint rule's tests is now copying vfmt's +sequence item lands: writing a lint rule's tests is now copying lucisv's own diagnostics into a data file, and the harness polices itself.** Points reviewed and accepted: diff --git a/docs/features/lint-rules-2/README.md b/docs/features/lint-rules-2/README.md index 6a471a5..cfa4de2 100644 --- a/docs/features/lint-rules-2/README.md +++ b/docs/features/lint-rules-2/README.md @@ -11,7 +11,7 @@ plus `wire-reg-mixup`, the SystemVerilog-ness decision the linter-core round parked; (3) `vlog_linter::rules_markdown()`, a rule reference generated from the registry so the docs cannot drift from the rules (Verible's `--generate_markdown`, ruff's generated rule pages). Everything slots into the -existing registry, so `vfmt check`, `--select`/`--ignore` and `vfmt-server`'s +existing registry, so `lucisv check`, `--select`/`--ignore` and `lucisv-server`'s diagnostics pick the new rules up with **zero wiring** — verified live, not assumed. @@ -22,10 +22,10 @@ assumed. class localparams, class typedefs and class methods. Nothing about a rule is class-aware; the walk is what changed. - **Naming presets are fixed per rule this round.** Verible spells its - conventions as RE2 patterns and lets you override them; vfmt spells the same + conventions as RE2 patterns and lets you override them; lucisv spells the same conventions as character-class predicates (`src/naming.rs`) and does not let you override them yet. Per-rule style configuration needs the `lint` - key in `vfmt.toml`, which is still parked (see Handshakes). + key in `lucisv.toml`, which is still parked (see Handshakes). - **Escaped identifiers (`\my$name`) are exempt from every naming rule.** Their whole purpose is to carry characters no convention allows. - **A name's style is judged on ASCII.** A non-ASCII identifier fails @@ -34,7 +34,7 @@ assumed. practical population. - **`wire-reg-mixup` decides SystemVerilog-ness from the file extension alone** — `.sv`/`.svh`, compared case-insensitively. Not from content, not - from a config key, and never for a buffer with no name: `vfmt check -` + from a config key, and never for a buffer with no name: `lucisv check -` without `--stdin-filename` is silent. This is the whole SV-ness decision, deliberately: any content heuristic ("it uses `logic`, so it's SV") would make the rule's own subject its input. @@ -42,7 +42,7 @@ assumed. parse is still checked, and a `reg` inside a `constraint`/`covergroup` verbatim block is still seen. A `reg` inside a `` `define`` body is *not*: a directive is one `TokenKind::Directive` token and its body is never - lexed as keywords. Consistent with vfmt's no-preprocessing stance. + lexed as keywords. Consistent with lucisv's no-preprocessing stance. - **`rules_markdown()`'s "Fix" column is declarative metadata** (`Rule::fix()`), not derived from running the rules. A unit test probes the rules against a file that trips every fixable one and asserts the two @@ -68,28 +68,28 @@ assumed. `None`). Both have defaults, so an out-of-crate implementor of `Rule` — if there ever is one — is not broken by them. - `default_rules()` is no longer `all_rules()`: it filters on `default_on()`. - Callers are unaffected (`crates/vfmt` calls `select_rules`, - `crates/vfmt_server/src/lint.rs` calls `default_rules()`); both keep + Callers are unaffected (`crates/lucisv` calls `select_rules`, + `crates/lucisv_server/src/lint.rs` calls `default_rules()`); both keep compiling and keep meaning what they meant. - Rule *names* are stable API — they appear in users' waivers. The five new names are `enum-name-style`, `module-name-style`, `parameter-name-style`, `struct-union-name-style`, `wire-reg-mixup`. Four of the five are spelled exactly as Verible spells its equivalent, on purpose: a codebase already - annotated `// verilog_lint: waive enum-name-style` is honored by vfmt + annotated `// verilog_lint: waive enum-name-style` is honored by lucisv unedited. **Requested of others (not done here)** -- *`crates/vfmt`'s owner (concurrent this round)*: a `vfmt check --rules-doc` +- *`crates/lucisv`'s owner (concurrent this round)*: a `lucisv check --rules-doc` flag that prints `vlog_linter::rules_markdown()` to stdout and exits 0. One `println!`; no other wiring. Until then the same output is available as `cargo run -p vlog_linter --example rules_markdown`. -- *config-discovery's owner*: the `lint` key in `vfmt.toml` is what +- *config-discovery's owner*: the `lint` key in `lucisv.toml` is what per-rule naming-style configuration waits on — the shape wanted is `[lint.parameter-name-style] style = "CamelCase"` picking one of the named presets, not a regex. Restated from `linter-core`, unchanged. -- No request to `vlog_formatter`, `vlog_semantic`, `vfmt_server` or - `vfmt_core`; none of them was touched. +- No request to `vlog_formatter`, `vlog_semantic`, `lucisv_server` or + `lucisv_core`; none of them was touched. ## Status / TODO @@ -110,8 +110,8 @@ assumed. - [x] Violating/clean/waived/unused-waiver quartets for all five new rules; class-body coverage tests for all four original AST rules. - [x] Corpus baseline re-run, before/after per rule. -- [ ] Per-rule style **configuration** — needs the `vfmt.toml` `lint` key. -- [ ] `vfmt check --rules-doc` — `crates/vfmt`, handshake above. +- [ ] Per-rule style **configuration** — needs the `lucisv.toml` `lint` key. +- [ ] `lucisv check --rules-doc` — `crates/lucisv`, handshake above. - [ ] Parked naming rules, listed with their Verible names below. - [ ] External waiver files — untouched, still `linter-core`'s open item. @@ -132,9 +132,9 @@ That check changed two decisions, both recorded honestly below. **`parameter-name-style`** — accepts `CamelCase` or `ALL_CAPS` for both `parameter` and `localparam`. Verible's defaults are `parameter_style: CamelCase|ALL_CAPS` and `localparam_style: CamelCase`, i.e. stricter for -`localparam`. vfmt accepts the union for both, deliberately: matching +`localparam`. lucisv accepts the union for both, deliberately: matching Verible's `localparam` default would flag `localparam int ADDR_W` — an -overwhelmingly common spelling — in a rule that is on by default, and vfmt +overwhelmingly common spelling — in a rule that is on by default, and lucisv has no per-rule config key yet to relax it with. When that key lands, the strict split is the natural first setting to offer. Covers item- and statement-level declarations and the `#( ... )` ports of module *and* class @@ -142,12 +142,12 @@ headers; `type` parameters are skipped (they name a type, which is Verible's separate `parameter-type-name-style`, parked). **`enum-name-style`** — Verible's default pattern is literally -`[a-z_0-9]+(_t|_e)`; vfmt checks `lower_snake_case` ending in `_e` or `_t`, +`[a-z_0-9]+(_t|_e)`; lucisv checks `lower_snake_case` ending in `_e` or `_t`, the same shape. Only `typedef enum` is judged: an anonymous enum has no name, and *requiring* the typedef is Verible's separate `typedef-enums` (parked). **`struct-union-name-style`** — Verible requires `lower_snake_case` ending in -`_t` for `struct` and `union`; vfmt checks the same. Only `typedef struct` / +`_t` for `struct` and `union`; lucisv checks the same. Only `typedef struct` / `typedef union`; requiring the typedef is Verible's `typedef-structs-unions` (parked). @@ -155,11 +155,11 @@ and *requiring* the typedef is Verible's separate `typedef-enums` (parked). round's brief.** The brief said "snake_case default-on per Verible". Verible has **no `module-name-style` rule at all** — the documentation check above is explicit about it, and the nearest things it does have are -`module-filename` (enabled by default, which vfmt already implements) and +`module-filename` (enabled by default, which lucisv already implements) and `interface-name-style` for the sibling construct. The instruction for this round was to default a naming rule on *only* where Verible defaults its equivalent on, and there is no equivalent to inherit a default from, so the -rule ships selectable but quiet: `vfmt check --select module-name-style`. +rule ships selectable but quiet: `lucisv check --select module-name-style`. The rationale in `Rule::doc` cites the lowRISC/Google SystemVerilog style guide, which does require `lower_snake_case` for module names. Flipping it on is a one-line change (`fn default_on`) if the lead prefers the brief's @@ -203,7 +203,7 @@ anything useful to say about `i`. ## Why no regex dependency -Verible spells naming conventions as RE2 patterns. vfmt spells them as three +Verible spells naming conventions as RE2 patterns. lucisv spells them as three character-class predicates in `src/naming.rs`, roughly 20 lines: ``` @@ -320,11 +320,11 @@ Read honestly: markdown document — 139 lines today. Shape: ```markdown -# vfmt lint rules +# lucisv lint rules Generated from the rule registry by `vlog_linter::rules_markdown` — do not edit by hand. -A rule marked **default** runs for a plain `vfmt check`; the others need `--select `. ... +A rule marked **default** runs for a plain `lucisv check`; the others need `--select `. ... | Rule | Default | Fix | |---|---|---| @@ -362,7 +362,7 @@ Three tests hold it: described in Assumptions. `cargo run -p vlog_linter --example rules_markdown` prints it today; the -`vfmt check --rules-doc` flag is filed as a handshake because `crates/vfmt` +`lucisv check --rules-doc` flag is filed as a handshake because `crates/lucisv` belongs to a concurrent agent this round. ## Zero-wiring claim, verified @@ -370,17 +370,17 @@ belongs to a concurrent agent this round. The claim that a new rule needs no wiring outside the registry was checked by running the built binary, not by reading the code: -- `vfmt check corpus/` reports the four new default-on rules with no CLI +- `lucisv check corpus/` reports the four new default-on rules with no CLI change (the table above is that run). -- `vfmt check ... --select module-name-style` runs an off-by-default rule, +- `lucisv check ... --select module-name-style` runs an off-by-default rule, and `--select wire-reg-mixup` an on-by-default one; both were used to produce numbers above. -- `--ignore ` and `// vfmt: waive ` work by construction +- `--ignore ` and `// lucisv: waive ` work by construction (they key on `rule_by_name`), and each new rule has a waiver test. -- `crates/vfmt_server/src/lint.rs` was read **read-only**: it calls +- `crates/lucisv_server/src/lint.rs` was read **read-only**: it calls `default_rules()` with no filtering of its own, so the four new default-on rules appear as editor diagnostics automatically, and `module-name-style` - correctly does not. `cargo test -p vfmt_server` stays green. + correctly does not. `cargo test -p lucisv_server` stays green. ## Work log @@ -426,9 +426,9 @@ running the built binary, not by reading the code: `cargo fmt --check` diff, **both in `crates/vlog_formatter`** — the concurrent agent's churn, untouched here. - **Scope**: files changed are `crates/vlog_linter/**`, this README, and - `TODO.md` §4 checkboxes. `crates/vfmt`, `vfmt_server`, `vlog_parser`, - `vlog_formatter`, `vlog_semantic` and `vfmt_core` were not modified; - `vfmt_server/src/lint.rs` was read only. + `TODO.md` §4 checkboxes. `crates/lucisv`, `lucisv_server`, `vlog_parser`, + `vlog_formatter`, `vlog_semantic` and `lucisv_core` were not modified; + `lucisv_server/src/lint.rs` was read only. - **TODO.md §4**: checked the naming-rules item (with the "styles are fixed presets, configuration waits on the `lint` key" caveat spelled out) and the `--generate_markdown` item; checked the `wire`/`reg` sub-item of the seed @@ -439,9 +439,9 @@ running the built binary, not by reading the code: ### 2026-08-19 — QA -Scope: `-p vlog_linter` only, plus a read-only look at `crates/vfmt/src/lint.rs` -and `crates/vfmt_server/src/lint.rs` for the wiring/fence claims. Did not touch -`vlog_formatter`, `vfmt_server`, `vlog_parser` or `vlog_semantic` (concurrent +Scope: `-p vlog_linter` only, plus a read-only look at `crates/lucisv/src/lint.rs` +and `crates/lucisv_server/src/lint.rs` for the wiring/fence claims. Did not touch +`vlog_formatter`, `lucisv_server`, `vlog_parser` or `vlog_semantic` (concurrent this round). All six claims verified; no corpus regression; no preset false positive/negative found. Two documentation-gap findings, no functional bugs. @@ -473,7 +473,7 @@ Additionally probed live: `parameter-name-style` fires on a class header fires on a `case` inside a class method. **Pass.** **Corpus** (claim 3) — reproduced deterministically. -- After: built `vfmt --release` at the current working tree, ran `vfmt check +- After: built `lucisv --release` at the current working tree, ran `lucisv check corpus/ --output-format json`. Total **7921**, 96 files, and the per-rule breakdown (no-tabs 7527/45, explicit-parameter-storage-type 183/51, no-trailing-whitespace 85/7, case-missing-default 65/21, @@ -498,15 +498,15 @@ fires on a `case` inside a class method. **Pass.** - Proven zero #1: extracted every `typedef enum ... name;` in the corpus's `.sv`/`.svh` with an independent regex scan (not the linter) — **166** names, **0** violate `[a-z_0-9]+(_t|_e)`. Matches the claimed 166/0 exactly. -- Proven zero #2: `vfmt check corpus/picorv32/picorv32.v --select +- Proven zero #2: `lucisv check corpus/picorv32/picorv32.v --select wire-reg-mixup` → 0. Copied the identical bytes to `picorv32.sv` in the scratchpad and re-ran → **209**. Matches exactly. - Claim 3: **pass**, every number reproduced independently and exactly, not just re-read from the README. -**Zero-wiring** (claim 4) — `vfmt check --select nope` lists all +**Zero-wiring** (claim 4) — `lucisv check --select nope` lists all **13** known rules in its error, alphabetical, as `registry.rs`'s own test -already pins. `crates/vfmt_server/src/lint.rs` read (not modified): both call +already pins. `crates/lucisv_server/src/lint.rs` read (not modified): both call sites use `default_rules()` unfiltered, so the four new default-on rules and not `module-name-style` reach server diagnostics automatically, by construction. **Pass.** @@ -536,22 +536,22 @@ leading comment do **not** false-positive — confirmed live, not just by reading the token-kind filter. **Pass.** **Attack probes — class-body coverage and the fence/waiver asymmetry**: -`// vfmt: waive case-missing-default` inside a class method body suppresses -the finding — confirmed live. The fence question (does `// vfmt: off` inside +`// lucisv: waive case-missing-default` inside a class method body suppresses +the finding — confirmed live. The fence question (does `// lucisv: off` inside a class body protect a `--fix` edit, given the classes round found the *formatter's own* `scan_nested` inactive there) — built a probe file with a tab fenced inside a class body: ```systemverilog class c; -// vfmt: off +// lucisv: off int a; -// vfmt: on +// lucisv: on endclass ``` -`vfmt check --select no-tabs` **still reports** the tab (fences gate fixes, -not diagnostics — confirmed, not assumed). `vfmt check --select no-tabs +`lucisv check --select no-tabs` **still reports** the tab (fences gate fixes, +not diagnostics — confirmed, not assumed). `lucisv check --select no-tabs --fix` on the same file leaves the tab **untouched** — the fix is correctly -declined. `vfmt format` on the identical file, no `--fix`, silently +declined. `lucisv format` on the identical file, no `--fix`, silently reformats the tab away, exactly reproducing the classes round's finding that the formatter's own fence is inactive there. Read `fence::protected_regions` (`crates/vlog_formatter/src/fence.rs:96`) to understand *why* these two @@ -584,10 +584,10 @@ empty, confirmed byte-identical to the pre-sabotage state. - *Should-fix, documentation gap (not a corruption, not a corpus regression; the actual behavior is the safe/conservative direction).* Neither `docs/features/classes/README.md` nor this README states that a - `// vfmt: off` fence inside a class body **does** protect `vfmt check + `// lucisv: off` fence inside a class body **does** protect `lucisv check --fix` (via `fence::protected_regions`'s line-based backstop scan), even though the classes round documented, correctly, that the same fence is - **inactive** for `vfmt format` itself (the AST-scoped `scan_nested` doesn't + **inactive** for `lucisv format` itself (the AST-scoped `scan_nested` doesn't recurse into class items). Both facts are true and now confirmed by test; neither README says both in one place, so a reader of either document alone would reasonably conclude the fence does nothing at all inside a class @@ -596,22 +596,22 @@ empty, confirmed byte-identical to the pre-sabotage state. `docs/features/classes/README.md`'s existing fence-inactive note) stating the asymmetry plainly, with the mechanism (`collect` vs `scanned_regions`) named. Not fixed directly — it's a cross-cutting note that belongs to - whichever agent owns `crates/vfmt/src/lint.rs` / the fence handshake, not a + whichever agent owns `crates/lucisv/src/lint.rs` / the fence handshake, not a typo I can fix unambiguously in-place. - *Minor nit, not blocking.* The Assumptions section says "A non-ASCII identifier fails `lower_snake_case` etc. and is reported." In practice a genuinely non-ASCII byte in an identifier does not reach any naming rule at all: `vlog_linter::context`'s own comment says "a lex error leaves no - tokens (the lexer is all-or-nothing)", confirmed live — `vfmt check` on a + tokens (the lexer is all-or-nothing)", confirmed live — `lucisv check` on a file containing `parameter int élan = 1;` exits 0 with **zero** findings - (not even the unrelated `module-filename`), while `vfmt format` on the same + (not even the unrelated `module-filename`), while `lucisv format` on the same file correctly refuses with a `lex error` (invariant intact, nothing corrupted). So the practical claim is even truer than stated ("no practical population" because it's unreachable, not just because it's rare) but the wording "is reported" is not literally accurate for that case — pre-existing `context.rs` behavior, not introduced by this round, not worth a code change, just a one-clause wording fix if the README is touched again. - *(2026-08-19: delivered by lexer-cleanup — `vfmt check` on a file that + *(2026-08-19: delivered by lexer-cleanup — `lucisv check` on a file that does not lex now reports the lex error and exits 2 instead of silently passing; `docs/features/lexer-cleanup/README.md`.)* - No preset false positive or false negative found on any probed shape. @@ -656,5 +656,5 @@ Points reviewed and accepted: belongs to the lexer's existing gap list. Remaining §4 items stay honestly open: external waiver files, -per-rule style configuration (needs the vfmt.toml lint key), and the +per-rule style configuration (needs the lucisv.toml lint key), and the --rules-doc CLI flag (handshake filed; rules_markdown() is ready). diff --git a/docs/features/linter-core/README.md b/docs/features/linter-core/README.md index fb1c02a..b232c44 100644 --- a/docs/features/linter-core/README.md +++ b/docs/features/linter-core/README.md @@ -2,14 +2,14 @@ ## Goal -Give vfmt a linter — the `vlog_linter` crate and the `vfmt check` subcommand — +Give lucisv a linter — the `vlog_linter` crate and the `lucisv check` subcommand — built ruff-style from day one (a rule registry over a shared parse, violations that may carry fixes classified *safe* or *unsafe*, `--select`/`--ignore`, JSON output) with Verible's rule ergonomics (stable kebab-case names, a style-guide rationale per rule, inline waivers). This round ships the engine, seven seed rules and the CLI wiring; the rules deliberately stay **syntactic**, per TODO.md §7, because semantic rules wait on `vlog_semantic`. The formatter is -untouched: a bare `vfmt ` behaves exactly as it did before subcommands +untouched: a bare `lucisv ` behaves exactly as it did before subcommands existed. ## Assumptions @@ -36,10 +36,10 @@ existed. `no-trailing-whitespace` neither report nor rewrite a range that touches a `TokenKind::String` span. - **A tab expands to the run's indent width** (`--indent`, or the `indent` key - of the governing `vfmt.toml`, default 2) — one tab, one indent level. + of the governing `lucisv.toml`, default 2) — one tab, one indent level. - **`module-filename` speaks only for a file with exactly one top-level module**, and never without a file name (stdin without `--stdin-filename`). -- **Verible waivers naming rules vfmt does not have are ignored, not +- **Verible waivers naming rules lucisv does not have are ignored, not reported.** See Work log 2026-08-19 — this came out of the corpus baseline. - **`// verilog_format: off` regions are reported but never auto-fixed.** See "Fences" below; the linter reads fenced ranges through @@ -59,14 +59,14 @@ existed. - `vlog_formatter::Config`: only `indent_width`, and only as the tab-expansion width. The linter does not format. - `vlog_formatter::fence` (`collect`, `fence_of`, `Fence`, `Region` and its - fields) — read by `crates/vfmt/src/lint.rs` to keep `--fix` out of fenced + fields) — read by `crates/lucisv/src/lint.rs` to keep `--fix` out of fenced regions. All of it was **already `pub`**, so no visibility change was needed in `vlog_formatter`; nothing in that crate was modified. If `fence::collect` ever narrows its region for the formatter's own reasons, `--fix` narrows with it — that coupling is deliberate: one answer to "what is fenced", not two. Note the linter passes a **tolerant** tree to `collect`, which handles `Error` leaves without panicking (verified live, and by the fences QA round). -- `crates/vfmt`: the walk, `--exclude`, `.gitignore` and config discovery are +- `crates/lucisv`: the walk, `--exclude`, `.gitignore` and config discovery are reused unchanged — `check` is handed the same `(path, Config)` job list `format` builds, and the same worker pool. @@ -84,13 +84,13 @@ existed. - `run(source, path, enabled)` never panics on any input and never writes anything; `LintContext::new` never fails. - Findings come back sorted by `(span.start, span.end, rule)`. -- The exit-code contract of `vfmt check` mirrors the frozen formatter one: +- The exit-code contract of `lucisv check` mirrors the frozen formatter one: 0 clean, 1 violations remain, 2 error. **Requested of others (not done here)** - *config-discovery's owner*: a `lint = [...]` / `[lint]` section in - `vfmt.toml` (selected rules, per-rule settings) is out of scope this round — + `lucisv.toml` (selected rules, per-rule settings) is out of scope this round — rule selection is CLI-only (`--select` / `--ignore`). When that key lands, `Options::select`/`ignore` should gain the same "CLI flag > config file" precedence the formatter settings have, and `select_rules` already takes the @@ -101,7 +101,7 @@ existed. thing that would need to accept a pre-built tree. ~~is **not** done~~ **Delivered by one-parse (round 19): `LintContext::from_parse` accepts pre-built products, `ParsedSource::parse` - is the parse-once bundle, and both `vfmt check` and the server lint from + is the parse-once bundle, and both `lucisv check` and the server lint from one parse — see `docs/features/one-parse/README.md`.** ## Status / TODO @@ -115,14 +115,14 @@ existed. - [x] `apply_fixes` — left-to-right, overlapping fixes skipped, all-or-nothing per fix. - [x] Registry: `all_rules`, `default_rules`, `rule_by_name`, `select_rules`. -- [x] Inline waivers: `waive`, `waive-start`/`waive-stop`, `vfmt:` and +- [x] Inline waivers: `waive`, `waive-start`/`waive-stop`, `lucisv:` and `verilog_lint:` spellings. - [x] `unused-waiver` pseudo-rule (unused, unknown-rule, malformed, unmatched `waive-stop`), itself waivable and ignorable. - [x] Seed rules: `no-tabs`, `no-trailing-whitespace`, `case-missing-default`, `always-ff-non-blocking`, `always-comb-blocking`, `explicit-parameter-storage-type`, `module-filename`. -- [x] `vfmt check` wiring, `vfmt format` alias, backward-compatible bare +- [x] `lucisv check` wiring, `lucisv format` alias, backward-compatible bare invocation. - [x] `--output-format json`, `--select`, `--ignore`, `--fix`, `--unsafe-fixes` (plumbed; no unsafe fix exists yet). @@ -132,7 +132,7 @@ existed. - [ ] External waiver files (`waive --rule=X --line=N --location=glob`) — out of scope this round; needs a file format, a discovery rule and a precedence story against inline waivers. -- [ ] `lint` config key in `vfmt.toml` — handshake above. +- [ ] `lint` config key in `lucisv.toml` — handshake above. - [x] One parse shared by `check` and `format` — handshake above. **Delivered by one-parse (round 19)** for the linter's consumers; `format` keeps its own strict parse by design. @@ -167,7 +167,7 @@ Honest reading of that table: - `unused-waiver` scored **14 before** the Verible-spelling decision below and 0 after; every one was `// verilog_lint: waive macro-name-style` in ibex's vendored lowRISC code. -- No file errored: the tolerant parse means even the 40 % of the corpus vfmt +- No file errored: the tolerant parse means even the 40 % of the corpus lucisv cannot fully parse still gets linted for what it can see. That is also the caveat — AST-rule counts above are a **lower bound**. @@ -193,16 +193,16 @@ them quiet and the on/off reasoning are in ## Waiver semantics as implemented ```systemverilog -wire a; // vfmt: waive no-tabs suppresses that rule on this line -// vfmt: waive no-tabs alone on its line: suppresses the NEXT line -// vfmt: waive-start no-tabs ... from this line -// vfmt: waive-stop no-tabs ... through this one, both included +wire a; // lucisv: waive no-tabs suppresses that rule on this line +// lucisv: waive no-tabs alone on its line: suppresses the NEXT line +// lucisv: waive-start no-tabs ... from this line +// lucisv: waive-stop no-tabs ... through this one, both included ``` -- `verilog_lint:` is accepted everywhere `vfmt:` is. +- `verilog_lint:` is accepted everywhere `lucisv:` is. - Exactly one rule name per waiver; anything else is `unused-waiver: malformed`. A comment that does not start with one of the two prefixes plus - a `waive*` keyword is an ordinary comment (`// vfmt: off` stays a format + a `waive*` keyword is an ordinary comment (`// lucisv: off` stays a format fence). - Ranges nest per rule; the innermost open `waive-start` for a rule is what a `waive-stop` closes. An unclosed `waive-start` runs to the end of the file @@ -210,10 +210,10 @@ wire a; // vfmt: waive no-tabs suppresses that rule on this line - A waiver whose rule this run did not enable is silent — with `--select no-tabs`, waivers for other rules are not "unused", they simply had no chance to fire. -- A `verilog_lint:` waiver naming a rule vfmt does not implement is ignored - silently; the same waiver written `vfmt:` is reported as naming an unknown - rule. A codebase annotated for Verible is lintable by vfmt without editing - it first, while typos in vfmt's own waivers still surface. +- A `verilog_lint:` waiver naming a rule lucisv does not implement is ignored + silently; the same waiver written `lucisv:` is reported as naming an unknown + rule. A codebase annotated for Verible is lintable by lucisv without editing + it first, while typos in lucisv's own waivers still surface. - `unused-waiver` findings can themselves be waived, and the derivation loops until the used-set stops growing so waiving one does not leave the waiver that did it reported as unused. @@ -221,9 +221,9 @@ wire a; // vfmt: waive no-tabs suppresses that rule on this line ## Fences: reported, never auto-fixed -A `// verilog_format: off` / `// vfmt: off` region is emitted by the formatter +A `// verilog_format: off` / `// lucisv: off` region is emitted by the formatter as the exact source bytes it was written with — hand-aligned tables are the -reason the fence exists. `vfmt check` therefore **reports** violations inside a +reason the fence exists. `lucisv check` therefore **reports** violations inside a fenced region (a finding is information, and `--select`/`--ignore`/waivers are the ways to silence one) but **never fixes** them: `--fix` drops any fix whose edits intersect a fenced range, leaving those violations reported and the exit @@ -260,7 +260,7 @@ ruff's, verbatim in spirit: changes the circuit. - A fix is all-or-nothing; its edits are applied together or not at all. - Within one pass, a fix overlapping one already applied is skipped rather - than merged, so a pass can never garble text. `vfmt check --fix` therefore + than merged, so a pass can never garble text. `lucisv check --fix` therefore loops (fix → re-lint) until nothing changes, capped at 10 rounds. The everyday case needing two rounds is a line ending in a tab: `no-tabs` and `no-trailing-whitespace` both want those bytes. @@ -268,21 +268,21 @@ ruff's, verbatim in spirit: Fences above. - Fixed output re-lints clean for the fixed rules — asserted in `crates/vlog_linter/src/lib.rs` (`fixing_leaves_the_file_clean_for_the_fixed_rules`) - and end to end in `crates/vfmt/tests/cli.rs` + and end to end in `crates/lucisv/tests/cli.rs` (`check_fix_rewrites_the_file_and_the_result_relints_clean`). ## CLI surface ``` -vfmt check [OPTIONS] ... lint -vfmt format [OPTIONS] ... format (alias for the bare invocation) -vfmt [OPTIONS] ... format — unchanged +lucisv check [OPTIONS] ... lint +lucisv format [OPTIONS] ... format (alias for the bare invocation) +lucisv [OPTIONS] ... format — unchanged ``` The subcommand word is read **only as the first argument**. Everything else is -inputs and flags exactly as before, so `vfmt --check rtl/` is still the +inputs and flags exactly as before, so `lucisv --check rtl/` is still the formatter's check mode. A file named `check` can be formatted as -`vfmt format check`. +`lucisv format check`. `check`-only flags: `--select RULES`, `--ignore RULES` (comma-separated, repeatable), `--output-format text|json`, `--fix`, `--unsafe-fixes`. Using one @@ -308,7 +308,7 @@ parsable), each element: `fix` is `null` when the rule offers none. Serialization is hand-rolled (~30 lines): the shape is three fields deep, and no serialization crate is a -dependency of this crate or of `vfmt`. +dependency of this crate or of `lucisv`. Exit codes: **0** clean (or everything fixed), **1** violations remain, **2** error (bad arguments, unknown rule, unreadable file). An error outranks @@ -321,7 +321,7 @@ violations, as in the formatter. - Created `crates/vlog_linter` (files first, workspace member after — the ordering that bit a previous round) with `vlog_parser` + std only. Added `crates/vlog_linter` to the root `members` list additively, leaving the - concurrent `vfmt_server` entries and workspace deps untouched. + concurrent `lucisv_server` entries and workspace deps untouched. - Modules: `violation` (Violation/Fix/Applicability/apply_fixes), `context` (LintContext), `visit` (item/statement walks), `registry` (Rule trait + tables + selection), `waiver`, `rules/` (one file per rule). @@ -345,26 +345,26 @@ violations, as in the formatter. - **Corpus finding that changed a decision.** The first baseline reported 14 `unused-waiver` violations, all of them `// verilog_lint: waive macro-name-style` in vendored lowRISC code — i.e. correct Verible waivers - for a rule vfmt has not implemented. Reporting those punishes exactly the + for a rule lucisv has not implemented. Reporting those punishes exactly the codebases the `verilog_lint:` spelling exists to welcome. Changed so that an - unknown rule name is reported only for the `vfmt:` spelling; a - `verilog_lint:` waiver for a rule vfmt lacks is ignored. Corpus - `unused-waiver` count went 14 → 0, and a typo'd `// vfmt: waive` is still - caught. Tested by `a_verible_waiver_for_a_rule_vfmt_does_not_have_is_ignored`. + unknown rule name is reported only for the `lucisv:` spelling; a + `verilog_lint:` waiver for a rule lucisv lacks is ignored. Corpus + `unused-waiver` count went 14 → 0, and a typo'd `// lucisv: waive` is still + caught. Tested by `a_verible_waiver_for_a_rule_lucisv_does_not_have_is_ignored`. - CLI: `args.rs` gained `Command`/`OutputFormat`, the five check-only flags and a scope check that rejects a flag used with the wrong tool; the subcommand is only read as the first argument, which is what keeps every old command line - meaning what it did. New `crates/vfmt/src/lint.rs` holds the check driver + meaning what it did. New `crates/lucisv/src/lint.rs` holds the check driver and reuses `gather`, `build_pool` and `catch_panic` from `main.rs`. - Tests: 71 unit + 30 inline-marker integration tests in `vlog_linter`; - 16 new CLI tests in `crates/vfmt/tests/cli.rs` (exit codes, JSON shape, + 16 new CLI tests in `crates/lucisv/tests/cli.rs` (exit codes, JSON shape, `--fix` round trip in a temp dir, waivers, stdin, walk reuse, and four backward-compatibility tests including a byte-for-byte comparison of - `vfmt --check` against `vfmt format --check`). -- Gates: `cargo test -p vlog_linter` 71+30+1 green, `cargo test -p vfmt` 46 - green, `cargo clippy -p vlog_linter -p vfmt --all-targets` silent, + `lucisv --check` against `lucisv format --check`). +- Gates: `cargo test -p vlog_linter` 71+30+1 green, `cargo test -p lucisv` 46 + green, `cargo clippy -p vlog_linter -p lucisv --all-targets` silent, `cargo fmt --all --check` clean. The workspace has three failing tests and - one clippy warning in `crates/vfmt_server`, which belongs to another agent's + one clippy warning in `crates/lucisv_server`, which belongs to another agent's concurrent round and does not depend on this crate. - TODO.md §4: checked the rule trait/registry item, the diagnostic-format + JSON item, the fix-applicability item, the waiver item (with the external @@ -373,11 +373,11 @@ violations, as in the formatter. ### 2026-08-19 — dev (QA follow-up) -- **QA should-fix: `--fix` rewrote bytes inside `// vfmt: off` fences.** Fixed +- **QA should-fix: `--fix` rewrote bytes inside `// lucisv: off` fences.** Fixed per the lead's ruling: violations inside a fenced region are still reported, but no fix that touches those bytes is applied. Implemented in - `crates/vfmt/src/lint.rs` (`fixable_outside_fences` / `touches_fence`), not - in `vlog_linter` — `vfmt` already depends on `vlog_formatter`, and doing it + `crates/lucisv/src/lint.rs` (`fixable_outside_fences` / `touches_fence`), not + in `vlog_linter` — `lucisv` already depends on `vlog_formatter`, and doing it here keeps the linter crate's dependency list at `vlog_parser` + std, which is the property QA verified with `cargo tree`. - **No visibility change was needed.** `fence::{collect, fence_of, Fence, @@ -410,7 +410,7 @@ violations, as in the formatter. per-rule counts byte-identical to the table above (the corpus contains no fences, so the filter is a no-op there — confirmed, not assumed). - Gates after the change: `cargo test -p vlog_linter` 71+30+1, - `cargo test -p vfmt` 58 unit + 48 CLI, workspace green, clippy silent, fmt + `cargo test -p lucisv` 58 unit + 48 CLI, workspace green, clippy silent, fmt clean. ## QA log @@ -422,15 +422,15 @@ live corpus run. All PASS unless noted; one should-fix finding below. **Gates.** `cargo tree -p vlog_linter`: only `vlog_parser` (+ std), matching the dependency claim. `cargo fmt --all --check` clean. -`cargo clippy -p vlog_linter -p vfmt --all-targets` silent on a forced +`cargo clippy -p vlog_linter -p lucisv --all-targets` silent on a forced rebuild (touched `lib.rs` first to rule out a stale cache). No `unsafe`, no `#[allow]`, and every `.unwrap()`/`.expect()` in the crate is inside a `#[cfg(test)]` module (checked `crates/vlog_linter/src/**` and -`crates/vfmt/src/lint.rs` by hand) — CLAUDE.md's Rust standards hold. +`crates/lucisv/src/lint.rs` by hand) — CLAUDE.md's Rust standards hold. `cargo test -p vlog_linter`: 71 unit + 30 integration + 1 doctest, green. -`cargo test -p vfmt`: 46 green. Counts match the work log exactly. +`cargo test -p lucisv`: 46 green. Counts match the work log exactly. -**Corpus baseline.** Release build, `vfmt check corpus/ --output-format +**Corpus baseline.** Release build, `lucisv check corpus/ --output-format json`: **7806** violations over **93** files, byte-identical across repeated runs and across `--threads 1` vs the default pool (fully deterministic). Per-rule breakdown parsed from the JSON matches the @@ -475,8 +475,8 @@ a discrepancy; determinism and counts are what matter and both check out. matching". - A waiver for a rule dropped by `--ignore` is silent (0 findings, exit 0) — confirmed with `--ignore no-tabs --select no-tabs,unused-waiver`. -- `verilog_lint: waive ` → silent; the same spelled - `vfmt:` → reported unknown-rule. Both confirmed live via the CLI, not +- `verilog_lint: waive ` → silent; the same spelled + `lucisv:` → reported unknown-rule. Both confirmed live via the CLI, not just the unit tests. - `unused-waiver` waiving itself → no findings at all (fixed-point derivation works). `--select unused-waiver` alone still catches an @@ -490,7 +490,7 @@ a discrepancy; determinism and counts are what matter and both check out. (`module-filename`) fixes what it can, leaves the rest reported, exits 1. - `check --fix --check` is rejected (`--check is not valid for - \`vfmt check\``), confirming `--check` stays a formatter-only flag. + \`lucisv check\``), confirming `--check` stays a formatter-only flag. - A second `--fix` run on an already-fixed-as-far-as-possible file is a no-op for fixing (0 additional applied) and exit code reflects only the remaining unfixable violation. @@ -499,21 +499,21 @@ a discrepancy; determinism and counts are what matter and both check out. so `--unsafe-fixes` changing nothing today is accurate, not just claimed. -**Should-fix finding — `--fix` does not respect `// vfmt: off` fences.** -`crates/vfmt/src/lint.rs` (`run_rules`/`fix_source`) builds a +**Should-fix finding — `--fix` does not respect `// lucisv: off` fences.** +`crates/lucisv/src/lint.rs` (`run_rules`/`fix_source`) builds a `LintContext` straight from the raw source and never consults `fence.rs`; `crate::vlog_linter` has no notion of fences at all (its `Cargo.toml` doesn't even depend on `vlog_formatter` beyond the `Config::indent_width` handshake noted in this README). Repro: a file -with `// vfmt: off` around a tab-and-trailing-whitespace line — `vfmt +with `// lucisv: off` around a tab-and-trailing-whitespace line — `lucisv check` reports `no-tabs` and `no-trailing-whitespace` *inside* the -fenced region, and `vfmt check --fix` rewrites it, while `vfmt format` +fenced region, and `lucisv check --fix` rewrites it, while `lucisv format` (the formatter) leaves the same region byte-for-byte untouched by design. This does not corrupt code (the rewrite is a Safe, meaning-preserving one) and does not break any hard invariant, but it -violates the fence's whole premise — a user who wrote `// vfmt: off` +violates the fence's whole premise — a user who wrote `// lucisv: off` expecting hands-off code gets it silently edited by `check --fix`. Not -mentioned anywhere in this README (the one `// vfmt: off` reference, +mentioned anywhere in this README (the one `// lucisv: off` reference, lines 162–163, only says the waiver *parser* treats it as an ordinary comment, which is correct and unrelated to this). Recommend either (a) `LintContext`/the fix/report path skip fenced ranges, matching the @@ -529,12 +529,12 @@ confirmed on a clean file, exit 0. **Backward compatibility.** Built the pre-round binary from a `git worktree` at HEAD (`1ac9746`, before this round's uncommitted changes) -and compared `vfmt --check` over the full corpus against the new +and compared `lucisv --check` over the full corpus against the new binary: stdout byte-identical, stderr byte-identical (including the same 359 parse-error lines and the same "488 files would be reformatted, 13 files left unchanged, 359 files failed to format" -summary), same exit code (2). Also reconfirmed live that `vfmt --check` -and `vfmt format --check` are byte-identical on the new binary. The +summary), same exit code (2). Also reconfirmed live that `lucisv --check` +and `lucisv format --check` are byte-identical on the new binary. The linter changes did not perturb the formatter at all, as the README promises. @@ -557,23 +557,23 @@ break. One should-fix finding (fences vs. `--fix`, above). ## Review **2026-08-19 — lead. Verdict: accepted after one directed fix; commits -jointly with vfmt-server (round 11). `vfmt check` completes the ruff +jointly with lucisv-server (round 11). `lucisv check` completes the ruff analog.** Points reviewed and accepted: 1. **The Verible-waiver asymmetry** is the round's best judgment call: - `verilog_lint:` waivers naming rules vfmt lacks are ignored, not + `verilog_lint:` waivers naming rules lucisv lacks are ignored, not reported, because punishing them punishes exactly the vendored codebases the compatibility spelling exists to welcome — while - typo'd `vfmt:` waivers still get caught. A design decision changed + typo'd `lucisv:` waivers still get caught. A design decision changed by corpus evidence, recorded with the evidence. 2. **The fix engine's conservatism** (Safe/Unsafe from day one, overlaps skipped not merged, fix→re-lint loop with a cap, `always-*-blocking` deliberately fixless because swapping `=`/`<=` changes the circuit) is the right posture for a tool whose sibling formatter promises never to corrupt. -3. **The fence ruling** (violations reported inside `// vfmt: off`, +3. **The fence ruling** (violations reported inside `// lucisv: off`, fixes never applied there) was implemented better than directed: the dev discovered that `fence::collect` yields no regions on files with a parse error before the fence — exactly the tolerant-parse diff --git a/docs/features/vfmt-core-lift/README.md b/docs/features/lucisv-core-lift/README.md similarity index 77% rename from docs/features/vfmt-core-lift/README.md rename to docs/features/lucisv-core-lift/README.md index 43d515f..9b084c7 100644 --- a/docs/features/vfmt-core-lift/README.md +++ b/docs/features/lucisv-core-lift/README.md @@ -1,16 +1,16 @@ -# vfmt-core-lift +# lucisv-core-lift ## Goal The CLI and the language server were answering two different questions with -two different pieces of code: `vfmt` discovers `vfmt.toml` and walks a tree -honoring `.gitignore` and `--exclude`, while `vfmt-server` formatted with +two different pieces of code: `lucisv` discovers `lucisv.toml` and walks a tree +honoring `.gitignore` and `--exclude`, while `lucisv-server` formatted with built-in defaults and indexed everything it could find, because both rules -lived inside the `vfmt` **binary** crate where nothing else could reach them -(the two Handshake requests filed by `docs/features/vfmt-server/README.md`). +lived inside the `lucisv` **binary** crate where nothing else could reach them +(the two Handshake requests filed by `docs/features/lucisv-server/README.md`). That is the classic way an editor's format-on-save drifts away from CI's -`vfmt --check`. This round lifts `config.rs` and `walk.rs` — unchanged — into -a new std-only library crate `crates/vfmt_core`, re-points the CLI at it with +`lucisv --check`. This round lifts `config.rs` and `walk.rs` — unchanged — into +a new std-only library crate `crates/lucisv_core`, re-points the CLI at it with no behavior change at all, and wires the server through the same code: one discovery rule, one walk, two front ends. @@ -21,13 +21,13 @@ discovery rule, one walk, two front ends. line of their 31 unit tests, was edited. The modules kept their names inside the new crate, so even the import paths in the moved tests (`use super::*`) needed no change. Everything the CLI does is therefore unchanged by - construction, and the untouched `crates/vfmt/tests/cli.rs` (48 tests) plus a + construction, and the untouched `crates/lucisv/tests/cli.rs` (48 tests) plus a byte-identical 820-file corpus (count corrected by lead per QA) run are the evidence. -- **`vfmt_core` is two modules, not a framework.** `pub mod config; pub mod +- **`lucisv_core` is two modules, not a framework.** `pub mod config; pub mod walk;` and nothing else — no re-export layer, no new traits, no configuration struct invented for a third caller that does not exist. The crate has no dependencies, std only, as both modules already did. -- **Precedence in the server is `vfmt.toml` > the client's `tabSize` > the +- **Precedence in the server is `lucisv.toml` > the client's `tabSize` > the built-in default**, which is deliberately *not* the CLI's `--flag > config > default`. The CLI's flag is typed by a human for one run, so it outranks a file. `FormattingOptions::tab_size` is not that: LSP requires the client to @@ -35,18 +35,18 @@ discovery rule, one walk, two front ends. own default (VS Code's `editor.tabSize`, 4 unless changed) or its guess from the file's existing indentation. Treating an editor default as a deliberate override would let an unconfigured editor silently beat a checked-in - `vfmt.toml` — reintroducing exactly the CLI/editor divergence this feature - exists to delete, and making format-on-save fight `vfmt --check` in CI. + `lucisv.toml` — reintroducing exactly the CLI/editor divergence this feature + exists to delete, and making format-on-save fight `lucisv --check` in CI. Where the config file is *silent*, `tabSize` still beats the built-in - default, so a project with no `vfmt.toml` behaves exactly as the server did + default, so a project with no `lucisv.toml` behaves exactly as the server did before this round. `line-length` has no client analog at all and comes from the config file or not at all. -- **A broken `vfmt.toml` warns the editor; it does not fail it.** The CLI's +- **A broken `lucisv.toml` warns the editor; it does not fail it.** The CLI's contract for an unparsable config is fatal: exit 2, nothing written, all configs resolved before any file is touched (`docs/features/config-discovery/README.md`). That is right for a batch tool where a half-applied run is the danger. It is wrong for an editor: a user who - types a typo into `vfmt.toml` in one tab must not find that format-on-save + types a typo into `lucisv.toml` in one tab must not find that format-on-save has stopped working in every other tab, with an error where their code should be. So the server formats with the **built-in defaults** (never a partial mix of the broken file's keys — nothing at all is taken from a file that failed @@ -57,14 +57,14 @@ discovery rule, one walk, two front ends. parses are identical. - **The warning is said once per file change.** A format-on-save loop asks to format on every save; repeating the same config error forever would train the - user to dismiss vfmt's messages. The server remembers which documents it has + user to dismiss lucisv's messages. The server remembers which documents it has warned about and re-arms a document when its text changes (`didOpen`, `didChange`, `didSave` with text) or when it is closed. - **The index scan anchors its excludes on the workspace root.** `exclude` is resolved once per command-line input in the CLI, never mid-walk (config-discovery's own assumption); the server's analog of "an input" is a workspace root, so the config governing the root supplies the exclude - patterns for that root's whole scan. A `vfmt.toml` in a subdirectory still + patterns for that root's whole scan. A `lucisv.toml` in a subdirectory still governs `line-length`/`indent` for files under it when they are formatted — discovery there is per-document — it just cannot add excludes mid-scan, exactly as in the CLI. @@ -78,7 +78,7 @@ discovery rule, one walk, two front ends. - **The server's walk-depth cap is gone, deliberately.** The old plain walk capped recursion at 64 directories to survive a symlink cycle; the lifted walk has no cap, because the CLI's does not. Keeping the cap would mean the - index silently covering fewer files than `vfmt` formats — the divergence this + index silently covering fewer files than `lucisv` formats — the divergence this round exists to remove — and *adding* a cap to the shared walk would silently drop deep files from CLI runs, which is a behavior change this mechanical lift must not make. Cycle detection belongs in the shared walk where it would @@ -87,7 +87,7 @@ discovery rule, one walk, two front ends. search from, so it is formatted with `tabSize`-or-defaults, as before. - **Discovery is rebuilt per formatting request.** `Discovery`'s cache is per-instance and the server is long-lived, so a cached answer would go stale - the moment a user edits `vfmt.toml`. A fresh `Discovery` per request costs + the moment a user edits `lucisv.toml`. A fresh `Discovery` per request costs one file read on an explicit, user-initiated action — cheaper than any invalidation scheme that could be wrong. (config-discovery's Handshakes anticipated exactly this: "a server can drop and rebuild one when a config @@ -95,42 +95,42 @@ discovery rule, one walk, two front ends. ## Handshakes -- **New crate `vfmt_core`, consumed by `vfmt` and `vfmt_server`.** Public - surface, unchanged from what it was inside `crates/vfmt`: - - `vfmt_core::config`: `FileConfig { line_length, indent, exclude }`, +- **New crate `lucisv_core`, consumed by `lucisv` and `lucisv_server`.** Public + surface, unchanged from what it was inside `crates/lucisv`: + - `lucisv_core::config`: `FileConfig { line_length, indent, exclude }`, `parse(&str) -> Result`, `Discovery::{new, for_input, for_file, for_dir}`. - - `vfmt_core::walk`: `EXTENSIONS`, `collect_files(input, exclude, gitignore, + - `lucisv_core::walk`: `EXTENSIONS`, `collect_files(input, exclude, gitignore, &mut Vec) -> Result<(), String>`, `is_excluded(&Path, &[String])`. Every item already carried the one-line doc comment CLAUDE.md asks for; no signature changed, so no crate-public boundary moved in a way that needed a new one. The rules themselves stay documented where they were: `docs/features/config-discovery/README.md` and `docs/features/parallel-files/README.md`. -- **`crates/vfmt` consumes `vfmt_core`** and keeps nothing of its own: the two +- **`crates/lucisv` consumes `lucisv_core`** and keeps nothing of its own: the two modules are gone from its `src/`, `mod config;`/`mod walk;` are gone from - `main.rs`, and the three call sites now say `vfmt_core::…`. No duplicated + `main.rs`, and the three call sites now say `lucisv_core::…`. No duplicated logic was left behind. - **Discharges both Handshake requests filed by - `docs/features/vfmt-server/README.md`** (items 1 and 2, config discovery and + `docs/features/lucisv-server/README.md`** (items 1 and 2, config discovery and the ignore-aware walk). Both are annotated **DELIVERED** in that README, one line each, as the only edits made to another feature's document. -- **Request to the lead — stale prose in `docs/features/vfmt-server/README.md` +- **Request to the lead — stale prose in `docs/features/lucisv-server/README.md` and `TODO.md`, deliberately not edited here** (out of this feature's stated scope, and a concurrent editor-packaging round is live in the same files): - - vfmt-server README, Assumptions: "**The workspace walk is plain** … - `.gitignore` and `--exclude` are **not** honored" and "**`vfmt.toml` is not + - lucisv-server README, Assumptions: "**The workspace walk is plain** … + `.gitignore` and `--exclude` are **not** honored" and "**`lucisv.toml` is not discovered** … The server uses `Config::default()` … with the client's tab size overriding the indent" are both now false, and the tab-size sentence is contradicted by the precedence decided above. - - vfmt-server README, Status/TODO: "**Not done:** `vfmt.toml` discovery, + - lucisv-server README, Status/TODO: "**Not done:** `lucisv.toml` discovery, `.gitignore`-aware indexing — both blocked on the two Handshake requests above" is now done. - - `TODO.md:103` and `TODO.md:120` point at `crates/vfmt/src/config.rs` and - `crates/vfmt/src/walk.rs`; both files now live in `crates/vfmt_core/src/`. + - `TODO.md:103` and `TODO.md:120` point at `crates/lucisv/src/config.rs` and + `crates/lucisv/src/walk.rs`; both files now live in `crates/lucisv_core/src/`. `docs/features/spans/README.md:308` names the old config path in a work-log sentence about a concurrent round — historical, best left alone. -- **Follow-up for whoever next touches `vfmt_core::walk`:** the walk has no +- **Follow-up for whoever next touches `lucisv_core::walk`:** the walk has no symlink-cycle detection (a depth cap, or device+inode tracking). It never had; the CLI has always been exposed to it, and the server now shares the exposure since its own 64-directory cap was removed for parity. Fixing it in @@ -138,37 +138,37 @@ discovery rule, one walk, two front ends. behavior (deep trees, cyclic links), so it wants its own round with its own tests, not a quiet addition inside a mechanical lift. - **`TODO.md`: no matching checkbox.** The §3 config and `.gitignore` items and - the §6 `vfmt_server` item are already checked; this round moves code and + the §6 `lucisv_server` item are already checked; this round moves code and wires the server, and adds no item of its own. Nothing was checked off. ## Status / TODO -- [x] `crates/vfmt_core` created with a **compiling skeleton first**, built +- [x] `crates/lucisv_core` created with a **compiling skeleton first**, built standalone, and only then added to the root `members` (round 11's ordering lesson, taken literally). - [x] `config.rs` and `walk.rs` moved as 100% renames, unit tests and all. -- [x] `crates/vfmt` re-wired to `vfmt_core` (`Cargo.toml`, `main.rs`, +- [x] `crates/lucisv` re-wired to `lucisv_core` (`Cargo.toml`, `main.rs`, `args.rs`); no logic left behind, no CLI behavior change. -- [x] Server formatting discovers `vfmt.toml` anchored at the document's own +- [x] Server formatting discovers `lucisv.toml` anchored at the document's own path, by the CLI's rule. - [x] Precedence `config > tabSize > built-in default`, decided and documented. - [x] Broken config → one `showMessage` warning per file change, formatting proceeds with defaults, never a crash and never a partial config. - [x] `initialize`'s scan uses the lifted walk: same extensions, `.gitignore` honored, excludes from the workspace root's config. -- [x] Tests: `vfmt_core` inherits its 31 moved unit tests; server gains 8 unit - tests (config-beats-tabSize, `vfmt.toml` governing a real buffer, broken +- [x] Tests: `lucisv_core` inherits its 31 moved unit tests; server gains 8 unit + tests (config-beats-tabSize, `lucisv.toml` governing a real buffer, broken config, untitled buffer, gitignore-honoring scan, root-config excludes, broken root config, extension filter) and 2 e2e tests through the real binary over stdio. -- [x] Both vfmt-server Handshakes annotated DELIVERED. +- [x] Both lucisv-server Handshakes annotated DELIVERED. - [x] Gates: `cargo test --workspace`, `cargo clippy --workspace --all-targets`, `cargo fmt --all --check`, corpus check. - [ ] **Not done, deliberately:** symlink-cycle detection in the shared walk (see Handshakes — a real behavior change, wants its own round). - [ ] **Not done:** re-resolving `exclude` per directory during a scan. The CLI does not either; the two agree, which is the point of this round. -- [ ] **Not done:** watching `vfmt.toml` for changes +- [ ] **Not done:** watching `lucisv.toml` for changes (`workspace/didChangeWatchedFiles`). Discovery is re-run per formatting request, so an edited config takes effect at the next format without it. @@ -177,11 +177,11 @@ discovery rule, one walk, two front ends. ### 2026-08-19 — dev agent - Read `CLAUDE.md`, the two Handshake requests in - `docs/features/vfmt-server/README.md`, all of + `docs/features/lucisv-server/README.md`, all of `docs/features/config-discovery/README.md` and the behavior half of `docs/features/parallel-files/README.md` (both QA logs included), and - `crates/vfmt/src/{config,walk,main,args,lint}.rs` before writing anything. -- **Ordering lesson taken literally.** `crates/vfmt_core` was created with a + `crates/lucisv/src/{config,walk,main,args,lint}.rs` before writing anything. +- **Ordering lesson taken literally.** `crates/lucisv_core` was created with a literal-versioned manifest carrying an empty `[workspace]` table — making it its own workspace — the two modules were `git mv`'d in, and `cargo test` was run **standalone** (31 passed) *before* the root `members` @@ -193,11 +193,11 @@ discovery rule, one walk, two front ends. moves as `(100%)`. The 31 unit tests moved with their modules and did not need even an import-path edit, because the modules kept their names. The brief allowed edits to those imports; none were required. -- **Behavior preservation, measured rather than asserted.** `crates/vfmt`'s +- **Behavior preservation, measured rather than asserted.** `crates/lucisv`'s unit count is unchanged in total (58 = 27 that stayed + 31 that moved), and - `crates/vfmt/tests/cli.rs` — 48 CLI integration tests — is **byte-untouched** - and green. Then the strongest check available: a release `vfmt` built from a - clean `git worktree` at `HEAD` and the working-tree `vfmt` were both run over + `crates/lucisv/tests/cli.rs` — 48 CLI integration tests — is **byte-untouched** + and green. Then the strongest check available: a release `lucisv` built from a + clean `git worktree` at `HEAD` and the working-tree `lucisv` were both run over the 820-file corpus (count corrected by lead per QA), and their per-file TSVs are **byte-identical** (`diff` silent; verification-error: none, crash: none in both). The committed `corpus-check-results.tsv` in the repo predates several landed rounds and was @@ -208,7 +208,7 @@ discovery rule, one walk, two front ends. version is that LSP forces the client to send `tabSize` on every request, so it is a *default*, not an *intent*, and a default must not beat a file a human checked in. The rule is pinned by `a_config_file_beats_the_editors_tab_size` - (unit) and by `a_vfmt_toml_governs_formatting_over_the_editors_tab_size` + (unit) and by `a_lucisv_toml_governs_formatting_over_the_editors_tab_size` (e2e: the client asks for `tabSize: 2`, the config says `indent = 4`, the wire carries four spaces). - **Split `format::formatting` in two** rather than letting it talk to the @@ -234,7 +234,7 @@ discovery rule, one walk, two front ends. private file list, so they pin the behavior a user sees. - **The format unit tests that need a real tree write a `.git` marker** into their scratch directory. That stops the upward discovery walk at the temp - dir, so a `vfmt.toml` in some real ancestor of `/tmp` can never leak into a + dir, so a `lucisv.toml` in some real ancestor of `/tmp` can never leak into a test result — the `.git`-stops-the-walk rule config-discovery documents, used as a test-hermeticity tool. - **Two clippy fixes on the way through**, both in the e2e test: `&PathBuf` → @@ -251,47 +251,47 @@ discovery rule, one walk, two front ends. **Results** (settled tree, all re-run at the end): - `cargo test --workspace`: **512 passed, 0 failed** (baseline before this - round: 503; +31 `vfmt_core`, −31 moved out of `vfmt`, +7 net `vfmt_server` - unit, +2 `vfmt_server` e2e). - - `vfmt_core`: 31 unit (20 config + 11 walk), all moved, all unmodified. - - `vfmt`: 27 unit + **48 CLI integration, unmodified** — the + round: 503; +31 `lucisv_core`, −31 moved out of `lucisv`, +7 net `lucisv_server` + unit, +2 `lucisv_server` e2e). + - `lucisv_core`: 31 unit (20 config + 11 walk), all moved, all unmodified. + - `lucisv`: 27 unit + **48 CLI integration, unmodified** — the behavior-preservation proof. - - `vfmt_server`: 82 unit (was 75) + 3 e2e (was 1). + - `lucisv_server`: 82 unit (was 75) + 3 e2e (was 1). - `cargo clippy --workspace --all-targets`: **0 warnings**. - `cargo fmt --all --check`: clean. - Corpus: HEAD binary vs. lifted binary over 860 files → **identical TSVs**, `verification-error: none`, `crash: none`. `corpus-check-results.tsv` unmodified in the repo. -- Files added: `crates/vfmt_core/{Cargo.toml,src/lib.rs}` (+ the two moved +- Files added: `crates/lucisv_core/{Cargo.toml,src/lib.rs}` (+ the two moved modules), this README. Files edited: root `Cargo.toml` (one `members` line, - additive), `crates/vfmt/{Cargo.toml,src/main.rs,src/args.rs}`, - `crates/vfmt_server/{Cargo.toml,src/{format,server,state}.rs,tests/e2e.rs}`, - and two annotation lines in `docs/features/vfmt-server/README.md`. + additive), `crates/lucisv/{Cargo.toml,src/main.rs,src/args.rs}`, + `crates/lucisv_server/{Cargo.toml,src/{format,server,state}.rs,tests/e2e.rs}`, + and two annotation lines in `docs/features/lucisv-server/README.md`. ## QA log ### 2026-08-19 — QA agent -Scope: `-p vfmt_core -p vfmt -p vfmt_server`. Verified every claim in the +Scope: `-p lucisv_core -p lucisv -p lucisv_server`. Verified every claim in the brief; **all PASS, no blocking findings.** **1. Mechanical lift.** - `git diff -M --summary`: both moves report `(100%)` — confirmed rename, zero content diff by definition. -- `git show HEAD:crates/vfmt/src/config.rs | diff - crates/vfmt_core/src/config.rs` +- `git show HEAD:crates/lucisv/src/config.rs | diff - crates/lucisv_core/src/config.rs` and the same for `walk.rs`: **both `diff` exit 0** — byte-identical, no divergence line. -- `crates/vfmt/tests/cli.rs`: `git diff HEAD` empty (byte-untouched); +- `crates/lucisv/tests/cli.rs`: `git diff HEAD` empty (byte-untouched); `grep -c '#\[test\]'` = 48, all pass. -- Unit total conserved: `vfmt_core` 31 (20 config + 11 walk), `vfmt` 27 + - 48 CLI = 75. 58 (27+31) was the pre-lift `vfmt` total; post-lift it's - 27 (stayed) + 31 (moved to vfmt_core) = 58, matches exactly. -- `main.rs`/`args.rs` call sites confirmed rewired: `use vfmt_core::config::Discovery`, - `use vfmt_core::walk::{collect_files, EXTENSIONS}` (main.rs:28-29), - `use vfmt_core::config::FileConfig` (args.rs:3). No `mod config;`/`mod walk;` +- Unit total conserved: `lucisv_core` 31 (20 config + 11 walk), `lucisv` 27 + + 48 CLI = 75. 58 (27+31) was the pre-lift `lucisv` total; post-lift it's + 27 (stayed) + 31 (moved to lucisv_core) = 58, matches exactly. +- `main.rs`/`args.rs` call sites confirmed rewired: `use lucisv_core::config::Discovery`, + `use lucisv_core::walk::{collect_files, EXTENSIONS}` (main.rs:28-29), + `use lucisv_core::config::FileConfig` (args.rs:3). No `mod config;`/`mod walk;` left in `main.rs`. -**2. CLI behavior identical (corpus md5).** Built `target/release/vfmt` from +**2. CLI behavior identical (corpus md5).** Built `target/release/lucisv` from the working tree and a second binary from a `git worktree add ... HEAD` checkout, ran `tools/corpus_check.sh` with each (`-b `) over the same `corpus/` tree (820 `.v`/`.sv` files — not 860 as the work log states; @@ -301,14 +301,14 @@ hash**, `diff` silent, `verification-error: none`, `crash: none` in both. Worktree removed after (`git worktree remove --force`). **3. Server config — all sub-claims verified live**, driving the real -`target/debug/vfmt-server` binary over stdio with a custom interactive +`target/debug/lucisv-server` binary over stdio with a custom interactive Python driver (scratchpad: `drive_lsp.py`) that can mutate the filesystem *between* requests in one session — the packaged `talk()` e2e helper writes the whole session up front and can't do that, so this fills the gap the brief asked for ("drive the server live"). - - **Fresh discovery per request**: scratch dir with `vfmt.toml` (`indent=4`), + - **Fresh discovery per request**: scratch dir with `lucisv.toml` (`indent=4`), `didOpen`, format with `tabSize:2` → 4-space output (config wins). - Deleted `vfmt.toml` from disk, sent a `didChange` touch (same text), + Deleted `lucisv.toml` from disk, sent a `didChange` touch (same text), formatted again → 2-space output (tabSize wins). Confirms the strongest claim in Assumptions. - **Bonus, not required by the brief**: repeated the above *without* the @@ -323,14 +323,14 @@ brief asked for ("drive the server live"). touch is required. - **Precedence, `config > tabSize > default`**: unit test `a_config_file_beats_the_editors_tab_size` and e2e - `a_vfmt_toml_governs_formatting_over_the_editors_tab_size` both green. - - **Precedence edge (config silent on indent)**: scratch `vfmt.toml` + `a_lucisv_toml_governs_formatting_over_the_editors_tab_size` both green. + - **Precedence edge (config silent on indent)**: scratch `lucisv.toml` with only `line-length = 100`, formatted with `tabSize:3` → `newText` used 3-space indent (`"module m;\n wire a;\nendmodule\n"`). Per-setting precedence confirmed, not per-file. - **Broken config**: one `window/showMessage` (type 2 = Warning) per file change, formatting proceeds on defaults, CLI's `path:line: message` - format preserved (`vfmt.toml:2` and `unknown key \`bogus\`` both + format preserved (`lucisv.toml:2` and `unknown key \`bogus\`` both present in the message). Two formats with no edit between → exactly one warning (live-verified: warnings-after-format#1 = 1, warnings-after-format#2-no-edit = 1). @@ -342,15 +342,15 @@ brief asked for ("drive the server live"). `didSave`-with-text, and on `didClose`) documents. Matches the README's "once per file change" rule to the letter — a config-only edit does not reset it (there's no code path that would), a document edit does. - - `a_vfmt_toml_governs_formatting_over_the_editors_tab_size` and - `a_broken_vfmt_toml_warns_once_and_still_formats`: both green, + - `a_lucisv_toml_governs_formatting_over_the_editors_tab_size` and + `a_broken_lucisv_toml_warns_once_and_still_formats`: both green, assertions match the brief exactly (`newText` diff, warning count, message content). **4. Server scan.** - `state.rs`: confirmed `MAX_WALK_DEPTH`/`SOURCE_EXTENSIONS`/`walk()`/ `is_source()` are gone; `source_files()` (state.rs:143) calls - `vfmt_core::walk::collect_files` with `gitignore=true` always and + `lucisv_core::walk::collect_files` with `gitignore=true` always and `Discovery::new(true).for_dir(root)`'s `exclude`, anchored per root — matches the "workspace-root config excludes" claim exactly. - Live-verified: scratch workspace with `.gitignore` containing @@ -363,46 +363,46 @@ brief asked for ("drive the server live"). `a_broken_root_config_does_not_stop_the_scan`, `the_scan_takes_only_source_extensions` all present and green. - Follow-up filing: confirmed present in this README's Handshakes - ("Follow-up for whoever next touches `vfmt_core::walk`" — symlink-cycle + ("Follow-up for whoever next touches `lucisv_core::walk`" — symlink-cycle detection, deliberately deferred) and cross-referenced in - `docs/features/vfmt-server/README.md`'s superseded-prose note + `docs/features/lucisv-server/README.md`'s superseded-prose note ("symlink-cycle exposure now shared with the CLI, filed as a follow-up in that feature's README"). Filing exists as claimed. **5. Gates.** - `cargo test --workspace`: **512 passed, 0 failed** — summed every crate's reported count by hand to cross-check the workspace-wide - figure (concurrent round's crates included): 27+48 (vfmt) + 31 - (vfmt_core) + 82+3 (vfmt_server) + 8+1+4+6+2+39 (vlog_formatter) + + figure (concurrent round's crates included): 27+48 (lucisv) + 31 + (lucisv_core) + 82+3 (lucisv_server) + 8+1+4+6+2+39 (vlog_formatter) + 71+30 (vlog_linter) + 53+24+19+17 (vlog_parser) + 6+1+19+20 (vlog_semantic) + 1 doctest = 512. Exact match to the claim; the concurrent comments-round-2 work in `vlog_parser`/`vlog_formatter` was green at the time of this run. - - Scoped counts confirmed exactly: `vfmt_core` 31 unit; `vfmt` 27 unit + - 48 CLI integration; `vfmt_server` 82 unit + 3 e2e (all three e2e tests + - Scoped counts confirmed exactly: `lucisv_core` 31 unit; `lucisv` 27 unit + + 48 CLI integration; `lucisv_server` 82 unit + 3 e2e (all three e2e tests green, including `the_binary_serves_a_whole_session_over_stdio` which predates this round). - `cargo clippy --workspace --all-targets`: 0 warnings. - `cargo fmt --all --check`: clean. - - Handshakes: both vfmt-server Handshake items 1 and 2 annotated - **DELIVERED** in `docs/features/vfmt-server/README.md` (lines 256, + - Handshakes: both lucisv-server Handshake items 1 and 2 annotated + **DELIVERED** in `docs/features/lucisv-server/README.md` (lines 256, 268), one line each as required, plus a Status/TODO checkbox flip and superseded-prose annotations on the two stale Assumptions bullets — all carrying a "(lead note)" attribution, consistent with this being the lead acting on the Handshakes request rather than dev-agent scope creep. `TODO.md:103` and `:120`x2 (via `git diff`, now at different - line numbers) already point at `crates/vfmt_core/src/{config,walk}.rs` + line numbers) already point at `crates/lucisv_core/src/{config,walk}.rs` — also already fixed, also outside this feature's own diff per the work log's file list. Nothing left for QA to do on these two items. **6. CLAUDE.md compliance.** - - `cargo tree -p vfmt_core`: single line, `vfmt_core v0.1.0 (...)`, zero + - `cargo tree -p lucisv_core`: single line, `lucisv_core v0.1.0 (...)`, zero dependencies — std-only confirmed. - No `unwrap()`/`expect(`/`panic!` outside `#[cfg(test)]` in - `vfmt_core/src/{config,walk,lib}.rs` or `vfmt_server/src/{format,state, + `lucisv_core/src/{config,walk,lib}.rs` or `lucisv_server/src/{format,state, server}.rs` (checked with an awk pass that stops counting at the `#[cfg(test)]` marker per file — zero hits before it in every file). - `vfmt/src/{main,args}.rs`'s `unwrap()`/`panic!` calls are all inside + `lucisv/src/{main,args}.rs`'s `unwrap()`/`panic!` calls are all inside `#[cfg(test)] mod tests` blocks — allowed. - Every `pub` item in `config.rs`/`walk.rs` carries a `///` doc comment (spot-checked `FileConfig`, `parse`, `Discovery`, `EXTENSIONS`, @@ -447,7 +447,7 @@ Points reviewed and accepted: is (an editor default sent on every request, not a deliberate choice). Rejecting the CLI analogy (`--flag > config`) for the editor was correct — the whole feature exists to stop format-on-save - fighting `vfmt --check` in CI, and treating an unconfigured editor's + fighting `lucisv --check` in CI, and treating an unconfigured editor's 4 as an override would have reintroduced that fight. QA verified the per-setting edge (config sets only line-length → tabSize still governs indent) live. @@ -466,6 +466,6 @@ Points reviewed and accepted: instinct, twice. Lead fix on acceptance: the corpus file-count figure (860→820) per QA. -The stale vfmt-server Assumptions this lift superseded were struck +The stale lucisv-server Assumptions this lift superseded were struck through with lead notes at the editor-packaging review, alongside the TODO path pointers. diff --git a/docs/features/vfmt-server/README.md b/docs/features/lucisv-server/README.md similarity index 94% rename from docs/features/vfmt-server/README.md rename to docs/features/lucisv-server/README.md index 21c5942..bdd2002 100644 --- a/docs/features/vfmt-server/README.md +++ b/docs/features/lucisv-server/README.md @@ -1,9 +1,9 @@ -# vfmt-server +# lucisv-server ## Goal -`crates/vfmt_server` is the analog of ruff's `ruff_server`: one binary, -`vfmt-server`, that speaks LSP over stdio and serves both VS Code and +`crates/lucisv_server` is the analog of ruff's `ruff_server`: one binary, +`lucisv-server`, that speaks LSP over stdio and serves both VS Code and Vim/Neovim with no editor-specific logic below the protocol layer (TODO.md §6). Every engine it needs already exists — the tolerant parser, the span and line-index utilities, the `` `define`` table, `vlog_semantic` and the @@ -55,12 +55,12 @@ into a full instantiation skeleton and `signatureHelpProvider` names the ports inside a connection list — see `docs/features/refactor-instantiate/README.md`**, ~~and cross-file references~~ **delivered by references-nav (M7): `textDocument/references` -now routes through the same collection a rename runs, so what vfmt lists and -what vfmt would edit are one answer — see +now routes through the same collection a rename runs, so what lucisv lists and +what lucisv would edit are one answer — see `docs/features/references-nav/README.md`, which also brought `documentHighlight` for symbols and `foldingRange`.** -(`vfmt.toml` discovery and `.gitignore`-aware indexing, deferred when this -was written, were delivered by vfmt-core-lift the same day — lead note.) +(`lucisv.toml` discovery and `.gitignore`-aware indexing, deferred when this +was written, were delivered by lucisv-core-lift the same day — lead note.) ## Dependencies, and the justification CLAUDE.md asks for @@ -193,7 +193,7 @@ handler is milliseconds; the complexity of a worker pool buys nothing yet. | layer | rebuilt when | cost | |---|---|---| | a document's `Semantics` + tokens + diagnostics | every `didOpen`/`didChange` | one file, full recompute | -| the `WorkspaceIndex` | `initialize`, every `didSave`, every `workspace/didChangeWatchedFiles`, and a changed `vfmt.exclude`/`vfmt.filelist` | full re-scan of the roots | +| the `WorkspaceIndex` | `initialize`, every `didSave`, every `workspace/didChangeWatchedFiles`, and a changed `lucisv.exclude`/`lucisv.filelist` | full re-scan of the roots | | the `` `include`` graph | with the `WorkspaceIndex`, from the same file list | a line scan per file (~6ms over the 860-file corpus). An open buffer's *own* includes are re-resolved on every request instead, so a line just typed is clickable before the next save | **Per-file recompute on every keystroke** is the strategy TODO.md §6 states @@ -225,7 +225,7 @@ remains, honestly:** a client that did not advertise `workspace.didChangeWatchedFiles.dynamicRegistration` cannot be registered (the protocol has no static form of the capability) and keeps the save-only model above; nested `-f` filelists are not watched, only the root one; -`vfmt.toml` is not watched either (it is re-read on every rebuild, so the next +`lucisv.toml` is not watched either (it is re-read on every rebuild, so the next rebuild from any cause picks it up); and there is no time-based debouncing, so a burst arriving as several separate notifications costs one rebuild each. @@ -254,7 +254,7 @@ not see. - **The workspace walk is plain.** `initialize`'s `workspace_folders` (falling back to `root_uri`) are walked recursively for `*.v`/`*.sv`/`*.vh`/`*.svh`. ~~`.gitignore` and `--exclude` are **not** honored~~ **Superseded by - vfmt-core-lift (lead note): the scan now uses the lifted `vfmt_core` walk — + lucisv-core-lift (lead note): the scan now uses the lifted `lucisv_core` walk — `.gitignore` always on, workspace-root config excludes applied. The old 64-directory depth cap is gone for CLI parity (symlink-cycle exposure now shared with the CLI, filed as a follow-up in that feature's README).** @@ -268,11 +268,11 @@ not see. becomes a second error item. Symbols and diagnostics in that state are oddly-placed but never wrong about their spans. This is the documented shape, not a bug in this crate. -- ~~**`vfmt.toml` is not discovered.**~~ **Superseded by vfmt-core-lift - (lead note): discovery now runs per formatting request via `vfmt_core`, +- ~~**`lucisv.toml` is not discovered.**~~ **Superseded by lucisv-core-lift + (lead note): discovery now runs per formatting request via `lucisv_core`, with precedence config > client tabSize > built-in default, and a broken config warns once and formats with defaults. See - `docs/features/vfmt-core-lift/README.md`.** + `docs/features/lucisv-core-lift/README.md`.** ## Handshakes @@ -308,11 +308,11 @@ the binary's name and its stdio contract, nothing else. **Requested of other modules** — none of these block this round, and none was done here: -1. **DELIVERED** by `docs/features/vfmt-core-lift/README.md` (round 12): - `config.rs` now lives in `crates/vfmt_core`, and formatting discovers - `vfmt.toml` anchored at the document's own path. **`crates/vfmt`: make - config discovery reusable.** `vfmt.toml` search, - parsing and precedence live in `crates/vfmt/src/config.rs`, inside a binary +1. **DELIVERED** by `docs/features/lucisv-core-lift/README.md` (round 12): + `config.rs` now lives in `crates/lucisv_core`, and formatting discovers + `lucisv.toml` anchored at the document's own path. **`crates/lucisv`: make + config discovery reusable.** `lucisv.toml` search, + parsing and precedence live in `crates/lucisv/src/config.rs`, inside a binary crate, so the server cannot call it. The LSP needs exactly the same answer the CLI gives for the same file, and duplicating the search rule is how the two silently diverge. The ask: lift `config.rs` into a small @@ -320,12 +320,12 @@ done here: `discover(path) -> Config`-shaped entry point. Until then the server formats with defaults, which is wrong for any project that sets `line-length`. -2. **DELIVERED** by `docs/features/vfmt-core-lift/README.md` (round 12): - `walk.rs` now lives in `crates/vfmt_core`, and the index scan uses it, so - the index skips what the CLI skips. **`crates/vfmt`: make the ignore-aware +2. **DELIVERED** by `docs/features/lucisv-core-lift/README.md` (round 12): + `walk.rs` now lives in `crates/lucisv_core`, and the index scan uses it, so + the index skips what the CLI skips. **`crates/lucisv`: make the ignore-aware walk reusable.** Same shape of problem for `walk.rs` (`.gitignore` + `--exclude`). The server's plain walk - will index generated netlists a `vfmt` run would skip. + will index generated netlists a `lucisv` run would skip. 3. **`vlog_parser`: token-kind detail the lexer folds away.** Two spellings are indistinguishable in `TokenKind` today and are therefore classified coarsely by `semanticTokens` rather than reached for privately: an operator @@ -428,7 +428,7 @@ resolves a fence's info string against the language registry rather than against the hovered document. Changing the tag, or fencing a new surface with a different one, silently returns every card to flat grey. The three call sites pin the exact fenced string in their own tests; the registration is pinned by -`crates/vfmt_server/tests/grammar.rs`, which also holds the extension's keyword +`crates/lucisv_server/tests/grammar.rs`, which also holds the extension's keyword list to `vlog_parser::KEYWORDS`. Rationale and inventory: `docs/features/editor-packaging/README.md`. @@ -451,7 +451,7 @@ list to `vlog_parser::KEYWORDS`. Rationale and inventory: - [x] Handler-level tests against constructed state, no process spawned. - [x] One end-to-end smoke test that spawns the built binary and speaks framed JSON-RPC. -- [x] TODO.md §6 `vfmt_server` checkbox, annotated with what shipped. +- [x] TODO.md §6 `lucisv_server` checkbox, annotated with what shipped. - [x] ~~**Not done, deliberately:** `rangeFormatting`. It reuses TODO.md §2's `--lines`, which does not exist yet; advertising the capability before the engine does is how an editor learns to distrust a server.~~ @@ -479,8 +479,8 @@ list to `vlog_parser::KEYWORDS`. Rationale and inventory: (`vlog_refactor::find_references`) rather than from new machinery. The same round added `documentHighlight` for symbols and `foldingRange`. `docs/features/references-nav/README.md`. -- [x] ~~**Not done:**~~ `vfmt.toml` discovery, `.gitignore`-aware indexing — - delivered by vfmt-core-lift (both Handshakes below marked DELIVERED). +- [x] ~~**Not done:**~~ `lucisv.toml` discovery, `.gitignore`-aware indexing — + delivered by lucisv-core-lift (both Handshakes below marked DELIVERED). - [x] `textDocument/inlayHint` — delivered by **inlay-hints** (M8): port and parameter names on ordered connection lists, off the same `instantiation_plan` completion and signature help read. @@ -503,7 +503,7 @@ list to `vlog_parser::KEYWORDS`. Rationale and inventory: ### 2026-08-25 — dev agent (M14 macro-expansion, 0.5.0) - **No new capability, one new module, one card grew a section.** - `crates/vfmt_server/src/expand.rs` turns a macro-use token plus the `Define` + `crates/lucisv_server/src/expand.rs` turns a macro-use token plus the `Define` the card already chose into an "expands to" block; `hover.rs`'s private `define_text` takes the call text as a fourth argument and appends the section when there is one. `server.rs`, `state.rs`, the capability list and @@ -517,7 +517,7 @@ list to `vlog_parser::KEYWORDS`. Rationale and inventory: pinned by the e2e round trip, which now asserts a whole macro hover card byte for byte rather than by `contains`. - All eighteen pre-existing hover tests pass with no assertion changed. - `cargo test -p vfmt_server`: **528 passed, 0 failed** (498 unit + 27 e2e + + `cargo test -p lucisv_server`: **528 passed, 0 failed** (498 unit + 27 e2e + 3 grammar), up 27. Rules and non-goals: `docs/features/macro-expansion/README.md`. @@ -526,10 +526,10 @@ list to `vlog_parser::KEYWORDS`. Rationale and inventory: - **One new capability, two new modules, one lifted walk.** `callHierarchyProvider` is advertised as a plain `true` — the three requests are either all served or none are — `server.rs` gained three dispatch arms, - and `crates/vfmt_server/src/hierarchy.rs` holds the answers. No engine + and `crates/lucisv_server/src/hierarchy.rs` holds the answers. No engine change: `WorkspaceIndex` is read exactly as before. - **The instantiation walk is now shared.** - `crates/vfmt_server/src/instantiations.rs` holds the walk that used to be + `crates/lucisv_server/src/instantiations.rs` holds the walk that used to be private to `inlay.rs`, with the innermost enclosing module declaration threaded through it. `inlay.rs` calls it and ignores the owner; its 34 tests were left untouched as the evidence that the factoring changed nothing. @@ -555,7 +555,7 @@ list to `vlog_parser::KEYWORDS`. Rationale and inventory: - **One new capability, one new module, nothing else moved.** `inlayHintProvider` is advertised as `InlayHintOptions` with no `resolveProvider` (every hint is returned complete), `server.rs` gained one - dispatch arm, and `crates/vfmt_server/src/inlay.rs` holds the whole answer. + dispatch arm, and `crates/lucisv_server/src/inlay.rs` holds the whole answer. No engine change: `vlog_refactor::module_definition` + `instantiation_plan` were already public for M4, and this feature reads only the port/parameter **names** out of the plan. @@ -608,7 +608,7 @@ turned one of this crate's output details into a cross-module contract. `workspace-index` before writing anything. Every query this crate needed existed already; **no change was required in any engine crate**, which is the outcome the two-layer design in `workspace-index` was aiming for. -- **Took the ordering lesson literally.** `crates/vfmt_server/` was created +- **Took the ordering lesson literally.** `crates/lucisv_server/` was created with a `Cargo.toml` and a `fn main() {}` and *built* before the root `members` entry was added, then the entry, then a build, then the dependencies, then a build. A members line pointing at nothing breaks the @@ -664,19 +664,19 @@ turned one of this crate's output details into a cross-module contract. the server exits on `exit` so stdout closes and the read terminates on its own. No timeouts, no reader thread, and it cannot deadlock. - Did not touch `vlog_parser`, `vlog_formatter`, `vlog_semantic`, - `vlog_linter` or `crates/vfmt`. Did not run `git commit`/`git push`. + `vlog_linter` or `crates/lucisv`. Did not run `git commit`/`git push`. - **Concurrency note:** another agent's `vlog_linter` round is live in the same tree and added its own `members` line to the root `Cargo.toml` mid-round; left alone, as expected. Something in that round also ran `cargo fmt --all` across the tree, which reflowed a few of this crate's lines — harmless, and the final `cargo fmt --all --check` is clean. -**Results.** `cargo test -p vfmt_server`: **76 passed, 0 failed** (75 unit + +**Results.** `cargo test -p lucisv_server`: **76 passed, 0 failed** (75 unit + 1 e2e; counts trued up by the lead per the QA log — the workspace total below also moved as the concurrent linter round landed). `cargo test --workspace`: **494+ passed, 0 failed**. `cargo clippy --workspace --all-targets`: silent, 0 warnings. `cargo fmt --all --check`: -clean. Files added: `crates/vfmt_server/{Cargo.toml,src/{main,server,state, +clean. Files added: `crates/lucisv_server/{Cargo.toml,src/{main,server,state, convert,uri,locate,diagnostics,format,tokens,hover,nav,symbols}.rs, tests/e2e.rs}`, this README. Files edited: root `Cargo.toml` (one `members` entry, four `[workspace.dependencies]` lines — additive only), `TODO.md` @@ -686,21 +686,21 @@ entry, four `[workspace.dependencies]` lines — additive only), `TODO.md` ### 2026-08-19 — QA agent -Scope: `-p vfmt_server` only. Did not touch `vlog_linter`, `crates/vfmt`, or +Scope: `-p lucisv_server` only. Did not touch `vlog_linter`, `crates/lucisv`, or `docs/features/linter-core` (a concurrent QA round owns those). No source was edited; this entry is the only write. -**Gates.** `cargo fmt -p vfmt_server -- --check`: clean. `cargo clippy -p -vfmt_server --all-targets`: 0 warnings. `cargo test -p vfmt_server`: **76 +**Gates.** `cargo fmt -p lucisv_server -- --check`: clean. `cargo clippy -p +lucisv_server --all-targets`: 0 warnings. `cargo test -p lucisv_server`: **76 passed, 0 failed (75 unit + 1 e2e)** — stable across two runs. `cargo test --workspace`: green (503 passed at the instant measured; the concurrent `vlog_linter` round is landing tests live in the same tree, so this number -moves independently of anything here — `-p vfmt_server`'s own 76 is the +moves independently of anything here — `-p lucisv_server`'s own 76 is the number that matters for this feature and is not moving). **Dependency audit, independently reproduced.** `git diff HEAD -- Cargo.lock` adds exactly the 18 named packages, plus two *local* workspace crates -(`vfmt_server` itself and `vlog_linter`, the concurrent round — not part of +(`lucisv_server` itself and `vlog_linter`, the concurrent round — not part of the transitive count). Exactly one `syn` resolves, `3.0.3`. Exact-pin lines in root `Cargo.toml` confirmed: `lsp-server = "=0.10.0"`, `lsp-types = "=0.97.0"`, `serde = "=1.0.229"`, `serde_json = "=1.0.140"`. Read all five @@ -740,11 +740,11 @@ All PASS: - `hover` on `` `WIDTH`` → macro body `` `define WIDTH 8``; `hover` on `K` (reached via `import P::K`) → `**parameter** — declared in pkg.sv:2`. - `didChange` introducing `localparam int ;` → two diagnostics, non-empty - sane ranges (`severity: 1`, `source: "vfmt"`). + sane ranges (`severity: 1`, `source: "lucisv"`). - `didChange` reverting the fix → **diagnostics array published empty** — the classic forgotten-clear case, verified actually clearing. - `textDocument/formatting` on the unformatted file → one edit whose - `newText` is **byte-for-byte identical** to `target/debug/vfmt --stdout` + `newText` is **byte-for-byte identical** to `target/debug/lucisv --stdout` on the same source. - `textDocument/formatting` on the already-formatted output → `result: []`. - `semanticTokens/full` on `B.sv` → decoded the delta stream by hand (12 @@ -795,7 +795,7 @@ and `"clk"` (a common substring almost certainly matching far more than 256 declarations across a real 860-file corpus) both return exactly 256 hits; `"uart_core"` returns the correct single hit. -*Tooling note, not a vfmt_server defect:* an earlier attempt at this same +*Tooling note, not a lucisv_server defect:* an earlier attempt at this same check, using a persistent bidirectional-threaded Python client (a reader thread continuously draining stdout while the main thread issues requests — the natural way to extend the e2e pattern for an interactive multi-request @@ -815,18 +815,18 @@ flagging it so nobody mistakes the interactive-client hang for a server issue if they re-run a similar probe. **CLAUDE.md / TODO.md compliance.** README has all seven required sections. -TODO.md §6's `vfmt_server` checkbox (`TODO.md:330`) is checked and its +TODO.md §6's `lucisv_server` checkbox (`TODO.md:330`) is checked and its shipped/not-shipped annotation matches the README's Capabilities table and Status/TODO checklist exactly — no over-claiming. Both filed Handshakes (`config.rs` and `walk.rs` lifting requests, README.md:370-371) are -recorded; confirmed independently that `crates/vfmt` is `[[bin]]`-only (no +recorded; confirmed independently that `crates/lucisv` is `[[bin]]`-only (no `[lib]` target in its `Cargo.toml`), so the Handshake's premise — that -`vfmt_server` genuinely cannot call into them today — holds. +`lucisv_server` genuinely cannot call into them today — holds. **Minor, non-blocking:** the Work log's "Results" paragraph (README.md:447-448) says "75 passed, 0 failed (74 unit + 1 e2e)" and "493 passed" workspace-wide. Current actual counts are 76 (75 unit + 1 e2e) and -503 workspace-wide (the latter net of concurrent work). The `-p vfmt_server` +503 workspace-wide (the latter net of concurrent work). The `-p lucisv_server` count is off by exactly one unit test from what's written — likely a test added after that paragraph was written. Not fixed here since it's prose in another agent's Work log entry, not a code or test defect; flagging so the @@ -848,7 +848,7 @@ What earned it: ten rounds of foundations were sufficient exactly as documented, which is the strongest validation the feature-README discipline has produced. Where the CLI's config/gitignore behavior couldn't be - reached (they live in the vfmt binary), the dev filed Handshakes + reached (they live in the lucisv binary), the dev filed Handshakes instead of duplicating logic — those two lifts are round-12 work. 2. **Honest capability advertising**: deferred features are absent from the initialize result, so no editor is lied to. rangeFormatting diff --git a/docs/features/macro-expansion/README.md b/docs/features/macro-expansion/README.md index eddb22a..1d08ce4 100644 --- a/docs/features/macro-expansion/README.md +++ b/docs/features/macro-expansion/README.md @@ -22,7 +22,7 @@ expanded, not even checked for existence. Two reasons, and they are the reason this stays bookkeeping rather than becoming a preprocessor: 1. **Expanding the nest is preprocessing.** It needs a definition set, which - needs the conditional-compilation state, which vfmt deliberately does not + needs the conditional-compilation state, which lucisv deliberately does not have (`define-table`'s Assumptions: `` `ifdef`` arms are both recorded and neither is evaluated). One honest step is worth more than a cascade built on a guess about which arm is live. @@ -170,7 +170,7 @@ argument on a private function and one section on one card, `main.rs` gains one ## Status / TODO -- [x] `crates/vfmt_server/src/expand.rs` (new, ~250 lines with tests): +- [x] `crates/lucisv_server/src/expand.rs` (new, ~250 lines with tests): `single_step`, `has_macro_use`, `CAP`, `Expansion`. No dependencies. - [x] Argument splitting on top-level commas, mirroring `read_params` (nesting, strings, comments, `` `NAME()`` = zero arguments). @@ -189,7 +189,7 @@ argument on a private function and one section on one card, `main.rs` gains one trip pinning the exact card. All pre-existing hover tests unchanged. - [x] Version 0.5.0 across the workspace and the extension; `CHANGELOG.md` entry covering M7–M14. -- [x] `define-table`'s promise annotated as kept; `vfmt-server`'s hover row +- [x] `define-table`'s promise annotated as kept; `lucisv-server`'s hover row updated. - [ ] **Not done, deliberately:** expanding the nest (see "One step"), stringification/paste semantics, and a `` `define`` chosen by cursor @@ -200,7 +200,7 @@ argument on a private function and one section on one card, `main.rs` gains one ### 2026-08-25 — dev agent -- Read `CLAUDE.md`, the `define-table`, `include-nav` and `vfmt-server` +- Read `CLAUDE.md`, the `define-table`, `include-nav` and `lucisv-server` READMEs, `hover.rs`, `defines.rs` and the lexer's `` ` `` arm before writing anything. Baseline: `cargo test --workspace` **1556 passed, 0 failed**; clippy silent; fmt clean. @@ -210,7 +210,7 @@ argument on a private function and one section on one card, `main.rs` gains one `(call text, Define)`, which is what let the substitution rules get 18 tests without constructing a `Workspace`. - **The hard decision was what "one step" excludes**, and it was decided by - what vfmt already refuses to know. Expanding a nested `` `INNER`` would need + what lucisv already refuses to know. Expanding a nested `` `INNER`` would need a definition set resolved through conditional compilation; `define-table` records both `` `ifdef`` arms and evaluates neither, so any cascade would sit on a guess. Stopping after one substitution pass also removes recursion, @@ -266,9 +266,9 @@ argument on a private function and one section on one card, `main.rs` gains one **1. Gates — PASS.** `cargo test --workspace`: **1583 passed, 0 failed** (summed across every test binary; matches the work log's claim exactly). `cargo clippy --all-targets`: silent. `cargo fmt --all --check`: clean. -`node editors/vscode/smoke.js target/debug/vfmt-server`: `smoke: OK`. +`node editors/vscode/smoke.js target/debug/lucisv-server`: `smoke: OK`. `npx @vscode/vsce ls` (in `editors/vscode/`): exit 0, manifest accepted. -`vfmt --version` → `vfmt 0.5.0`. Version sweep: root `Cargo.toml` +`lucisv --version` → `lucisv 0.5.0`. Version sweep: root `Cargo.toml` `version = "0.5.0"`, all eight crates inherit via `version.workspace = true` (confirmed by reading every `crates/*/Cargo.toml`), `editors/vscode/package.json` and `package-lock.json` (both places) at `0.5.0`, `tools/RELEASING.md`, @@ -326,7 +326,7 @@ plus my boundary probe above cover the char-vs-byte question from two angles; both green. **5. M10-narrowing consistency — independently re-verified outside the unit -tests**, by building two `vfmt-server` binaries and driving both over real +tests**, by building two `lucisv-server` binaries and driving both over real stdio with a hand-written Python LSP client (temporary, deleted after the run — not `cargo test`, so it exercises the wire format the same way `smoke.js` does but for hover): @@ -337,7 +337,7 @@ run — not `cargo test`, so it exercises the wire format the same way narrowed definition, not a guess. - **2 candidates, unnarrowed, byte-identical to pre-M14.** Fixture: both `a.svh` (`x + 1`) and `b.svh` (`x + 2`) included, so the lookup lists both - candidates. Built `vfmt-server` at HEAD (`36ddaba`, pre-M14, via + candidates. Built `lucisv-server` at HEAD (`36ddaba`, pre-M14, via `git stash push -u` / `git stash pop` around the build — working tree restored immediately after, confirmed via `git status --short` matching the pre-stash listing exactly) and at the current M14 tree, ran the identical @@ -352,7 +352,7 @@ run — not `cargo test`, so it exercises the wire format the same way **6. Independent e2e — PASS.** Same Python stdio client (not the dev's `e2e.rs`, a separate harness) against `` `define M(x) x + 1`` / `` `M(7)`` returned `expands to` → `7 + 1` over the real LSP wire. The dev's own -`crates/vfmt_server/tests/e2e.rs::a_macro_call_hover_carries_its_single_step_expansion_over_the_wire` +`crates/lucisv_server/tests/e2e.rs::a_macro_call_hover_carries_its_single_step_expansion_over_the_wire` was also run and pins a whole card byte for byte (`` `define MAX(a, b) ((a) > (b) ? (a) : (b))`` / `` `MAX(p, q + 1)`` → `((p) > (q + 1) ? (p) : (q + 1))``) — both independently green. @@ -378,8 +378,8 @@ work log: `expand.rs` 18 unit tests (counted directly, matches), `hover.rs` (`a_macro_call_hover_carries_its_single_step_expansion_over_the_wire`, confirmed present and green), 1583 total workspace (summed every `test result: ok` line myself rather than trusting the printed total). -`vfmt_server`'s own count (498 unit + 27 e2e + 3 grammar = 528, from -`docs/features/vfmt-server/README.md`'s work log) reproduced exactly with a +`lucisv_server`'s own count (498 unit + 27 e2e + 3 grammar = 528, from +`docs/features/lucisv-server/README.md`'s work log) reproduced exactly with a clean tree; it read 510 while my 12 temporary QA tests were still present (510 − 12 = 498), which is itself a small confirmation the base count is honest rather than coincidental. diff --git a/docs/features/macro-items/README.md b/docs/features/macro-items/README.md index 0bf7029..c3e3b6d 100644 --- a/docs/features/macro-items/README.md +++ b/docs/features/macro-items/README.md @@ -197,7 +197,7 @@ precisely to carry free text: The leading whitespace of `line two` is part of the string's **value**. Round 1 re-indented it like any other continuation line (QA measured 3 spaces -becoming 7) *and* masked the change in `verify.rs`, so `vfmt` exited 0 and +becoming 7) *and* masked the change in `verify.rs`, so `lucisv` exited 0 and wrote corrupted code — a real violation of hard invariant #1. The same hole existed for `` `define `` bodies with a `\`-continued string and for `(* attr = "..." *)`; both pre-date this feature and are fixed here too, since @@ -271,7 +271,7 @@ From QA round 1 (2026-08-19): Re-ran `./tools/corpus_check.sh corpus` against the same pinned 820-file corpus as the baseline in `docs/features/corpus-check/README.md`. The corpus was verified unmodified afterwards (`git status --porcelain` clean in all four -repos; only the untracked `.vfmt-corpus-rev` stamps show). +repos; only the untracked `.lucisv-corpus-rev` stamps show). | metric | baseline (35.2% era) | after macro-items | |---|---|---| @@ -404,7 +404,7 @@ argument — one file per dialect the corpus README named. gained, **0 lost**, and all 22 new verification errors traced back to the four root causes already catalogued in the corpus-check README (none touches a macro token). Confirmed all four corpus repos unmodified afterwards. -- Did not touch `tools/`, `corpus/`, `crates/vfmt/` or `TODO.md` (no matching +- Did not touch `tools/`, `corpus/`, `crates/lucisv/` or `TODO.md` (no matching checkbox exists). Did not run `git commit`/`git push`. **Results:** `cargo test --workspace` **95 passed, 0 failed** (up from 86: +4 @@ -420,7 +420,7 @@ Files touched: `crates/vlog_parser/src/{lexer,token,ast,parser}.rs`, - **Reproduced the blocking finding before touching anything**, end-to-end through the real debug binary rather than from the QA write-up: the string's - second line went from 3 leading spaces to 7, `vfmt` exited 0, and the file + second line went from 3 leading spaces to 7, `lucisv` exited 0, and the file was written. Confirmed QA's point that convergence does not help — the corrupted output is a stable fixed point, so re-formatting reproduces it. - **Widened the finding before fixing it.** QA reported it against macro @@ -463,7 +463,7 @@ Files touched: `crates/vlog_parser/src/{lexer,token,ast,parser}.rs`, verification-error, 0 crash; 179 gained, **0 lost** against the committed baseline. Honest delta from this fix: **zero**, because no corpus file carries a string across a line break inside a macro, directive or attribute. - The fix is about what vfmt would do to code it has not met yet, which is the + The fix is about what lucisv would do to code it has not met yet, which is the whole point of the net. All four corpus repos confirmed unmodified. **Results:** `cargo test --workspace` **98 passed, 0 failed** (up from 95: +3 @@ -491,7 +491,7 @@ time before moving on). **Tools — exact results.** - `cargo test --workspace`: **95 passed, 0 failed**, 0 ignored, across - vfmt (18 unit + 13 cli), vlog_formatter (3 unit + 1 cases + 4 deep_nesting + + lucisv (18 unit + 13 cli), vlog_formatter (3 unit + 1 cases + 4 deep_nesting + 2 fixtures + 22 verification), vlog_parser (32 unit). Matches the claimed 86→95 (+4 lexer, +3 parser, +2 verification). - `cargo clippy --all-targets`: silent, 0 warnings (`grep -c warning:` → 0). @@ -509,12 +509,12 @@ body, package body, generate region, generate `if`/`for`/`case`, `begin`/ without-`begin`, `for`-without-`begin`, `foreach`-without-`begin`, case-item body, `else` branch, sole content of a generate `if`/`else` block — all parse, format, and round-trip idempotent (formatted, then `--check`d -the result → exit 0) via `target/debug/vfmt -`. Did **not** find a statement +the result → exit 0) via `target/debug/lucisv -`. Did **not** find a statement position where a macro fails to parse; this claim holds without qualification for everywhere tested. **Claim 2 (disambiguation) — PASS, with one documented edge case.** -Adversarial cases through `target/release/vfmt -` (or debug, same logic): +Adversarial cases through `target/release/lucisv -` (or debug, same logic): | input | result | |---|---| @@ -569,7 +569,7 @@ equivalence check passes. Reproduced two ways: -1. **End-to-end through the real binary** (`target/debug/vfmt -`), no +1. **End-to-end through the real binary** (`target/debug/lucisv -`), no handcrafted internals: ``` module m; @@ -650,7 +650,7 @@ TSV (`corpus-check-results.tsv` is gitignored and only the post-feature copy was on disk), so per the task instructions I rebuilt one: `git worktree add` a detached checkout at `HEAD` (no stash, no modification to the working tree — verified `git status --porcelain` identical before/after), built -`target/release/vfmt` there, and ran `tools/corpus_check.sh` against the +`target/release/lucisv` there, and ran `tools/corpus_check.sh` against the *same* corpus with `-b` pointed at that baseline binary vs. the feature binary. Worktree removed after. @@ -669,7 +669,7 @@ would-reformat file silently became verification-error, etc.) — the +22 verification-errors are entirely accounted for by files that were parse-error at baseline and land in verification-error now, matching the dev's claim precisely. All four corpus repos confirmed `git status ---porcelain` clean except the untracked `.vfmt-corpus-rev` stamp, both +--porcelain` clean except the untracked `.lucisv-corpus-rev` stamp, both before and after. Ran the feature corpus check twice — byte-identical TSVs both times (deterministic). @@ -733,7 +733,7 @@ test files were dropped into `crates/vlog_formatter/tests/`, run, and removed, verified clean each time. **1. Original repro re-run — FIXED, confirmed both ways.** -- End-to-end through `target/debug/vfmt -` on the exact round-1 input: exit +- End-to-end through `target/debug/lucisv -` on the exact round-1 input: exit 0, and the string's second line is now byte-identical between input and output (`"line one\n line two with leading spaces"` — 3 leading spaces in, 3 leading spaces out; previously became 7). Idempotent (formatted the @@ -758,14 +758,14 @@ each through the real binary for idempotency: | `/* ... */` comment spanning lines with quotes inside, followed by a real string | corruption of the real string **rejected**; reindenting *inside* the block comment itself (no real string reachable from it) is still **accepted** | verbatim for the string; comment-only case reindents normally, idempotent | | a string containing `/*` (must not be read as opening a comment) | corruption inside that string **rejected** | verbatim, idempotent | | backtick-nested macro, inner string spans a line inside the outer token's raw text (`` `A("x", `B("y\nz")) ``) | corruption inside the inner string **rejected** | verbatim, idempotent | -| CRLF: `\r` immediately before an in-string `\n` | corruption (reindent) of the string **rejected**; the `\r` is not silently trimmed as ordinary whitespace | in practice the lexer strips `\r` from every token before it's ever recorded, so real `vfmt` input never carries `\r` this deep — confirmed by feeding it a raw `\r\n` file end-to-end: output is pure `\n`, idempotent. The `verify_equivalence`-level test still matters because that function accepts raw strings from any caller, not just the file-reading pipeline. | +| CRLF: `\r` immediately before an in-string `\n` | corruption (reindent) of the string **rejected**; the `\r` is not silently trimmed as ordinary whitespace | in practice the lexer strips `\r` from every token before it's ever recorded, so real `lucisv` input never carries `\r` this deep — confirmed by feeding it a raw `\r\n` file end-to-end: output is pure `\n`, idempotent. The `verify_equivalence`-level test still matters because that function accepts raw strings from any caller, not just the file-reading pipeline. | | CRLF, reindent outside any string | **accepted** | reindented normally, idempotent | Repro saved to the QA scratchpad as `qa_round2_state_machine_attack.rs` (10/10 passed, not committed). No masked-corruption pair survived. **3. Directive/Attribute fix — confirmed end-to-end.** Ran the dev's two -named repro shapes through `target/debug/vfmt -`: +named repro shapes through `target/debug/lucisv -`: - `` `define MSG "line one \ line two" `` inside an indented block: output's continuation line is byte-identical to input (` line two"`, 3 leading spaces, untouched) — previously this pre-existing @@ -808,7 +808,7 @@ containing a bare `"` still reindents normally end-to-end). files, exactly as the dev predicted (no corpus file carries a string across a line break inside a macro/directive/attribute). All four corpus repos confirmed `git status --porcelain` clean (only the untracked - `.vfmt-corpus-rev` stamp) before and after. + `.lucisv-corpus-rev` stamp) before and after. - `git status --porcelain`: identical to the dev's stated diff throughout — no stray files left behind. @@ -845,7 +845,7 @@ errors. The rejection was for the one thing that matters more than any feature: the verify.rs normalization added for multi-line macro tokens could mask real corruption — a string literal spanning lines inside a macro arg had -its bytes changed by re-indent, and vfmt exited 0. First genuine +its bytes changed by re-indent, and lucisv exited 0. First genuine invariant-#1 violation in the project. Credit where due on the rework: 1. **The dev widened the finding before fixing it** — the same defect diff --git a/docs/features/mop-up-2/README.md b/docs/features/mop-up-2/README.md index 8e28202..8ca2431 100644 --- a/docs/features/mop-up-2/README.md +++ b/docs/features/mop-up-2/README.md @@ -81,7 +81,7 @@ A fourth shape was investigated and deliberately **not** implemented: see defined in `corpus/ibex/dv/formal/check/top.sv:206` as a chain of `` `X(...) `` invocations, and the file-local `` `define X(c) ... && `` makes the expansion end in a dangling `&&`, so `` `X_EACH_CSR 1 `` is one expression - only *after* preprocessing. vfmt deliberately does not read `` `define `` + only *after* preprocessing. lucisv deliberately does not read `` `define `` bodies from other files, and the only rule that would accept the shape without them — "a macro in expression position may be followed by an operand" — would have to accept `` `A b `` everywhere, which is exactly the @@ -243,7 +243,7 @@ would fail to lex and the net would refuse it, which is what | file | category | reason | |---|---|---| -| `corpus/ibex/dv/formal/check/peek/compare_helper.sv` | macro-items | `` `X_EACH_CSR 1 `` — needs the macro body, which lives in another file vfmt does not read. See Assumptions. Not mine to fix and not fixable. | +| `corpus/ibex/dv/formal/check/peek/compare_helper.sv` | macro-items | `` `X_EACH_CSR 1 `` — needs the macro body, which lives in another file lucisv does not read. See Assumptions. Not mine to fix and not fixable. | | `corpus/picorv32/scripts/smtbmc/mulcmp.v` | other | Not in this cluster's scope (deliberately unsupported). | **Gates.** `cargo fmt --all` clean; `cargo clippy --all-targets` clean (no new @@ -312,7 +312,7 @@ correctly *forgiven* (so the fix isn't just "reject everything"). prefix-truncation and every single-character deletion (2231 trials): 0 crashes, 0 timeouts, every one either a clean exit 0/1 or a clean exit 2. Ran a second pass inserting a block comment and a line comment at every -whitespace/newline gap, wrapping each case in `// vfmt: off` / `// vfmt: on` +whitespace/newline gap, wrapping each case in `// lucisv: off` / `// lucisv: on` fences, and running `--lines -` for every line (807 trials): same, 0 crashes. diff --git a/docs/features/name-spans/README.md b/docs/features/name-spans/README.md index b784055..92f4c71 100644 --- a/docs/features/name-spans/README.md +++ b/docs/features/name-spans/README.md @@ -151,7 +151,7 @@ now serves both the opening and the closing label, which used to be parsed by two different snippets). **Promised to `vlog_semantic`** (and to the workspace index, and to -`vfmt_server` when it exists): +`lucisv_server` when it exists): - Every field in the table above is the exact byte range of the name as written: `src[name_span] == name`, with the one documented @@ -313,7 +313,7 @@ the same expected strings. Nothing else in any existing test moved. `cargo clipp warning. `cargo fmt --all --check` clean. `tools/corpus_check.sh corpus` (read-only): 820 files, **0 verification errors, 0 crashes**, TSV md5 `aa982463f68c1a3568c02a0fc5e0c455` — byte-identical to the baseline. Corpus -repos clean apart from the pre-existing untracked `.vfmt-corpus-rev` stamps. +repos clean apart from the pre-existing untracked `.lucisv-corpus-rev` stamps. `cargo test -p vlog_semantic --test corpus`: 21 485 symbols, 73 708 references, **0 names unplaced**, unchanged in every digit. @@ -337,7 +337,7 @@ commit/push. 19, `tests/spans.rs` **17**, up from 12 as claimed). - `cargo test -p vlog_formatter`, `-p vlog_semantic`, `--workspace`: all green. Per-crate counts summed to **299 passed, 0 failed**, matching the - work log exactly (50+30+8+1+4+6+2+39 vfmt/vlog_formatter, + work log exactly (50+30+8+1+4+6+2+39 lucisv/vlog_formatter, 53+24+19+17 vlog_parser, 6+1+19+20 vlog_semantic). - `cargo clippy --workspace --all-targets`: silent (forced a re-check with `touch` on `parser.rs` first, since a cached `Finished` line proves @@ -419,7 +419,7 @@ mutate/revert cycle is **byte-identical** (diffed the two `git diff` outputs directly). **Formatter byte-identity beyond the corpus TSV (claim 4).** Built a -baseline `vfmt` release binary from a `git worktree` at `HEAD` (`7cf657a`, +baseline `lucisv` release binary from a `git worktree` at `HEAD` (`7cf657a`, the dev's stated baseline — confirmed by the worktree's own "detached HEAD 7cf657a" message). Formatted 5 corpus files with `--stdout` (non-mutating) on both the baseline and the current worktree binary and md5'd the output: @@ -431,7 +431,7 @@ tree at `7cf657a`, matching `master`'s current position (branch is `[ahead 8]` of its upstream, unrelated to this feature). **Process note, not a feature defect — full disclosure.** My first pass at -the byte-identity check invoked `vfmt ` (no `--stdout`/`--check`), +the byte-identity check invoked `lucisv ` (no `--stdout`/`--check`), which writes in place; this reformatted `corpus/common_cells/src/ binary_to_gray.sv` once. Caught it because the corpus repos under `corpus/` are themselves real git checkouts (from `tools/corpus_fetch.sh`, gitignored @@ -439,7 +439,7 @@ at the top level but each subdir has its own `.git`): `git status` inside `corpus/common_cells` showed the one modified file, `git checkout -- src/binary_to_gray.sv` restored it exactly, and a follow-up `git status` in all four corpus repos (`common_cells`, `ibex`, `picorv32`, `opentitan`) came -back clean (only the pre-existing untracked `.vfmt-corpus-rev` stamps). The +back clean (only the pre-existing untracked `.lucisv-corpus-rev` stamps). The corpus-md5 gate above and the semantic-corpus numbers were both captured *after* this restoration, so neither is affected. Re-ran the 5-file comparison with `--stdout` afterward, which is what the numbers above diff --git a/docs/features/one-parse/README.md b/docs/features/one-parse/README.md index 22342db..e016588 100644 --- a/docs/features/one-parse/README.md +++ b/docs/features/one-parse/README.md @@ -5,8 +5,8 @@ TODO §4's "one parse, two tools", delivered on the linter side: parse a file once and lint from those products, instead of every consumer re-lexing and re-parsing text somebody already parsed. `LintContext` gains a constructor -that accepts pre-built parse products; `vfmt check` builds the products once -per file; and `vfmt_server` — which already holds a fully analyzed `Document` +that accepts pre-built parse products; `lucisv check` builds the products once +per file; and `lucisv_server` — which already holds a fully analyzed `Document` per buffer — lints from that document's own tokens and tree rather than paying two extra lexes and an extra tolerant parse per keystroke. Behavior is the hard gate: every finding, position, fix, diagnostic and exit code is @@ -36,7 +36,7 @@ byte-identical to before; only duplicated work is removed. them, keeps them where they always were: on `Document`. - **The `--fix` loop's per-round re-parse is inherent.** Each round rewrites the text, and products of the old text describe nothing. Only the *first* - round of `vfmt check --fix` (and all of a plain `vfmt check`) saves work. + round of `lucisv check --fix` (and all of a plain `lucisv check`) saves work. - **Per-change recompute stays the server's model.** This round removes duplicate work *within* one change/request; it adds no caching or invalidation machinery beyond what `Document` already is (TODO §6: @@ -62,7 +62,7 @@ unchanged in behavior): construction. - `pub struct ParsedSource` + `ParsedSource::parse(source) -> ParsedSource` + `ParsedSource::context(&self, path) -> LintContext<'_>` — the owned bundle - of products for callers with no `Document` of their own (`vfmt check`, and + of products for callers with no `Document` of their own (`lucisv check`, and `run`/`LintContext::new` internally). `parse` lexes **once** and builds the tree from a clone of the token stream. - `LintContext::new(source, path)` **stays**, as the convenience wrapper the @@ -77,7 +77,7 @@ unchanged in behavior): **Consumed** - `vlog_parser::parse_tolerant(tokens, source)` — newly consumed by - `vlog_linter` and `vfmt_server` (both already depended on the crate; it was + `vlog_linter` and `lucisv_server` (both already depended on the crate; it was already `pub`). Relied on: with the same tokens it returns exactly the tree `parse_source_tolerant(source)` would (that function *is* `tokenize` + `parse_tolerant`), and on a well-formed file the tree equals `parse`'s. @@ -86,12 +86,12 @@ unchanged in behavior): **Changed call sites** -- `crates/vfmt/src/lint.rs::run_rules` — parses once via `ParsedSource` and +- `crates/lucisv/src/lint.rs::run_rules` — parses once via `ParsedSource` and hands the products to the context. -- `crates/vfmt_server/src/state.rs::Document` — gains the `tree: SourceFile` +- `crates/lucisv_server/src/state.rs::Document` — gains the `tree: SourceFile` field (it was parsed and thrown away after `analyze`), and `Document::new` lexes once instead of twice. -- `crates/vfmt_server/src/lint.rs::{violations, fixable}` — the one call site +- `crates/lucisv_server/src/lint.rs::{violations, fixable}` — the one call site server-lint's README predicted: both lint from the document's own products via `from_parse` instead of re-parsing `doc.text`. @@ -108,7 +108,7 @@ products for, per request, as of the start of this round: | `Document::new` (every buffer change) | the text lexed twice: `tokenize` for `doc.tokens`, then `parse_source_tolerant`'s internal `tokenize` | **Eliminated** — one lex, tree built by `parse_tolerant` over a clone of the tokens; the lex-error fallback still goes through `parse_source_tolerant` so the error tree and diagnostic are byte-identical | | `format::formatting` / `range_formatting` | `format_source`/`format_range` lex+parse strictly inside `vlog_formatter` | **Kept** — the formatter's parse is the *strict* one (a tree `Document` does not hold), and the runtime safety net (equivalence + convergence) is defined over `format_source` doing its own work; sharing would need `vlog_formatter` API changes, which is the concurrent round's crate and a different feature | | `Workspace::rebuild_index` (initialize + every didSave) | re-reads and re-parses every workspace file inside `WorkspaceIndex::build`, open unchanged buffers included | **Kept** — the documented full-scan index model (TODO §6 defers incrementality to salsa); making it incremental is invalidation machinery this round explicitly must not build | -| `semanticTokens`, `hover`, `definition`, `references`, `documentSymbol`, `workspace/symbol`, `diagnostics::diagnostics` | none — all already read `doc.tokens` / `doc.semantics` / `doc.defines` / `doc.diagnostics` | already clean (verified by grep for `tokenize`/`parse` over `crates/vfmt_server/src`) | +| `semanticTokens`, `hover`, `definition`, `references`, `documentSymbol`, `workspace/symbol`, `diagnostics::diagnostics` | none — all already read `doc.tokens` / `doc.semantics` / `doc.defines` / `doc.diagnostics` | already clean (verified by grep for `tokenize`/`parse` over `crates/lucisv_server/src`) | ## The protected_regions decision: left alone @@ -121,7 +121,7 @@ construction"? Almost — the server would pass `doc.tree` and the CLI its current round's tree — but "almost" is the problem: the CLI's `--fix` loop rebuilds text every round, and a future caller passing last round's tree is precisely the bug the `&str` signature makes unwritable. The cost lands only -on fix-application paths (`vfmt check --fix`, `textDocument/codeAction`), +on fix-application paths (`lucisv check --fix`, `textDocument/codeAction`), never on the per-keystroke diagnostics path. Two further reasons to leave it: it is `vlog_formatter`'s code, which belongs to the concurrent dynamic-types round this session; and the interior parse is of the *current* @@ -134,22 +134,22 @@ answer.** - [x] `vlog_linter`: `LintContext<'a>`, `from_parse`, `ParsedSource`, `new` kept as the wrapper; single-lex parse recipe in one place. - [x] Rules, visitors, waivers untouched (they compile and read unchanged). -- [x] `crates/vfmt/src/lint.rs`: `run_rules` parses once via `ParsedSource`. -- [x] `crates/vfmt_server`: `Document.tree` kept; `Document::new` single-lex; +- [x] `crates/lucisv/src/lint.rs`: `run_rules` parses once via `ParsedSource`. +- [x] `crates/lucisv_server`: `Document.tree` kept; `Document::new` single-lex; `lint::violations`/`fixable` lint from the document's products. - [x] Server catalog above; semanticTokens/hover verified already clean. - [x] protected_regions decision written (left alone). - [x] Tests: products-in == source-in property over rule-test inputs; lex-error and broken-file paths; existing CLI + server suites green **unmodified**. -- [x] Byte-identity: corpus `vfmt check` (text + JSON) vs a HEAD worktree +- [x] Byte-identity: corpus `lucisv check` (text + JSON) vs a HEAD worktree binary; server diagnostics vs a HEAD worktree binary over a real stdio session. - [x] Timing before/after. - [x] TODO §4 checkbox + linter-core / server-lint annotation lines. -- [ ] **Not done, deliberately:** `vfmt format` sharing the parse. The +- [ ] **Not done, deliberately:** `lucisv format` sharing the parse. The formatter requires a *strict* parse and runs its safety net over its own - products; wiring `vfmt check --fix --format` workflows is a future + products; wiring `lucisv check --fix --format` workflows is a future feature and is not blocked by anything here. - [ ] **Not done, deliberately:** any caching/invalidation in the server beyond `Document`'s per-change recompute. @@ -161,7 +161,7 @@ answer.** - Read `CLAUDE.md`, TODO §4, and the linter-core / server-lint / shared-fence-filter READMEs in full (QA logs and Reviews included) before writing anything, then the code: `vlog_linter`'s `context.rs`/`lib.rs`, - `crates/vfmt/src/lint.rs`, and every file in `crates/vfmt_server/src`. + `crates/lucisv/src/lint.rs`, and every file in `crates/lucisv_server/src`. - **The design was forced by one fact: `SourceFile` is not `Clone`.** The server's `Document` owns one tree that must serve semantics, published diagnostics *and* linting, so the products constructor has to borrow — @@ -196,7 +196,7 @@ answer.** `lint::violations` and `lint::fixable` now share a four-line `context(doc)` helper over `from_parse`. `vlog_linter::run` is no longer imported there. The catalog above was compiled by grepping `tokenize|parse` over - `crates/vfmt_server/src` and reading each hit. + `crates/lucisv_server/src` and reading each hit. - **Tests.** The products-in == source-in property was put where it covers the most ground: inside the rule-test harness's `assert_lint_with`, so all 55 inline-marker cases (every rule × fires/quiet/waived/unused-waiver, @@ -205,9 +205,9 @@ answer.** Two new unit tests in `context.rs`: borrowed-vs-owned accessor equality, and the lex-error fallback producing the exact old error tree. Existing CLI and server suites pass **unmodified** (`git diff` on - `crates/vfmt/tests`, `crates/vfmt_server` tests: empty). + `crates/lucisv/tests`, `crates/lucisv_server` tests: empty). - Did not touch `vlog_parser`, `vlog_formatter`, `vlog_semantic`, - `vfmt_core`, `editors/**`, or any `Cargo.toml`/`Cargo.lock` (no dependency + `lucisv_core`, `editors/**`, or any `Cargo.toml`/`Cargo.lock` (no dependency moved; `parse_tolerant` was already `pub`). Did not run `git commit`/`git push`. - **Concurrency note.** A dynamic-types round was announced live in @@ -220,18 +220,18 @@ answer.** **Results.** - `cargo test -p vlog_linter`: 118 unit + 55 integration + 1 doctest, green - (118 was 116: the two new `context.rs` tests). `cargo test -p vfmt`: + (118 was 116: the two new `context.rs` tests). `cargo test -p lucisv`: green including all 69 CLI integration tests, unmodified. - `cargo test -p vfmt_server`: 115 unit + 6 e2e, green, unmodified. + `cargo test -p lucisv_server`: 115 unit + 6 e2e, green, unmodified. `cargo test --workspace`: **770 passed, 0 failed**. - `cargo clippy --workspace --all-targets`: silent. `cargo fmt -p - vlog_linter -p vfmt -p vfmt_server -- --check`: clean (scoped, per the + vlog_linter -p lucisv -p lucisv_server -- --check`: clean (scoped, per the concurrency rule). No `#[allow]`, no `unwrap`/`expect`/`panic!`/`unsafe` outside `#[cfg(test)]` in anything touched. - **Byte-identity, CLI** (HEAD worktree binary at `e9008b6` vs this tree, both release): - - `vfmt check corpus/`: stdout, stderr and exit code (1) identical. - - `vfmt check corpus/ --output-format json`: **2 418 071 bytes of JSON, + - `lucisv check corpus/`: stdout, stderr and exit code (1) identical. + - `lucisv check corpus/ --output-format json`: **2 418 071 bytes of JSON, byte-identical**, stderr identical, exit identical. - `check --fix` over ten crafted shapes in twin directories (tabs + trailing whitespace, fence, fence-in-broken-file, waiver, lex failure, @@ -246,7 +246,7 @@ answer.** byte-identical** between the two binaries, canonicalized only by stripping the differing scratch-dir prefix from the URI. - **Timing, CLI** (release, median of 7, 860-file corpus): - `vfmt check corpus/` **265.5 → 207.9 ms** at `--threads 1` (−22 %), + `lucisv check corpus/` **265.5 → 207.9 ms** at `--threads 1` (−22 %), **79.7 → 70.5 ms** at the default thread count (−12 %). The single-thread number is the honest one (the pool hides latency); the saving matches the arithmetic — the lint pipeline did 2 lexes + 1 parse per file and now does @@ -296,7 +296,7 @@ identity run below was done in an **isolated copy**: `scratchpad/qa-new` = a byte copy of the dev's HEAD worktree (`scratchpad/head-wt`, verified clean at `e9008b6`) with **exactly this round's six code files** overlaid. `diff -rq head-wt qa-new` reports those six files and nothing else. The -baseline binaries are `head-wt/target/release/{vfmt,vfmt-server}`; the "new" +baseline binaries are `head-wt/target/release/{lucisv,lucisv-server}`; the "new" ones were rebuilt from `qa-new`. `corpus/` was never written to — the `--fix` runs used copies. @@ -327,7 +327,7 @@ runs used copies. `unterminated block comment` + `no-tabs`, identical on both binaries). 3. *Server catalog complete* — **PASS.** `grep -rn 'tokenize|parse_source_tolerant|parse_tolerant|format_source|format_range| - rebuild_index' crates/vfmt_server/src` returns exactly the sites the + rebuild_index' crates/lucisv_server/src` returns exactly the sites the catalog names: `state.rs:56-61` (`Document::new`, one lex), `format.rs:57,87` (kept, strict parse), `state.rs:123/137` + `server.rs:251` (`rebuild_index`, kept), `lint.rs:54` @@ -339,7 +339,7 @@ runs used copies. `git diff --name-only -- crates/vlog_formatter/src/fence.rs` is empty; the file is untouched by this round (and by the concurrent one). 5. *Behavior identity* — **PASS, re-run from scratch, not taken on trust.** - - `vfmt check corpus/` (820 files): stdout **692 198 bytes identical**, + - `lucisv check corpus/` (820 files): stdout **692 198 bytes identical**, stderr identical, exit 1 both. - `--output-format json`: **2 418 071 bytes identical** (matches the dev's figure exactly), stderr identical, exit 1 both. @@ -351,8 +351,8 @@ runs used copies. case-missing-default,module-filename` over the whole corpus. **12/12 identical.** - `check --fix` over 13 crafted shapes (multi-round tab+trailing, a real - `// verilog_format: off/on` fence, the `// vfmt: off/on` alias, an - unclosed fence, `// vfmt: waive`, unused + malformed + unknown-rule + `// verilog_format: off/on` fence, the `// lucisv: off/on` alias, an + unclosed fence, `// lucisv: waive`, unused + malformed + unknown-rule waivers, a lex-error file, a filename mismatch, CRLF, multi-byte + emoji + tab, an empty file, a class body, a parse-error file): every rewritten file byte-identical, stdout (path-normalized) and stderr @@ -383,14 +383,14 @@ runs used copies. **8.2 → 3.7 ms** (informational; dev reported 18.0 → 11.0 and 7.6 → 3.4). 7. *Gates* — **PASS.** In the isolated tree: `cargo test --workspace` **770 passed, 0 failed** (27 result lines; vlog_linter 118 unit + 55 - integration + 1 doctest, vfmt 30 unit + 69 CLI, vfmt_server 115 unit + 6 + integration + 1 doctest, lucisv 30 unit + 69 CLI, lucisv_server 115 unit + 6 e2e — every count the work log claims). `cargo clippy --workspace --all-targets` exit 0, **zero warnings**. `cargo fmt --all -- --check` clean (not just the scoped set). In the *merged* tree the scoped crates are - also green (`cargo test -p vlog_linter -p vfmt -p vfmt_server`: 30/69/115/ + also green (`cargo test -p vlog_linter -p lucisv -p lucisv_server`: 30/69/115/ 6/118/55/1) with scoped clippy and fmt clean. Test churn is zero: `git diff --numstat crates/vlog_linter/tests/rules.rs` is **12 added, 0 - removed**, and no other test file in `vfmt`/`vfmt_server`/`vlog_linter` is + removed**, and no other test file in `lucisv`/`lucisv_server`/`vlog_linter` is touched. No `unwrap`/`expect`/`panic!`/`unsafe`/`#[allow]` outside `#[cfg(test)]` in any of the six files. @@ -445,11 +445,11 @@ runs used copies. - **QA-1 (MEDIUM — missing coverage, not a defect in shipped behavior).** The stale-tree bug that this round newly makes possible is caught by **no test in the workspace**. With the sabotage above in place, `cargo test -p - vfmt_server` passes **115 unit + 6 e2e, 0 failed**, and `cargo test + lucisv_server` passes **115 unit + 6 e2e, 0 failed**, and `cargo test --workspace` passes **773, 0 failed** (770 + 3 scratch probes). Only a live stdio session caught it. `Document.tree` is now a cached derivation of `Document.text`, and nothing asserts they agree. The cheapest guard is one - `#[cfg(test)]` case in `crates/vfmt_server/src/lint.rs` or `state.rs`: + `#[cfg(test)]` case in `crates/lucisv_server/src/lint.rs` or `state.rs`: `set_document` a buffer whose module name mismatches the filename, then `set_document` the renamed text, and assert `violations` no longer contains `module-filename` — an AST-rule finding, which is exactly the class that diff --git a/docs/features/parallel-files/README.md b/docs/features/parallel-files/README.md index 82e316f..e18b15b 100644 --- a/docs/features/parallel-files/README.md +++ b/docs/features/parallel-files/README.md @@ -2,11 +2,11 @@ ## Goal -Make `vfmt` format a whole RTL tree on all cores instead of one, and stop +Make `lucisv` format a whole RTL tree on all cores instead of one, and stop walking into directories the repository already declares generated. Two `TODO.md` §3 items in one change, because they touch the same loop: formatting is a pure function of `(source, config)`, so the per-file loop in -`crates/vfmt/src/main.rs` parallelises with `rayon::par_iter` once panic +`crates/lucisv/src/main.rs` parallelises with `rayon::par_iter` once panic containment and output ordering are reworked for concurrency; and `.gitignore` support is the other half of the file-discovery item whose `--exclude` half already shipped with cli-polish. The user-visible contract @@ -27,7 +27,7 @@ same invocation, regardless of thread count. therefore produce byte-identical stdout and stderr. - **Output is buffered until the run ends.** The price of ordered reporting is that `--diff` / `--stdout` text is held in memory until every file is done, - rather than streaming. For the sizes vfmt targets (a large RTL tree is tens + rather than streaming. For the sizes lucisv targets (a large RTL tree is tens of MiB of source) this is acceptable; it is the reason `--stdout` over a huge tree is no longer incremental. - **8 MiB of worker stack is enough.** Taken from @@ -86,7 +86,7 @@ literally or as plain `*`, they are not errors): space). - The global ignore file (`core.excludesFile`), `.git/info/exclude`, and `$GIT_DIR/info/exclude`. -- Git's "already-tracked files are not ignored" rule: vfmt has no index, so +- Git's "already-tracked files are not ignored" rule: lucisv has no index, so a tracked file matching an ignore rule *is* skipped. - Re-including a path inside an ignored directory. An ignored directory is never descended into, so a `!` rule underneath it cannot bring anything @@ -142,13 +142,13 @@ A path named directly on the command line is never ignored, exactly as with CLAUDE.md requires a written justification for every dependency; `TODO.md` §3 pre-sanctions this one by name. It is the workspace's first third-party -dependency, and `vfmt`'s only one. +dependency, and `lucisv`'s only one. **Why not hand-rolled threads.** The obvious alternative is *N* `std::thread`s each draining a shared `Mutex`, about 30 lines. Three things make that the worse choice here: -1. **Work stealing.** vfmt's per-file cost varies by two orders of magnitude +1. **Work stealing.** lucisv's per-file cost varies by two orders of magnitude (a 20-line header vs. a 10 000-line generated netlist). A static chunking leaves cores idle behind one slow file; a shared-queue design fixes that but then contends on the mutex for short files. rayon's per-worker deques @@ -156,7 +156,7 @@ make that the worse choice here: 2. **Panic propagation.** A panic on a hand-rolled worker either poisons the shared mutex or is silently swallowed by a detached `JoinHandle`. rayon propagates a worker panic to the thread that called `par_iter` — which - matters because vfmt's own containment (`catch_panic`) is the *inner* + matters because lucisv's own containment (`catch_panic`) is the *inner* layer, and anything that escapes it must still surface as a crash rather than as a quietly missing file. 3. **Maintenance.** Thread count, stack size, worker naming, and clean @@ -166,10 +166,10 @@ make that the worse choice here: **Cost.** Five transitive crates (`rayon-core`, `crossbeam-deque`, `crossbeam-epoch`, `crossbeam-utils`, `either`), all from the same -well-maintained ecosystem, no build scripts, no `unsafe` in vfmt itself, and +well-maintained ecosystem, no build scripts, no `unsafe` in lucisv itself, and ~9 s of cold release compile time. The version is pinned with `=` rather than a caret: a work-stealing scheduler is exactly the kind of dependency whose -minor releases can change thread behavior, and vfmt's determinism claim is +minor releases can change thread behavior, and lucisv's determinism claim is worth an explicit bump. ## Work log @@ -178,7 +178,7 @@ worth an explicit bump. - Read CLAUDE.md, `TODO.md` §3, `docs/features/cli-polish/README.md` (the panic-hook handshake), `docs/features/recursion-limit/README.md` - (Handshakes: the 8 MiB request) and all of `crates/vfmt/src` before + (Handshakes: the 8 MiB request) and all of `crates/lucisv/src` before writing anything. - **Blocked on the workspace for most of the run.** Another agent was mid-flight creating `crates/vlog_semantic`; its `Cargo.toml` was in the @@ -225,7 +225,7 @@ parallel iterator, so the collect restores input order; `run_files` then walks that vector serially, printing and counting. Diff hunks and error lines therefore cannot interleave, and the summary counters are derived from the ordered vector rather than from shared counters. Verified at -corpus scale: `vfmt --diff` over the 860-file corpus produces 2 424 208 +corpus scale: `lucisv --diff` over the 860-file corpus produces 2 424 208 bytes of stdout and 66 019 bytes of stderr that are **byte-identical** across `--threads 1`, `2`, `8`, the default, and a repeat run. @@ -271,7 +271,7 @@ one" and "the last line in a file wins" from one loop. expectations: a scratchpad `git init` tree with a root `.gitignore` (`build/`, `*_gen.sv`, `/anchored.sv`, `gen/rtl`, `sub/*.sv`, a comment) and a nested `sub/.gitignore` (`!keep_gen.sv`, `drop.sv`) over 13 `.sv` files. -`git check-ignore` and vfmt agree on **every** file. +`git check-ignore` and lucisv agree on **every** file. On the real corpus (28 `.gitignore` files across ibex, OpenTitan, PULP common_cells and picorv32) the honoured rules change nothing: the same 860 @@ -325,7 +325,7 @@ accurately; nothing fabricated. Did not touch `crates/vlog_semantic` `a_deeply_nested_file_formats_on_a_worker_thread` — it fails with the child process losing its exit code entirely (`panicked at cli.rs:81:23: exit code`), i.e. a hard crash, not a graceful error; - restored the file and confirmed `git diff crates/vfmt/src/main.rs` + restored the file and confirmed `git diff crates/lucisv/src/main.rs` byte-identical to before the experiment (`diff` of the two captured diffs was empty). **Pass.** 2. **Hook.** Single `Once`-guarded `install_panic_hook` (`main.rs:266`); @@ -342,7 +342,7 @@ accurately; nothing fabricated. Did not touch `crates/vlog_semantic` scratchpad build: it still prints the full `thread 'main' panicked at … note: run with RUST_BACKTRACE=1`, exit 101 — the default hook is intact for real bugs. **Pass.** -3. **Determinism.** Ran `vfmt --diff` over the full 860-file corpus (not +3. **Determinism.** Ran `lucisv --diff` over the full 860-file corpus (not just ~100) at `--threads` 1/2/8/default, 3 repeats each (12 runs) plus 2 more default-thread repeats (5 total for that setting): stdout hashes to one value across all 12, stderr to one value across all 12 — @@ -357,15 +357,15 @@ accurately; nothing fabricated. Did not touch `crates/vlog_semantic` (`scratchpad/gitprobe/`) covering all four requested tricky cases plus extras: a `!secret.sv` inside `build/` (ignored by the parent `build/` rule — git prunes the directory before reading its `.gitignore`, and so - does vfmt); `/x.sv` anchored inside a *nested* `anchor_test/.gitignore` + does lucisv); `/x.sv` anchored inside a *nested* `anchor_test/.gitignore` (correctly scoped to that directory only, not its `sub2/`); `!keepdir/` negating a directory while `*.sv` still catches the file inside it - (git: ignored; vfmt: ignored — negating the directory doesn't negate the + (git: ignored; lucisv: ignored — negating the directory doesn't negate the per-file pattern); and the `build/` vs. bare `build` directory-only distinction (already covered by the existing unit test `a_trailing_slash_matches_directories_only`, confirmed still green). Ran `git check-ignore -q` against every `.sv` file in the tree, compared - to which files vfmt actually visited (16 files, 6 not ignored) — + to which files lucisv actually visited (16 files, 6 not ignored) — **exact agreement, 0 discrepancies.** Corpus visited-set check: `--diff` with and without `--no-gitignore` over the real 860-file corpus (28 `.gitignore` files) produced byte-identical stdout and stderr, matching @@ -377,15 +377,15 @@ accurately; nothing fabricated. Did not touch `crates/vlog_semantic` (extensions: v, sv, vh, svh)`, exit 2 — sane, and `--no-gitignore` recovers the files as expected. `.gitignore` + `--exclude` together: both apply simultaneously (verified with one pattern from each). **Pass.** -5. **Deps.** `cargo tree -p vfmt` shows exactly `rayon` → `either`, +5. **Deps.** `cargo tree -p lucisv` shows exactly `rayon` → `either`, `rayon-core` → `crossbeam-deque` → `crossbeam-epoch`/`crossbeam-utils` (5 transitive crates as documented); `cargo metadata` confirms none of the six packages (rayon included) declare a build script. `rayon` is pinned `=1.12.0` in both `Cargo.toml` and `Cargo.lock`. Justification section present and specific. **Pass.** -6. **Tools.** `cargo test -p vfmt`: 50 unit + 30 CLI, all green (0.01s + - 0.14–0.21s). `cargo clippy -p vfmt --all-targets` and - `cargo fmt -p vfmt -- --check`: both silent/clean. Workspace-wide (now +6. **Tools.** `cargo test -p lucisv`: 50 unit + 30 CLI, all green (0.01s + + 0.14–0.21s). `cargo clippy -p lucisv --all-targets` and + `cargo fmt -p lucisv -- --check`: both silent/clean. Workspace-wide (now that `vlog_semantic` compiles): `cargo build --workspace`, `cargo clippy --workspace --all-targets` clean, `cargo test --workspace` green across all crates. Note: workspace-wide `cargo fmt --check` is @@ -427,7 +427,7 @@ accurately; nothing fabricated. Did not touch `crates/vlog_semantic` (error outranks would-reformat), no interleaving. **One methodology note, not a product finding:** immediately after the -`WORKER_STACK` sabotage-and-restore in item 1, `cargo build -p vfmt` +`WORKER_STACK` sabotage-and-restore in item 1, `cargo build -p lucisv` reported "Finished in 0.01s" and silently kept serving the *stale* 2 MiB binary — restoring the file with `mv` from a `sed -i.bak` backup left its mtime older than the already-rebuilt (sabotaged) target, so Cargo's @@ -435,18 +435,18 @@ mtime fast-path skipped recompilation despite the content being back to the original 8 MiB source. This briefly made `cargo test --workspace` report `a_deeply_nested_file_formats_on_a_worker_thread` and `deeply_nested_file_does_not_kill_the_batch` as crashing. `touch`ing -`crates/vfmt/src/main.rs` and rebuilding made both pass again immediately, +`crates/lucisv/src/main.rs` and rebuilding made both pass again immediately, and `git diff` on the file was unaffected throughout (content never changed). Recorded here in case anyone else sees the same thing after a `sed -i.bak` / `mv` round-trip on this codebase — it is a Cargo caching -quirk local to that workflow, not a vfmt bug. +quirk local to that workflow, not a lucisv bug. **Severity summary:** no BLOCKING findings (zero nondeterminism observed across ~40 varied repeated runs), no should-fix gitignore/git disagreements (0 of many probe files disagreed). CLAUDE.md compliance: no `unwrap`/`expect`/`panic!` in library code paths in `main.rs`/`args.rs`/ `walk.rs` outside `#[cfg(test)]` (grepped directly); all `pub` items carry -a one-line doc comment; feature stayed inside `crates/vfmt` + +a one-line doc comment; feature stayed inside `crates/lucisv` + `docs/features/parallel-files` as scoped, confirmed via `git status`/`git diff --stat` against `HEAD`. README.md and TODO.md claims read as accurate against what I independently measured. diff --git a/docs/features/range-formatting/README.md b/docs/features/range-formatting/README.md index a3f8929..cb0a6f3 100644 --- a/docs/features/range-formatting/README.md +++ b/docs/features/range-formatting/README.md @@ -3,11 +3,11 @@ ## Goal Format only the lines the caller names and emit every other byte exactly as it -was written — `vfmt --lines M-N[,M-N...]`, and `textDocument/rangeFormatting` +was written — `lucisv --lines M-N[,M-N...]`, and `textDocument/rangeFormatting` on the same engine. This is the adoption story for a legacy tree: a formatter that can only rewrite a whole 2000-line file is one that never gets turned on, because the first patch it touches becomes unreviewable. Verible ships -`git-verible-verilog-format.sh` on top of exactly this, and `tools/vfmt-changed.sh` +`git-verible-verilog-format.sh` on top of exactly this, and `tools/lucisv-changed.sh` is our version. A range is morally an **inverted fence**: the same `Doc::Verbatim` splice `docs/features/format-fences/README.md` built, over byte ranges the *caller* chose instead of ranges a comment marked. @@ -118,7 +118,7 @@ file is read. ### `// verilog_format: off` outranks `--lines` A fenced item is never laid out, whatever the caller selected. `off` means -hands off across all of vfmt (the position `docs/features/shared-fence-filter/README.md` +hands off across all of lucisv (the position `docs/features/shared-fence-filter/README.md` already took for `--fix` and the server's quick fixes), and a range is a weaker signal than a comment somebody wrote into the source. Mechanically the planner asks `fence::region_at` before it asks about lines, and the two @@ -210,7 +210,7 @@ differently on the replay and the check would fail for a bookkeeping reason. **Promised, and checked at runtime:** replaying the same selection is a fixed point. That is what "the output is stable" means for a partial run. -**True in practice, and tested:** running `vfmt --lines M-N` twice on the same +**True in practice, and tested:** running `lucisv --lines M-N` twice on the same lines changes nothing the second time — *when the first run did not move the selected lines*. Every hand-written case in `tests/ranges.rs` is of that kind, which is the normal editing experience. @@ -234,7 +234,7 @@ further on a second run with the same line numbers, and **every one of them settled on that second run** (checked to 12 iterations; none needed a third). **Also not promised, and this is the feature:** a partial run is not a fixed -point of the *whole-file* formatter. `vfmt` with no `--lines` afterwards will +point of the *whole-file* formatter. `lucisv` with no `--lines` afterwards will reformat more. That is the point of having formatted less. *(Lead note, per lexer-cleanup QA: one more unstated exception to @@ -251,12 +251,12 @@ the promise's edges are all in one place.)* line ranges; comma-separated and repeatable ``` -- **Format only.** `vfmt check --lines` is an error: the linter has no notion +- **Format only.** `lucisv check --lines` is an error: the linter has no notion of a line range (waivers are its equivalent). - **Explicit files, never a directory.** "Line 12 of everything under `rtl/`" is not a thing anyone meant, so a directory input is an error. Several file arguments are accepted and get the same ranges each — defined, but a wrapper - should invoke once per file, which `tools/vfmt-changed.sh` does. + should invoke once per file, which `tools/lucisv-changed.sh` does. - **Combines with** `--check`, `--diff`, `--stdout`, and stdin (`-`, with `--stdin-filename`). `--check` exits 1 only if the *partial* format would change something, which is what makes "CI checks the lines this PR touched" @@ -267,14 +267,14 @@ the promise's edges are all in one place.)* under the "already formatted" verdict, which is the one thing `docs/features/format-cache/README.md` promises the cache only ever stores. -### `tools/vfmt-changed.sh` +### `tools/lucisv-changed.sh` The `git diff` half of TODO.md §2's follow-up. It reads `git diff -U0` hunk headers, turns each `@@ -old +first,count @@` into `first-(first+count-1)`, -and calls `vfmt --lines` once per changed `.sv`/`.svh`/`.v`/`.vh` file. A hunk +and calls `lucisv --lines` once per changed `.sv`/`.svh`/`.v`/`.vh` file. A hunk with `count == 0` deleted only and contributes nothing. `--check`/`--diff` and -a base revision pass through, so `tools/vfmt-changed.sh --check origin/main` -is the CI form. A `vfmt --diff-base ` flag *inside* the binary is still +a base revision pass through, so `tools/lucisv-changed.sh --check origin/main` +is the CI form. A `lucisv --diff-base ` flag *inside* the binary is still open; the script answers the need without teaching the CLI about git. ## LSP @@ -346,7 +346,7 @@ to `fence.rs`: two `fn` → `pub(crate) fn`, no behavior.** one definition of the answer — but only `format_range` and `LineRanges` are meant for outside callers. -**Promised to `crates/vfmt` and `crates/vfmt_server`:** both call +**Promised to `crates/lucisv` and `crates/lucisv_server`:** both call `format_range` and nothing else new. `Options::lines` and `Options::cache_enabled` are the CLI's own. @@ -381,19 +381,19 @@ is a leaf, as it was for fences. the spec grammar, the line-shift counterexample, and a corpus spot check. - [x] CLI `--lines`: comma and repeated forms, `--check`/`--diff`/`--stdout`/ - stdin, directory refusal, cache bypass, `vfmt check` rejection — 6 CLI + stdin, directory refusal, cache bypass, `lucisv check` rejection — 6 CLI tests + 2 arg unit tests. - [x] LSP `documentRangeFormattingProvider` + `format::range_formatting` — 6 handler tests and one e2e leg over the wire with UTF-16 content. -- [x] `tools/vfmt-changed.sh`. +- [x] `tools/lucisv-changed.sh`. - [x] README.md usage block + a Range formatting section; TODO.md §2 - checkbox; the one-line `vfmt-server` README annotation. + checkbox; the one-line `lucisv-server` README annotation. - [ ] **Not done, deliberately:** statement-level ranges (an intersected `always` block lays out whole). - [ ] **Not done, deliberately:** descending into `generate` regions, classes, functions and tasks. One `scope_of` arm plus a head/tail doc each, whenever a real file makes it hurt. -- [ ] **Not done:** a `vfmt --diff-base ` flag. `tools/vfmt-changed.sh` +- [ ] **Not done:** a `lucisv --diff-base ` flag. `tools/lucisv-changed.sh` covers the need from outside; putting git inside the binary is a separate decision. @@ -402,7 +402,7 @@ is a leaf, as it was for fences. ### 2026-08-19 — dev agent - Read `CLAUDE.md`, TODO.md §2/§6, and the Handshakes of `format-fences`, - `spans`, `vfmt-server` and `alignment` before writing anything. Baseline: + `spans`, `lucisv-server` and `alignment` before writing anything. Baseline: `cargo test -p vlog_formatter` **113 passed**, clippy silent, fmt clean. (`cargo test --workspace` did not build at that moment — a concurrent `vlog_linter` round had the tree mid-edit; it was green again before the @@ -476,8 +476,8 @@ is a leaf, as it was for fences. - `cargo test --workspace`: **768 passed, 0 failed** (a moving number — the concurrent `vlog_linter` round is landing tests in the same tree; it read 767 an hour earlier). This feature's own crates: `vlog_formatter` 113 → - **141** (+6 unit tests in `range.rs`, +22 in `tests/ranges.rs`), `vfmt` - 91 → **99** (+2 arg unit tests, +6 CLI tests), `vfmt_server` 114 → **121** + **141** (+6 unit tests in `range.rs`, +22 in `tests/ranges.rs`), `lucisv` + 91 → **99** (+2 arg unit tests, +6 CLI tests), `lucisv_server` 114 → **121** (+6 handler tests, +1 e2e). - `cargo clippy --workspace --all-targets`: silent, 0 warnings. `cargo fmt --all --check`: clean. @@ -498,20 +498,20 @@ is a leaf, as it was for fences. in; `tests/ranges.rs`'s corpus spot check is the committed version. Files added: `crates/vlog_formatter/src/range.rs`, -`crates/vlog_formatter/tests/ranges.rs`, `tools/vfmt-changed.sh`, this README. +`crates/vlog_formatter/tests/ranges.rs`, `tools/lucisv-changed.sh`, this README. Files edited: `crates/vlog_formatter/src/{lib,format,fence}.rs`, -`crates/vfmt/src/{args,main}.rs`, `crates/vfmt/tests/cli.rs`, -`crates/vfmt_server/src/{main,server,format}.rs`, -`crates/vfmt_server/tests/e2e.rs`, `README.md`, `TODO.md`, -`docs/features/vfmt-server/README.md` (the deferred-capability annotation). +`crates/lucisv/src/{args,main}.rs`, `crates/lucisv/tests/cli.rs`, +`crates/lucisv_server/src/{main,server,format}.rs`, +`crates/lucisv_server/tests/e2e.rs`, `README.md`, `TODO.md`, +`docs/features/lucisv-server/README.md` (the deferred-capability annotation). ## QA log ### 2026-08-19 — QA agent Read `CLAUDE.md`, this README, `range.rs`, the `format.rs`/`fence.rs`/`lib.rs` -diffs, `tests/ranges.rs`, the `vfmt`/`vfmt_server` diffs, and -`tools/vfmt-changed.sh` before touching anything. Verified by (a) rebuilding +diffs, `tests/ranges.rs`, the `lucisv`/`lucisv_server` diffs, and +`tools/lucisv-changed.sh` before touching anything. Verified by (a) rebuilding and re-running the gates myself, (b) an independent binary-diff of the no-default-change claim, (c) hand-written probe files against the real release binaries (not just re-running the shipped test suite), and (d) one @@ -535,14 +535,14 @@ nothing else — read the whole diff, not just the summary. re-run.** `tools/corpus_check.sh corpus` here: TSV md5 `b74f2f167c57e381d46f3503363a79b3`, byte-for-byte the value in the Work log. Then, independently of the dev's worktree (which was already removed): -created my own `git worktree` at `003e076`, built its `vfmt --release`, and +created my own `git worktree` at `003e076`, built its `lucisv --release`, and compared `--stdout` output against the current binary over all 578 formattable corpus files (from the TSV's `ok-unchanged`/`would-reformat` rows) — 0 differing via a `$()`-capture pass over all 578, then a second, byte-exact `cmp` pass on a 20-file stride subset (every 29th file). Both clean. Worktree removed after. -**Semantics (claim 1) — pass.** Hand probes against `target/release/vfmt`, +**Semantics (claim 1) — pass.** Hand probes against `target/release/lucisv`, not just re-running `tests/ranges.rs`: - Unit rule: a range on only a leading comment lays out the whole unit (comment + declaration), sibling untouched — matches the doc's "selecting a @@ -566,7 +566,7 @@ not just re-running `tests/ranges.rs`: whole, not partially — confirmed via CLI, matches the shipped test. **Interactions (claim 2) — pass.** -- Fence wins: `--lines` on lines fully inside a `// vfmt: off` region leaves +- Fence wins: `--lines` on lines fully inside a `// lucisv: off` region leaves the region untouched; the on-fence-line quirk (selecting the `on` line selects the *next* item, not the region) reproduced independently. - Alignment split: `ALIGNED`-shaped probe with lines 2-3 selected — the two @@ -600,7 +600,7 @@ not just re-running `tests/ranges.rs`: - `--lines` forms (comma, repeated), `--check`/`--diff` combination (diff patch applied cleanly with `patch` against a copy and matched the actual `--lines` output byte-for-byte), stdin, directory refusal (exit 2, correct - message, file untouched), `vfmt check --lines` rejection (exit 2) — all + message, file untouched), `lucisv check --lines` rejection (exit 2) — all reproduced directly against the binary, not just by reading `cli.rs`. - `--lines` bypasses the cache in both directions: verified via `cli.rs`'s own test (already covers "warm cache, `--lines` run still does the work, @@ -608,30 +608,30 @@ not just re-running `tests/ranges.rs`: reading it, since it is a single boolean at one call site (`args.rs::cache_enabled`) and the existing test already exercises both the hit-skip and the no-write cases. -- LSP: drove the **real** `vfmt-server` release binary over stdio with a +- LSP: drove the **real** `lucisv-server` release binary over stdio with a hand-rolled Content-Length framer (independent of `e2e.rs`'s harness) — `initialize` advertises `documentRangeFormattingProvider: true`; a range mid-module (line 3 of a 3-item module) returns one whole-document `TextEdit` containing only that line reformatted; a range on an already-clean line returns `"result": []` (empty, no edit). Matches the doc's "reply absent/empty when nothing changes" and "one whole-document - edit" claims. `cargo test -p vfmt_server` (part of the workspace run + edit" claims. `cargo test -p lucisv_server` (part of the workspace run above) is green, e2e included. - Did not independently re-derive the end-at-character-0 UTF-16 conversion math beyond reading `format.rs::range_formatting` and its unit tests - (`crates/vfmt_server/src/format.rs:80-90`) — the logic is a two-line `if` + (`crates/lucisv_server/src/format.rs:80-90`) — the logic is a two-line `if` with four unit tests covering exactly the boundary cases the doc names (cursor-only, "select two lines" ending at char 0, single line via the same rule, and a multi-byte line proving only line numbers survive the conversion); re-tracing it by hand against each test agreed with both. -**vfmt-changed.sh — pass.** Scratch git repo, two files, three edited lines +**lucisv-changed.sh — pass.** Scratch git repo, two files, three edited lines (one in `a.sv`, two in `b.sv`): only the touched declarations moved, module headers and untouched siblings stayed exactly as written. A deletion-only hunk (`sed -i '' '3d'`, no added lines) was skipped entirely — file untouched, confirmed by diff. `--check` pass-through: exit 1 when the touched hunk would still reformat, exit 0 once clean, exit 2 when -`$VFMT` points at a nonexistent binary (the script's own guard, not vfmt's +`$LUCISV` points at a nonexistent binary (the script's own guard, not lucisv's exit code, but still the documented "2 = error" contract). **Sabotage (required by CLAUDE.md invariant #4's spirit, even though this @@ -695,7 +695,7 @@ Points reviewed and accepted: 2. **The honest limit is measured and pinned**, not hidden: same LINE NUMBERS can sweep in a neighbor when the first run moved lines (449/8236 corpus trials, all settled next run), with a committed - counterexample test. Users of vfmt-changed.sh get self-stabilizing + counterexample test. Users of lucisv-changed.sh get self-stabilizing behavior; the docs say why. 3. **Run-merged verbatim slices** — found by a probe, not reasoning — is the kind of bug (separator-collapsed blank lines between diff --git a/docs/features/recursion-limit/README.md b/docs/features/recursion-limit/README.md index aada5ea..af3a802 100644 --- a/docs/features/recursion-limit/README.md +++ b/docs/features/recursion-limit/README.md @@ -5,7 +5,7 @@ `vlog_parser` is a recursive-descent parser, so nesting in the input becomes nesting on the call stack. Deeply nested input therefore did not produce a parse error — it overflowed the stack and killed the process (SIGABRT). A -stack overflow is not a panic, so `catch_unwind` in `crates/vfmt/src/main.rs` +stack overflow is not a panic, so `catch_unwind` in `crates/lucisv/src/main.rs` could not contain it: the run died mid-batch, every file after the offending one went unprocessed, and there was not even an exit-code-2 summary (cli-polish QA finding, `docs/features/cli-polish/README.md`). This feature @@ -51,7 +51,7 @@ not by 64 × 256. `parse_gen_if`), one `.b` or one `+` costs 1 link. The limits are a stack-safety budget, not a style rule. - **8 MiB of stack is available.** That is the default main-thread stack on - macOS and Linux, and `vfmt` parses on the main thread. Anything that parses + macOS and Linux, and `lucisv` parses on the main thread. Anything that parses on a *spawned* thread must give it a comparable stack — the default 2 MiB is not enough to reach the limit in an unoptimized build (see Handshakes; the tests here spawn 16 MiB threads for exactly this reason). @@ -274,7 +274,7 @@ not inflate depth — the output of a max-depth file re-parses inside - **Consumed from `vlog_parser`:** nothing new. `parse()` keeps its signature; the limit shows up as a normal `ParseError`, so `vlog_formatter` - and `vfmt` report it through the paths they already had (`FormatError:: + and `lucisv` report it through the paths they already had (`FormatError:: Source` → `error: : parse error: …` → exit 2). - **Promised to `vlog_formatter`:** AST depth on any path is bounded by `vlog_parser::parser::MAX_NESTING_DEPTH + MAX_CHAIN_LENGTH` (both public, @@ -311,7 +311,7 @@ not inflate depth — the output of a max-depth file re-parses inside - [x] Parser unit tests: at limit / past limit, one per construct family. - [x] Formatter tests (`tests/deep_nesting.rs`): max-legal depth formats and converges; past-limit input surfaces as a parse error. -- [x] CLI test (`crates/vfmt/tests/cli.rs`): the cli-polish repro (150 levels) +- [x] CLI test (`crates/lucisv/tests/cli.rs`): the cli-polish repro (150 levels) exits 2, is left untouched, and files after it are still formatted. - [x] `cargo test --workspace`, `cargo clippy --all-targets`, `cargo fmt --check` all clean. @@ -390,16 +390,16 @@ From QA round 1 (2026-08-19): live outside the repo; nothing generated by them was committed. **Results:** `cargo test --workspace` **80 passed, 0 failed** (up from 70: -+6 `vlog_parser` unit, +3 `vlog_formatter` `deep_nesting`, +1 `vfmt` CLI). ++6 `vlog_parser` unit, +3 `vlog_formatter` `deep_nesting`, +1 `lucisv` CLI). `cargo clippy --all-targets` silent. `cargo fmt --check` clean. Files touched: `crates/vlog_parser/src/parser.rs`, `crates/vlog_formatter/tests/deep_nesting.rs` (new), -`crates/vfmt/tests/cli.rs` (one test), `TODO.md` (one checkbox), this README. +`crates/lucisv/tests/cli.rs` (one test), `TODO.md` (one checkbox), this README. ### 2026-08-19 (later) — dev agent, answering QA round 1 - **The blocking finding is correct and was reproduced first thing**: - `./target/debug/vfmt` on `assign x = a` + `.b`×1500 died with SIGABRT + `./target/debug/lucisv` on `assign x = a` + `.b`×1500 died with SIGABRT (exit 134). Bisected the crash with the real binary before touching anything, and swept the whole shape class rather than just the reported one — crash thresholds on the default 8 MiB main-thread stack, debug: @@ -480,8 +480,8 @@ grew a second pathological file). `cargo clippy --all-targets` silent. - `cargo fmt --check`: clean, exit 0. **Claim 4 (150-level repro, batch survival) — CONFIRMED**, checked two ways: -- `cargo test -p vfmt deeply_nested_file_does_not_kill_the_batch` passes. -- Independently, ran the real debug `vfmt` binary (not the test harness) on +- `cargo test -p lucisv deeply_nested_file_does_not_kill_the_batch` passes. +- Independently, ran the real debug `lucisv` binary (not the test harness) on a 3-file batch (`good`, 150-level `if…begin` repro, `good`) in the scratchpad: exit 2, `error: b_deep.sv: parse error: 32:5: nesting too deep (limit 64) (found "clk")`, `2 files reformatted, 1 file failed to format`, @@ -522,7 +522,7 @@ python3 -c " n = 1500 s = 'module m;\nassign x = a' + '.b'*n + ';\nendmodule\n' open('member_chain_1500.sv','w').write(s)" -./target/debug/vfmt member_chain_1500.sv +./target/debug/lucisv member_chain_1500.sv # thread 'main' (NNNN) has overflowed its stack # fatal runtime error: stack overflow, aborting # exit code 134 (SIGABRT) @@ -715,7 +715,7 @@ file so its own count is unchanged but its assertions grew). `cargo clippy **Job 1 — original blocking repros: CONFIRMED FIXED.** Rebuilt the debug binary fresh (touched `parser.rs` to force a rebuild, confirmed via the binary's mtime) and reran all four original crash shapes at n=1500 through -the real `vfmt`, default 8 MiB stack: +the real `lucisv`, default 8 MiB stack: ``` member1500.sv -> parse error: 2:525: expression chain too long (limit 256) (found ".") exit 2 diff --git a/docs/features/refactor-instantiate/README.md b/docs/features/refactor-instantiate/README.md index c535bda..9d36cef 100644 --- a/docs/features/refactor-instantiate/README.md +++ b/docs/features/refactor-instantiate/README.md @@ -5,7 +5,7 @@ hinting**. ## Goal -Give vfmt the thing rope gets from Python's type hints and no Verilog tool +Give lucisv the thing rope gets from Python's type hints and no Verilog tool ships well: the workspace already knows every module's parameters and ports, so an instantiation should be *generated from the definition* rather than typed by hand. Typing a module name at item position offers the whole @@ -14,7 +14,7 @@ a named connection, the ports that already have a same-named signal in scope bound to it and the rest left as snippet tabstops — and once the connection list is open, signature help names the remaining ports with their directions and types. The facts live in `vlog_refactor` so Vim and a future CLI get the -same answers; `vfmt_server` owns only the position gate, the snippet encoding +same answers; `lucisv_server` owns only the position gate, the snippet encoding and the LSP items. Nothing in this milestone edits a file. Everything it produces is *offered* @@ -37,7 +37,7 @@ corrupt. editor-snippets assumption restated for generated text, and it is verified rather than assumed — see the corpus test under *Work log*. It is what forced parameter defaults through a parse-back probe. -- **vfmt does not preprocess.** A port or parameter list split across +- **lucisv does not preprocess.** A port or parameter list split across `` `ifdef`` arms is read straight through, so the plan lists **every arm's** entries and says so in a warning. Policy chosen deliberately over refusing: a skeleton is a suggestion the user edits before it becomes code, unlike M3's @@ -63,8 +63,8 @@ corrupt. - **The client's `snippetSupport` is read once, at `initialize`.** The protocol offers no way to learn it later, and a client that changes its mind mid-session is not a case worth modelling. -- **The indent step comes from `vfmt.indent` (default 2), not from - `vfmt.toml`.** `format::indent_width` discovers a config file from disk on +- **The indent step comes from `lucisv.indent` (default 2), not from + `lucisv.toml`.** `format::indent_width` discovers a config file from disk on every call; a completion request arrives on every keystroke, and walking the tree for a config file that often is not a trade worth making. Deviation from how the formatter resolves the same setting — recorded here so the lead @@ -84,12 +84,12 @@ corrupt. `ports::visible_in` went from private to `pub(crate)` so `instantiate.rs` reuses them instead of writing a second scope walk. No behaviour changed; both still have exactly one definition. -- **Consumes `vfmt_server::pairs`** — `pairs::analyze` and the public +- **Consumes `lucisv_server::pairs`** — `pairs::analyze` and the public `ScopeAnalysis`/`Pair`/`Unmatched` it already exposes — to decide whether the cursor is at module-item position. Nothing in `pairs.rs` was changed: the gate is built entirely from its published output, so editor-scopes keeps ownership of the matcher. -- **Promises `vfmt_server`**: `instantiation_plan` never panics and never +- **Promises `lucisv_server`**: `instantiation_plan` never panics and never returns a plan whose plain rendering fails to parse — corpus-verified over all 454 modules, plus escaped-identifier cases the corpus does not contain (see the *Escaped identifiers* section). `render_with` is the single layout @@ -110,7 +110,7 @@ corrupt. parse ("unexpected keyword `struct` in expression"). Two corpus headers (`common_cells/src/ecc_encode.sv`, `ecc_decode.sv`) declare `parameter type` with such a default. M4 drops the default rather than - writing back text vfmt cannot read. + writing back text lucisv cannot read. 2. An **interface-typed ANSI port** (`module m (iface_bus.mst bus, input logic clk);`) stops the whole header from parsing ("expected `)` (found \".\")"), so no `Module` item is produced and module hinting is silently @@ -282,7 +282,7 @@ hold a module of that name. stdio round trips - [x] `cargo fmt --all -- --check`, `cargo clippy --all-targets`, `cargo test --workspace` -- [x] `docs/features/vfmt-server/README.md` capability table updated +- [x] `docs/features/lucisv-server/README.md` capability table updated - [x] QA rework (2026-08-24): escaped-identifier spacing + plain-text fallback, the `.*` wildcard in signature help, the parse-failure refusal message @@ -293,7 +293,7 @@ hold a module of that name. ## Work log - **2026-08-24 (dev)** — read M1–M3 first: the umbrella plan, the ports and - rename READMEs, `vlog_refactor`'s `Scope`, and `vfmt_server`'s dispatch, + rename READMEs, `vlog_refactor`'s `Scope`, and `lucisv_server`'s dispatch, `state.rs` and `ports.rs`. **Design decision 1 — the engine takes an index and a file's text, not the @@ -316,7 +316,7 @@ hold a module of that name. **Deviation from the brief — no `// auto-connected` comments.** The milestone's example writes `.clk(clk), // auto-connected` into the inserted text. Not done: those comments are permanent (nothing later removes them), - they would appear on the majority of connections in real RTL, and vfmt + they would appear on the majority of connections in real RTL, and lucisv writing editorial comments into a user's design is a line the formatter has never crossed. The information is in the completion item's documentation panel instead ("connected, same name in scope"), where it is read once and @@ -336,10 +336,10 @@ hold a module of that name. caught two: `common_cells`' `ecc_encode`/`ecc_decode` declare `parameter type encoded_data_t = struct packed { ... }` across several lines, and the skeleton pasted the source's own indentation into a `#( ... )` on - someone else's line *and* produced text vfmt's own parser rejects. Fixed by + someone else's line *and* produced text lucisv's own parser rejects. Fixed by `default_text`: a default written across lines is dropped, and every surviving default is probed by writing it into a throwaway - `m #(.P(...)) u ();` and requiring a clean parse. A default vfmt cannot write + `m #(.P(...)) u ();` and requiring a clean parse. A default lucisv cannot write back is not offered — the tabstop comes up empty. The parser gap itself is filed in *Handshakes*, unfixed, because it belongs to another crate. @@ -349,17 +349,17 @@ hold a module of that name. what makes collapsing safe there and unsafe for parameter defaults. **Files touched.** New: `crates/vlog_refactor/src/instantiate.rs`, - `crates/vfmt_server/src/completion.rs`, - `crates/vfmt_server/src/signature.rs`, this README. Edited: + `crates/lucisv_server/src/completion.rs`, + `crates/lucisv_server/src/signature.rs`, this README. Edited: `crates/vlog_refactor/src/lib.rs` (module + re-exports + a paragraph on the one member that edits nothing), `crates/vlog_refactor/src/ports.rs` (`find_module` and `visible_in` to `pub(crate)`, no behaviour change), - `crates/vfmt_server/src/main.rs` (two capabilities, `snippet_support`, - `Server::new` gained the flag), `crates/vfmt_server/src/server.rs` (two + `crates/lucisv_server/src/main.rs` (two capabilities, `snippet_support`, + `Server::new` gained the flag), `crates/lucisv_server/src/server.rs` (two dispatch arms, the flag on `Server`), `crates/vlog_refactor/tests/corpus.rs` and - `crates/vfmt_server/tests/e2e.rs` (new tests only), - `docs/features/vfmt-server/README.md` (capability table). + `crates/lucisv_server/tests/e2e.rs` (new tests only), + `docs/features/lucisv-server/README.md` (capability table). **Not touched, deliberately:** `TODO.md`, the umbrella checklist, `pairs.rs`, `hover.rs` (module hover already works through nav), and every @@ -417,8 +417,8 @@ hold a module of that name. QA suggested. **Files touched this round:** `crates/vlog_refactor/src/instantiate.rs`, - `crates/vfmt_server/src/completion.rs`, - `crates/vfmt_server/src/signature.rs`, this README. Nothing else; no + `crates/lucisv_server/src/completion.rs`, + `crates/lucisv_server/src/signature.rs`, this README. Nothing else; no behaviour outside M4 was reached. ## QA log @@ -488,7 +488,7 @@ run and then fully reverted — nothing left in the tree (confirmed with - A signal declared in an enclosing `generate`/`endgenerate` block before the site — binds, as expected. -**MEDIUM — an escaped-identifier port name produces a skeleton `vfmt`'s own +**MEDIUM — an escaped-identifier port name produces a skeleton `lucisv`'s own parser rejects, falsifying the feature's own stated invariant** `docs/features/refactor-instantiate/README.md`'s Handshakes section @@ -552,7 +552,7 @@ endmodule (`expected \`)\` (found ".")`, confirmed directly against `parse_source_tolerant`), so no `Module` item is produced for `m` at all, and `instantiation_plan("m", ...)` refuses with *"the file that declared -\`m\` no longer declares it, so vfmt cannot write an instantiation of +\`m\` no longer declares it, so lucisv cannot write an instantiation of it."* — a message that reads as "someone edited the file out from under the index" when the real cause is "the parser never supported this syntax." This is the identical class of gap the dev already found and @@ -574,7 +574,7 @@ substance (no skeleton is offered) even if imprecise in wording. **MEDIUM — dead code means `.*` inside a connection list is never recognized, so it falls through into a wrong active-parameter count** -`active_entry` (`crates/vfmt_server/src/signature.rs:219-257`) has this +`active_entry` (`crates/lucisv_server/src/signature.rs:219-257`) has this branch, evidently meant to treat `.*` as a name (so that, like an unknown `.name`, it highlights nothing rather than being mistaken for an ordered connection): @@ -655,14 +655,14 @@ All via temporary probes, reverted: Ran the dev's own `completion_and_signature_help_round_trip_over_the_wire` and `a_client_without_snippet_support_gets_the_skeleton_as_plain_text` -(`crates/vfmt_server/tests/e2e.rs`) as part of the full-suite gate run — +(`crates/lucisv_server/tests/e2e.rs`) as part of the full-suite gate run — both pass, part of the workspace's 1222. They already exercise exactly what the brief asked for: one real `initialize` → `completion` round trip over stdio asserting the JSON-decoded snippet text is byte-for-byte the expected `${n:...}` syntax, one `signatureHelp` round trip with UTF-16 label-offset arithmetic checked against the decoded label string, and the advertised `completionProvider`/`signatureHelpProvider` capability shapes. -Re-ran both in isolation (`cargo test -p vfmt_server --test e2e +Re-ran both in isolation (`cargo test -p lucisv_server --test e2e completion_and_signature_help_round_trip -- --nocapture` and the plain-text one) to confirm independently rather than trust the aggregate count — both pass standalone. @@ -680,7 +680,7 @@ No disagreements to file. Specifically: review above; divergence between the two spellings is impossible by construction, confirmed. 3. No `// auto-connected` comments — reasonable; the stated reasons - (permanent, majority-case noise, a line vfmt hasn't crossed elsewhere) + (permanent, majority-case noise, a line lucisv hasn't crossed elsewhere) are sound, and the alternative (documentation panel) genuinely carries the same information. Agree. 4. Measuring `parse_source_tolerant` before choosing eager-vs-`resolve` — @@ -717,8 +717,8 @@ limitation and does not block shipping on its own. ### Files touched during QA (all reverted; nothing left in the tree) -`crates/vlog_refactor/src/instantiate.rs`, `crates/vfmt_server/src/completion.rs`, -`crates/vfmt_server/src/signature.rs` — 12 temporary `qa_probe_*`/probe +`crates/vlog_refactor/src/instantiate.rs`, `crates/lucisv_server/src/completion.rs`, +`crates/lucisv_server/src/signature.rs` — 12 temporary `qa_probe_*`/probe tests added, run with `--nocapture`, then removed. Verified clean with `grep -rn qa_probe` (zero hits) and a final `cargo fmt --all -- --check` + `cargo clippy --all-targets` + `cargo test --workspace` (1222 passed) @@ -793,7 +793,7 @@ very first character); `\u_weird-mod` is. `has_escaped_identifier()` correctly returns `true` from the module-name check alone; `instance_name()` correctly returns `\u_weird-mod`; the skeleton `\weird-mod \u_weird-mod (\n .a(a)\n);` parses. -- `crates/vfmt_server/src/completion.rs:126`'s gate +- `crates/lucisv_server/src/completion.rs:126`'s gate (`snippets && !plan.has_escaped_identifier()`) — confirmed it forces plain text for the module-name-only case too, not just the port/param-escaped cases the dev's test already covers. @@ -857,7 +857,7 @@ _definition` already filters to names the index found. ### MEDIUM #2 (`.*` dead code) — mechanism review -Read the fix (`crates/vfmt_server/src/signature.rs:225-271`). The wildcard +Read the fix (`crates/lucisv_server/src/signature.rs:225-271`). The wildcard check now lives inside the `if token.kind == TokenKind::Symbol` arm, *before* the `match` that does depth bookkeeping: diff --git a/docs/features/refactor-ports/README.md b/docs/features/refactor-ports/README.md index 99feff1..c7c85fa 100644 --- a/docs/features/refactor-ports/README.md +++ b/docs/features/refactor-ports/README.md @@ -9,7 +9,7 @@ would: add a port and every instantiation in the project gains a connection for it; remove a port and every instantiation loses it; ask one instantiation to catch up with the module it instantiates and the missing connections appear. The engine lives in `crates/vlog_refactor` beside M2's rename, so Vim, VS Code -and any future CLI get identical behavior; `vfmt_server` maps the protocol — +and any future CLI get identical behavior; `lucisv_server` maps the protocol — two code actions and three `workspace/executeCommand` commands — and decides nothing. Every edit comes from a node `vlog_parser` parsed or a name `vlog_semantic` resolved, and the whole edit is verified in memory before it is @@ -44,7 +44,7 @@ editor says the same thing. A lightbulb that only ever explains why it cannot help is worse than no lightbulb, so a refusal produces no action at all. `ModuleRef::At` exists because a code action or a keybinding knows a cursor, -not a name; `ModuleRef::Name` because `vfmt.addPort` is also the API a UI calls +not a name; `ModuleRef::Name` because `lucisv.addPort` is also the API a UI calls after asking the user which module (M4's instantiate work will want it too). ## What each refactoring does — exactly @@ -116,7 +116,7 @@ its body declaration; both are the same removal. - **An empty connection list** is not edited: there was nothing there. - Every occurrence of the port's name in text **the preprocessor owns** — a macro invocation's arguments (`` `BUMP(rst) ``), a `` `define`` body — is - reported, in the module's file and in every file the removal edits. vfmt does + reported, in the module's file and in every file the removal edits. lucisv does not expand macros, so an invocation is one opaque token: nothing there can be edited, and nothing there is visible to the body-use refusal either. Silence would be the worst answer, because only a real preprocessor would discover @@ -146,7 +146,7 @@ comment and the new element after it, as two insertions. A comma written after ### Conditional compilation — where a new port may not go -vfmt does not preprocess, so an `` `ifdef`` arm is ordinary text to it. That +lucisv does not preprocess, so an `` `ifdef`` arm is ordinary text to it. That makes "append after the last declared port" wrong in one specific, silent way: ```systemverilog @@ -162,7 +162,7 @@ The last declared port is inside the arm, so the byte after it is inside the arm too, and a port appended there **only exists when `HAS_RST` is defined** — the opposite of what "add a port" means. None of the five verification checks can see this, by design: the file parses, no name changes meaning, and the -re-parsed header really does declare the port, because vfmt reads straight +re-parsed header really does declare the port, because lucisv reads straight through the `` `ifdef``. It is a *planning* mistake, not a verification gap, so it is caught in the planner: @@ -174,10 +174,10 @@ it is caught in the planner: - **A non-zero count refuses the whole refactoring**, naming the arm and its line, and says to place the port by hand. (The ruling asked for `> 0`; `< 0` — more `` `endif``s than opens, a region opened outside the list — is refused - too, since vfmt equally cannot tell what it would be writing into.) + too, since lucisv equally cannot tell what it would be writing into.) - **A zero count proceeds, with a warning** naming the directives: the port lands outside every arm, which is correct, but the module's port set is - configuration-dependent and the user should know that vfmt only sees one + configuration-dependent and the user should know that lucisv only sees one spelling of it. A macro *item* in a body (`` `ASSERT_INIT(...) ``) is not counted: it is a @@ -188,10 +188,10 @@ call, not a directive, and cannot open a region. Positional connections are where a port refactoring can silently change what a circuit does, so each case is decided rather than guessed: -| Situation | What vfmt does | +| Situation | What lucisv does | |---|---| | `add_port`, ordered list whose length **equals** the module's port count before the change | Appends a position at the end. The new port *is* the new last port, so the end is where it belongs. | -| `add_port`, ordered list of a **different** length | **Refuses the whole refactoring**, naming the instance and both counts, and says to convert it to named connections first. vfmt cannot tell which port a short list meant to connect. | +| `add_port`, ordered list of a **different** length | **Refuses the whole refactoring**, naming the instance and both counts, and says to convert it to named connections first. lucisv cannot tell which port a short list meant to connect. | | `add_port`, **empty** list (`u1 ()`) | Left alone, with a warning. An empty list connects nothing before *and* after; appending would bind the new port to position 0. | | `add_port`, ordered site where no same-named signal is in scope | The position is written **empty** (`u1 (a, b, )`), not `/* TODO */`: a comment between two commas *is* an empty position, so a placeholder there would be a lie. Warned. | | `remove_port`, **any** non-empty ordered list anywhere in scope | **Refuses the whole refactoring.** Dropping one positional connection re-binds every one after it. The message says to convert to named connections first. | @@ -215,7 +215,7 @@ because nothing before it moves; deleting from one is not. port count (above). 6. The module writes an `import` in its header and has **no** port list at all: the `;` that ends such a header cannot be told from the import's own `;` - without preprocessing, so vfmt asks for `()` to be written first. (Today's + without preprocessing, so lucisv asks for `()` to be written first. (Today's parser rejects that header outright, so this is a guard, not a path users reach.) 7. The insertion point falls **inside a conditional arm**, or the directives @@ -232,7 +232,7 @@ because nothing before it moves; deleting from one is not. it is a warning instead; see above.) 12. A deletion range would swallow a **comment** — a connection or a port with a comment written inside it. Comments are never dropped (invariant 3), and - vfmt will not decide where a comment should move. + lucisv will not decide where a comment should move. 13. Verification fails. `propagate_ports` refuses when: @@ -326,13 +326,13 @@ byte-for-byte. ## The LSP surface -**Code actions** (`vfmt_server/src/ports.rs`), kind -`refactor.rewrite.vfmt.ports`, advertised alongside the existing quick-fix +**Code actions** (`lucisv_server/src/ports.rs`), kind +`refactor.rewrite.lucisv.ports`, advertised alongside the existing quick-fix kinds and honoring the client's `only` filter: - On a port declaration in a header (or its non-ANSI body declaration): - *"vfmt: remove port `p` (updates 3 instantiations)"*. -- On an instantiation missing connections: *"vfmt: connect 2 missing ports"*. + *"lucisv: remove port `p` (updates 3 instantiations)"*. +- On an instantiation missing connections: *"lucisv: connect 2 missing ports"*. Both carry the computed `WorkspaceEdit` inline — nothing to resolve — and neither is offered where the refactoring would be refused. They answer for the @@ -353,9 +353,9 @@ constructs. | Command | Arguments | Why it exists | |---|---|---| -| `vfmt.addPort` | `[uri, module-name-or-Position, "input logic [7:0] cfg"]` | A code action carries no free-form input. This is the API a UI calls once it has asked the user; the VS Code side can grow an input box over it without the engine changing. | -| `vfmt.removePort` | `[uri, Position]` | A Vim user has no lightbulb; a command works wherever a keybinding does. | -| `vfmt.propagatePorts` | `[uri, Position]` | Same. | +| `lucisv.addPort` | `[uri, module-name-or-Position, "input logic [7:0] cfg"]` | A code action carries no free-form input. This is the API a UI calls once it has asked the user; the VS Code side can grow an input box over it without the engine changing. | +| `lucisv.removePort` | `[uri, Position]` | A Vim user has no lightbulb; a command works wherever a keybinding does. | +| `lucisv.propagatePorts` | `[uri, Position]` | Same. | Each answers with the `WorkspaceEdit` for the client to apply. The server does **not** push `workspace/applyEdit`: the client asked for the command and owns @@ -373,25 +373,25 @@ engine's sentence verbatim, M2's precedent. disk — the same list `WorkspaceIndex::build` was given. The crate does no I/O. (M2's assumption, unchanged.) - **A module name is unique in scope.** Every instantiation resolves by name; - if the workspace declares the name twice, vfmt refuses rather than guessing. + if the workspace declares the name twice, lucisv refuses rather than guessing. - **`inst.module` is compared by name.** A scope-qualified instantiation (`pkg::mod u1 (...)`) is stored with its `::` glued and therefore does not match a bare module name — such an instantiation is not found and not edited. Real RTL does not write them; if it starts to, this is where to look. -- **vfmt does not preprocess.** An instantiation hidden inside a macro body or +- **lucisv does not preprocess.** An instantiation hidden inside a macro body or produced by a macro invocation is one opaque token and cannot be edited or even seen. An instantiation inside an `` `ifdef`` arm *is* ordinary tokens and *is* edited, in every arm — the same honesty M2 documents. -- **vfmt does not elaborate.** "Is a signal called `cfg` in scope here?" is a +- **lucisv does not elaborate.** "Is a signal called `cfg` in scope here?" is a lexical-scope question answered by `vlog_semantic`, not an elaboration; a - name that would come from a wildcard package import that vfmt cannot resolve + name that would come from a wildcard package import that lucisv cannot resolve reads as "not in scope", so the connection is a TODO rather than a wrong guess. - **A port refactoring is a rare, user-initiated request**, so re-parsing the in-scope files that mention the module (twice: once to plan, once to verify) is affordable. The substring prefilter M2 introduced keeps it to a handful of files. Measured below. -- **Two spaces** are used for the one indentation vfmt has to invent (a body +- **Two spaces** are used for the one indentation lucisv has to invent (a body declaration in a module with no items at all). Every other insertion copies an indentation that is already in the file. @@ -424,7 +424,7 @@ engine's sentence verbatim, M2's precedent. rename's wording. M2's warning text and ordering are byte-for-byte unchanged; its 48 behavior tests pin that. -**Promised to `vfmt_server`** (and to any future CLI): +**Promised to `lucisv_server`** (and to any future CLI): - None of the four public functions panics, and none returns a partial edit: `Ok` means every edit in it verified *together*, `Err` means nothing at all is @@ -436,14 +436,14 @@ engine's sentence verbatim, M2's precedent. - `warnings` are informational: an `Ok` with warnings is still safe to apply. - `PortAction.title` is user-facing text; the server does not rewrite it. -**Changed in `vfmt_server`** (protocol layer only): `code_action::wanted` is +**Changed in `lucisv_server`** (protocol layer only): `code_action::wanted` is now `pub` so the port actions can honor the same `only` filter the lint actions do; `server.rs` gained the `workspace/executeCommand` arm and the port-action call inside the existing `textDocument/codeAction` arm; `main.rs` advertises `executeCommandProvider` and the new code-action kind. **Requested of nobody.** No change was needed in `vlog_parser`, -`vlog_semantic`, `vlog_formatter` or `vfmt_core` for this milestone. +`vlog_semantic`, `vlog_formatter` or `lucisv_core` for this milestone. ## Status / TODO @@ -464,7 +464,7 @@ call inside the existing `textDocument/codeAction` arm; `main.rs` advertises resolution identity outside the edits — plus the shape check - [x] Masked-corruption attacks for every new forgiveness (10 attacks and 2 positive controls in `check.rs`) -- [x] `vfmt_server`: code actions, three commands, capabilities +- [x] `lucisv_server`: code actions, three commands, capabilities - [x] `may_have_port_action` — the one-file pre-check that keeps a cursor-move-frequency code-action request off the workspace walk - [x] Conditional-compilation guard on both insertion paths: refuse inside an @@ -474,13 +474,13 @@ call inside the existing `textDocument/codeAction` arm; `main.rs` advertises M2's scan (QA HIGH #2) - [x] Tests: 138 in `vlog_refactor` (36 unit — 12 of them the splice verifier's, 10 attacks and 2 positive controls — 50 behavior in - `tests/ports.rs`, 48 rename behavior, 4 corpus), 9 in `vfmt_server`'s + `tests/ports.rs`, 48 rename behavior, 4 corpus), 9 in `lucisv_server`'s `ports.rs`, 2 capability assertions, 1 e2e session covering a code action, all three commands and two refusals - [ ] Deferred to the umbrella backlog: reorder ports, parameter add/remove, task/function arguments, ordered → named conversion (which would turn three of the refusals above into an offer to convert first) -- [ ] Deferred: a VS Code input box over `vfmt.addPort` (the command is the API +- [ ] Deferred: a VS Code input box over `lucisv.addPort` (the command is the API until then; M4's instantiate work is the natural moment) ## Corpus acceptance @@ -494,7 +494,7 @@ corpus add_port over 860 files: Ok((6, 18)) in 0.39s (release; 1.9s debug) corpus rename over 860 files: Ok((6, 18)) in 0.38s ``` -Adding `input logic vfmt_probe_i` to `prim_fifo_sync` — a module OpenTitan +Adding `input logic lucisv_probe_i` to `prim_fifo_sync` — a module OpenTitan instantiates all over — edits **6 files in 18 places**: the declaration, and every instantiation of it in the corpus, all of which are named-connection sites. Every edit is asserted to be an insertion of non-empty text, and the @@ -567,7 +567,7 @@ Checks at the end: `cargo fmt --all -- --check` clean, `cargo clippy --all-targets` silent (zero warnings, workspace-wide), `cargo test --workspace` green at **1164** tests (was 1085). No `unwrap`/`expect`/`panic!` and no `unsafe` in any library path of either crate (test modules only). One -`#![allow(clippy::mutable_key_type)]` in `vfmt_server/src/ports.rs`, with the +`#![allow(clippy::mutable_key_type)]` in `lucisv_server/src/ports.rs`, with the same reason `rename.rs` carries: `WorkspaceEdit.changes` is keyed by `lsp_types::Uri`, whose interior mutability is its own parse cache and takes no part in `Hash`/`Eq`. @@ -594,27 +594,27 @@ guard is exactly the ruling: count `` `ifdef``/`` `ifndef`` opens minus body for the non-ANSI declaration path — and refuse when the count is not zero, naming the arm and its line. When directives exist but the point is balanced, the edit proceeds with a warning naming them, because the module's port set is -configuration-dependent either way and vfmt only ever sees one spelling of it. +configuration-dependent either way and lucisv only ever sees one spelling of it. `` `else``/`` `elsif`` continue a region rather than opening one; a macro item in a body is a call, not a directive, and is not counted. The ruling said "unbalanced (> 0)"; the implementation refuses on **any** non-zero count. A negative count means a region was opened outside the list, and -vfmt can tell just as little about what it would be writing into — refusing is +lucisv can tell just as little about what it would be writing into — refusing is the same answer for the same reason. Flagging the widening rather than doing it quietly. Where the guard lives matters and is now stated in the README: this is a *planning* rule, not a verification one. All five verification checks correctly pass QA's reproduction — the file parses, no name changes meaning, and the -re-parsed header does declare the port, because vfmt reads through the +re-parsed header does declare the port, because lucisv reads through the `` `ifdef``. Only the planner can know the insertion point was wrong. Regression tests: QA's exact source as a crate-level refusal (`a_port_that_would_land_inside_an_ifdef_arm_is_refused`), the balanced mirror (`a_port_list_with_a_closed_conditional_is_edited_and_reported`), the non-ANSI body path (`a_non_ansi_body_declaration_that_would_land_inside_an_ifdef_arm_is_refused`), and QA's e2e shape kept: the existing port session gained a third file and a -`vfmt.addPort` that comes back `-32803` with the arm named. +`lucisv.addPort` that comes back `-32803` with the arm named. **2. `remove_port` macro silence — now warned (QA HIGH #2).** M2's two scans were factored rather than copied: `Scope::define_sites` and @@ -664,7 +664,7 @@ One clippy-driven tidy while there: the header planner's arguments are now a Work log's number exactly (was 1085 before this milestone). Per-crate breakdown confirmed against the `Running`/`test result` pairs: `vlog_refactor` unit 36 + `corpus` 4 + `ports` 44 + `rename` 48 = 132; - `vfmt_server` unit 222 + `e2e` 13 = 235; the rest unchanged from M1/M2. + `lucisv_server` unit 222 + `e2e` 13 = 235; the rest unchanged from M1/M2. All three gates: **pass, claims confirmed.** ### Priority — `Shift::map`'s predicate change (`range.start < span.start` → @@ -741,7 +741,7 @@ task brief specifically raised: | Move a comment's exact text inside a string literal elsewhere in the file, with an edit that claims no changes | **Rejected.** The comment disappears as a `Piece::Comment` (piece-count/positional mismatch against the re-tokenized "after"); reappearing inside a string's token text doesn't fool the piece-kind comparison. | | A declared edit range covering only *half* the bytes of a `/* ... */` comment (partial overlap, not the whole span) | **Rejected**, via the existing "would delete a comment" rule — `overlaps()` is a share-a-byte test, so a partial overlap still counts as "deleted" and refuses outright, which is the conservative direction. | | An edit landing in the parameter list `#( ... )` instead of the port list `( ... )` — lexically clean, no comment touched, resolution identity holds, file still parses | **`verify_splice` alone returns `Ok`** — confirmed directly by calling it on a hand-built plan. This is not a hole; it is exactly the gap the README says `ports::confirm` (the shape check) exists to close, checks 1–4 have no concept of "port list vs. parameter list". | -| The same parameter-list-injection plan, run through `ports::confirm` (the shape check) with the plan's own `expected` `Shape` (as `plan_add` would compute it) | **Rejected** — `confirm` re-parses the edited text, reads back the module's actual declared ports, sees `cfg` is not among them (it's a parameter), and refuses with "would not leave the signature vfmt intended". This proves end-to-end that a parameter-list capture is caught, and specifically that it is `confirm`, not `verify_splice`, doing the catching — matching the README's claim in "The shape check" and "One change to shared code" precisely. | +| The same parameter-list-injection plan, run through `ports::confirm` (the shape check) with the plan's own `expected` `Shape` (as `plan_add` would compute it) | **Rejected** — `confirm` re-parses the edited text, reads back the module's actual declared ports, sees `cfg` is not among them (it's a parameter), and refuses with "would not leave the signature lucisv intended". This proves end-to-end that a parameter-list capture is caught, and specifically that it is `confirm`, not `verify_splice`, doing the catching — matching the README's claim in "The shape check" and "One change to shared code" precisely. | No holes found in the verifier itself. The two-layer design (checks 1–4 for lexical/semantic honesty, check 5/`confirm` for "landed in the right list") @@ -767,7 +767,7 @@ brief's attack ideas: `"input a) (input b"`, `"input a)) (( input b"`, `` "input a /* ) */ b" ``, `` "input a `define X 1" ``) — all refused, none escaped the throwaway-header probe. (One string I initially treated as an injection attempt, - `"input a[__vfmt_port_probe]"`, is not one on reflection — it's a legal ANSI + `"input a[__lucisv_port_probe]"`, is not one on reflection — it's a legal ANSI port named `a` with an unpacked-array dimension that happens to *mention* the probe module's name; the probe is discarded after parsing, so there is nothing for it to interact with. Correctly accepted; my test's original @@ -775,12 +775,12 @@ brief's attack ideas: - Duplicate module names in the workspace (`m` declared in two files) → refused, "declared in more than one indexed file". - `propagate_ports` on an instantiation of an unindexed module name → - refused, "vfmt indexes no module named `unknown_mod`". + refused, "lucisv indexes no module named `unknown_mod`". - `.rst()` (empty named connection) is correctly treated as *already connected* by `propagate_ports` — refused with "already connects every port `sub` declares" rather than treating the empty parens as missing. - `remove_port` on a port used only inside an `` `ifdef NEVER_DEFINED`` - arm → **refused** ("still used inside `m` at m.sv:6"), confirming vfmt's + arm → **refused** ("still used inside `m` at m.sv:6"), confirming lucisv's documented "does not preprocess" honesty extends correctly to body-use checking: an ifdef arm is ordinary tokens regardless of whether the guard is ever true. @@ -817,7 +817,7 @@ brief's attack ideas: Reproduced twice: once through the crate's public `add_port` API, and independently through the **real server binary over stdio** -(`vfmt.addPort` executeCommand — see below) to rule out a test-harness +(`lucisv.addPort` executeCommand — see below) to rule out a test-harness artifact. ```systemverilog @@ -859,7 +859,7 @@ region. This is not a lexical, resolution, or shape-check failure — `verify_splice` correctly finds nothing to object to (the file parses, no comment moves, no name outside the edit changes meaning), and `confirm`'s shape check correctly -finds `cfg` declared as a port in the re-parsed text (vfmt doesn't +finds `cfg` declared as a port in the re-parsed text (lucisv doesn't preprocess, so it parses through the `` `ifdef`` regardless of the guard). So none of the four checks can catch this class of bug **by design** — it's not a verification gap, it's a planning gap: the plan itself asked for the wrong @@ -871,7 +871,7 @@ the response — no warning, no refusal — tells the user. This is exactly the brief named. Confirmed independently over the **real server binary via stdio** -(`workspace/executeCommand` → `vfmt.addPort`, `["","m","input logic cfg"]`): +(`workspace/executeCommand` → `lucisv.addPort`, `["","m","input logic cfg"]`): the returned `WorkspaceEdit`'s single insertion lands at line 3 (0-indexed) of the source above — one line before `` `endif `` on line 4 — reproducing the finding through the full LSP stack, not just a direct crate call. @@ -918,7 +918,7 @@ valid-looking tokens to any downstream tool that also doesn't preprocess) but whose macro expansion, once actually preprocessed by a real compiler, references a port name that no longer exists — with the refactoring reporting complete, silent success. Not a byte-level corruption (hard invariant 1 -is about vfmt's own output being verified-correct or refused, and the output +is about lucisv's own output being verified-correct or refused, and the output here *is* what the edit promised), but it is the same "silently wrong, zero indication" shape QA flagged as HIGH in M2, applied to the sibling feature that reused none of the fix. @@ -940,30 +940,30 @@ Handshake. Noting for awareness, not asking for a fix. ### Real server binary over stdio Ran the dev's own `a_port_code_action_and_the_port_commands_round_trip_over_the_wire` -(`crates/vfmt_server/tests/e2e.rs:1001`) as part of the full-suite gate run +(`crates/lucisv_server/tests/e2e.rs:1001`) as part of the full-suite gate run (pass, part of the 13 e2e sessions) — it already drives one `textDocument/codeAction` -and all three `workspace/executeCommand`s (`vfmt.propagatePorts`, -`vfmt.addPort` twice, once refused) against the real `vfmt-server` binary, +and all three `workspace/executeCommand`s (`lucisv.propagatePorts`, +`lucisv.addPort` twice, once refused) against the real `lucisv-server` binary, and asserts the code action's inline `WorkspaceEdit`, the command responses' edits, the advertised capabilities (`executeCommandProvider`, the -`refactor.rewrite.vfmt.ports` code-action kind), and the `-32803` refusal +`refactor.rewrite.lucisv.ports` code-action kind), and the `-32803` refusal shape. I re-ran it in isolation to confirm independently rather than trust the aggregate count, and it passed. I additionally wrote and ran (temporarily, then reverted) my own independent -e2e session — not reusing the dev's fixture — that drives `vfmt.addPort` +e2e session — not reusing the dev's fixture — that drives `lucisv.addPort` through `workspace/executeCommand` against the real binary on the `` `ifdef ``-in-port-list source above; see the HIGH finding. ### Files touched during QA (all reverted; nothing left in the tree) `crates/vlog_refactor/src/lib.rs`, `crates/vlog_refactor/src/check.rs`, -`crates/vlog_refactor/src/ports.rs`, `crates/vfmt_server/tests/e2e.rs` each +`crates/vlog_refactor/src/ports.rs`, `crates/lucisv_server/tests/e2e.rs` each had temporary `#[test] fn qa_*` functions added, run, and then restored byte-for-byte from a pre-edit copy (diffed against the copy to confirm a clean revert). `crates/vlog_refactor/tests/qa_probe.rs` was created, run, and deleted. `git status --short` after cleanup shows only the dev's -original changes; `cargo build -p vlog_refactor -p vfmt_server --tests` +original changes; `cargo build -p vlog_refactor -p lucisv_server --tests` rebuilds clean. ### Summary @@ -1039,7 +1039,7 @@ record):** in the trailing-directive-after-insertion case above, the edit is correctly accepted, but the accompanying warning still names the (entirely irrelevant, position-wise) trailing directives: `` "`m`'s port list carries compiler directives (`ifdef UNUSED` at m.sv:4, and 1 more), so what ports it -declares depends on the configuration; vfmt added the port outside every +declares depends on the configuration; lucisv added the port outside every conditional arm." `` The new port is *not* actually configuration-dependent here (nothing is declared inside that trailing, empty `` `ifdef``), because `guard_conditionals`'s warning branch reads from the full unfiltered @@ -1076,7 +1076,7 @@ invoked with no args vs. with args": all, so silence here is correct, not a gap. - **A *different* macro whose body spells the port name, invoked bare elsewhere** (`` `define GET_RST rst`` ... `` `GET_RST;``) — **correctly - reported**: `` "`rst` appears in the body of macro `GET_RST` ... vfmt does + reported**: `` "`rst` appears in the body of macro `GET_RST` ... lucisv does not preprocess, so that body still names the removed port." `` Confirms `define_sites` catches this via the `` `define`` table directly, independent of how the macro is later invoked (bare or with parens) — a body-spelling @@ -1111,7 +1111,7 @@ different from the ones already in `tests/rename.rs`, calling the public - `` `define BUMP(x) x = x + 1`` / `` `BUMP(a);``, renaming `a` → `b`: warning text came back **exactly** `` "`a` appears in the arguments of the macro invocation `BUMP` at m.sv:4 and was left unchanged; a macro - invocation is one opaque token to vfmt, which does not expand macros." `` + invocation is one opaque token to lucisv, which does not expand macros." `` — byte-for-byte the template `rename.rs::macro_use_warnings` has always produced. - `` `define HOLDS_A a`` (no invocation at all, just the body), renaming diff --git a/docs/features/refactor-rename/README.md b/docs/features/refactor-rename/README.md index 3e0feca..73e84ba 100644 --- a/docs/features/refactor-rename/README.md +++ b/docs/features/refactor-rename/README.md @@ -4,11 +4,11 @@ Milestone **M2** of `docs/features/refactor/README.md`. ## Goal -Give vfmt the refactoring every Verilog user misses: rename a symbol and have +Give lucisv the refactoring every Verilog user misses: rename a symbol and have *every* reference to it change, across files, or have the request refused with a sentence explaining why. The engine lives in a new crate, `crates/vlog_refactor`, so the CLI and every editor get identical behavior; -`vfmt_server` only maps the protocol (`textDocument/prepareRename`, +`lucisv_server` only maps the protocol (`textDocument/prepareRename`, `textDocument/rename` → `WorkspaceEdit`). Every edit comes from a span the semantic layer resolved — there is no textual search-and-replace anywhere in this feature — and the whole edit is verified in memory before it is returned: @@ -33,7 +33,7 @@ pub fn rename(files: &[(PathBuf, String)], file: &Path, offset: u32, new_name: & `files` is **the boring option**: the in-scope files as `(path, text)` pairs — exactly what `WorkspaceIndex::build` already takes, and exactly what -`vfmt_server`'s scope resolution (M1's filelist ⊃ walk ⊃ siblings ladder, open +`lucisv_server`'s scope resolution (M1's filelist ⊃ walk ⊃ siblings ladder, open buffers overlaying disk) already produces. No trait, no borrow of server state, no I/O inside the crate. @@ -105,7 +105,7 @@ sites, `.port(...)` connection names, and `#(.PARAM(...))` overrides. caught when the rename starts *from the declaration* and so never reaches rule 8. 10. Some other in-scope reference to the name resolves ambiguously **onto this - declaration** — a use vfmt would have to edit but cannot attribute. + declaration** — a use lucisv would have to edit but cannot attribute. 11. The declaration's `name_span` is empty (the layer could not find the name literally in the source), or an edit span does not slice back to the name. 12. **Collision / capture.** After applying the edits in memory and @@ -181,7 +181,7 @@ microseconds on a Verilog file and needs no argument at all. Simplicity first. ## Preprocessor honesty -vfmt does not preprocess (TODO.md §7). What that means here, exactly as +lucisv does not preprocess (TODO.md §7). What that means here, exactly as implemented: - **`` `define`` bodies and macro names are never edited.** A `` `define`` is @@ -197,7 +197,7 @@ implemented: warns per occurrence: "`a` appears in the arguments of the macro invocation `` `BUMP `` at m.sv:4 …". This scan covers files the rename never edits, since a macro call in an untouched file still expands to the old name. -- **`` `ifdef`` arms are ordinary tokens to vfmt**, so a resolved reference +- **`` `ifdef`` arms are ordinary tokens to lucisv**, so a resolved reference inside one **is** renamed — in every arm. That is the honest behavior: the tokens are there, they bound to the declaration, and editing only one arm would break the build for the other. No warning; there is nothing left @@ -205,15 +205,15 @@ implemented: - **Occurrences the layer records nothing for are left alone and warned about, grouped by *why*** — the warning names the actual construct rather than guessing at a template: - - `a hierarchical or member tail, which vfmt does not resolve` — + - `a hierarchical or member tail, which lucisv does not resolve` — `u_inst.sig`, `a.b.c`, and `defparam u1.P` paths. This is the honest limitation: resolving a tail needs instance elaboration, which is a non-goal of `vlog_semantic`. A `defparam` naming a renamed parameter is therefore left pointing at the old name, and said so. - - `an end label vfmt could not attach to its declaration` — a mismatched + - `an end label lucisv could not attach to its declaration` — a mismatched label, or one whose declaration was a redeclaration. - - `a label vfmt records no declaration for`, and - `an occurrence vfmt cannot attribute to any declaration` for the rest. + - `a label lucisv records no declaration for`, and + `an occurrence lucisv cannot attribute to any declaration` for the rest. ## Assumptions @@ -256,7 +256,7 @@ implemented: ranges that slice back to the name — every edit span is one of these, and the engine re-checks the slice before emitting it. -**Promised to `vfmt_server`** (and to any future CLI): +**Promised to `lucisv_server`** (and to any future CLI): - `rename` never panics and never returns a partial edit: `Ok` means every edit in it verified together, `Err` means nothing at all is to be applied. @@ -308,9 +308,9 @@ a much larger change than an end label and is not part of M2. HIGH #2), and unaccounted-occurrence warnings grouped by reason - [x] End labels renamed with their declaration, through a lead-authorized `vlog_semantic` change (QA round 1, priority finding) -- [x] `vfmt_server`: `rename.rs`, `prepareRename` + `rename`, capabilities +- [x] `lucisv_server`: `rename.rs`, `prepareRename` + `rename`, capabilities - [x] Tests: 64 in `vlog_refactor` (14 unit incl. 8 masked-corruption attacks, - 48 behavior, 2 corpus), 3 new in `vlog_semantic`, 8 in `vfmt_server` + 48 behavior, 2 corpus), 3 new in `vlog_semantic`, 8 in `lucisv_server` (7 in `rename.rs`, 1 capability), 1 e2e session - [ ] Deferred: rename in comments and strings (rope's `docs=True`) — the umbrella lists it as an option, off by default, "until asked for" @@ -397,14 +397,14 @@ Two things worth flagging for review: record nothing", `docs/features/vlog-semantic/README.md`), which is a handshake for a later round rather than a textual patch here. *(The lead authorized exactly that handshake; see the rework entry below.)* -- **A `#[allow(clippy::mutable_key_type)]`** on `crates/vfmt_server/src/rename.rs`, +- **A `#[allow(clippy::mutable_key_type)]`** on `crates/lucisv_server/src/rename.rs`, with the reason in a comment: `WorkspaceEdit.changes` is keyed by `lsp_types::Uri`, whose interior mutability is its own parse cache and takes no part in `Hash`/`Eq`. The map's shape is the protocol's, not ours. Checks at the end: `cargo fmt --all -- --check` clean, `cargo clippy --all-targets` silent (zero warnings, workspace-wide), -`cargo test --workspace` green — 55 in `vlog_refactor`, 212 in `vfmt_server`'s +`cargo test --workspace` green — 55 in `vlog_refactor`, 212 in `lucisv_server`'s unit suite, 12 e2e sessions, nothing else moved. No `unwrap`/`expect`/`panic!` and no `unsafe` in any library path of either crate (test modules only). @@ -486,13 +486,13 @@ Checks after the rework: `cargo fmt --all -- --check` clean, - `cargo test --workspace` — green, 0 failures across every crate. Counts match the Work log's claims: `vlog_refactor` 55 (14 unit incl. 8 masked-corruption attacks in `check.rs`, 39 behavior in `tests/rename.rs`, - 2 corpus), `vfmt_server` unit suite 212, `vfmt_server` e2e 12 sessions + 2 corpus), `lucisv_server` unit suite 212, `lucisv_server` e2e 12 sessions (`the_binary_serves_a_whole_session_over_stdio` and friends). - Spot-checked the "no `unwrap`/`expect`/`panic!`/`unsafe` in library paths" claim: the only `expect()` calls in `crates/vlog_refactor/src/check.rs` are inside `#[cfg(test)] mod tests` (lines 302-303, 380). None in - `crates/vfmt_server/src/rename.rs` outside its test module. The single - `#![allow(clippy::mutable_key_type)]` in `vfmt_server/src/rename.rs:13` + `crates/lucisv_server/src/rename.rs` outside its test module. The single + `#![allow(clippy::mutable_key_type)]` in `lucisv_server/src/rename.rs:13` carries the required explanatory comment (lines 8-12). All confirmed. - All three gates: **pass, claims confirmed.** @@ -664,7 +664,7 @@ implementation doesn't match its own contract. ### Real server binary over stdio -Built `target/debug/vfmt-server` and drove it directly with a hand-rolled +Built `target/debug/lucisv-server` and drove it directly with a hand-rolled LSP/stdio client (`initialize` → `initialized` → `didOpen` → `textDocument/rename` → `shutdown` → `exit`), not just the crate's Rust tests: @@ -678,7 +678,7 @@ tests: `WorkspaceEdit` with the edit range exactly `{18, 19}` on that line — the "a" and nothing else. Correct. - **Refusal case.** Same file, rename to `module` (a keyword). Got back a - JSON-RPC error, `code: -32803` (`RequestFailed`), `message: "vfmt: \`module\` + JSON-RPC error, `code: -32803` (`RequestFailed`), `message: "lucisv: \`module\` is a Verilog keyword."` — matches the documented `-32803` refusal convention exactly. @@ -744,7 +744,7 @@ named-`begin`) plus fork/join and interface, which round 1 didn't try: `module m; endmodule module other; endmodule : m` (the `: m` on `other` is already-illegal SV, since it doesn't match `other`) — renaming `m` leaves `other`'s `endmodule : m` **untouched**, with a warning naming it as "an - end label vfmt could not attach to its declaration." Correct: it must never + end label lucisv could not attach to its declaration." Correct: it must never attach by name. - The "redeclaration binds no symbol" case: `wire m; initial begin : m ... end : m` (a block label colliding with an existing net name — pre-existing @@ -813,7 +813,7 @@ and "the code path is actually reachable." Re-ran the round-1 repro (`` `define BUMP(x) x = x + 1`` / `` `BUMP(a)``, renaming `a`): now warned — "`a` appears in the arguments of the macro invocation `BUMP` at m.sv:4 and -was left unchanged; a macro invocation is one opaque token to vfmt, which +was left unchanged; a macro invocation is one opaque token to lucisv, which does not expand macros." Matches the dev's new test (`the_name_inside_a_macro_invocations_arguments_is_warned_about`). @@ -880,7 +880,7 @@ unchanged, and the fixes held. The `vlog_semantic` change is scoped exactly as narrow as the Handshakes section says (additive, one target variant, one helper, no `vlog_parser` change), and the remaining warned-not-fixed surface (hierarchical tails, `defparam` paths, mismatched/redeclared end -labels) is honestly disclosed and consistent with the "vfmt does not +labels) is honestly disclosed and consistent with the "lucisv does not preprocess / does not elaborate" boundary the umbrella already draws. ## Review diff --git a/docs/features/refactor/README.md b/docs/features/refactor/README.md index 679973f..6dbbc9b 100644 --- a/docs/features/refactor/README.md +++ b/docs/features/refactor/README.md @@ -2,7 +2,7 @@ This is the **umbrella plan** for porting the ideas of [rope](https://github.com/python-rope/rope) — Python's refactoring library — -to vfmt. It is the single source of truth for the refactoring roadmap: the +to lucisv. It is the single source of truth for the refactoring roadmap: the feature list below is the checklist the lead crosses off as milestones land and pass QA. Each milestone is implemented as its **own feature** with its own `docs/features//README.md`, per the repo's document-based workflow; this @@ -10,12 +10,12 @@ file links to them. ## Goal -Give vfmt the refactoring layer that ruff/Pylance users take for granted and +Give lucisv the refactoring layer that ruff/Pylance users take for granted and no Verilog tool ships well: rename that actually updates every reference across files, module signature changes (add/remove ports) that update every instantiation, and "module hinting" — instantiation skeletons generated from the module's real definition, the way type hints drive completion in Python. -All of it server-first (VS Code + Vim through the one `vfmt-server` binary), +All of it server-first (VS Code + Vim through the one `lucisv-server` binary), scoped by an explicit **filelist** when the user has one and by sensible defaults when they don't, and covered by the same never-corrupt-code contract as the formatter. @@ -142,7 +142,7 @@ Found by auditing the shipped capability set against the LSP end goal built but nothing consumes yet. Ordered by value ÷ cost: - [x] **Cross-file find-all-references** — `textDocument/references` is - still in-file only (nav.rs:50; vfmt-server README names it "not done"), + still in-file only (nav.rs:50; lucisv-server README names it "not done"), yet M2's rename already collects cross-file reference sets in `vlog_refactor`. Rename can change what references can't even list. Reuse M2's collection for the references answer — mostly wiring. @@ -171,8 +171,8 @@ built but nothing consumes yet. Ordered by value ÷ cost: multiply-driven: TODO.md §7 calls this the differentiation Verible cannot do, `vlog_semantic` has existed for rounds, and no semantic rule ships yet. -- [x] **CLI `-f` filelist flag** — the vfmt.toml `filelist` key and the - server consume M1's parser; `vfmt -f files.f` (format/lint exactly the +- [x] **CLI `-f` filelist flag** — the lucisv.toml `filelist` key and the + server consume M1's parser; `lucisv -f files.f` (format/lint exactly the project's files) still does not exist. - [x] **Single-step macro expansion on hover** — the define-table README promised it "later"; hover shows the body but expands nothing. @@ -189,7 +189,7 @@ corpus-check CI wiring, `--diff-base`, salsa (TODO.md §4–6). from a resolved reference span. Where resolution is honest about uncertainty (`InheritedCandidate`, ambiguous duplicates), the refactoring refuses rather than guesses — rope's "unsure matches" mode is *not* ported. -- vfmt does not preprocess. A rename target whose name also appears inside +- lucisv does not preprocess. A rename target whose name also appears inside a `` `define`` body or an `` `ifdef``-excluded region is reported as a warning on the response, and those occurrences are left untouched. - Verification budget: re-parsing every touched file after an edit is @@ -210,28 +210,28 @@ corpus-check CI wiring, `--diff-base`, salsa (TODO.md §4–6). `references_of`), `WorkspaceIndex` and `ExternalResolutions` read-only. Any resolution gap found while refactoring is filed against `vlog-semantic`, not patched around in the refactor crate. -- **`vfmt_server`**: owns only the protocol mapping (WorkspaceEdit, +- **`lucisv_server`**: owns only the protocol mapping (WorkspaceEdit, completion/snippet encoding, signature help); all edit *computation* lives in the new `vlog_refactor` crate so Vim gets identical behavior. -- **`vfmt_core`**: filelist parsing lives here (next to config/walk), so a +- **`lucisv_core`**: filelist parsing lives here (next to config/walk), so a future CLI `-f` flag reuses it unchanged. - **`vlog_formatter`**: not a dependency. Refactored output is *edited source*, not reformatted source — the user runs the formatter separately. (Keeps refactor edits minimal and reviewable, and keeps the formatter's safety net out of scope.) -- **`editors/vscode`**: new setting `vfmt.filelist` (string path, default - empty) forwarded like the existing `vfmt.*` settings. +- **`editors/vscode`**: new setting `lucisv.filelist` (string path, default + empty) forwarded like the existing `lucisv.*` settings. ## Milestones Each is one feature dir, one dev agent, one QA pass, one lead review, one commit — in order: -1. **M1 `filelist`** — `.f` parsing in `vfmt_core` (paths, `-f` nesting with +1. **M1 `filelist`** — `.f` parsing in `lucisv_core` (paths, `-f` nesting with cycle detection, `+incdir+`/`+define+` recorded, `#`//`//` comments, `$VAR`/`${VAR}` expansion; unknown `+args`/`-flags` skipped with a warning), server scope resolution (filelist ⊃ workspace walk ⊃ - current-file directory), `vfmt.filelist` VS Code setting + vfmt.toml + current-file directory), `lucisv.filelist` VS Code setting + lucisv.toml `filelist` key. 2. **M2 `refactor-rename`** — new crate `vlog_refactor` with the edit-plan model (`RefactorEdit { file → Vec }`, verification by @@ -288,10 +288,10 @@ commit — in order: is. Workspace suite grew 1007 → 1232 tests. Backlog triage is the next session's first task. - **2026-08-24 (lead)**: Umbrella plan created from the rope overview docs - and the current state of `vlog_semantic`/`vfmt_server`/`WorkspaceIndex`. + and the current state of `vlog_semantic`/`lucisv_server`/`WorkspaceIndex`. Key decisions: server-first (no CLI surface yet), semantic-resolution-only edits (no textual fallback), whole-edit-or-nothing verification by - re-parse, filelist in `vfmt_core`, rope's history/restructure explicitly + re-parse, filelist in `lucisv_core`, rope's history/restructure explicitly not ported. Milestone READMEs are created by their dev agents. ## QA log diff --git a/docs/features/references-nav/README.md b/docs/features/references-nav/README.md index 155d999..7a089e4 100644 --- a/docs/features/references-nav/README.md +++ b/docs/features/references-nav/README.md @@ -8,7 +8,7 @@ milestone taken from that plan's "LSP-parity and plumbing gaps" triage. Three navigation capabilities that were all wiring over machinery the tree already had. **Cross-file find-all-references**: `textDocument/references` answered in-file only, while M2's rename had been collecting cross-file -reference sets since it shipped — so vfmt could *change* references it could +reference sets since it shipped — so lucisv could *change* references it could not *list*. **Document highlight for symbols**: the cursor on a signal now highlights its declaration and every use in the file, where before only a `begin`/`end` pair answered and everything else fell through to the editor's @@ -28,7 +28,7 @@ predicate, and three handlers. layer. Consequence: a declaration the index has not seen yet (a buffer edited but not saved, when the file is new) is answered in-file until the next rebuild. That is the same staleness window every other cross-file - answer already has, documented in `docs/features/vfmt-server/README.md`. + answer already has, documented in `docs/features/lucisv-server/README.md`. - **A references answer costs what a rename costs.** The cross-file path calls `Workspace::sources()`, which re-reads every in-scope file, and then re-analyzes the files that spell the name. Measured at 218 ms over the @@ -80,10 +80,10 @@ out of `collect_edits`, which now calls it and turns the spans into edits. spans. The alternative considered was lifting the walk into `vlog_semantic`; it was rejected because the walk is not a semantic query — it needs the `Scope` cache, the workspace overlay *per file*, and the ambiguity policy, -all of which are refactor-crate concerns, and `vfmt_server` already depends +all of which are refactor-crate concerns, and `lucisv_server` already depends on `vlog_refactor`. Copy-pasting the walk into the server was never on the table: a references list that disagreed with what a rename would touch is a -lie about what vfmt is going to do. +lie about what lucisv is going to do. **Consumed from `vlog_semantic`** (all pre-existing, nothing requested): `Semantics::{reference_at, reference_id_at, references_of, symbol, symbol_at, @@ -96,7 +96,7 @@ scope}`, `Scope::owner`, `Symbol::{name, scope, name_span}`, **Consumed from this crate's own `pairs.rs`**: `analyze(&[Token]) -> ScopeAnalysis`, unchanged. `folding.rs` is its fourth consumer -(`documentHighlight`, the missing-closer warnings, `vfmt/scopePairs`, folding) +(`documentHighlight`, the missing-closer warnings, `lucisv/scopePairs`, folding) and reads only `pairs`, never `unmatched_open`/`unmatched_close`. **Promised to the editors**: nothing new to configure. `foldingRange` is a @@ -123,7 +123,7 @@ and none was made. - [x] `foldingRangeProvider` advertised in `main.rs`. - [x] e2e: one session covering cross-file references (both `includeDeclaration` values), `foldingRange` and `documentHighlight`. -- [x] `docs/features/vfmt-server/README.md`: capability table, the "not done" +- [x] `docs/features/lucisv-server/README.md`: capability table, the "not done" list, and Handshakes updated. - [ ] **Not done, deliberately:** line-comment run folding (`//` blocks). The token stream carries each `//` comment separately, so folding a *run* of @@ -145,7 +145,7 @@ and none was made. ### 2026-08-24 — dev agent (M7) - **Read first**: `CLAUDE.md`, `docs/features/refactor/README.md`'s triage, - `docs/features/vfmt-server/README.md` in full, then `nav.rs`, `pairs.rs`, + `docs/features/lucisv-server/README.md` in full, then `nav.rs`, `pairs.rs`, `state.rs`, `server.rs`, `main.rs`, `vlog_refactor/src/rename.rs` and `vlog_semantic`'s `workspace.rs`/`model.rs`. The design decisions below all came out of that reading rather than out of the brief. @@ -169,7 +169,7 @@ and none was made. - **`documentHighlight` gained a second answer rather than a second handler.** `pairs::highlights` is tried first and `nav::document_highlights` second; both return `Option`, and both `None` means `null`, which is what - keeps the editor's own word highlighting alive where vfmt knows nothing. + keeps the editor's own word highlighting alive where lucisv knows nothing. The two never compete: a scope keyword is never an identifier. - **Folding stops one line short of the closer** (`endLine = close line - 1`). LSP hides `startLine + 1 ..= endLine`, so this leaves `end`/`endmodule` on @@ -194,20 +194,20 @@ and none was made. inside the 1 s budget the brief set. - **No new dependencies.** No `unsafe`, no `unwrap`/`expect`/`panic!` outside `#[cfg(test)]`, no new `#[allow]`. -- Did not touch `vlog_parser`, `vlog_formatter`, `vlog_linter`, `vfmt_core`, - `crates/vfmt`, `editors/`, `TODO.md` or the umbrella plan. Did not run +- Did not touch `vlog_parser`, `vlog_formatter`, `vlog_linter`, `lucisv_core`, + `crates/lucisv`, `editors/`, `TODO.md` or the umbrella plan. Did not run `git commit`/`git push`. No version bump (0.5.0 is M14's). **Results.** `cargo fmt --all -- --check`: clean. `cargo clippy --all-targets`: 0 warnings. `cargo test --workspace`: **1329 passed, 0 failed**, of which **34 are new**: 15 in `folding.rs`, 11 added to `nav.rs` (20 there in total), 7 in `references.rs`, and 1 e2e (18 in that file now). -`node editors/vscode/smoke.js target/release/vfmt-server`: OK. +`node editors/vscode/smoke.js target/release/lucisv-server`: OK. Files added: `crates/vlog_refactor/src/references.rs`, -`crates/vfmt_server/src/folding.rs`, this README. Files edited: +`crates/lucisv_server/src/folding.rs`, this README. Files edited: `crates/vlog_refactor/src/{lib.rs,rename.rs}`, -`crates/vfmt_server/src/{main.rs,server.rs,nav.rs}`, -`crates/vfmt_server/tests/e2e.rs`, `docs/features/vfmt-server/README.md`. +`crates/lucisv_server/src/{main.rs,server.rs,nav.rs}`, +`crates/lucisv_server/tests/e2e.rs`, `docs/features/lucisv-server/README.md`. ## QA log @@ -221,7 +221,7 @@ Files added: `crates/vlog_refactor/src/references.rs`, - `cargo test --workspace` — **1329 passed, 0 failed**, matching the Work log's count exactly, before I added one regression test (see below); 1330 after. -- `node editors/vscode/smoke.js target/release/vfmt-server` — OK. +- `node editors/vscode/smoke.js target/release/lucisv-server` — OK. - `cargo test -p vlog_refactor` standalone — **48/48** rename behavior tests green (`tests/rename.rs`), confirming the `collect_edits`/ `collect_occurrences` split changed nothing rename depends on. @@ -270,7 +270,7 @@ removed after the round, not committed) exercising the public API directly: `find_references(..., include_declaration: true)` are **identical** after sorting. Spot-checked in code, not just eyeballed. -#### Attempts to break it (`vfmt_server::nav`, handler level) +#### Attempts to break it (`lucisv_server::nav`, handler level) Six scratch tests added temporarily to `nav.rs`'s own test module, run, then removed (`git diff --stat` on `nav.rs` returned to the dev's exact @@ -310,7 +310,7 @@ removed (`git diff --stat` on `nav.rs` returned to the dev's exact **Fix applied (small, unambiguous per CLAUDE.md's QA license):** added `a_name_declared_in_two_files_degrades_references_to_the_in_file_answer` to -`crates/vfmt_server/src/nav.rs` (permanent, not a probe) — the one claim +`crates/lucisv_server/src/nav.rs` (permanent, not a probe) — the one claim above that had behavior verified correct but zero regression coverage. Workspace test count is now 1330 (was 1329), gates re-run green after the addition. @@ -404,13 +404,13 @@ is a completely ordinary real-world query, not an edge case. "820 source files indexed"; the Assumptions section separately says "the 860-file corpus". A plain `find` over `corpus/` for `.v`/`.sv`/`.svh`/`.vh` returns exactly **860**, matching every earlier round's number for this same -directory (`docs/features/vfmt-server/README.md`'s QA log, 2026-08-19: "860 +directory (`docs/features/lucisv-server/README.md`'s QA log, 2026-08-19: "860 files"). `corpus/` itself is listed in the repo's own `.gitignore`, but the LSP root was pointed *at* `corpus/`, so that rule is moot; however `corpus/` contains **19 nested `.gitignore` files** from the vendored upstream repos themselves (`corpus/ibex/.gitignore`, `corpus/opentitan/.gitignore`, etc.), and the workspace walk has honored `.gitignore` unconditionally since -`vfmt-core-lift` landed the same day as this round. So 820 vs. 860 is +`lucisv-core-lift` landed the same day as this round. So 820 vs. 860 is plausibly real — some vendored generated/build files are legitimately excluded now that they weren't when the 860 number was first measured — but I could not independently confirm 820 exactly: LSP exposes no diff --git a/docs/features/release-prep/README.md b/docs/features/release-prep/README.md index 3d2a055..1e1e8d8 100644 --- a/docs/features/release-prep/README.md +++ b/docs/features/release-prep/README.md @@ -2,9 +2,9 @@ ## Goal -Make vfmt a thing that can be *handed to someone* rather than a working tree: +Make lucisv a thing that can be *handed to someone* rather than a working tree: a real `LICENSE`, a user-facing `CHANGELOG.md` for **0.2.0**, one version -number that actually reaches `vfmt --version` and the language server's +number that actually reaches `lucisv --version` and the language server's `serverInfo`, a `tools/release.sh` that turns a clean tree into `dist/{binaries, .vsix, SHA256SUMS}` with nothing but cargo, npm and `shasum`, and a `tools/RELEASING.md` that says where every one of those numbers lives. @@ -23,7 +23,7 @@ a Handshake request to the repo root. in two files if so: `LICENSE` and its copy `editors/vscode/LICENSE`. - **0.2.0 is the first release.** There are no git tags and no prior changelog; `0.1.0` was the workspace's initial version number and was never tagged or - distributed. So the changelog describes vfmt as it stands rather than a delta + distributed. So the changelog describes lucisv as it stands rather than a delta against a shipped predecessor, and says so in its own text. - **The `LICENSE` copy under `editors/vscode/` is a real file, not a symlink.** `vsce` requires the file next to `package.json`, and a symlink is one more @@ -36,7 +36,7 @@ a Handshake request to the repo root. - **`dist/` is disposable.** The script `rm -rf`s and recreates it, and it is gitignored. Nothing should ever be authored there. - **The binaries are the authority on the version**, not `Cargo.toml`: - `release.sh` reads `vfmt --version` from the binary it just built, so a + `release.sh` reads `lucisv --version` from the binary it just built, so a stale build can never be labeled with a fresh version number. ## Handshakes @@ -47,7 +47,7 @@ a Handshake request to the repo root. against the freshly copied server binary before packaging anything. Contract used: `node smoke.js ` exits 0 on a healthy binary, non-zero otherwise. If that script's argument shape changes, `release.sh` changes with it. -- `crates/vfmt`'s `--version` output format: `vfmt ` on one line, with +- `crates/lucisv`'s `--version` output format: `lucisv ` on one line, with the version in field 2. `release.sh` parses it with `awk '{print $2}'`. - `editors/vscode/.vscodeignore` — still the thing that keeps `smoke.js` out of the package; the script does not re-implement it, it verifies the result. @@ -59,13 +59,13 @@ a Handshake request to the repo root. `editors/vscode/package-lock.json`) and nowhere in Rust source. Anyone adding a hard-coded version string breaks that promise and should update `tools/RELEASING.md` §1 in the same change. -- `tools/release.sh`'s output layout (`dist/vfmt--`, - `dist/vfmt-server--`, `dist/vfmt-.vsix`, +- `tools/release.sh`'s output layout (`dist/lucisv--`, + `dist/lucisv-server--`, `dist/lucisv-.vsix`, `dist/SHA256SUMS`) is what `README.md` and `tools/RELEASING.md` document. **Requested of other modules:** none. Nothing under `crates/` was modified — the serverInfo version wire the brief flagged as "wire if trivial" turned out -to already exist (`crates/vfmt_server/src/main.rs:98` uses +to already exist (`crates/lucisv_server/src/main.rs:98` uses `env!("CARGO_PKG_VERSION")`), so the workspace bump reached it for free. ## Status / TODO @@ -79,8 +79,8 @@ to already exist (`crates/vfmt_server/src/main.rs:98` uses - [x] Version bumped to **0.2.0**: `Cargo.toml` `[workspace.package]` (all seven crates inherit), `Cargo.lock`, `editors/vscode/package.json`, `editors/vscode/package-lock.json` (both entries). -- [x] `vfmt --version` → `vfmt 0.2.0`; `initialize` → `serverInfo` → - `{"name":"vfmt-server","version":"0.2.0"}`, checked over the wire. +- [x] `lucisv --version` → `lucisv 0.2.0`; `initialize` → `serverInfo` → + `{"name":"lucisv-server","version":"0.2.0"}`, checked over the wire. - [x] `tools/release.sh` — host-target release build, smoke test, `.vsix`, `SHA256SUMS`, into `dist/`. Std tooling only, no new dependency. - [x] `tools/RELEASING.md` — bump locations, gate, artifacts, `.vsix` details @@ -102,7 +102,7 @@ to already exist (`crates/vfmt_server/src/main.rs:98` uses - [ ] **Not done, deliberately:** cross-compiled binaries, a release tarball layout, CI packaging, and signing/notarization. Each is a real project with a dependency behind it; none is needed to hand someone a binary. -- [ ] **Not verified here:** `code --install-extension dist/vfmt-0.2.0.vsix`. +- [ ] **Not verified here:** `code --install-extension dist/lucisv-0.2.0.vsix`. Installing into the user's editor is a change to their environment, not a validation step — the same line editor-packaging's dev round drew. The package was built and its contents inspected instead. @@ -123,7 +123,7 @@ to already exist (`crates/vfmt_server/src/main.rs:98` uses harmless and pre-existing; removing them would be a change nobody asked for). What I did keep in `editors/vscode/README.md` is a **correctness** edit, not a marketing one: its install block still said `--skip-license` and - `vfmt-0.1.0.vsix`, both of which are now false. + `lucisv-0.1.0.vsix`, both of which are now false. - **The `LICENSE` closed an open Handshake, not just a checkbox.** `docs/features/editor-packaging/README.md` filed "Repo root: no `LICENSE` file exists" as a request, and its README and the top-level README both @@ -131,11 +131,11 @@ to already exist (`crates/vfmt_server/src/main.rs:98` uses in `editors/vscode/`, `npx @vscode/vsce package` runs clean and ships `extension/LICENSE.txt` — confirmed in the built package, not assumed. - **No version string was hard-coded anywhere, and none had to be added.** - `vfmt --version` and `ServerInfo.version` both already read + `lucisv --version` and `ServerInfo.version` both already read `env!("CARGO_PKG_VERSION")`, and all seven crates use `version.workspace = true`, so the bump is genuinely one line plus the two lockfiles. I checked for version-asserting tests before bumping (the brief - warned some might exist): `crates/vfmt_server/tests/e2e.rs:393` asserts + warned some might exist): `crates/lucisv_server/tests/e2e.rs:393` asserts `serverInfo.name` only, and no test anywhere matches `0.1.0`. Nothing needed fixing, and nothing under `crates/` was touched — the concurrent parser/formatter round's files are untouched by me. @@ -148,8 +148,8 @@ to already exist (`crates/vfmt_server/src/main.rs:98` uses release script that ships an untested binary is a release script that ships a broken one eventually. If `node` is absent the script says so on stderr and continues rather than failing — the binaries are still valid artifacts. -- **The checksum line is explicit, not a glob.** `shasum -a 256 vfmt-*` would - have matched `vfmt-server-*` twice and raced the `> SHA256SUMS` redirect +- **The checksum line is explicit, not a glob.** `shasum -a 256 lucisv-*` would + have matched `lucisv-server-*` twice and raced the `> SHA256SUMS` redirect against its own glob; the script builds the file list by name instead. - **The `vsce` sandbox-path failure is documented where someone will hit it.** editor-packaging's QA traced it (vsce shells out to `npm list --parseable` @@ -180,25 +180,25 @@ to already exist (`crates/vfmt_server/src/main.rs:98` uses | Check | Result | |---|---| | `tools/release.sh` end to end | exit 0, all four artifacts produced | -| `target/release/vfmt --version` | `vfmt 0.2.0` | -| `initialize` → `serverInfo` (hand-driven LSP session over stdio) | `{"name":"vfmt-server","version":"0.2.0"}`, exit 0 | -| `node smoke.js dist/vfmt-server-0.2.0-aarch64-apple-darwin` | `smoke: OK` — 3 messages, exit 0 | +| `target/release/lucisv --version` | `lucisv 0.2.0` | +| `initialize` → `serverInfo` (hand-driven LSP session over stdio) | `{"name":"lucisv-server","version":"0.2.0"}`, exit 0 | +| `node smoke.js dist/lucisv-server-0.2.0-aarch64-apple-darwin` | `smoke: OK` — 3 messages, exit 0 | | `npx @vscode/vsce package` **without** `--skip-license` | packaged, 321 files, 463.1 KB | | `.vsix` contains `extension/LICENSE.txt` | yes, 1062 bytes (the MIT text) | | `.vsix` contains `smoke.js` | no (`unzip -l \| grep -c smoke.js` → 0) | | `cd dist && shasum -a 256 -c SHA256SUMS` | 3/3 OK | -| `git check-ignore dist/vfmt-0.2.0.vsix` | ignored via `.gitignore:4:/dist` | +| `git check-ignore dist/lucisv-0.2.0.vsix` | ignored via `.gitignore:4:/dist` | | `cargo test --workspace` | **589 passed, 0 failed**, exit 0 | | `cargo fmt --check` | exit 0 | | `cargo clippy --all-targets` | exit 0, zero warnings | -**Artifacts (aarch64-apple-darwin, vfmt 0.2.0):** +**Artifacts (aarch64-apple-darwin, lucisv 0.2.0):** | File | Bytes | SHA-256 | |---|---|---| -| `vfmt-0.2.0-aarch64-apple-darwin` | 1,292,080 | `5a0c9d7ad936230461be163efdfec8b654c5c49e3efcd19641a8d091014083aa` | -| `vfmt-server-0.2.0-aarch64-apple-darwin` | 2,211,072 | `ab3a5d8acb19bc5ec692ac0150b3f0d475e5a7d4a160d20255a2bb2ded5d0e09` | -| `vfmt-0.2.0.vsix` | 474,214 | `1c9493d2225d5766e930b089de38ab7213478f150619a81f46ec84a4f2771afe` | +| `lucisv-0.2.0-aarch64-apple-darwin` | 1,292,080 | `5a0c9d7ad936230461be163efdfec8b654c5c49e3efcd19641a8d091014083aa` | +| `lucisv-server-0.2.0-aarch64-apple-darwin` | 2,211,072 | `ab3a5d8acb19bc5ec692ac0150b3f0d475e5a7d4a160d20255a2bb2ded5d0e09` | +| `lucisv-0.2.0.vsix` | 474,214 | `1c9493d2225d5766e930b089de38ab7213478f150619a81f46ec84a4f2771afe` | (The `.vsix` hash is not reproducible across runs — a zip embeds mtimes — so it identifies one build, not the source it came from.) @@ -242,13 +242,13 @@ happened when I exercised `tools/release.sh` anyway. `publisher` is still the literal string `REPLACE-ME`; `categories`, `repository` etc. are untouched (pre-existing, not added this round). `git diff editors/vscode/README.md` is exactly the three claimed edits: -`--skip-license` removed, `vfmt-0.1.0.vsix` → `vfmt-0.2.0.vsix`, and a new +`--skip-license` removed, `lucisv-0.1.0.vsix` → `lucisv-0.2.0.vsix`, and a new "sideloading is the supported install" paragraph — no marketplace-audience restructuring. Marketplace commands (`vsce publish`, `ovsx publish`) appear only inside `tools/RELEASING.md`'s `## Appendix — if the owner ever publishes to a marketplace` section, explicitly headed "Optional and deferred." Independent corroboration: sideloading the built `.vsix` (see job below) -resolved the extension id as `replace-me.vfmt@0.2.0` — the placeholder is +resolved the extension id as `replace-me.lucisv@0.2.0` — the placeholder is live, not just present in the source file. **2. Artifacts — PASS**, checked against the dist/ state as left by the dev, @@ -257,17 +257,17 @@ before I ran anything myself: `dist/SHA256SUMS` matched the work-log table character for character (`5a0c9d7a…83aa`, `ab3a5d8a…d5d0e09`, `1c9493d2…2771afe`), as did all three file sizes (1,292,080 / 2,211,072 / 474,214 bytes). -- `unzip -l dist/vfmt-0.2.0.vsix` → exactly `321 files`; `extension/LICENSE.txt` +- `unzip -l dist/lucisv-0.2.0.vsix` → exactly `321 files`; `extension/LICENSE.txt` present at exactly `1062` bytes; `grep -c smoke.js` over the listing → `0`. -- `unzip -p dist/vfmt-0.2.0.vsix extension/readme.md | diff - editors/vscode/README.md` +- `unzip -p dist/lucisv-0.2.0.vsix extension/readme.md | diff - editors/vscode/README.md` → identical. The hand-repackage claim (vsix readme matches the *current* vscode README, not the one from the full script run) checks out. **3. Version — PASS.** -`dist/vfmt-0.2.0-aarch64-apple-darwin --version` → `vfmt 0.2.0`. Hand-rolled a +`dist/lucisv-0.2.0-aarch64-apple-darwin --version` → `lucisv 0.2.0`. Hand-rolled a minimal LSP client (Python, framed `initialize` over stdio) against -`dist/vfmt-server-0.2.0-aarch64-apple-darwin`: `serverInfo` came back -`{"name":"vfmt-server","version":"0.2.0"}` — confirms the claim independent of +`dist/lucisv-server-0.2.0-aarch64-apple-darwin`: `serverInfo` came back +`{"name":"lucisv-server","version":"0.2.0"}` — confirms the claim independent of the smoke test, which doesn't check `serverInfo` at all. All seven `crates/*/Cargo.toml` have `version.workspace = true` (grepped each file by hand). `Cargo.lock` shows `version = "0.2.0"` for all seven workspace crates @@ -293,8 +293,8 @@ described. **6. RELEASING.md — PASS**, one non-blocking note. §1's four bump locations match reality; a repo-wide `git grep -n "0\.1\.0"` turned up exactly one hit outside `Cargo.lock`, and it is not a checklist -gap: `docs/features/vfmt-core-lift/README.md:399` quotes an *illustrative* -`cargo tree` example (`vfmt_core v0.1.0 (...)`) inside a different, older +gap: `docs/features/lucisv-core-lift/README.md:399` quotes an *illustrative* +`cargo tree` example (`lucisv_core v0.1.0 (...)`) inside a different, older feature's doc prose — not a version string any tool reads or ships. Leaving it as an FYI for whoever next touches that doc, not filing it as a release-prep defect. The sandbox-path `vsce` warning is present in @@ -321,10 +321,10 @@ this isn't a false claim, just worth knowing before running it offline. **Additional jobs:** - **Sideload dry run — did the real install, not just unzip-inspection**, since it's cheaply reversible: `code --install-extension - dist/vfmt-0.2.0.vsix` → "successfully installed"; `code --list-extensions - --show-versions` showed `replace-me.vfmt@0.2.0`; `code --uninstall-extension - replace-me.vfmt` → "successfully uninstalled", confirmed gone from the list - afterward. What a user would see: VS Code installs and activates "vfmt — + dist/lucisv-0.2.0.vsix` → "successfully installed"; `code --list-extensions + --show-versions` showed `replace-me.lucisv@0.2.0`; `code --uninstall-extension + replace-me.lucisv` → "successfully uninstalled", confirmed gone from the list + afterward. What a user would see: VS Code installs and activates "lucisv — Verilog/SystemVerilog" with no publisher verification badge (since `REPLACE-ME` isn't a real Marketplace identity) — consistent with a sideload-only extension, nothing more. @@ -336,14 +336,14 @@ this isn't a false claim, just worth knowing before running it offline. concurrently-running parser/formatter round (touched exactly the files that round's own compile errors pointed at, see below), none of them plausibly a release-prep edit (no version strings, no CLI/LSP wiring in the diffs). - `crates/vfmt`, `crates/vfmt_server`, `crates/vfmt_core`, `crates/vlog_linter` + `crates/lucisv`, `crates/lucisv_server`, `crates/lucisv_core`, `crates/vlog_linter` and `crates/vlog_semantic` show no pending changes at all. **Honesty note — what I did to the tree, and why the dist/ hashes above are "as of the start of QA", not "as of right now".** After validating the original `dist/` (all results above are against that original build), I -attempted a compile as instructed. `cargo build --release -p vfmt -p -vfmt_server` happened to succeed on the first try (18s, clean). Following the +attempted a compile as instructed. `cargo build --release -p lucisv -p +lucisv_server` happened to succeed on the first try (18s, clean). Following the brief's instruction to attempt `tools/release.sh` end-to-end once, I ran it: it failed with a real error, `crates/vlog_parser/src/parser.rs:3109`, `at_postfix_segment` called with 0 args against a 1-arg signature — a @@ -355,7 +355,7 @@ once" and a failure isn't informative about the actual release path, I ran it a second time a few minutes later; by then the concurrent round had apparently moved past that error, and it succeeded end-to-end, **which overwrote `dist/` with a fresh build**. I re-validated that new output for self-consistency -(`shasum -c` 3/3 OK against its own new `SHA256SUMS`, `--version` → `vfmt +(`shasum -c` 3/3 OK against its own new `SHA256SUMS`, `--version` → `lucisv 0.2.0`, vsix still 321 files / no smoke.js / `LICENSE.txt` present) — the script still produces a correct, internally consistent release even against a tree that moved under it. But the specific hashes quoted in the Work log @@ -371,7 +371,7 @@ gates, per the brief. ## Review -**2026-08-19 — lead. Verdict: accepted and committed. vfmt 0.2.0 is a +**2026-08-19 — lead. Verdict: accepted and committed. lucisv 0.2.0 is a buildable, checksummed, sideloadable release — publishing stays fully optional per the owner, and nothing was published anywhere.** @@ -381,7 +381,7 @@ Points reviewed and accepted: arrived before any marketplace polish was written, the README edit that did ship is correctness-only (the stale `--skip-license` and versioned-vsix references), and QA corroborated the placeholder - publisher live (`replace-me.vfmt@0.2.0` on a real + publisher live (`replace-me.lucisv@0.2.0` on a real install/uninstall cycle). 2. **The LICENSE closing the vsce handshake** (packaging now runs without `--skip-license`) resolves the last open item from diff --git a/docs/features/safety-net/README.md b/docs/features/safety-net/README.md index 6f7a3b4..e83f79a 100644 --- a/docs/features/safety-net/README.md +++ b/docs/features/safety-net/README.md @@ -2,7 +2,7 @@ ## Goal -Make "vfmt can never corrupt code" a *runtime* guarantee instead of a +Make "lucisv can never corrupt code" a *runtime* guarantee instead of a test-suite property. Every call to `format_source()` re-lexes its own output and compares the token stream (comments included) against the input, then formats the output a second time and checks for a fixed @@ -48,7 +48,7 @@ This is TODO.md §1's first three items, and mirrors what Verible does in ## Consequence: known formatter bugs now refuse to produce output The safety net does not fix formatting bugs, it *stops* them. Three -already-known bugs (all marked `#SKIP` in `tests/cases/`) now make vfmt +already-known bugs (all marked `#SKIP` in `tests/cases/`) now make lucisv report an error and leave the file untouched instead of writing bad output: @@ -67,7 +67,7 @@ output: token stream and are caught the same way if they cross a token. This is the intended contract (hard invariant 1: no partial output), but -it is a visible behavior change: files that vfmt used to rewrite badly +it is a visible behavior change: files that lucisv used to rewrite badly are now refused with exit code 2. ## Handshakes @@ -93,7 +93,7 @@ are now refused with exit code 2. comment before re-indenting it. Recording the original column — or the byte span TODO.md §6 wants anyway — would let the comment-formatting bug above be fixed properly. -- **`crates/vfmt/src/main.rs`** needed no structural change: it already +- **`crates/lucisv/src/main.rs`** needed no structural change: it already treats a `format_source` error as "report, skip the file, exit 2". Two cosmetic edits only — a space after the filename in the error line, and the summary now says "failed to format" instead of "failed @@ -203,11 +203,11 @@ gap fixed directly. **PASS**. Read `format_source` (`crates/vlog_formatter/src/format.rs:62-68`): unconditionally calls `verify_equivalence` then `verify_convergence` after every `format_once`; both are `?`-propagated, no bypass path, no -config flag to skip it. `crates/vfmt/src/main.rs:165-187`: `fs::write` +config flag to skip it. `crates/lucisv/src/main.rs:165-187`: `fs::write` is only reached after a successful `format_source`, so any `FormatError` (source or verification) leaves the file alone; error path increments `errors` and hits `ExitCode::from(2)` at line 210. -Confirmed live with the real CLI (`target/debug/vfmt`, built from this +Confirmed live with the real CLI (`target/debug/lucisv`, built from this tree) — see the two bug repros below, both exit 2 with byte-identical files (`cmp` confirms). @@ -271,12 +271,12 @@ files (`cmp` confirms). **Claim 3 (catches the two pre-existing bugs)** — **PASS**, confirmed end-to-end with the real CLI, not just unit tests: - `end : label` drop: `module m; initial begin : blk x = 1; end : blk - endmodule` → `vfmt` prints `verification failed: token stream + endmodule` → `lucisv` prints `verification failed: token stream diverges at index 12: input has symbol ':' at 4:7, output has keyword 'endmodule' at 5:1`, exit code 2, `cmp` confirms the file is byte-identical to the original afterward. - Block comment reindent non-convergence: a 3-line indented `/* one / - two / three */` comment → `vfmt` prints `verification failed: + two / three */` comment → `lucisv` prints `verification failed: formatting is not idempotent; line 3 changed from " two" to " two"`, exit code 2, file byte-identical afterward. @@ -290,7 +290,7 @@ list — makes the real formatter drop the comment. Root cause: discards whatever leading comments were attached to those tokens (the AST variant carries no comment field), and `crates/vlog_formatter/src/format.rs:1111` always prints `SensList::Star` -as the canonical `@(*)`. Reproduced live: `target/debug/vfmt` on a file +as the canonical `@(*)`. Reproduced live: `target/debug/lucisv` on a file containing `always @( /* comment inside sensitivity list */ * ) y = a;` exits 2 with `token stream diverges at index 5: input has symbol '(' at 2:11, output has symbol '*' at 2:12`, file left untouched. This is not @@ -320,9 +320,9 @@ change, out of this feature's scope). and `cargo test -p vlog_formatter --test verification` after the change: still 0 diffs, still 19/19 passing. - No new dependencies: confirmed by reading all three `Cargo.toml` - files (`vlog_parser`, `vlog_formatter`, `vfmt`) — `vlog_parser` has + files (`vlog_parser`, `vlog_formatter`, `lucisv`) — `vlog_parser` has zero dependencies, `vlog_formatter` depends only on `vlog_parser` via - a path dependency, `vfmt` depends only on both via path. Matches the + a path dependency, `lucisv` depends only on both via path. Matches the "no new deps" implicit claim. - README sections: all six required sections present (Goal, Assumptions, Handshakes, Status/TODO, Work log, QA log); Assumptions @@ -334,7 +334,7 @@ change, out of this feature's scope). than being swallowed as an attribute). **Performance** — sane, not pathological. `tests/fixtures/` is 4 files, -215 lines total. 200 sequential `target/release/vfmt --check` process +215 lines total. 200 sequential `target/release/lucisv --check` process invocations over all 4 files completed in 0.71s wall time (~3.5ms per invocation, including process startup, parsing+printing+re-lexing the input twice and re-parsing+printing once more per file). No fixture diff --git a/docs/features/semantic-lints/README.md b/docs/features/semantic-lints/README.md index 98a90ce..967c360 100644 --- a/docs/features/semantic-lints/README.md +++ b/docs/features/semantic-lints/README.md @@ -2,13 +2,13 @@ ## Goal -The first three lint rules vfmt writes against the *symbol table* rather than +The first three lint rules lucisv writes against the *symbol table* rather than the syntax tree (TODO.md §8, M12): `unused-signal`, `undriven-net` and `multiply-driven`. TODO.md §7's non-goal — "no semantic claims in v1 lint rules; semantic rules only after `vlog_semantic` exists" — is crossed here, which is the whole point: these are the rules Verible structurally cannot write, because each one needs to know which declaration a name refers to. The -round also wires the analysis into `LintContext` so `vfmt check` and the +round also wires the analysis into `LintContext` so `lucisv check` and the language server both reach it through the existing one-parse path, and pays for it only when a semantic rule actually runs. @@ -33,14 +33,14 @@ listed as a decision rather than left implicit. `clocking` block's signals, and the implicit `.name` connection form. - **A name a macro, a compiler directive, an attribute, a verbatim block (`constraint`/`covergroup`/concurrent assertion) or an unparsed region - mentions is dropped from every judgement.** vfmt does not expand macros and + mentions is dropped from every judgement.** lucisv does not expand macros and does not evaluate directives, so what those regions do to a signal is unknowable. This is measured, not theoretical: it is what keeps `` `ASSERT_KNOWN(FooKnown_A, foo) `` from making `foo` look unused. - **A module that hides code is not judged at all.** Two ways to hide it: an instance connected with `.*` (which reads and drives same-named signals without writing any of their names down) and an `` `include`` written - *inside* the module body (arbitrary code vfmt does not follow — this is + *inside* the module body (arbitrary code lucisv does not follow — this is exactly how `prim_rom.sv` loads its memory array). A file-level `` `include`` does not blind anything: it brings in macro definitions, and any macro *use* is already guarded above. @@ -60,9 +60,9 @@ listed as a decision rather than left implicit. - **The intentionally-unused convention is Verilator's, not Verible's.** Verible has no unused-signal rule to be compatible with, so there is no Verible spelling to match. Verilator's `--unused-regexp` defaults to - `*unused*`; vfmt exempts a name containing `unused` (case-insensitive) or + `*unused*`; lucisv exempts a name containing `unused` (case-insensitive) or starting with `_`. It is not configurable this round — that waits on the - `lint` key in `vfmt.toml`, like every other rule setting. + `lint` key in `lucisv.toml`, like every other rule setting. - **`analyze` is exact enough to lint on.** The `vlog-semantic` corpus test asserts every one of its 95 193 name spans slices back to the name it claims; these rules trust `references_of` for "is this used" and the @@ -103,7 +103,7 @@ listed as a decision rather than left implicit. `with_semantics(&Semantics)` (lends a caller's). `from_parse`'s signature is **unchanged**, so no existing caller had to move. - The analysis is lazy: a `LintContext` on which no semantic rule ever runs - never calls `analyze`. Measured — a default `vfmt check` over the corpus is + never calls `analyze`. Measured — a default `lucisv check` over the corpus is byte-identical and time-identical to the one before this round. - The signal table is built once per context and shared by all three rules, so enabling three costs what enabling one costs. Also measured. @@ -118,7 +118,7 @@ listed as a decision rather than left implicit. than attempted: it changes a rule from single-file to project-wide, which is a design decision, not a patch. - *config-discovery's owner*: the intentionally-unused convention wants to be - a `vfmt.toml` setting (`[lint.unused-signal] ignore = "..."`), for the same + a `lucisv.toml` setting (`[lint.unused-signal] ignore = "..."`), for the same reason the naming styles do. Restated, unchanged. ## The three rules @@ -185,12 +185,12 @@ driver that is: It also steps aside when a conditional-compilation directive (`` `ifdef``/`` `else``/`` `endif``) is written between the first and last driver — the preprocessor's spelling of the same exclusivity `generate` has. -vfmt parses both arms of an `` `ifdef`` as ordinary items, so without this +lucisv parses both arms of an `` `ifdef`` as ordinary items, so without this guard the `` `ifdef FAST / `else `` pattern would report every time. ## The corpus measurement, and the on/off ruling -Release build, `vfmt check corpus --select --output-format json`, over +Release build, `lucisv check corpus --select --output-format json`, over the 860 `.v`/`.sv`/`.svh` files in `corpus/` (Ibex, OpenTitan, PULP common_cells, picorv32), 2026-08-25: @@ -263,10 +263,10 @@ Same corpus, best of five runs, this machine: | run | 1 thread | 10 cores | |---|---:|---:| -| `vfmt check` before this round | 0.21 s | 0.07 s | -| `vfmt check` after (semantic rules off) | 0.22 s | 0.07 s | -| `vfmt check --select ,unused-signal` | 0.26 s | 0.07 s | -| `vfmt check --select ` + all three | 0.26 s | 0.07 s | +| `lucisv check` before this round | 0.21 s | 0.07 s | +| `lucisv check` after (semantic rules off) | 0.22 s | 0.07 s | +| `lucisv check --select ,unused-signal` | 0.26 s | 0.07 s | +| `lucisv check --select ` + all three | 0.26 s | 0.07 s | Reading it: the default run is unchanged — proven byte-for-byte, not inferred, by diffing the whole-corpus JSON and stderr of this build against a @@ -286,14 +286,14 @@ disappears into the worker pool. whole-word mention scan, the `.*` / `` `include`` blindness rule. - [x] `unused-signal`, `undriven-net`, `multiply-driven` — registered, documented, diagnose-only, off by default. -- [x] Server wiring: `vfmt_server` lends the document's own `Semantics`, so +- [x] Server wiring: `lucisv_server` lends the document's own `Semantics`, so a keystroke never analyzes twice. - [x] `force`/`release`/`deassign` classified as their own driver kinds, out of `multiply-driven` entirely and half-out of `undriven-net` (QA finding, fixed 2026-08-25). - [x] 69 new unit tests: 23 in `signals.rs` (the classification), 43 across the three rule modules, 2 in `context.rs` (lazy vs lent analysis), 1 in - `vfmt_server::lint` (the server reads the document's own table). + `lucisv_server::lint` (the server reads the document's own table). - [x] 52 `.lint` cases across three new case files — 16 + 20 + 16 — covering violating / clean / waived / unused-waiver and every guard. - [x] Corpus measurement, per-finding judgement, and the on/off ruling above. @@ -309,7 +309,7 @@ disappears into the worker pool. unknown. Deliberately not done — it is a second resolution mechanism and wants the workspace index behind it anyway. - [ ] Per-rule configuration of the intentionally-unused convention — needs - the `vfmt.toml` `lint` key. + the `lucisv.toml` `lint` key. ## Work log @@ -332,7 +332,7 @@ disappears into the worker pool. one 658-line module (`signals.rs`, plus 275 lines of its own tests) and `vlog_semantic` is untouched. - **Lazy analysis — decision.** Making `from_parse` take a `Semantics` - would have forced every caller to build one, i.e. made `vfmt check` pay for + would have forced every caller to build one, i.e. made `lucisv check` pay for an analysis nobody reads on a default run. Instead `LintContext` holds a `OnceCell` filled on first use, plus `with_semantics` for the server, which analyzes every buffer anyway. `from_parse`'s signature never @@ -362,7 +362,7 @@ disappears into the worker pool. clocking case is a `judgeable` test and not a `connected` one); an expression statement that is not `x++` is a call whose arguments may be `output` arguments. -- **The `` `ifdef`` guard for `multiply-driven`** exists because vfmt parses +- **The `` `ifdef`` guard for `multiply-driven`** exists because lucisv parses both arms of a conditional as ordinary items — the same property that makes `unused-signal` see through an `` `ifdef``. Two `always_comb` blocks in opposite arms would otherwise report every time. Implemented as "is a @@ -370,14 +370,14 @@ disappears into the worker pool. narrow: a directive elsewhere in the file excuses nothing. - **Part-selects: silence.** The task named this as the judgement call. `a[0]` in one block and `a[1]` in another *is* illegal in `always_comb`, but - it is also the everyday shape of legacy `always` code, and vfmt does not + it is also the everyday shape of legacy `always` code, and lucisv does not resolve bit ranges. Any partial driver takes the signal out of the rule. - **On/off**: measured, judged per finding, ruled off for all three, with the reasoning and the dissent for `multiply-driven` written above rather than buried. - **Scope**: `crates/vlog_linter/{Cargo.toml,src/context.rs,src/lib.rs, src/signals.rs,src/rule_docs.rs,src/registry.rs,src/rules/**,tests/cases/**}`, - `crates/vfmt_server/src/lint.rs` (the two-line lend + one test, which the + `crates/lucisv_server/src/lint.rs` (the two-line lend + one test, which the task authorized), this README, `docs/features/linter-core/README.md`'s rule table, and the top-level `README.md`'s Linting section (the three rules and their off-by-default footnote — changed because that section called the @@ -391,7 +391,7 @@ disappears into the worker pool. `git worktree`: 1474 — the delta is exactly this pass's 61 new tests); `cargo test -p vlog_linter` 182 unit (was 122) + 14 case-harness + 1 doc. CLI smoke: all three rules fire on a crafted module, the `_ignored` name is exempt, a - `// vfmt: waive unused-signal` suppresses its finding, the default run on + `// lucisv: waive unused-signal` suppresses its finding, the default run on the same file is clean, and JSON carries `"fix":null`. ### 2026-08-25 — dev (QA follow-up: the `force`/`release` ruling) @@ -450,7 +450,7 @@ QA's should-fix, and the lead's ruling on it, implemented in full. three JSON outputs are byte-identical to the pre-fix run — the corpus's two `force`/`release` files write through hierarchical paths these rules do not track, which is exactly why the corpus never showed the bug. Default - `vfmt check` over the corpus is still byte-identical (stdout **and** + `lucisv check` over the corpus is still byte-identical (stdout **and** stderr) to a `git worktree` build of `HEAD` a96c908. - **README**: the `undriven-net` driver list now names `force` and states that `release`/`deassign` are not drives; `multiply-driven`'s exclusion @@ -480,7 +480,7 @@ flags as "closest to default-on." --workspace` silent (forced rebuild by touching `lib.rs` first, per the house discipline). `cargo test --workspace`: **1535 passed**, 0 failed, summed from every `test result:` line — matches the claim exactly. -`node editors/vscode/smoke.js target/debug/vfmt-server`: `OK`. No `unsafe`; +`node editors/vscode/smoke.js target/debug/lucisv-server`: `OK`. No `unsafe`; the only `.unwrap()`/`.expect()`/`panic!` in the five touched files (`signals.rs:675-676`, `context.rs:355`) are inside `#[cfg(test)]` modules. No `#[allow]` anywhere in the new code. `cargo tree -p vlog_linter -e @@ -491,7 +491,7 @@ version stayed `0.4.2` (no bump), `TODO.md` untouched, confirmed by **Byte-identical claim — verified myself, not re-trusted.** Built HEAD (`a96c908`) in a `git worktree`, release profile, alongside the working -tree's release build. `vfmt check corpus --output-format json` from both +tree's release build. `lucisv check corpus --output-format json` from both binaries: stdout **byte-identical**, stderr **byte-identical** (same single lex-error line and the same "found 7932 violations, 1 file could not be checked" summary — the corpus grew a naming-rule finding since the @@ -606,7 +606,7 @@ and not told apart from each other. Two consequences, reproduced live: assign q = a; endmodule ``` - `vfmt check --select multiply-driven` on this file: 1 violation, + `lucisv check --select multiply-driven` on this file: 1 violation, `` `a` is driven both by a continuous assignment and by a procedural block``. This is exactly the kind of finding CLAUDE.md and this feature's own "not crying wolf" bar exist to prevent — a real, @@ -634,7 +634,7 @@ and not told apart from each other. Two consequences, reproduced live: assign q = a; endmodule ``` - `vfmt check --select undriven-net`: 0 violations, even though `a` is + `lucisv check --select undriven-net`: 0 violations, even though `a` is never actually assigned a value anywhere in the file. This is the silent/harmless direction (no false accusation), so it is not a blocking bug, but it is a real behavior gap the doc doesn't own, and it @@ -674,20 +674,20 @@ because the QA brief asked about "procedural continuous assign/deassign" by name and the honest answer is "silently and safely out of scope," not "handled." -**Waivers.** Spot-ran `// vfmt: waive ` on the declaration/violation +**Waivers.** Spot-ran `// lucisv: waive ` on the declaration/violation line for all three rules live (not just the `.lint` harness, which was also re-run: `cargo test -p vlog_linter --test lint_cases` — 14/14 green, including the three new case files' own suites). Every waiver suppressed its rule's finding as expected. -**Server parity.** `crates/vfmt_server/src/lint.rs`'s `context()` now +**Server parity.** `crates/lucisv_server/src/lint.rs`'s `context()` now calls `.with_semantics(&doc.semantics)`, and the round's own test (`a_semantic_rule_reads_the_documents_own_analysis`) proves both that a semantic rule fires correctly through the server's `LintContext` and that `context(doc).semantics()` is pointer-identical to `&doc.semantics` (the lent table, not a second analysis) — read and re-run, passes. **Caveat -worth recording**: `vfmt_server::lint::violations`/`diagnostics` call -`lint(&context(doc), &default_rules())` only (`crates/vfmt_server/src/ +worth recording**: `lucisv_server::lint::violations`/`diagnostics` call +`lint(&context(doc), &default_rules())` only (`crates/lucisv_server/src/ lint.rs:35-36`) — there is no server-side rule-selection surface yet, so none of the three semantic rules can actually be *reached* through the live LSP path today; the parity claim is true at the plumbing level (verified @@ -700,7 +700,7 @@ editor today." **Test-count reconciliation — exact, not approximate.** `grep -c "#\[test\]"`: `signals.rs` 21, `rules/{unused_signal,undriven_net, multiply_driven}.rs` 12+13+12=37, `context.rs` 9 total (2 new — the other -7 predate this round), `vfmt_server/src/lint.rs` 11 total (1 new). New +7 predate this round), `lucisv_server/src/lint.rs` 11 total (1 new). New total: 21+37+2+1 = **61**, matching the claim exactly. `.lint` case files: 15/15/13 `====` separators → 16/16/14 cases (one more case than separators, per the format) = **46**, matching exactly. This precision @@ -710,7 +710,7 @@ the narrative is trustworthy. **Minor, cosmetic finding.** The Work log's "Scope" bullet (`docs/features/semantic-lints/README.md`, the "2026-08-25 — dev" entry) lists the touched files as `crates/vlog_linter/{...}`, -`crates/vfmt_server/src/lint.rs`, "this README, and +`crates/lucisv_server/src/lint.rs`, "this README, and `docs/features/linter-core/README.md`'s rule table" — it does not mention the top-level `README.md`, which `git diff HEAD -- README.md` shows *was* changed (a "Linting" section update adding the three new rules and the @@ -833,14 +833,14 @@ No new false positives or false negatives found in this pass. **Test-count and case-count reconciliation, exact again.** `#[test]` counts: `signals.rs` 23 (+2), `unused_signal.rs`/`undriven_net.rs`/ `multiply_driven.rs` 12+15+16=43 (+6), `context.rs` 9 (unchanged), -`vfmt_server/src/lint.rs` 11 (unchanged) → **8 new unit tests**, matching +`lucisv_server/src/lint.rs` 11 (unchanged) → **8 new unit tests**, matching the claim exactly. `.lint` `====` separators: `unused_signal` 15 (unchanged, 16 cases), `undriven_net` 19 (+4, 20 cases), `multiply_driven` 15 (+2, 16 cases) → **6 new cases**, totalling **52** (16+20+16), matching both the round-2 claim and the arithmetic in `Status/TODO`. **Byte-identical claim, re-verified with a fresh worktree build.** Built -HEAD (`a96c908`) in a new `git worktree`, release profile. `vfmt check +HEAD (`a96c908`) in a new `git worktree`, release profile. `lucisv check corpus --output-format json`: stdout and stderr byte-identical to the working tree's release build (same exit 2, same single lex-error line, same summary line). Also diffed the new `--select ` corpus outputs @@ -884,7 +884,7 @@ extension was the correct call for the right reason: driver semantics is a lint concept, and the binder discards the context it would need by design. QA's force/release find was real — the fix's two independent layers (own DriverKind; override-excludes-entirely) each carry their own -only-test-that-goes-red, verified by sabotage twice over. Default `vfmt +only-test-that-goes-red, verified by sabotage twice over. Default `lucisv check` output stays byte-identical to HEAD, worktree-diffed by three different people now. Accepted; M12 checked off in the umbrella plan and TODO §8. The path to default-on runs through the workspace-index diff --git a/docs/features/server-lint/README.md b/docs/features/server-lint/README.md index c4b1296..58f03c5 100644 --- a/docs/features/server-lint/README.md +++ b/docs/features/server-lint/README.md @@ -2,15 +2,15 @@ ## Goal -`vfmt check` has existed since round 11 and the language server has published +`lucisv check` has existed since round 11 and the language server has published parse errors since the same round, but the two never met: an editor running -`vfmt-server` saw syntax errors and nothing else, while CI running `vfmt check` +`lucisv-server` saw syntax errors and nothing else, while CI running `lucisv check` saw seven rules' worth of findings. This round wires `vlog_linter` into -`vfmt_server` so the editor shows what CI will say — lint findings as +`lucisv_server` so the editor shows what CI will say — lint findings as **warnings** alongside the parse **errors**, in **one** `publishDiagnostics` per change — and adds `textDocument/codeAction`: a quick fix per Safe fix, and a -`source.fixAll.vfmt` action for fix-on-save. Nothing about the linter changed; -this is protocol-layer wiring, which is all `vfmt_server` is allowed to be. +`source.fixAll.lucisv` action for fix-on-save. Nothing about the linter changed; +this is protocol-layer wiring, which is all `lucisv_server` is allowed to be. ## Assumptions @@ -28,14 +28,14 @@ this is protocol-layer wiring, which is all `vfmt_server` is allowed to be. - **A lint finding is a `Warning`, a parse error stays an `Error`.** The linter has opinions; the parser reports the file not being Verilog. `code` is the rule's stable kebab-case name — the string the user needs to write a waiver or - an `--ignore`, and the string a code action matches on. `source` is `"vfmt"` + an `--ignore`, and the string a code action matches on. `source` is `"lucisv"` for both, as before. - **The linter is handed the URI's own path**, so `module-filename` can speak. It is the one default rule that needs a file name; without the path it goes quiet, which would have made the editor disagree with CI on exactly the rule whose whole subject is the file name. An `untitled:` buffer genuinely has no path and genuinely gets no `module-filename` finding — the same behavior as - `vfmt check` on stdin without `--stdin-filename`. + `lucisv check` on stdin without `--stdin-filename`. - **The document is parsed twice per change, and that is a known cost, not an oversight.** `Document::new` parses for the server, and `LintContext::new` parses again inside the linter. `linter-core`'s own Handshakes file this as @@ -57,7 +57,7 @@ this is protocol-layer wiring, which is all `vfmt_server` is allowed to be. code (`quick_fix` returns `None` for anything not `Applicability::Safe`) and in `apply_fixes(.., include_unsafe = false)` for the fix-all path, not just stated here. -- **`source.fixAll.vfmt` is one pass, deliberately.** `vfmt check --fix` loops +- **`source.fixAll.lucisv` is one pass, deliberately.** `lucisv check --fix` loops fix → re-lint until nothing changes, because a single pass skips any fix overlapping one already applied (the everyday case is a line ending in a tab, which `no-tabs` and `no-trailing-whitespace` both want to rewrite). The server @@ -72,33 +72,33 @@ this is protocol-layer wiring, which is all `vfmt_server` is allowed to be. interleave two fixes in a way the linter's own skip rule would have refused. It matches what `textDocument/formatting` already sends, so no client is surprised by the shape. -- **A quick fix's tab-expansion width comes from `vfmt.toml`.** A code-action +- **A quick fix's tab-expansion width comes from `lucisv.toml`.** A code-action request carries no `FormattingOptions`, so unlike formatting there is no - client `tabSize` in play: the precedence is `vfmt.toml` > the built-in + client `tabSize` in play: the precedence is `lucisv.toml` > the built-in default, via `format::indent_width`. Without this, a project with `indent = 4` would get a quick fix inserting two spaces that format-on-save then rewrites — - precisely the CLI/editor divergence `vfmt-core-lift` exists to prevent. The + precisely the CLI/editor divergence `lucisv-core-lift` exists to prevent. The diagnostics path does not do this lookup: it never reads a fix, so it would be a config file read per keystroke bought for nothing. -- **A broken `vfmt.toml` is silent on the code-action path.** The formatting - path already warns once per file change (`vfmt-core-lift`); warning again from +- **A broken `lucisv.toml` is silent on the code-action path.** The formatting + path already warns once per file change (`lucisv-core-lift`); warning again from a lightbulb an editor requests on every cursor move would train the user to - ignore vfmt's messages. The fix falls back to the built-in indent width. + ignore lucisv's messages. The fix falls back to the built-in indent width. - **The client's `context.only` filter is honored here rather than left to the client.** The spec permits a server to return everything and let the client - filter, but fix-on-save asks for `source.fixAll.vfmt` alone, and computing + filter, but fix-on-save asks for `source.fixAll.lucisv` alone, and computing every quick fix for a request that discards them is work nobody reads. Filtering is hierarchical, as the spec says: `source` selects - `source.fixAll.vfmt`. + `source.fixAll.lucisv`. - **A quick fix is offered when its diagnostic range *touches* the requested range.** A cursor sitting on the first character of a warning is asking about that warning; an empty requested range (a bare cursor) is the normal case. - **Waivers, fences and rule selection are the linter's business, not this - crate's.** A `// vfmt: waive no-tabs` suppresses the diagnostic and therefore + crate's.** A `// lucisv: waive no-tabs` suppresses the diagnostic and therefore the lightbulb, because the finding never reaches this crate. **Note the one - asymmetry with the CLI:** `vfmt check --fix` additionally refuses to fix + asymmetry with the CLI:** `lucisv check --fix` additionally refuses to fix inside a `// verilog_format: off` fence, and that refusal lives in - `crates/vfmt/src/lint.rs`, not in `vlog_linter` — so it is **not** inherited + `crates/lucisv/src/lint.rs`, not in `vlog_linter` — so it is **not** inherited here. See Status/TODO; it is the one honest gap this round leaves. ~~not inherited here~~ **Inherited as of shared-fence-filter (round 14): the filter moved to `vlog_formatter::fence` and this crate calls it.** @@ -125,12 +125,12 @@ waivers), `run` **never panics and never writes**, and findings come back **sorted by `(span.start, span.end, rule)`** — all three are promises in `docs/features/linter-core/README.md`'s Handshakes. -**Consumed from `vfmt_core`** — nothing new: `format::indent_width` reuses the +**Consumed from `lucisv_core`** — nothing new: `format::indent_width` reuses the existing private `discover`, which is `Discovery::for_file`. -**Promised to nobody.** `vfmt_server` is still a leaf binary with no library +**Promised to nobody.** `lucisv_server` is still a leaf binary with no library target. `editors/**` was not touched: a client needs no change to receive lint -diagnostics, and `editor.codeActionsOnSave` naming `source.fixAll.vfmt` is a +diagnostics, and `editor.codeActionsOnSave` naming `source.fixAll.lucisv` is a user setting, not an extension one. **Requested of others — not done here:** @@ -142,14 +142,14 @@ user setting, not an extension one. file that changes. **Delivered by one-parse (round 19) — `lint.rs` was indeed the one file (plus `Document` gaining its `tree` field).** -2. *linter-core / config-discovery*: **a `lint` key in `vfmt.toml`.** The server +2. *linter-core / config-discovery*: **a `lint` key in `lucisv.toml`.** The server runs `default_rules()` and nothing else, because there is no configured rule set to read — `--select`/`--ignore` are CLI-only. When `lint = [...]` lands, `lint.rs` should resolve it through the same `Discovery` the formatter uses, with the same anchored-at-the-document rule. -3. *lead*: **the fence gap.** `vfmt check --fix` will not rewrite bytes inside a +3. *lead*: **the fence gap.** `lucisv check --fix` will not rewrite bytes inside a `// verilog_format: off` region, but that filter lives in - `crates/vfmt/src/lint.rs` (it needs `vlog_formatter::fence`, which the linter + `crates/lucisv/src/lint.rs` (it needs `vlog_formatter::fence`, which the linter crate deliberately does not depend on). This round did not duplicate it — a third copy of "what is fenced" is exactly how the three answers drift — so a quick fix in this server *can* edit inside a fence. Reported honestly rather @@ -161,7 +161,7 @@ user setting, not an extension one. is now the one answer both front ends call, and `lint::fixable` withholds any fix that would edit a fenced byte — reported, never auto-fixed, exactly as the CLI.** -4. *lead*: **`TODO.md:353` is now stale.** §6's `vfmt_server` entry still lists +4. *lead*: **`TODO.md:353` is now stale.** §6's `lucisv_server` entry still lists "lint diagnostics (waits on `vlog_linter`)" under **Not shipped**. TODO.md is outside this round's stated scope, so it was left alone rather than edited; the checkbox itself is already `[x]` and needs no flip. @@ -171,7 +171,7 @@ user setting, not an extension one. | LSP request | Engine it consumes | Notes | |---|---|---| | `textDocument/publishDiagnostics` | `vlog_parser::parse_source_tolerant` **+ `vlog_linter::run`** | One publish per change carrying both: parse errors as `Error`, lint findings as `Warning` with `code` = rule name | -| `textDocument/codeAction` | `vlog_linter` fixes | `quickfix` per Safe fix (`isPreferred`, `diagnostics` populated); one `source.fixAll.vfmt` whole-document edit | +| `textDocument/codeAction` | `vlog_linter` fixes | `quickfix` per Safe fix (`isPreferred`, `diagnostics` populated); one `source.fixAll.lucisv` whole-document edit | The `initialize` diff is exactly one field: @@ -179,7 +179,7 @@ The `initialize` diff is exactly one field: code_action_provider: Some(CodeActionProviderCapability::Options(CodeActionOptions { code_action_kinds: Some(vec![ CodeActionKind::QUICKFIX, - CodeActionKind::new("source.fixAll.vfmt"), + CodeActionKind::new("source.fixAll.lucisv"), ]), work_done_progress_options: WorkDoneProgressOptions::default(), resolve_provider: None, @@ -197,7 +197,7 @@ TODO §2 `--lines`), `completion`, `rename`, `signatureHelp`, and cross-file ## Status / TODO -- [x] `vlog_linter` added to `crates/vfmt_server/Cargo.toml` (path dependency; +- [x] `vlog_linter` added to `crates/lucisv_server/Cargo.toml` (path dependency; the crate was already a workspace member, so the root `Cargo.toml` needed **no** edit). - [x] `src/lint.rs`: violations for the diagnostics path, violations-with-fixes @@ -206,7 +206,7 @@ TODO §2 `--lines`), `completion`, `rename`, `signatureHelp`, and cross-file - [x] `server.rs`: `publish()` sends that one list; every path that published before (`didOpen`, `didChange`, `didSave`, and the post-save republish of every open buffer) now publishes both sources, unchanged otherwise. -- [x] `src/code_action.rs`: quick fixes, `source.fixAll.vfmt`, `context.only` +- [x] `src/code_action.rs`: quick fixes, `source.fixAll.lucisv`, `context.only` filtering, range-overlap matching. - [x] `format::indent_width` — the config-governed tab width a fix writes. - [x] `textDocument/codeAction` wired into the request dispatcher. @@ -218,14 +218,14 @@ TODO §2 `--lines`), `completion`, `rename`, `signatureHelp`, and cross-file - [x] e2e through the real binary: one publish carrying two rule codes, the capability's kinds on the wire, quick fixes + fixAll, and a filtered fix-on-save request. -- [x] `docs/features/vfmt-server/README.md` deferred list annotated. -- [ ] **Not done, deliberately:** rule selection. No `vfmt.toml` `lint` key +- [x] `docs/features/lucisv-server/README.md` deferred list annotated. +- [ ] **Not done, deliberately:** rule selection. No `lucisv.toml` `lint` key exists (Handshake 2); the server runs `default_rules()`. - [ ] **Not done, deliberately:** offering Unsafe fixes. No rule ships one, and when one does it wants a decision (a separate `source.fixAll` kind? a client setting?), not a silent inclusion. - [x] ~~**Not done:** fence-aware fixes (Handshake 3) — a quick fix can edit - inside a `// verilog_format: off` region, where `vfmt check --fix` would + inside a `// verilog_format: off` region, where `lucisv check --fix` would not.~~ Delivered by **shared-fence-filter** (round 14). - [ ] **Not done:** `codeAction/resolve`. Every action is cheap to build in full; lazy resolution is a payload optimization for actions that are not. @@ -236,9 +236,9 @@ TODO §2 `--lines`), `completion`, `rename`, `signatureHelp`, and cross-file ### 2026-08-19 — dev agent -- Read `CLAUDE.md`, `docs/features/vfmt-server/README.md`, +- Read `CLAUDE.md`, `docs/features/lucisv-server/README.md`, `docs/features/linter-core/README.md` and - `docs/features/vfmt-core-lift/README.md` in full (QA logs and Reviews + `docs/features/lucisv-core-lift/README.md` in full (QA logs and Reviews included) before writing anything, plus `vlog_linter`'s public surface (`lib.rs`, `violation.rs`, `context.rs`, `registry.rs`). No engine crate needed a change, again: every entry point this round wanted was already @@ -254,10 +254,10 @@ TODO §2 `--lines`), `completion`, `rename`, `signatureHelp`, and cross-file - **Two lint entry points, for one honest reason.** `lint::violations` (the diagnostics path) calls `vlog_linter::run` and never looks at a fix, so it does no config work per keystroke. `lint::fixable` (the code-action path) - builds a `LintContext` with the tab width of the governing `vfmt.toml`, since + builds a `LintContext` with the tab width of the governing `lucisv.toml`, since a fix that writes two spaces into an `indent = 4` project is a fix format-on-save immediately overwrites. The split costs three lines and buys - the CLI/editor parity `vfmt-core-lift` was about. + the CLI/editor parity `lucisv-core-lift` was about. - **`fixAll` is one pass and says so in a doc comment at the function**, with the reasoning (the client's own edit/re-lint cycle *is* the convergence loop). The tab-and-trailing-whitespace case — the everyday two-round example from @@ -269,7 +269,7 @@ TODO §2 `--lines`), `completion`, `rename`, `signatureHelp`, and cross-file `lint::diagnostic` the publisher uses, so the diagnostic in the action is equal to the one on screen rather than a lookalike reconstructed by hand. - **`context.only` is honored** with hierarchical prefix matching, because - fix-on-save requests `source.fixAll.vfmt` alone and would otherwise be handed + fix-on-save requests `source.fixAll.lucisv` alone and would otherwise be handed every quick fix in the file to throw away. - **Two clippy warnings fixed by restructuring, not by `#[allow]`**: both were `clippy::mutable_key_type` on a `let`-bound `&HashMap>` in @@ -280,7 +280,7 @@ TODO §2 `--lines`), `completion`, `rename`, `signatureHelp`, and cross-file - No `unwrap`/`expect`/`panic!`/`unsafe` outside `#[cfg(test)]` in any file added or touched. - Did not touch `vlog_linter`, `vlog_parser`, `vlog_formatter`, `vlog_semantic`, - `vfmt`, `vfmt_core` or `editors/**`. Root `Cargo.toml` needed no edit — + `lucisv`, `lucisv_core` or `editors/**`. Root `Cargo.toml` needed no edit — `vlog_linter` is already a workspace member, so the dependency is one path line in this crate's own manifest (`Cargo.lock` gained the corresponding one-line edge). `TODO.md` left alone per the round's stated scope, with the @@ -288,10 +288,10 @@ TODO §2 `--lines`), `completion`, `rename`, `signatureHelp`, and cross-file **Results.** -- `cargo test -p vfmt_server`: **108 passed, 0 failed** (104 unit + 4 e2e), +- `cargo test -p lucisv_server`: **108 passed, 0 failed** (104 unit + 4 e2e), up from 85 (82 + 3). New: 7 in `lint.rs`, 10 in `code_action.rs`, 2 in `diagnostics.rs`, 2 in `format.rs`, 2 in `main.rs`, 1 e2e. -- `cargo clippy -p vfmt_server --all-targets`: **0 warnings from this crate**. +- `cargo clippy -p lucisv_server --all-targets`: **0 warnings from this crate**. One warning reaches the output from a dependency — `vlog_formatter`'s `with_comma is never used` — which belongs to the concurrent round live in `vlog_parser`/`vlog_formatter`, not to anything here. @@ -301,20 +301,20 @@ TODO §2 `--lines`), `completion`, `rename`, `signatureHelp`, and cross-file - **Concurrency note.** Mid-round the other agent landed new `ast::Module` / `ast::AnsiPort` fields, and for ~20 minutes nothing in the workspace compiled, this crate included. Nothing was touched in response; the gates were re-run - once `vlog_parser` built again and are the numbers above. `-p vfmt_server`'s + once `vlog_parser` built again and are the numbers above. `-p lucisv_server`'s own 104 + 4 is the count that belongs to this feature and did not move across the break. -- Files added: `crates/vfmt_server/src/{lint,code_action}.rs`, this README. - Files edited: `crates/vfmt_server/Cargo.toml` (one line), - `crates/vfmt_server/src/{main,server,diagnostics,format}.rs`, - `crates/vfmt_server/tests/e2e.rs`, one annotation line in - `docs/features/vfmt-server/README.md`. +- Files added: `crates/lucisv_server/src/{lint,code_action}.rs`, this README. + Files edited: `crates/lucisv_server/Cargo.toml` (one line), + `crates/lucisv_server/src/{main,server,diagnostics,format}.rs`, + `crates/lucisv_server/tests/e2e.rs`, one annotation line in + `docs/features/lucisv-server/README.md`. ## QA log ### 2026-08-19 — QA agent -Scoped to `-p vfmt_server` per the concurrency note (a second agent was live +Scoped to `-p lucisv_server` per the concurrency note (a second agent was live in `vlog_parser`/`vlog_formatter` for the directives-in-lists round; the tree briefly failed to build mid-session and recovered on its own — retested after and the numbers below are post-recovery). No files touched outside this QA @@ -322,18 +322,18 @@ log entry. **Gates.** -- `cargo test -p vfmt_server`: **104 unit + 4 e2e, 0 failed** — matches the +- `cargo test -p lucisv_server`: **104 unit + 4 e2e, 0 failed** — matches the claimed count exactly. -- `cargo clippy -p vfmt_server --all-targets`: **0 warnings from this crate.** +- `cargo clippy -p lucisv_server --all-targets`: **0 warnings from this crate.** - `cargo fmt --all -- --check`: clean. -- `grep -rn "#\[allow" crates/vfmt_server/src/{lint,code_action,diagnostics,format,main,server}.rs crates/vfmt_server/tests/e2e.rs` +- `grep -rn "#\[allow" crates/lucisv_server/src/{lint,code_action,diagnostics,format,main,server}.rs crates/lucisv_server/tests/e2e.rs` finds exactly one hit, `main.rs:112` (`#[allow(deprecated)]` on - `root_uri`) — confirmed via `git diff crates/vfmt_server/src/main.rs` to + `root_uri`) — confirmed via `git diff crates/lucisv_server/src/main.rs` to predate this round (it sits outside every hunk this diff touches). **No new `#[allow]` was added.** **Claim 1 — single-publish merge: PASS.** -`grep -rn "send_diagnostics\|PublishDiagnostics" crates/vfmt_server/src/` +`grep -rn "send_diagnostics\|PublishDiagnostics" crates/lucisv_server/src/` shows exactly one call site that ever sends a non-empty diagnostics list — `server.rs:259`, `self.send_diagnostics(uri.clone(), diagnostics::all(doc))` inside `publish()` — plus the `didClose` clear-with-`Vec::new()` at line 236, @@ -346,7 +346,7 @@ client, framed JSON-RPC over stdio, script kept at error) produced **exactly one** `publishDiagnostics`, carrying one `Error` (unnamed `wire`) and one `Warning` `code: "no-tabs"`. `didChange` fixing the parse error but keeping the tab: still one publish, error gone, `no-tabs` -warning persists. `didChange` adding `// vfmt: waive no-tabs`: still one +warning persists. `didChange` adding `// lucisv: waive no-tabs`: still one publish, diagnostics array empty. All three steps matched the claim exactly. **Claim 2 — codeAction: PASS**, verified against the real binary @@ -355,12 +355,12 @@ publish, diagnostics array empty. All three steps matched the claim exactly. (`isPreferred: true`, `diagnostics` = one entry, built from the same `lint::diagnostic` the publisher uses — confirmed both by source (`code_action.rs:63`) and by the wire payload being byte-identical to the - publish's own diagnostic) and one `source.fixAll.vfmt`. The quickfix's + publish's own diagnostic) and one `source.fixAll.lucisv`. The quickfix's edit, applied by hand from UTF-16 positions, was byte-identical to - `vfmt check --fix`'s output on the same file. + `lucisv check --fix`'s output on the same file. - `fixAll` carried no `diagnostics` key (absent from the JSON entirely, i.e. `None`, matching the one-pass argument in the README) and its one - whole-document edit also matched `vfmt check --fix`. + whole-document edit also matched `lucisv check --fix`. - Convergence: a line with both a leading tab and a trailing tab (`no-tabs` + `no-trailing-whitespace` both wanting those bytes) took **3 rounds** to reach a clean buffer via repeated `fixAll` → `didChange` → @@ -370,11 +370,11 @@ publish, diagnostics array empty. All three steps matched the claim exactly. - `context.only=["source"]` returned only the `fixAll` action (1 action); `context.only=["quickfix"]` returned only the quickfix (1 action) — both confirmed live, not just via the existing unit test. -- Tab width from `vfmt.toml`: a scratch tree with `indent = 4` produced a +- Tab width from `lucisv.toml`: a scratch tree with `indent = 4` produced a quickfix expanding the tab to 4 spaces; a tree with no config produced 2 spaces (the built-in default) — both driven through the real binary (`test6_config_and_filename.py`). -- Diagnostics path skips config reads: `grep -rn "indent_width" crates/vfmt_server/src/*.rs` +- Diagnostics path skips config reads: `grep -rn "indent_width" crates/lucisv_server/src/*.rs` shows `format::indent_width` called from exactly one site, `server.rs:131`, inside the `CodeActionRequest` handler. Neither `lint::violations` nor `lint::diagnostics` (the path every `didOpen`/ @@ -388,7 +388,7 @@ publish, diagnostics array empty. All three steps matched the claim exactly. **Claim 3 — capabilities: PASS.** `main.rs`'s `capabilities()` diff is exactly the one field the README documents (`code_action_provider: Options` -with `[QUICKFIX, "source.fixAll.vfmt"]`, `resolve_provider: None`); nothing +with `[QUICKFIX, "source.fixAll.lucisv"]`, `resolve_provider: None`); nothing else in `capabilities()` changed per `git diff`. `caps.code_action_provider` is `Options`, not `Simple(true)` — asserted by `the_two_code_action_kinds_are_named_in_the_capability` and by the e2e test @@ -402,13 +402,13 @@ in spirit — only gained one new assertion for `code_action_provider`). **Claim 5 — handshakes: PASS**, and the fence gap was reproduced live rather than taken on faith. `test4_fence_gap.py`: a file with `// verilog_format: off` / a tabbed line / `// verilog_format: on` — -`vfmt check --fix` left the tab untouched (confirmed: output still contains +`lucisv check --fix` left the tab untouched (confirmed: output still contains the literal tab byte); the server's `fixAll` action **did** rewrite it to spaces (confirmed: applied output has the tab replaced). This is exactly what Handshake 3 claims, stated as a known gap rather than silently — the handshake text is accurate, not aspirational. The other three handshakes (second-parse-per-keystroke in `lint.rs`'s own doc comments, no `lint` key -in `vfmt.toml` yet, `TODO.md:353` being stale) were spot-checked against the +in `lucisv.toml` yet, `TODO.md:353` being stale) were spot-checked against the actual files and are accurate: `TODO.md`'s "Not shipped, deliberately: ... lint diagnostics (waits on `vlog_linter`)" line is indeed still present and now stale, and its checkbox is already `[x]`, exactly as claimed. @@ -416,7 +416,7 @@ now stale, and its checkbox is already `[x]`, exactly as claimed. **UTF-16 under fixes: PASS.** `test5_utf16.py`: a violation on a line after `🎉🎉 café` (multi-byte, multi-UTF-16-unit content) — the server's `fixAll` edit, applied from its UTF-16 positions, produced output **byte-identical** -to `vfmt check --fix` on the same file, and the emoji/accented content was +to `lucisv check --fix` on the same file, and the emoji/accented content was untouched. **module-filename via URI: PASS.** A `file://` URI whose module name @@ -428,14 +428,14 @@ hang on a subsequent `codeAction` request against the same untitled buffer **Documentation.** README has all seven CLAUDE.md-required sections, all populated except Review (correctly reserved for the lead). The two -`docs/features/vfmt-server/README.md` annotation locations (the "Deferred" +`docs/features/lucisv-server/README.md` annotation locations (the "Deferred" paragraph's `lint diagnostics (waits on \`vlog_linter\`)` clause, and the Status/TODO `lint diagnostics` checklist item) are each a single struck-through-and-replaced item, word-wrapped across several physical lines in the file's existing 80-column convention — consistent with "one annotation" per location, not a rewrite of surrounding content. Minor, non-blocking nit: the dev's own work-log sentence says "one annotation line -in `docs/features/vfmt-server/README.md`" (singular), but two separate +in `docs/features/lucisv-server/README.md`" (singular), but two separate locations in that file were actually touched (the Deferred-paragraph clause and the Status/TODO item) — the substance of both edits is correct and scoped, this is purely a miscount in the work-log's own wording. @@ -467,19 +467,19 @@ Points reviewed and accepted: `diagnostics` list on the action because a pass that skips overlapping fixes can't honestly name what it resolved. Declining to claim what you can't prove is the house style. -3. **Quick fixes byte-identical to `vfmt check --fix`** — the two +3. **Quick fixes byte-identical to `lucisv check --fix`** — the two front ends provably agree, which is the property users will actually rely on. 4. **The fence gap filed, not papered over**: a server fix can edit - inside `// vfmt: off` because the fence filter lives in - `crates/vfmt`, and a third copy of "what is fenced" is how answers + inside `// lucisv: off` because the fence filter lives in + `crates/lucisv`, and a third copy of "what is fenced" is how answers drift. QA reproduced both sides live. This is the top item for the next round — a shared fence-region helper (likely in - `vlog_formatter` next to `fence.rs`, or `vfmt_core`) that the CLI + `vlog_formatter` next to `fence.rs`, or `lucisv_core`) that the CLI and the server both call. Until then: no corruption is possible (only Safe fixes exist), but the hands-off promise has a documented editor-side hole. -5. The second-parse-per-keystroke cost and the `vfmt.toml` `lint` key +5. The second-parse-per-keystroke cost and the `lucisv.toml` `lint` key stay filed where they belong (vlog_linter's one-parse-two-tools TODO and config-discovery's key list respectively). diff --git a/docs/features/shared-fence-filter/README.md b/docs/features/shared-fence-filter/README.md index bc1c84d..cd7a06f 100644 --- a/docs/features/shared-fence-filter/README.md +++ b/docs/features/shared-fence-filter/README.md @@ -4,11 +4,11 @@ There were two answers to "which bytes does a `// verilog_format: off` fence protect from an automatic edit", and one of them was missing. The formatter -had `fence::collect`; `vfmt check --fix` had its own union of that plus a -line-scan backstop, written inside `crates/vfmt/src/lint.rs` because the +had `fence::collect`; `lucisv check --fix` had its own union of that plus a +line-scan backstop, written inside `crates/lucisv/src/lint.rs` because the linter crate deliberately does not depend on `vlog_formatter`; and -`vfmt_server`'s quick fixes had **none**, so a lightbulb in an editor happily -rewrote bytes `vfmt check --fix` refused to touch (server-lint Handshake 3, +`lucisv_server`'s quick fixes had **none**, so a lightbulb in an editor happily +rewrote bytes `lucisv check --fix` refused to touch (server-lint Handshake 3, reproduced live by that round's QA). This round moves the CLI's computation down into `vlog_formatter::fence` as `protected_regions` + `is_protected` and has both front ends call it, so the fence answer is defined once. The CLI's @@ -32,12 +32,12 @@ behavior is unchanged byte for byte; the server gains the CLI's example of that width — the formatter's `collect` does not yet fire inside class bodies, the classes round's filed gap, but the scan backstop does, so a fence inside a class body protects `--fix` and server quick fixes even - though `vfmt format` ignores it there.) + though `lucisv format` ignores it there.) - **`protected_regions` takes `&str` and parses internally, on purpose.** The alternative — accepting a caller's `SourceFile` — would let the two front ends feed different trees and get different answers, which is the drift this feature exists to end. The cost is one tolerant parse per call, paid only on - paths that are about to *apply* a fix: `vfmt check --fix` (already + paths that are about to *apply* a fix: `lucisv check --fix` (already re-parsing per round) and `textDocument/codeAction`. The server's per-keystroke diagnostics path pays nothing, because it never reads a fix. - **The regions this function returns are for `is_protected` only.** Unlike @@ -68,12 +68,12 @@ question. `fence_of`, `collect`, `region_at`, `Fence` and `Region` are unchanged, and the formatter's own use of `collect` is untouched — this is additive. -**Consumed by `crates/vfmt/src/lint.rs`**: `fixable_outside_fences` now calls +**Consumed by `crates/lucisv/src/lint.rs`**: `fixable_outside_fences` now calls `protected_regions`, and `touches_fence` is a one-line map over `is_protected`. The file's own `scanned_fence_regions` was **moved**, not copied — it no longer exists there. -**Consumed by `crates/vfmt_server/src/lint.rs`**: `fixable` — the code-action +**Consumed by `crates/lucisv_server/src/lint.rs`**: `fixable` — the code-action path, and only that path — drops any violation whose fix would edit a protected byte. `violations`/`diagnostics` (the publishing path) are deliberately untouched, which is what keeps a fenced finding reported. @@ -94,22 +94,22 @@ dependency for no gain: the two lines that remain are "which violations does - [x] `fence::protected_regions` + `fence::is_protected` in `crates/vlog_formatter/src/fence.rs`, with the scan (`scanned_regions`) - moved down from `crates/vfmt/src/lint.rs`. + moved down from `crates/lucisv/src/lint.rs`. - [x] Unit tests in `fence.rs`: the boundary matrix (first/last byte inside, adjacent-outside both ends, straddling either edge, insertions, empty region list), a good-tree region, the broken-file backstop (asserting the premise — `collect` really does return nothing there), an unclosed fence running to EOF, and ordinary comments protecting nothing. -- [x] `crates/vfmt/src/lint.rs` rewired; the boundary test matrix and every +- [x] `crates/lucisv/src/lint.rs` rewired; the boundary test matrix and every CLI test pass unmodified. -- [x] `crates/vfmt_server/src/lint.rs`: `fixable` filters through the shared +- [x] `crates/lucisv_server/src/lint.rs`: `fixable` filters through the shared answer; `fix_touches_fence` is the all-or-nothing rule. - [x] Server tests: a fenced violation is reported but not fixable, a fence holds in a file that does not parse, an unfenced file is unaffected; no `quickfix` action on a fenced line while the neighbouring free line still has one; `fixAll` leaves fenced bytes byte-identical. - [x] e2e through both real binaries: the server's `fixAll` edit is - byte-identical to what `vfmt check --fix` writes for the same content, + byte-identical to what `lucisv check --fix` writes for the same content, with the CLI still exiting 1 for the finding it declined to fix. - [x] `docs/features/server-lint/README.md` Handshake 3 annotated as delivered. @@ -137,7 +137,7 @@ dependency for no gain: the two lines that remain are "which violations does and `Region` was already the vocabulary). What is *not* shared is which violations a tool offers, because that is genuinely each tool's own question; what is shared is every byte of "what is fenced". -- The scan was **moved verbatim** from `crates/vfmt/src/lint.rs` into +- The scan was **moved verbatim** from `crates/lucisv/src/lint.rs` into `fence.rs` as `scanned_regions` (private; `protected_regions` is the only way in), with `fence::fence_of` calls becoming bare `fence_of`. Same pairing, same EOF rule, same `Region` construction. The CLI's @@ -151,7 +151,7 @@ dependency for no gain: the two lines that remain are "which violations does **unmodified**, as do all 48 CLI integration tests including `check_reports_inside_a_fence_but_never_fixes_there` and `a_fence_holds_even_in_a_file_that_does_not_parse`. -- Three unit tests in `crates/vfmt/src/lint.rs` did have to change, because +- Three unit tests in `crates/lucisv/src/lint.rs` did have to change, because they called the private `scanned_fence_regions` that no longer lives there. They were rewritten to assert the same three behaviors (broken-file backstop, unclosed fence to EOF, ordinary comments) through @@ -164,21 +164,21 @@ dependency for no gain: the two lines that remain are "which violations does fixes and `fixAll` at once and cannot be forgotten by a future third action kind. `violations` was left alone, on purpose and with a doc comment saying why: the finding must still be published. -- The e2e test finds the `vfmt` binary by path next to `CARGO_BIN_EXE_vfmt-server` +- The e2e test finds the `lucisv` binary by path next to `CARGO_BIN_EXE_lucisv-server` (Cargo names no env var for another package's binary) and **skips with a printed note** if it is absent, which can only happen under - `cargo test -p vfmt_server` in a tree where `vfmt` was never built. Under + `cargo test -p lucisv_server` in a tree where `lucisv` was never built. Under the `--workspace` gate it always runs. A test that fails for a reason that is not about the code under test is worse than one that says it skipped. - Did not touch `verify.rs`, `format.rs`, any `.cases` file, `vlog_parser`, - `vlog_linter`, `vlog_semantic`, `vfmt_core` or `editors/**`. No new + `vlog_linter`, `vlog_semantic`, `lucisv_core` or `editors/**`. No new dependency, no `Cargo.toml` edit, no `#[allow]`, no `unwrap`/`expect`/ `panic!`/`unsafe` outside `#[cfg(test)]`. Did not run `git commit`/`git push`. - **Concurrency note.** Another agent was live in `crates/vlog_parser` (the directives-in-instances round) for part of this session; the workspace did not compile for a stretch, exactly as the previous round recorded. Nothing was touched in response; the gates below were run once `vlog_parser` built - again. `cargo fmt` was scoped to `-p vlog_formatter -p vfmt -p vfmt_server` + again. `cargo fmt` was scoped to `-p vlog_formatter -p lucisv -p lucisv_server` rather than `--all` for the same reason. That round's `format.rs` had landed in the tree by then; `git diff` on it shows four hunks, every one of them their own semantic edit and none a whitespace-only reflow, so the @@ -188,21 +188,21 @@ dependency for no gain: the two lines that remain are "which violations does - `cargo test --workspace`: **574 passed, 0 failed**, up from **563** at the session's start commit `6e6aacb`. The +11 are all this round's: 5 in - `vlog_formatter`'s `fence.rs`, 3 in `vfmt_server`'s `lint.rs`, 2 in its - `code_action.rs`, 1 e2e. `crates/vfmt` is net 0 — three scan tests became + `vlog_formatter`'s `fence.rs`, 3 in `lucisv_server`'s `lint.rs`, 2 in its + `code_action.rs`, 1 e2e. `crates/lucisv` is net 0 — three scan tests became three filter tests. - `cargo clippy --workspace --all-targets`: **silent** (re-run after touching every file this round changed, to rule out a cached result). -- `cargo fmt -p vlog_formatter -p vfmt -p vfmt_server -- --check`: clean. +- `cargo fmt -p vlog_formatter -p lucisv -p lucisv_server -- --check`: clean. `--all` was deliberately **not** used: `crates/vlog_parser` belongs to the concurrent round and is not this round's to reformat. **Byte-identity of the CLI, measured rather than argued.** Two `git worktree` builds — `old` at `6e6aacb`, `new` at `6e6aacb` + this round's diff to -`fence.rs` and `crates/vfmt/src/lint.rs` and nothing else, so the concurrent +`fence.rs` and `crates/lucisv/src/lint.rs` and nothing else, so the concurrent round's uncommitted parser work perturbs neither: -- `vfmt check corpus/ --output-format json`: **byte-identical** (2 407 345 +- `lucisv check corpus/ --output-format json`: **byte-identical** (2 407 345 bytes of JSON), stderr byte-identical, both exit 1. - 22 crafted fence shapes (simple, unclosed, broken-parse-before-the-fence, long spelling, `off-by-one`, block comment, indented fence, trailing fence, @@ -234,26 +234,26 @@ their round, not this one. ### 2026-08-19 — QA Read `CLAUDE.md`, this feature's README (dev's Work log included), and the -diff to `fence.rs`, `crates/vfmt/src/lint.rs`, `crates/vfmt_server/src/lint.rs`, +diff to `fence.rs`, `crates/lucisv/src/lint.rs`, `crates/lucisv_server/src/lint.rs`, `code_action.rs`, `tests/e2e.rs`, and `server-lint`'s annotations, before -touching anything. Scoped to `-p vlog_formatter -p vfmt -p vfmt_server` +touching anything. Scoped to `-p vlog_formatter -p lucisv -p lucisv_server` throughout, per the concurrency note (`vlog_parser`/`format.rs`/`.cases` were live under another agent for part of this session). -**Gates.** `cargo test -p vlog_formatter -p vfmt -p vfmt_server`: all 11 test -binaries green (vfmt-server unittests 109, `cli.rs` 48, `e2e.rs` 5, +**Gates.** `cargo test -p vlog_formatter -p lucisv -p lucisv_server`: all 11 test +binaries green (lucisv-server unittests 109, `cli.rs` 48, `e2e.rs` 5, `vlog_formatter` unittests 13, its `verification.rs` 63, `fences.rs` 6, etc.) -— **0 failures**. `crates/vfmt/tests/cli.rs` has an **empty `git diff`**, +— **0 failures**. `crates/lucisv/tests/cli.rs` has an **empty `git diff`**, i.e. the 48 CLI tests are not merely passing, they are byte-for-byte unmodified, confirming the README's claim directly rather than by count. -`cargo clippy -p vlog_formatter -p vfmt -p vfmt_server --all-targets`: -silent. `cargo fmt -p vlog_formatter -p vfmt -p vfmt_server -- --check`: clean +`cargo clippy -p vlog_formatter -p lucisv -p lucisv_server --all-targets`: +silent. `cargo fmt -p vlog_formatter -p lucisv -p lucisv_server -- --check`: clean at the time of this check. Note: mid-session it briefly reported diffs, all three confined to `crates/vlog_formatter/tests/verification.rs` lines 600-679 — `git diff` on that file attributes those lines to the concurrent directives-in-instances round (new tests added there), not to this diff; the five files this feature actually touches (`fence.rs`, -`vfmt/src/lint.rs`, `vfmt_server/src/lint.rs`, `code_action.rs`, `e2e.rs`) +`lucisv/src/lint.rs`, `lucisv_server/src/lint.rs`, `code_action.rs`, `e2e.rs`) were independently checked with `rustfmt --check` and are clean on their own, and the workspace-wide check is clean again as of this writing (the other agent evidently ran its own `cargo fmt` since). No `#[allow]`, `unwrap`/ @@ -271,7 +271,7 @@ Confirmed. **Claim 2 (CLI byte-identity).** Built two release binaries in isolated `git worktree`s: `old` at `6e6aacb`, `new` at `6e6aacb` plus only this -feature's diff to `fence.rs` and `crates/vfmt/src/lint.rs` (copied the two +feature's diff to `fence.rs` and `crates/lucisv/src/lint.rs` (copied the two files directly; `git diff --stat` in that worktree confirmed exactly those two files, 171 lines, matching the dev's own isolation). Ran 8 crafted fence shapes (simple, unclosed-to-EOF, broken-parse-before-the-fence/scan-backstop, @@ -281,7 +281,7 @@ file byte-identical** (`cmp` clean on all 8), stdout identical (`found 15 violations, fixed 8 violations` from both), exit 1 from both. This is a smaller sample than the dev's 22-shape run but corroborates it independently rather than repeating it. The 3 rewritten unit tests in -`crates/vfmt/src/lint.rs` were read: they now call `fixable_outside_fences` +`crates/lucisv/src/lint.rs` were read: they now call `fixable_outside_fences` end-to-end with a `no-tabs`-shaped violation instead of asserting on `scanned_fence_regions`'s return shape directly, but assert the same three behaviors (broken-file backstop, unclosed-to-EOF, ordinary-comment-is-not- @@ -289,7 +289,7 @@ a-fence) — confirmed by reading, and by the sabotage below, which fails two of exactly these three. **Claim 3 (server drops fenced fixes, diagnostics untouched).** Drove the -real `vfmt-server` debug binary live over hand-framed LSP JSON-RPC (Python, +real `lucisv-server` debug binary live over hand-framed LSP JSON-RPC (Python, not the Rust `talk()` helper, so this is independent of the e2e test's own plumbing): - Fenced tab: diagnostic published at both the fenced and unfenced lines; @@ -301,7 +301,7 @@ plumbing): diagnostics still published (including the fenced tab's `no-tabs`), and `codeAction` at the fenced tab still returns `[]` — the scan backstop holds through the server's path too, not just the CLI's. -- Fence + waiver: `// vfmt: waive no-tabs` on the line before a fenced, +- Fence + waiver: `// lucisv: waive no-tabs` on the line before a fenced, tabbed `wire a;` → **zero diagnostics for that violation** (not "reported but unfixable" — genuinely absent), while the unfenced tab two lines later is still reported. This is correct and is not a fence @@ -334,7 +334,7 @@ lead, not fixed here. `vlog_formatter`/`vlog_parser` as path deps, so as not to touch any crate under test): - `protected_regions("")` → 0 regions. -- Fence spelled inside a string literal (`string s = "// vfmt: off";`) → 0 +- Fence spelled inside a string literal (`string s = "// lucisv: off";`) → 0 regions — correct, the line as a whole does not start with `//` after trimming, so `fence_of` never fires on it. - Block-comment spelling (`/* verilog_format: off */`) → 0 regions — @@ -364,8 +364,8 @@ under test): — protected, per the `end.max(start+1)` rule — insertion just past the end — not protected). Both front ends call `fence::is_protected` with identical argument shape (`(range.start as usize, range.end as usize)` in - both `vfmt/src/lint.rs::touches_fence` and - `vfmt_server/src/lint.rs::fix_touches_fence`), so "both front ends refuse + both `lucisv/src/lint.rs::touches_fence` and + `lucisv_server/src/lint.rs::fix_touches_fence`), so "both front ends refuse identically" is a structural guarantee, not merely an observed one — there is no live rule today that emits a pure-insertion fix to exercise this end-to-end (`no-tabs` and `no-trailing-whitespace` both replace @@ -374,11 +374,11 @@ under test): **Sabotage.** Edited `protected_regions` in the working tree to drop the `regions.extend(scanned_regions(src))` line (tree-only). Result: -`crates/vfmt/src/lint.rs` unit tests — 3 failures (`the_line_scan_backstops_ +`crates/lucisv/src/lint.rs` unit tests — 3 failures (`the_line_scan_backstops_ a_file_that_does_not_parse`, `an_unclosed_fence_runs_to_the_end_of_the_file`, -`fixes_outside_a_fence_survive_the_filter`); `crates/vfmt`'s own CLI +`fixes_outside_a_fence_survive_the_filter`); `crates/lucisv`'s own CLI integration test `a_fence_holds_even_in_a_file_that_does_not_parse` — -failed; `vfmt_server`'s `lint::tests::a_fence_holds_even_when_the_file_ +failed; `lucisv_server`'s `lint::tests::a_fence_holds_even_when_the_file_ does_not_parse` — failed; `vlog_formatter`'s own `the_line_scan_backstops_a_file_that_does_not_parse` — failed, as expected. Reverted by hand (restored the two-line body exactly); `git diff` on diff --git a/docs/features/spans/README.md b/docs/features/spans/README.md index 7ae3783..ee455c4 100644 --- a/docs/features/spans/README.md +++ b/docs/features/spans/README.md @@ -176,7 +176,7 @@ Decisions, all unit-tested: rust-analyzer. A 4 GiB Verilog file is not a use case; `u32` halves the size cost of putting a span on every node. Nothing enforces this: a larger file would truncate offsets rather than fail, which is worth a guard if - vfmt ever grows an entry point that does not read the whole file into a + lucisv ever grows an entry point that does not read the whole file into a `String` first (today `usize`→`u32` conversion happens only in the lexer, from offsets into a `&str` the CLI already read whole). - **One file, no virtual sources.** A `TextRange` has no file identity; @@ -305,8 +305,8 @@ check that matters. - Did not touch `verify.rs`, `tools/`, `corpus/`, or the formatter's behavior. Did not run `git commit`/`git push`. - **Concurrency note:** another agent's `config-discovery` work landed in the - same working tree during this round (`crates/vfmt/src/config.rs`, - `crates/vfmt/tests/cli.rs`, `args.rs`, `main.rs`, `README.md`, TODO.md §3). + same working tree during this round (`crates/lucisv/src/config.rs`, + `crates/lucisv/tests/cli.rs`, `args.rs`, `main.rs`, `README.md`, TODO.md §3). Mid-round its `a_config_file_is_found_by_searching_upward` was failing at `cli.rs:317` (with `indent = 4` in the config it expected `WIDE_SPLIT`, a constant written with 2-space indent). Confirmed it was theirs and not this @@ -326,7 +326,7 @@ md5 `3fab114f4f00626b254259e9dafe0ed7` — **byte-identical** to the pre-change baseline; 820 files, 466 would-reformat, 2 ok-unchanged, 352 parse-error, **0 verification errors, 0 crashes**. All four corpus repos `git status --porcelain` clean apart from the pre-existing untracked -`.vfmt-corpus-rev` stamps. Files touched: +`.lucisv-corpus-rev` stamps. Files touched: `crates/vlog_parser/src/{span,line_index}.rs` (new), `crates/vlog_parser/src/{lib,token,lexer,ast,parser}.rs`, `crates/vlog_parser/tests/spans.rs` (new), @@ -346,7 +346,7 @@ part of the final diff. No commits made. **Tool results — all green:** - `cargo test --workspace`: **158 passed, 0 failed** at the time of this round (later observed at 160 as the concurrent `config-discovery` agent's - work landed two more `vfmt` unit tests in the same tree — unrelated to + work landed two more `lucisv` unit tests in the same tree — unrelated to this feature, confirmed by re-diffing; this feature's own crates stayed at 47 (`vlog_parser` unit) + 10 (`tests/spans.rs`) throughout). - `cargo clippy --workspace --all-targets`: 0 warnings. @@ -415,13 +415,13 @@ than trusted from the work log.** — byte-identical to the dev's reported baseline. (Built from the current tree, which also includes the now-committed `config-discovery` change; the match confirms neither feature altered corpus-visible output.) -- Built a second `vfmt` release binary from a `git worktree` at `HEAD` +- Built a second `lucisv` release binary from a `git worktree` at `HEAD` (`481cce2`, i.e. immediately pre-spans, config-discovery already committed) and diffed its `--stdin-filename f - < f` output against the working-tree binary (spans included) over **all 820 `.sv`/`.v` corpus files**, not just 3-4: **0 differences**. Worktree removed after. - Corpus repos' `git status --porcelain`: clean apart from the pre-existing - untracked `.vfmt-corpus-rev` stamps, confirmed again. + untracked `.lucisv-corpus-rev` stamps, confirmed again. - No `.cases`/fixture/snapshot files under `crates/vlog_formatter/tests/` show as modified in `git status`. diff --git a/docs/features/types-decls/README.md b/docs/features/types-decls/README.md index 69124ba..91b8d55 100644 --- a/docs/features/types-decls/README.md +++ b/docs/features/types-decls/README.md @@ -3,8 +3,8 @@ ## Goal Close the `types-decls` bucket of `scripts/score.sh`: the seven declaration -shapes that real RTL writes and vfmt could not parse. All of them are about a -**type standing somewhere vfmt only accepted a name** — an anonymous +shapes that real RTL writes and lucisv could not parse. All of them are about a +**type standing somewhere lucisv only accepted a name** — an anonymous `enum`/`struct`/`union` used as a type in place, a typedef'd name carrying packed dimensions, a `type` parameter outside the `#( ... )` list — plus a `for` loop whose init declares more than one variable. @@ -64,7 +64,7 @@ packed dimensions, a `type` parameter outside the `#( ... )` list — plus a - `ast::{EnumType, EnumMember, StructType, StructMember, Declarator, ListDirective}` now derive `Clone`, so `DataType` can keep deriving it. - No new `ItemKind` / `StmtKind` / `ExprKind` variants, so no exhaustive-match - arms were needed in `vlog_linter::visit`, `vlog_semantic` or `vfmt_server`. + arms were needed in `vlog_linter::visit`, `vlog_semantic` or `lucisv_server`. **Requests for other modules (not done here)** @@ -174,7 +174,7 @@ size and clippy is clean with no suppressions. **Not fixed, and why.** `corpus/ibex/vendor/google_riscv-dv/src/isa/custom/riscv_custom_instr_enum.sv` is an `include` fragment — a bare `CUSTOM_1,` at top level, meant to be -pasted inside an enum body. It is not a translation unit and vfmt should keep +pasted inside an enum body. It is not a translation unit and lucisv should keep rejecting it. It is classified `invalid-or-fragment`, not `types-decls`, in both the before and after TSVs, so it was never in this bucket's count. diff --git a/docs/features/vlog-semantic/README.md b/docs/features/vlog-semantic/README.md index 6b7d8c1..651bea7 100644 --- a/docs/features/vlog-semantic/README.md +++ b/docs/features/vlog-semantic/README.md @@ -224,7 +224,7 @@ region | generate block | for-generate header | for/foreach statement`. - `token::is_keyword` — to tell a built-in type keyword from a user type name, and to drop keywords the parser left in identifier slots. -**Promised to consumers** (`vfmt_server`, the workspace index, future lint +**Promised to consumers** (`lucisv_server`, the workspace index, future lint rules): - `analyze` never panics and never fails, on any input, tolerant tree or not. @@ -380,10 +380,10 @@ Gates: - Root `Cargo.toml` diff: the `members` line gains `vlog_semantic`, as claimed. (The diff also carries an unrelated `[workspace.dependencies] rayon = "=1.12.0"` hunk — that belongs to the concurrently-worked - `parallel-files`/`vfmt` feature, out of my scope, noted only so the + `parallel-files`/`lucisv` feature, out of my scope, noted only so the "members-line-only" claim for *this* feature isn't misread against the whole file.) -- `cargo test --workspace`: **2 failures**, both in `crates/vfmt` +- `cargo test --workspace`: **2 failures**, both in `crates/lucisv` (`a_deeply_nested_file_formats_on_a_worker_thread`, `deeply_nested_file_does_not_kill_the_batch`) — outside my gate (`-p vlog_semantic` is green) and inside the area another QA agent owns @@ -526,7 +526,7 @@ What earned it: clean files, 19.6% waiting on the index) is exactly the honest number the workspace-index feature will be measured against. -The workspace-green gate was transiently false during QA (two vfmt +The workspace-green gate was transiently false during QA (two lucisv deep-nesting tests) — timing overlap with the parallel-files QA's deliberate stack-sabotage check, verified restored before the joint commit. diff --git a/docs/features/workspace-index/README.md b/docs/features/workspace-index/README.md index de22ba5..6bf3d02 100644 --- a/docs/features/workspace-index/README.md +++ b/docs/features/workspace-index/README.md @@ -14,7 +14,7 @@ against that index and answers them in an **overlay** keyed by reference id. That is what turns `import prim_pkg::*` and `prim_fifo_sync u_fifo (...)` into a jump into the file that declares them — TODO.md §6's "cross-file resolution through header imports", the last piece `textDocument/definition` needs before -`vfmt_server` can be written. +`lucisv_server` can be written. ## API as built @@ -183,7 +183,7 @@ caller does know which file it means. the corpus does this. - `build` is O(files) and single-threaded. Measured at 860 files below; a workspace an order of magnitude larger would want the same rayon treatment - `vfmt` already applies to formatting, which is a change of caller, not of + `lucisv` already applies to formatting, which is a change of caller, not of this API. ## Non-goals @@ -229,7 +229,7 @@ unchanged by where the span comes from. Nothing here needs revisiting when ever change the spelling of a path, `follow_one` in `workspace.rs` changes with it. -**Promised to consumers (`vfmt_server`):** +**Promised to consumers (`lucisv_server`):** - `WorkspaceIndex::build` never panics and never fails, on any input, including files that do not lex. diff --git a/editors/nvim/README.md b/editors/nvim/README.md index 9bb91ec..d3de3db 100644 --- a/editors/nvim/README.md +++ b/editors/nvim/README.md @@ -1,6 +1,6 @@ -# vfmt for Vim / Neovim +# lucisv for Vim / Neovim -There is no plugin here, on purpose: `vfmt-server` speaks plain LSP over stdio, +There is no plugin here, on purpose: `lucisv-server` speaks plain LSP over stdio, and every editor in this family already ships a client. What follows is configuration, not code. @@ -8,7 +8,7 @@ Build the server first and put it on your `PATH`: ```bash cargo build --release # from the repo root -cp target/release/vfmt-server ~/.local/bin/ +cp target/release/lucisv-server ~/.local/bin/ ``` ## Neovim 0.11+ (built-in `vim.lsp.config`, no plugins) @@ -20,16 +20,16 @@ needed for a server this simple. -- ~/.config/nvim/init.lua vim.filetype.add({ extension = { v = 'verilog', vh = 'verilog', sv = 'systemverilog', svh = 'systemverilog' } }) -vim.lsp.config('vfmt', { - cmd = { 'vfmt-server' }, +vim.lsp.config('lucisv', { + cmd = { 'lucisv-server' }, filetypes = { 'verilog', 'systemverilog' }, - root_markers = { 'vfmt.toml', '.vfmt.toml', '.git' }, + root_markers = { 'lucisv.toml', '.lucisv.toml', '.git' }, }) -vim.lsp.enable('vfmt') +vim.lsp.enable('lucisv') ``` -Use an absolute path in `cmd` (`{ '/path/to/target/release/vfmt-server' }`) if +Use an absolute path in `cmd` (`{ '/path/to/target/release/lucisv-server' }`) if you would rather not install the binary. **The `vim.filetype.add` line is not boilerplate.** In the stock runtime @@ -42,24 +42,24 @@ never attaches the server. Drop the `v =` entry if you also write Coq or V. ## Neovim 0.9 / 0.10 (`nvim-lspconfig`) -`vfmt` is not in `nvim-lspconfig`'s registry, so register the config yourself: +`lucisv` is not in `nvim-lspconfig`'s registry, so register the config yourself: ```lua local configs = require('lspconfig.configs') local util = require('lspconfig.util') -if not configs.vfmt then - configs.vfmt = { +if not configs.lucisv then + configs.lucisv = { default_config = { - cmd = { 'vfmt-server' }, + cmd = { 'lucisv-server' }, filetypes = { 'verilog', 'systemverilog' }, - root_dir = util.root_pattern('vfmt.toml', '.vfmt.toml', '.git'), + root_dir = util.root_pattern('lucisv.toml', '.lucisv.toml', '.git'), single_file_support = true, }, } end -require('lspconfig').vfmt.setup({}) +require('lspconfig').lucisv.setup({}) ``` `single_file_support = true` matters: the server works with no workspace root @@ -71,7 +71,7 @@ serving everything single-file. Only cross-file navigation needs a root. One `autocmd`, in `~/.vimrc`: ```vim -au User lsp_setup call lsp#register_server({'name': 'vfmt', 'cmd': {server_info->['vfmt-server']}, 'allowlist': ['verilog', 'systemverilog']}) +au User lsp_setup call lsp#register_server({'name': 'lucisv', 'cmd': {server_info->['lucisv-server']}, 'allowlist': ['verilog', 'systemverilog']}) ``` ## coc.nvim @@ -81,10 +81,10 @@ coc has no `vim.lsp`; it takes servers from `coc-settings.json` (`:CocConfig`): ```jsonc { "languageserver": { - "vfmt": { - "command": "vfmt-server", + "lucisv": { + "command": "lucisv-server", "filetypes": ["verilog", "systemverilog"], - "rootPatterns": ["vfmt.toml", ".vfmt.toml", ".git"] + "rootPatterns": ["lucisv.toml", ".lucisv.toml", ".git"] } } } @@ -92,7 +92,7 @@ coc has no `vim.lsp`; it takes servers from `coc-settings.json` (`:CocConfig`): ## What you get, and what you don't -Everything in `docs/features/vfmt-server/README.md`'s capability table: +Everything in `docs/features/lucisv-server/README.md`'s capability table: `gd` (definition), `gr` (references, in-file only for now), `K` (hover, including `` `define`` expansion), `vim.lsp.buf.format()`, document and workspace symbols, diagnostics as you type, and semantic tokens — Neovim @@ -107,7 +107,7 @@ a matching `end` after a `begin` — but that is `textDocument/inlineCompletion` still proposed in LSP 3.18, and Neovim's built-in LSP client does not implement it yet. Nothing is lost: the same skeletons are in the completion list, where they have been since `docs/features/completion-templates`. Turn the server side -off with `vfmt.inlineTemplates = false` in your `settings` table if you would +off with `lucisv.inlineTemplates = false` in your `settings` table if you would rather it never answered. Two behaviors worth knowing before you file a bug: @@ -115,7 +115,7 @@ Two behaviors worth knowing before you file a bug: - **The workspace index rebuilds on save, not on keystroke.** Cross-file answers about file A reflect A as of its last write. A's own buffer is always current. This is the documented staleness model, not a lag. -- **`vfmt.toml` is honored.** The server discovers it per file exactly as +- **`lucisv.toml` is honored.** The server discovers it per file exactly as the CLI does; a config setting beats your `shiftwidth`/`tabstop` (an editor default is not a deliberate override), and without a config your editor's tab size governs the indent. @@ -137,7 +137,7 @@ vim.api.nvim_create_autocmd('BufWritePre', { :lua =vim.lsp.get_clients({ bufnr = 0 })[1].server_capabilities ``` -A healthy attach shows one client named `vfmt` with +A healthy attach shows one client named `lucisv` with `documentFormattingProvider`, `hoverProvider`, `definitionProvider`, `referencesProvider`, `documentSymbolProvider`, `workspaceSymbolProvider` and `semanticTokensProvider` set, and `positionEncoding` `utf-16`. @@ -146,7 +146,7 @@ If the client never attaches, the binary is the first thing to check, and you can check it without Neovim at all: ```bash -node ../vscode/smoke.js "$(command -v vfmt-server)" +node ../vscode/smoke.js "$(command -v lucisv-server)" ``` That drives a full LSP session over stdio and exits 0 only if the handshake and diff --git a/editors/vscode/README.md b/editors/vscode/README.md index 119ca8a..10c9cba 100644 --- a/editors/vscode/README.md +++ b/editors/vscode/README.md @@ -1,30 +1,30 @@ -# vfmt for VS Code +# lucisv for VS Code A thin extension: it registers the Verilog/SystemVerilog file types and starts -`vfmt-server`. Every *analysis* feature you see — formatting, diagnostics, +`lucisv-server`. Every *analysis* feature you see — formatting, diagnostics, semantic highlighting, hover, go-to-definition, references, symbols — comes from the server, so this directory contains no language logic and no editor-specific commands. The two exceptions are the snippet library and the TextMate grammar below, both static data VS Code reads straight from the manifest — LSP has no channel for either. See -`docs/features/vfmt-server/README.md` for the capability list, +`docs/features/lucisv-server/README.md` for the capability list, `docs/features/editor-packaging/README.md` for why the extension looks like this, and `docs/features/editor-snippets/README.md` for the snippets. ## 1. Build the server ```bash -cargo build --release # from the repo root; binary at target/release/vfmt-server +cargo build --release # from the repo root; binary at target/release/lucisv-server ``` Put it on your `PATH`: ```bash -cp target/release/vfmt-server ~/.local/bin/ # or wherever your PATH points +cp target/release/lucisv-server ~/.local/bin/ # or wherever your PATH points ``` Or leave it in `target/release` and point the extension at it with the -`vfmt.serverPath` setting (below). +`lucisv.serverPath` setting (below). ## 2. Smoke-test the spawn contract (no editor needed) @@ -34,8 +34,8 @@ argument list (none), same cwd, same inherited environment — and drives a full hand-rolled `Content-Length` framing. Plain `node`, no dependencies. ```bash -node smoke.js # `vfmt-server` from PATH -node smoke.js ../../target/release/vfmt-server # an explicit binary +node smoke.js # `lucisv-server` from PATH +node smoke.js ../../target/release/lucisv-server # an explicit binary ``` It prints `smoke: OK — …` and exits 0, or names the failure and exits 1. Run it @@ -47,14 +47,14 @@ catches "the binary moved" or "the handshake broke" without launching VS Code. ```bash npm ci # installs vscode-languageclient (the only dependency) npx @vscode/vsce package -code --install-extension vfmt-0.5.0.vsix +code --install-extension lucisv-0.5.0.vsix ``` Then reload VS Code and open a `.v`/`.sv`/`.vh`/`.svh` file. `tools/release.sh` from the repo root does all of the above (plus the release binaries and checksums) and drops the `.vsix` in `dist/`, so -`code --install-extension dist/vfmt-0.5.0.vsix` is the one-command path. +`code --install-extension dist/lucisv-0.5.0.vsix` is the one-command path. `editors/vscode/LICENSE` is a copy of the repo's MIT license and is what lets `vsce package` run without `--skip-license`. If you are packaging a fork that dropped `package.json`'s `repository` field, add `--allow-missing-repository`. @@ -73,28 +73,28 @@ if it ever happens. | Setting | Default | What it does | |---|---|---| -| `vfmt.serverPath` | `"vfmt-server"` | Path to the executable. A bare name is looked up on `PATH`; an absolute path is used as given. | -| `vfmt.rainbowBeginEnd` | `true` | Colour each nesting level of `begin`/`end` and `fork`/`join` differently, and half a pair in an error colour. Takes effect immediately — no reload. | -| `vfmt.lineLength` | unset | Maximum line width, same as `line-length` in a `vfmt.toml`. 40–400. | -| `vfmt.indent` | unset | Indent width in spaces, same as `indent` in a `vfmt.toml`. 1–8. | -| `vfmt.exclude` | `[]` | Extra patterns to keep out of the workspace index, same as `exclude` in a `vfmt.toml`. **Added to** the project's excludes, never replacing them. | -| `vfmt.filelist` | `""` | Path to an EDA filelist (`.f`), absolute or relative to the workspace folder. When set, exactly the files it names are indexed. Overrides a `filelist` key in the project's `vfmt.toml`. | +| `lucisv.serverPath` | `"lucisv-server"` | Path to the executable. A bare name is looked up on `PATH`; an absolute path is used as given. | +| `lucisv.rainbowBeginEnd` | `true` | Colour each nesting level of `begin`/`end` and `fork`/`join` differently, and half a pair in an error colour. Takes effect immediately — no reload. | +| `lucisv.lineLength` | unset | Maximum line width, same as `line-length` in a `lucisv.toml`. 40–400. | +| `lucisv.indent` | unset | Indent width in spaces, same as `indent` in a `lucisv.toml`. 1–8. | +| `lucisv.exclude` | `[]` | Extra patterns to keep out of the workspace index, same as `exclude` in a `lucisv.toml`. **Added to** the project's excludes, never replacing them. | +| `lucisv.filelist` | `""` | Path to an EDA filelist (`.f`), absolute or relative to the workspace folder. When set, exactly the files it names are indexed. Overrides a `filelist` key in the project's `lucisv.toml`. | -The last four mirror the four keys `vfmt.toml` supports, for people with no -config file in the tree. **A `vfmt.toml` always wins over them** — except -`vfmt.filelist`, which is a scope, not a style, and is explained below. So a project +The last four mirror the four keys `lucisv.toml` supports, for people with no +config file in the tree. **A `lucisv.toml` always wins over them** — except +`lucisv.filelist`, which is a scope, not a style, and is explained below. So a project that checks one in keeps one source of truth and format-on-save cannot drift -from CI's `vfmt --check`. Full precedence, highest first: +from CI's `lucisv --check`. Full precedence, highest first: -1. `vfmt.toml`, discovered per file exactly as the CLI discovers it. -2. `vfmt.lineLength` / `vfmt.indent` — typed on purpose, but one user's editor. +1. `lucisv.toml`, discovered per file exactly as the CLI discovers it. +2. `lucisv.lineLength` / `lucisv.indent` — typed on purpose, but one user's editor. 3. VS Code's tab size — sent on every request whether or not you chose it, so - the weakest thing that is still a signal. (`vfmt.lineLength` has no analog + the weakest thing that is still a signal. (`lucisv.lineLength` has no analog here at all: LSP carries no line-length option.) 4. The built-in defaults: indent 2, width 100. -Each rung applies only where the ones above it say nothing, so a `vfmt.toml` -naming only `indent` still lets `vfmt.lineLength` choose the width. Changes +Each rung applies only where the ones above it say nothing, so a `lucisv.toml` +naming only `indent` still lets `lucisv.lineLength` choose the width. Changes take effect on the next format — no reload — and out-of-range or wrong-typed values are ignored rather than half-honoured. @@ -103,13 +103,13 @@ values are ignored rather than half-honoured. Navigation, hover and workspace symbols answer from an index of the project's files. What goes into it, highest first: -1. **A filelist**, if there is one — `vfmt.filelist`, else a `filelist` key in - the project's `vfmt.toml`. Exactly the files it names are indexed, so a +1. **A filelist**, if there is one — `lucisv.filelist`, else a `filelist` key in + the project's `lucisv.toml`. Exactly the files it names are indexed, so a vendored copy your build does not compile stops showing up in go-to-definition. Standard `.f` syntax: one path per line, `-f other.f` to nest, `+incdir+`/`+define+` (recorded, unused for now), `#` and `//` comments, `$VAR`/`${VAR}` expansion, paths relative to the filelist itself. -2. **The workspace folder**, walked as `vfmt` itself walks it — same +2. **The workspace folder**, walked as `lucisv` itself walks it — same extensions, same `.gitignore`, same excludes. 3. **The open file's own directory**, when no folder is open at all. @@ -135,7 +135,7 @@ Two highlighters, and they are not rivals: by semantic tokens), a file before the server has started, and previews VS Code renders without a language server at all, such as a diff or a git blame. -One grammar file serves both `verilog` and `systemverilog`, because vfmt's +One grammar file serves both `verilog` and `systemverilog`, because lucisv's lexer draws no line between the two. Its keyword list is generated from that lexer's own list and a test in the repository fails if they drift apart. It covers no operators and no `(* attributes *)` — see @@ -156,8 +156,8 @@ theme you use, and you can change any of them in ```jsonc "workbench.colorCustomizations": { - "vfmt.rainbow1": "#FFD700", // and rainbow2 … rainbow6 - "vfmt.rainbowUnmatched": "#FF1212" // the half-pair colour + "lucisv.rainbow1": "#FFD700", // and rainbow2 … rainbow6 + "lucisv.rainbowUnmatched": "#FF1212" // the half-pair colour } ``` @@ -165,7 +165,7 @@ theme you use, and you can change any of them in defaults the last three of those to transparent, so borrowing them made deeply nested `begin`s invisible in most themes.) -Turn it off with `"vfmt.rainbowBeginEnd": false`; the colours disappear +Turn it off with `"lucisv.rainbowBeginEnd": false`; the colours disappear immediately. Cursor on a `begin` also highlights its matching `end` — that is `documentHighlight`, always on, and it needs no setting. @@ -230,7 +230,7 @@ The extension registers no formatter of its own — the server advertises bar. Another Verilog extension may own the `.sv` extension with a different language id; this one attaches to `verilog` and `systemverilog`. - **"command not found" style failure on startup.** The server is not on - `PATH`. Set `vfmt.serverPath` to an absolute path, and confirm the binary + `PATH`. Set `lucisv.serverPath` to an absolute path, and confirm the binary itself works with `node smoke.js `. -- **See what the server is saying.** View → Output → the `vfmt` channel carries +- **See what the server is saying.** View → Output → the `lucisv` channel carries the client/server log, including anything the server writes to stderr. diff --git a/editors/vscode/extension.js b/editors/vscode/extension.js index 09d5cea..75efc83 100644 --- a/editors/vscode/extension.js +++ b/editors/vscode/extension.js @@ -1,7 +1,7 @@ -// The whole VS Code extension: start `vfmt-server` over stdio, let the +// The whole VS Code extension: start `lucisv-server` over stdio, let the // language client do the rest, and paint one thing the protocol has no request // for — the `begin`/`end` rainbow, whose ranges the server computes and hands -// over through the custom `vfmt/scopePairs` request. +// over through the custom `lucisv/scopePairs` request. // // Every *answer* still comes from the server: nothing here parses Verilog, and // the only reason this file is longer than the language client's setup is that @@ -20,7 +20,7 @@ const LANGUAGES = ['verilog', 'systemverilog']; /** * How many colours the rainbow cycles through. Six, to match VS Code's own * bracket colouring — but the colours are **this extension's own** - * (`vfmt.rainbow1..6`, contributed with visible defaults for every theme kind + * (`lucisv.rainbow1..6`, contributed with visible defaults for every theme kind * in `package.json`), not `editorBracketHighlight.foreground1..6`. Those look * like the obvious thing to borrow and are a trap: VS Code's registry defaults * `foreground4`, `5` and `6` to `#00000000` — fully transparent — and leaves it @@ -38,7 +38,7 @@ let decorationTypes = []; /** The decoration for a `begin`/`end` whose counterpart is missing. */ let unmatchedType; -/** Whether the rainbow is on, per `vfmt.rainbowBeginEnd`. */ +/** Whether the rainbow is on, per `lucisv.rainbowBeginEnd`. */ let rainbowEnabled = true; /** The pending debounced repaint, if any. */ @@ -46,9 +46,9 @@ let repaintTimer; /** Spawn the server and attach it to Verilog/SystemVerilog documents. */ function activate(context) { - const serverPath = vscode.workspace.getConfiguration('vfmt').get('serverPath') || 'vfmt-server'; + const serverPath = vscode.workspace.getConfiguration('lucisv').get('serverPath') || 'lucisv-server'; - // No arguments: `vfmt-server` takes none and speaks LSP on stdin/stdout. + // No arguments: `lucisv-server` takes none and speaks LSP on stdin/stdout. // `editors/vscode/smoke.js` spawns it exactly this way. const serverOptions = { command: serverPath, @@ -57,18 +57,18 @@ function activate(context) { }; // No `scheme` filter: the server serves `untitled:` buffers too, for - // everything single-file (docs/features/vfmt-server/README.md). + // everything single-file (docs/features/lucisv-server/README.md). const clientOptions = { documentSelector: LANGUAGES.map((language) => ({ language })), - // Push the whole `vfmt` section to the server as + // Push the whole `lucisv` section to the server as // `workspace/didChangeConfiguration` — once when the client initializes - // and again on every change. The server reads `vfmt.lineLength`, - // `vfmt.indent` and `vfmt.exclude` from it and ignores the rest + // and again on every change. The server reads `lucisv.lineLength`, + // `lucisv.indent` and `lucisv.exclude` from it and ignores the rest // (docs/features/editor-settings/README.md). - synchronize: { configurationSection: 'vfmt' }, + synchronize: { configurationSection: 'lucisv' }, }; - client = new LanguageClient('vfmt', 'vfmt', serverOptions, clientOptions); + client = new LanguageClient('lucisv', 'lucisv', serverOptions, clientOptions); // `textDocument/inlineCompletion` is LSP 3.18 and still proposed, so // vscode-languageclient 9 does not register its client feature by default — // without this, the server's `inlineCompletionProvider` capability is read @@ -81,12 +81,12 @@ function activate(context) { // Every colour is one this extension contributes, so every one of them has // an opaque default in every theme kind: a theme that says nothing about - // `vfmt.rainbowN` gets our default, and a theme or user that overrides it + // `lucisv.rainbowN` gets our default, and a theme or user that overrides it // gets what they asked for. Nothing here may ever be transparent — the // rainbow colours code, it never hides it. decorationTypes = Array.from({ length: RAINBOW_COLORS }, (_, index) => vscode.window.createTextEditorDecorationType({ - color: new vscode.ThemeColor(`vfmt.rainbow${index + 1}`), + color: new vscode.ThemeColor(`lucisv.rainbow${index + 1}`), }), ); // Half a pair has no nesting level and therefore no rainbow colour. It is @@ -94,7 +94,7 @@ function activate(context) { // undecorated: a `begin` that lost its `end` is exactly what the user wants // to see. unmatchedType = vscode.window.createTextEditorDecorationType({ - color: new vscode.ThemeColor('vfmt.rainbowUnmatched'), + color: new vscode.ThemeColor('lucisv.rainbowUnmatched'), }); context.subscriptions.push(...decorationTypes, unmatchedType); @@ -111,7 +111,7 @@ function activate(context) { if (isVerilog(event.document)) scheduleRepaint(); }), vscode.workspace.onDidChangeConfiguration((event) => { - if (!event.affectsConfiguration('vfmt.rainbowBeginEnd')) return; + if (!event.affectsConfiguration('lucisv.rainbowBeginEnd')) return; rainbowEnabled = readRainbowSetting(); // Honoured immediately, both ways: turning it off has to take the // colours away, or "off" would only mean "off after a reload". @@ -144,7 +144,7 @@ function isVerilog(document) { } function readRainbowSetting() { - return vscode.workspace.getConfiguration('vfmt').get('rainbowBeginEnd') !== false; + return vscode.workspace.getConfiguration('lucisv').get('rainbowBeginEnd') !== false; } /** Coalesce a burst of edits into one repaint. */ @@ -175,7 +175,7 @@ async function paint(editor) { if (rainbowEnabled) { let result; try { - result = await client.sendRequest('vfmt/scopePairs', { + result = await client.sendRequest('lucisv/scopePairs', { textDocument: { uri: document.uri.toString() }, }); } catch { diff --git a/editors/vscode/package-lock.json b/editors/vscode/package-lock.json index 3f49e2f..a25fb76 100644 --- a/editors/vscode/package-lock.json +++ b/editors/vscode/package-lock.json @@ -1,11 +1,11 @@ { - "name": "vfmt", + "name": "lucisv", "version": "0.7.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "vfmt", + "name": "lucisv", "version": "0.7.0", "license": "MIT", "dependencies": { diff --git a/editors/vscode/package.json b/editors/vscode/package.json index a57ab5c..d06166f 100644 --- a/editors/vscode/package.json +++ b/editors/vscode/package.json @@ -1,7 +1,7 @@ { - "name": "vfmt", - "displayName": "vfmt — Verilog/SystemVerilog", - "description": "Formatting, diagnostics, navigation and semantic highlighting for Verilog and SystemVerilog, served by the vfmt language server.", + "name": "lucisv", + "displayName": "lucisv — Verilog/SystemVerilog", + "description": "Formatting, diagnostics, navigation and semantic highlighting for Verilog and SystemVerilog, served by the lucisv language server.", "version": "0.7.0", "publisher": "guoliangchen", "author": "Guoliang Chen", @@ -80,7 +80,7 @@ ], "colors": [ { - "id": "vfmt.rainbow1", + "id": "lucisv.rainbow1", "description": "begin/end nesting level 1 (and every 6th level below it).", "defaults": { "dark": "#FFD700", @@ -90,7 +90,7 @@ } }, { - "id": "vfmt.rainbow2", + "id": "lucisv.rainbow2", "description": "begin/end nesting level 2 (and every 6th level below it).", "defaults": { "dark": "#DA70D6", @@ -100,7 +100,7 @@ } }, { - "id": "vfmt.rainbow3", + "id": "lucisv.rainbow3", "description": "begin/end nesting level 3 (and every 6th level below it).", "defaults": { "dark": "#179FFF", @@ -110,7 +110,7 @@ } }, { - "id": "vfmt.rainbow4", + "id": "lucisv.rainbow4", "description": "begin/end nesting level 4 (and every 6th level below it).", "defaults": { "dark": "#87D96B", @@ -120,7 +120,7 @@ } }, { - "id": "vfmt.rainbow5", + "id": "lucisv.rainbow5", "description": "begin/end nesting level 5 (and every 6th level below it).", "defaults": { "dark": "#FF8C69", @@ -130,7 +130,7 @@ } }, { - "id": "vfmt.rainbow6", + "id": "lucisv.rainbow6", "description": "begin/end nesting level 6 (and every 6th level below it).", "defaults": { "dark": "#4FD6D6", @@ -140,7 +140,7 @@ } }, { - "id": "vfmt.rainbowUnmatched", + "id": "lucisv.rainbowUnmatched", "description": "A begin/end or fork/join keyword whose counterpart is missing.", "defaults": { "dark": "#FF1212", @@ -151,24 +151,24 @@ } ], "configuration": { - "title": "vfmt", + "title": "lucisv", "properties": { - "vfmt.serverPath": { + "lucisv.serverPath": { "type": "string", - "default": "vfmt-server", - "description": "Path to the vfmt-server executable. A bare name is looked up on PATH." + "default": "lucisv-server", + "description": "Path to the lucisv-server executable. A bare name is looked up on PATH." }, - "vfmt.rainbowBeginEnd": { + "lucisv.rainbowBeginEnd": { "type": "boolean", "default": true, - "markdownDescription": "Colour each nesting level of `begin`/`end` and `fork`/`join` a different colour, and a keyword whose counterpart is missing in an error colour. Every colour is a `vfmt.rainbow*` theme colour you can override in `workbench.colorCustomizations`. Takes effect immediately." + "markdownDescription": "Colour each nesting level of `begin`/`end` and `fork`/`join` a different colour, and a keyword whose counterpart is missing in an error colour. Every colour is a `lucisv.rainbow*` theme colour you can override in `workbench.colorCustomizations`. Takes effect immediately." }, - "vfmt.inlineTemplates": { + "lucisv.inlineTemplates": { "type": "boolean", "default": true, - "markdownDescription": "Show grey ghost text that finishes a block as you open it: `if (` suggests `) begin … end`, a `case (` suggests its arms and `endcase`, and a `begin`, `fork`, `generate` or `module` at the end of a line suggests its closer. Tab accepts it as a snippet, so the cursor lands in the condition first and in the body second; where more than one shape fits (`always @(`), `Alt+]` cycles them. The accepted text is indented with the editor's own `editor.tabSize`/`editor.insertSpaces`, not with `#vfmt.indent#`. Requires `editor.inlineSuggest.enabled`." + "markdownDescription": "Show grey ghost text that finishes a block as you open it: `if (` suggests `) begin … end`, a `case (` suggests its arms and `endcase`, and a `begin`, `fork`, `generate` or `module` at the end of a line suggests its closer. Tab accepts it as a snippet, so the cursor lands in the condition first and in the body second; where more than one shape fits (`always @(`), `Alt+]` cycles them. The accepted text is indented with the editor's own `editor.tabSize`/`editor.insertSpaces`, not with `#lucisv.indent#`. Requires `editor.inlineSuggest.enabled`." }, - "vfmt.lineLength": { + "lucisv.lineLength": { "type": [ "number", "null" @@ -176,9 +176,9 @@ "default": null, "minimum": 40, "maximum": 400, - "markdownDescription": "Maximum line width, the same as `line-length` in a `vfmt.toml`. A `vfmt.toml` in the project wins over this; leave it unset to use the built-in 100." + "markdownDescription": "Maximum line width, the same as `line-length` in a `lucisv.toml`. A `lucisv.toml` in the project wins over this; leave it unset to use the built-in 100." }, - "vfmt.indent": { + "lucisv.indent": { "type": [ "number", "null" @@ -186,20 +186,20 @@ "default": null, "minimum": 1, "maximum": 8, - "markdownDescription": "Indent width in spaces, the same as `indent` in a `vfmt.toml`. A `vfmt.toml` in the project wins over this; leave it unset to use the editor's tab size." + "markdownDescription": "Indent width in spaces, the same as `indent` in a `lucisv.toml`. A `lucisv.toml` in the project wins over this; leave it unset to use the editor's tab size." }, - "vfmt.exclude": { + "lucisv.exclude": { "type": "array", "items": { "type": "string" }, "default": [], - "markdownDescription": "Extra path patterns to keep out of the workspace index, the same as `exclude` in a `vfmt.toml`. These are **added to** the project's own excludes, never replacing them." + "markdownDescription": "Extra path patterns to keep out of the workspace index, the same as `exclude` in a `lucisv.toml`. These are **added to** the project's own excludes, never replacing them." }, - "vfmt.filelist": { + "lucisv.filelist": { "type": "string", "default": "", - "markdownDescription": "Path to an EDA filelist (`.f`), absolute or relative to the workspace folder. When set, **exactly** the files it names are indexed instead of the whole folder — `-f` nesting, `+incdir+`, `+define+`, `#`/`//` comments and `$VAR` expansion are all understood. Overrides a `filelist` key in the project's `vfmt.toml`; leave it empty to index the workspace folder." + "markdownDescription": "Path to an EDA filelist (`.f`), absolute or relative to the workspace folder. When set, **exactly** the files it names are indexed instead of the whole folder — `-f` nesting, `+incdir+`, `+define+`, `#`/`//` comments and `$VAR` expansion are all understood. Overrides a `filelist` key in the project's `lucisv.toml`; leave it empty to index the workspace folder." } } } diff --git a/editors/vscode/smoke.js b/editors/vscode/smoke.js index 2b9d71d..c186443 100644 --- a/editors/vscode/smoke.js +++ b/editors/vscode/smoke.js @@ -1,15 +1,15 @@ // Pre-publish smoke test: spawn the server exactly the way extension.js does // and drive a whole LSP session at it over stdio. Plain node, no dependencies, // hand-rolled framing — a check that reused a client library could not catch a -// framing or startup bug. Mirrors crates/vfmt_server/tests/e2e.rs. +// framing or startup bug. Mirrors crates/lucisv_server/tests/e2e.rs. // -// node smoke.js [path-to-vfmt-server] # default: `vfmt-server` on PATH +// node smoke.js [path-to-lucisv-server] # default: `lucisv-server` on PATH // // Exits 0 on success, 1 on any failure. const { spawn } = require('child_process'); -const serverPath = process.argv[2] || 'vfmt-server'; +const serverPath = process.argv[2] || 'lucisv-server'; /** Frame one JSON payload the way LSP wants it. */ function frame(payload) { @@ -86,13 +86,13 @@ server.stdin.end( method: 'textDocument/didOpen', params: { textDocument: { uri, languageId: 'systemverilog', version: 1, text: SOURCE } }, }), - frame({ jsonrpc: '2.0', id: 3, method: 'vfmt/scopePairs', params: { textDocument: { uri } } }), + frame({ jsonrpc: '2.0', id: 3, method: 'lucisv/scopePairs', params: { textDocument: { uri } } }), frame({ jsonrpc: '2.0', method: 'textDocument/didOpen', params: { textDocument: { uri: brokenUri, languageId: 'systemverilog', version: 1, text: BROKEN } }, }), - frame({ jsonrpc: '2.0', id: 5, method: 'vfmt/scopePairs', params: { textDocument: { uri: brokenUri } } }), + frame({ jsonrpc: '2.0', id: 5, method: 'lucisv/scopePairs', params: { textDocument: { uri: brokenUri } } }), // Ghost text, just after the `begin` on line 2 of the buffer that lost its // `end`. The extension only ever sends this after opting into // `ProposedFeatures`, so an "unhandled method" here is the same kind of @@ -104,13 +104,13 @@ server.stdin.end( params: { textDocument: { uri: brokenUri }, position: { line: 2, character: 15 }, context: { triggerKind: 2 } }, }), // The settings push, in exactly the shape `synchronize.configurationSection: - // 'vfmt'` produces — the whole section, defaults included. + // 'lucisv'` produces — the whole section, defaults included. frame({ jsonrpc: '2.0', method: 'workspace/didChangeConfiguration', params: { settings: { - vfmt: { serverPath: 'vfmt-server', rainbowBeginEnd: true, inlineTemplates: true, lineLength: null, indent: 4, exclude: [] }, + lucisv: { serverPath: 'lucisv-server', rainbowBeginEnd: true, inlineTemplates: true, lineLength: null, indent: 4, exclude: [] }, }, }, }), @@ -151,10 +151,10 @@ server.on('close', (code) => { // "unhandled method" error here is exactly the mismatch this test exists to // catch, and it is what an extension paired with an older server would hit. const scopePairs = messages.find((m) => m.id === 3); - if (!scopePairs) fail('no vfmt/scopePairs response'); - if (scopePairs.error) fail(`vfmt/scopePairs failed: ${JSON.stringify(scopePairs.error)}`); + if (!scopePairs) fail('no lucisv/scopePairs response'); + if (scopePairs.error) fail(`lucisv/scopePairs failed: ${JSON.stringify(scopePairs.error)}`); const pairs = scopePairs.result && scopePairs.result.pairs; - if (!Array.isArray(pairs)) fail(`vfmt/scopePairs result has no pairs array: ${JSON.stringify(scopePairs.result)}`); + if (!Array.isArray(pairs)) fail(`lucisv/scopePairs result has no pairs array: ${JSON.stringify(scopePairs.result)}`); // Depth counts only the scopes the rainbow draws, so the enclosing module // does not count: the outer begin is 0, the begin inside it is 1, and the // fork is the outer begin's sibling at 0. @@ -185,8 +185,8 @@ server.on('close', (code) => { // ... and the buffer missing its outer `end` reports that `begin`, so the // extension can paint it rather than leave it undecorated. const broken = messages.find((m) => m.id === 5); - if (!broken) fail('no vfmt/scopePairs response for the broken buffer'); - if (broken.error) fail(`vfmt/scopePairs failed: ${JSON.stringify(broken.error)}`); + if (!broken) fail('no lucisv/scopePairs response for the broken buffer'); + if (broken.error) fail(`lucisv/scopePairs failed: ${JSON.stringify(broken.error)}`); const unmatched = broken.result && broken.result.unmatched; if (!Array.isArray(unmatched) || unmatched.length !== 1) { fail(`expected one unmatched keyword, got ${JSON.stringify(unmatched)}`); @@ -225,7 +225,7 @@ server.on('close', (code) => { } const indented = edits[0].newText; if (!indented.includes('\n wire a;')) { - fail(`pushed vfmt.indent=4 was not honoured over tabSize=2:\n${indented}`); + fail(`pushed lucisv.indent=4 was not honoured over tabSize=2:\n${indented}`); } if (indented.includes('\n wire a;')) { fail(`the editor tab size won over the pushed setting:\n${indented}`); diff --git a/editors/vscode/syntaxes/systemverilog.tmLanguage.json b/editors/vscode/syntaxes/systemverilog.tmLanguage.json index 6a604b5..ed39bd9 100644 --- a/editors/vscode/syntaxes/systemverilog.tmLanguage.json +++ b/editors/vscode/syntaxes/systemverilog.tmLanguage.json @@ -1,7 +1,7 @@ { "information_for_contributors": [ - "One grammar for both contributed language ids: `verilog` and `systemverilog` register the same scopeName and the same file in package.json, because vfmt's own lexer draws no line between the two dialects.", - "The keyword alternation in `repository.keywords.match` is generated from `vlog_parser::KEYWORDS` and must stay identical to it. `crates/vfmt_server/tests/grammar.rs` fails the build if the two drift apart — regenerate, do not hand-edit.", + "One grammar for both contributed language ids: `verilog` and `systemverilog` register the same scopeName and the same file in package.json, because lucisv's own lexer draws no line between the two dialects.", + "The keyword alternation in `repository.keywords.match` is generated from `vlog_parser::KEYWORDS` and must stay identical to it. `crates/lucisv_server/tests/grammar.rs` fails the build if the two drift apart — regenerate, do not hand-edit.", "Deliberately absent: operators, `(* attributes *)`, and any rule needing lookaround. The reasoning is in docs/features/editor-packaging/README.md." ], "name": "SystemVerilog", diff --git a/scripts/score.sh b/scripts/score.sh index 40ecba5..fcd1bed 100755 --- a/scripts/score.sh +++ b/scripts/score.sh @@ -1,11 +1,11 @@ #!/usr/bin/env bash -# Score vfmt against the corpus: one JSON line on stdout. +# Score lucisv against the corpus: one JSON line on stdout. # # {"passing":N,"total":N,"pct":P,"failures_by_category":{"":N,...}} # -# A file *passes* when the formatter accepts it (`vfmt --check` exits 0 or 1 -- +# A file *passes* when the formatter accepts it (`lucisv --check` exits 0 or 1 -- # i.e. it parsed, and the runtime safety net verified the output) AND the -# linter runs over it without an internal error (`vfmt check` exits 0 or 1). +# linter runs over it without an internal error (`lucisv check` exits 0 or 1). # Exit 2 or a signal death on either side is a failure. The corpus is never # written to (only --check / check are used, with --no-cache). # @@ -15,28 +15,28 @@ # name is stable even when its count is zero -- zero-count categories are # simply absent from the JSON. # -# Usage: scripts/score.sh [corpus-dir] [-b vfmt-binary] [-j jobs] [-o details.tsv] +# Usage: scripts/score.sh [corpus-dir] [-b lucisv-binary] [-j jobs] [-o details.tsv] # details.tsv: outcomecategoryfilemessage, one row per file # (default .score-results.tsv, gitignored). set -eu corpus_dir=corpus -vfmt=target/release/vfmt +lucisv=target/release/lucisv jobs=$( (sysctl -n hw.ncpu 2>/dev/null || nproc 2>/dev/null || echo 4) ) details=.score-results.tsv while [ $# -gt 0 ]; do case $1 in - -b) vfmt=$2; shift 2 ;; + -b) lucisv=$2; shift 2 ;; -j) jobs=$2; shift 2 ;; -o) details=$2; shift 2 ;; - -*) echo "usage: $0 [corpus-dir] [-b vfmt] [-j jobs] [-o details.tsv]" >&2; exit 2 ;; + -*) echo "usage: $0 [corpus-dir] [-b lucisv] [-j jobs] [-o details.tsv]" >&2; exit 2 ;; *) corpus_dir=$1; shift ;; esac done -[ -x "$vfmt" ] || { echo "no vfmt binary at $vfmt (cargo build --release?)" >&2; exit 2; } +[ -x "$lucisv" ] || { echo "no lucisv binary at $lucisv (cargo build --release?)" >&2; exit 2; } [ -d "$corpus_dir" ] || { echo "no corpus at $corpus_dir (tools/corpus_fetch.sh?)" >&2; exit 2; } # --- per-file classification -------------------------------------------------- @@ -128,11 +128,11 @@ classify() { check_one() { file=$1 status=0 - out=$("$vfmt" --no-cache --check "$file" 2>&1) || status=$? + out=$("$lucisv" --no-cache --check "$file" 2>&1) || status=$? case $status in 0|1) lstatus=0 - lout=$("$vfmt" check --no-cache "$file" 2>&1 >/dev/null) || lstatus=$? + lout=$("$lucisv" check --no-cache "$file" 2>&1 >/dev/null) || lstatus=$? case $lstatus in 0|1) printf 'pass\t-\t%s\t\n' "$file" ;; 2) msg=$(printf '%s\n' "$lout" | grep '^error: ' | head -1 | tr '\t\n' ' ') @@ -156,7 +156,7 @@ check_one() { } export -f classify check_one -export vfmt +export lucisv tmp=$(mktemp) trap 'rm -f "$tmp"' EXIT diff --git a/tools/RELEASING.md b/tools/RELEASING.md index 7c4d3bd..71a86da 100644 --- a/tools/RELEASING.md +++ b/tools/RELEASING.md @@ -1,4 +1,4 @@ -# Releasing vfmt +# Releasing lucisv Everything here runs on a normal developer machine with cargo, node and `shasum`. Nothing in the main checklist needs an account anywhere: the @@ -16,7 +16,7 @@ Linux — statically linked, no glibc dependency) and `x86_64-pc-windows-gnu` distributions: the messense toolchain's sysroot keeps the highest referenced symbol at `GLIBC_2.28`, which is RHEL 8's own glibc, so it runs on RHEL 8.x (verified for 8.10 by symbol audit: -`x86_64-unknown-linux-gnu-objdump -T dist/vfmt-server-* | grep -o +`x86_64-unknown-linux-gnu-objdump -T dist/lucisv-server-* | grep -o 'GLIBC_[0-9.]*' | sort -Vu | tail -1`; every NEEDED library is in a base install). The static musl build runs there too — the gnu build exists for shops that require a native glibc link. The `.vsix` is @@ -57,13 +57,13 @@ Four files, one number. Keep them identical. | `editors/vscode/package.json` | `"version"` | | `editors/vscode/package-lock.json` | `"version"` in **both** places (the top level and the `packages[""]` entry) | -Nothing hard-codes a version string in Rust: `vfmt --version` and the language +Nothing hard-codes a version string in Rust: `lucisv --version` and the language server's `initialize` → `serverInfo.version` both read `env!("CARGO_PKG_VERSION")`, so the workspace bump reaches them for free. Verify after bumping: ```bash cargo build --release -target/release/vfmt --version # vfmt X.Y.Z +target/release/lucisv --version # lucisv X.Y.Z ``` ## 2. Write the changelog @@ -95,15 +95,15 @@ tools/release.sh # or: tools/release.sh -o /some/other/dir It builds `--release`, copies the two binaries into `dist/` under version-and-host names, smoke-tests the server binary with -`editors/vscode/smoke.js`, packages the extension into `dist/vfmt-.vsix`, +`editors/vscode/smoke.js`, packages the extension into `dist/lucisv-.vsix`, and writes `dist/SHA256SUMS`. `dist/` is gitignored and is deleted and recreated on every run. ``` dist/ - vfmt-0.7.0-aarch64-apple-darwin - vfmt-server-0.7.0-aarch64-apple-darwin - vfmt-0.7.0.vsix + lucisv-0.7.0-aarch64-apple-darwin + lucisv-server-0.7.0-aarch64-apple-darwin + lucisv-0.7.0.vsix SHA256SUMS ``` @@ -126,7 +126,7 @@ The script runs, inside `editors/vscode/`: ```bash npm ci # 8 packages, exact lockfile -npx @vscode/vsce package --out ../../dist/vfmt-.vsix +npx @vscode/vsce package --out ../../dist/lucisv-.vsix ``` - **No `--skip-license`.** `vsce` requires a `LICENSE` file next to @@ -145,19 +145,19 @@ npx @vscode/vsce package --out ../../dist/vfmt-.vsix repo and only writes its *output* to `-o`. - `.vscodeignore` keeps `smoke.js`, `.vscode/**` and `.gitignore` out of the package. Check that after any change to it: - `unzip -l dist/vfmt-.vsix | grep smoke` must print nothing, and - `unzip -l dist/vfmt-.vsix | grep syntaxes` must print the grammar — + `unzip -l dist/lucisv-.vsix | grep smoke` must print nothing, and + `unzip -l dist/lucisv-.vsix | grep syntaxes` must print the grammar — without it, hover cards ship unhighlighted. ## 5. Install / distribute ```bash # the CLI and the server: anywhere on PATH -install -m 755 dist/vfmt-0.7.0-aarch64-apple-darwin ~/.local/bin/vfmt -install -m 755 dist/vfmt-server-0.7.0-aarch64-apple-darwin ~/.local/bin/vfmt-server +install -m 755 dist/lucisv-0.7.0-aarch64-apple-darwin ~/.local/bin/lucisv +install -m 755 dist/lucisv-server-0.7.0-aarch64-apple-darwin ~/.local/bin/lucisv-server # the editor extension: sideload, no marketplace involved -code --install-extension dist/vfmt-0.7.0.vsix +code --install-extension dist/lucisv-0.7.0.vsix ``` Publishing the artifacts is a matter of attaching `dist/`'s contents plus @@ -165,13 +165,13 @@ Publishing the artifacts is a matter of attaching `dist/`'s contents plus gate is green: ```bash -git tag -a v0.5.0 -m 'vfmt 0.5.0' +git tag -a v0.5.0 -m 'lucisv 0.5.0' git push origin v0.5.0 ``` ## Appendix — if the owner ever publishes to a marketplace -**Optional and deferred.** Sideloading covers every use vfmt has today, and +**Optional and deferred.** Sideloading covers every use lucisv has today, and none of the steps below can be run by anyone but the repo owner: they need accounts, tokens and a decision about the published identity. Recorded here so the information is not lost, not as a checklist step. @@ -194,10 +194,10 @@ The commands themselves, once those exist: # VS Code Marketplace: needs an Azure DevOps PAT for the publisher npx @vscode/vsce publish -p "$VSCE_TOKEN" # ... or publish an already-built package -npx @vscode/vsce publish --packagePath dist/vfmt-0.7.0.vsix -p "$VSCE_TOKEN" +npx @vscode/vsce publish --packagePath dist/lucisv-0.7.0.vsix -p "$VSCE_TOKEN" # Open VSX (VSCodium, Gitpod, Cursor): needs an Eclipse Foundation account -npx ovsx publish dist/vfmt-0.7.0.vsix -p "$OVSX_TOKEN" +npx ovsx publish dist/lucisv-0.7.0.vsix -p "$OVSX_TOKEN" ``` Both tokens are secrets. Neither belongs in this repo, in a shell history, or diff --git a/tools/corpus_check.sh b/tools/corpus_check.sh index 578b60f..4acd846 100755 --- a/tools/corpus_check.sh +++ b/tools/corpus_check.sh @@ -1,12 +1,12 @@ #!/usr/bin/env bash -# Run vfmt over a corpus of real-world RTL and report parse/format health. +# Run lucisv over a corpus of real-world RTL and report parse/format health. # -# This is vfmt's answer to ruff's "ecosystem check": point it at a tree of +# This is lucisv's answer to ruff's "ecosystem check": point it at a tree of # third-party Verilog and it says how much of it we can parse, how much is # already format-clean, and which errors dominate. It never writes to the # corpus -- only --check is used. # -# Usage: tools/corpus_check.sh [corpus-dir] [-o results.tsv] [-t TOP] [-b vfmt] +# Usage: tools/corpus_check.sh [corpus-dir] [-o results.tsv] [-t TOP] [-b lucisv] # # Exit status: 0 if no verification errors and no crashes were seen, # 1 otherwise (those two outcomes are always formatter bugs). @@ -14,7 +14,7 @@ set -eu corpus_dir=corpus -vfmt=target/release/vfmt +lucisv=target/release/lucisv results=corpus-check-results.tsv top=20 @@ -22,22 +22,22 @@ while [ $# -gt 0 ]; do case $1 in -o) results=$2; shift 2 ;; -t) top=$2; shift 2 ;; - -b) vfmt=$2; shift 2 ;; - -*) echo "usage: $0 [corpus-dir] [-o out.tsv] [-t top-n] [-b vfmt-binary]" >&2; exit 2 ;; + -b) lucisv=$2; shift 2 ;; + -*) echo "usage: $0 [corpus-dir] [-o out.tsv] [-t top-n] [-b lucisv-binary]" >&2; exit 2 ;; *) corpus_dir=$1; shift ;; esac done -[ -x "$vfmt" ] || { echo "no vfmt binary at $vfmt (cargo build --release?)" >&2; exit 2; } +[ -x "$lucisv" ] || { echo "no lucisv binary at $lucisv (cargo build --release?)" >&2; exit 2; } [ -d "$corpus_dir" ] || { echo "no corpus at $corpus_dir (tools/corpus_fetch.sh?)" >&2; exit 2; } -# Classify one file. vfmt --check exit codes (frozen contract, see README): +# Classify one file. lucisv --check exit codes (frozen contract, see README): # 0 clean, 1 would reformat, 2 error. Anything else is a crash -- a signal # death (128+n) or an abort the per-file catch_unwind could not contain. check_one() { file=$1 status=0 - out=$("$vfmt" --check "$file" 2>&1) || status=$? + out=$("$lucisv" --check "$file" 2>&1) || status=$? msg=$(printf '%s\n' "$out" | grep '^error: ' | head -1) msg=${msg#error: } msg=${msg#"$file": } @@ -63,7 +63,7 @@ check_one() { printf '%s\t%s\t%s\n' "$outcome" "$file" "$msg" } -echo "vfmt: $vfmt" +echo "lucisv: $lucisv" echo "corpus: $corpus_dir" echo diff --git a/tools/corpus_fetch.sh b/tools/corpus_fetch.sh index 5b97954..e76e4d4 100755 --- a/tools/corpus_fetch.sh +++ b/tools/corpus_fetch.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # Clone pinned revisions of permissively-licensed open-source RTL into a -# local corpus directory, for tools/corpus_check.sh to run vfmt over. +# local corpus directory, for tools/corpus_check.sh to run lucisv over. # # Every repo is pinned to an exact commit and fetched shallow (--depth 1); # nothing here ever tracks a moving branch, so corpus numbers recorded in @@ -32,7 +32,7 @@ fetch_one() { commit=$3 sparse=$4 dest="$corpus_dir/$name" - stamp="$dest/.vfmt-corpus-rev" + stamp="$dest/.lucisv-corpus-rev" if [ -f "$stamp" ] && [ "$(cat "$stamp")" = "$commit" ]; then echo "== $name: already at $commit, skipping" diff --git a/tools/vfmt-changed.sh b/tools/lucisv-changed.sh similarity index 67% rename from tools/vfmt-changed.sh rename to tools/lucisv-changed.sh index 112ca49..518a401 100755 --- a/tools/vfmt-changed.sh +++ b/tools/lucisv-changed.sh @@ -1,18 +1,18 @@ #!/usr/bin/env bash -# Format only the lines a git diff touched — vfmt's answer to Verible's +# Format only the lines a git diff touched — lucisv's answer to Verible's # `git-verible-verilog-format.sh`. # -# This is what makes vfmt adoptable in a dirty legacy tree: your patch comes +# This is what makes lucisv adoptable in a dirty legacy tree: your patch comes # out formatted, and not one byte outside it moves, so review sees the change # you made rather than a reflow of the whole file. # -# Usage: tools/vfmt-changed.sh [--check|--diff] [] [-- ...] +# Usage: tools/lucisv-changed.sh [--check|--diff] [] [-- ...] # # what to diff against; default: unstaged+staged work, i.e. HEAD. -# `tools/vfmt-changed.sh origin/main` formats a whole branch. -# --check / --diff are passed through to vfmt, so this works in CI. +# `tools/lucisv-changed.sh origin/main` formats a whole branch. +# --check / --diff are passed through to lucisv, so this works in CI. # -# Exit status is vfmt's, per the frozen contract: 0 nothing to do, 1 +# Exit status is lucisv's, per the frozen contract: 0 nothing to do, 1 # --check/--diff found changes, 2 an error (that file was left untouched). # # Only *added* lines are formatted: `git diff -U0` hunk headers give @@ -21,7 +21,7 @@ set -eu -vfmt=${VFMT:-target/release/vfmt} +lucisv=${LUCISV:-target/release/lucisv} mode="" rev="HEAD" have_rev=0 @@ -36,8 +36,8 @@ while [ $# -gt 0 ]; do done [ "$have_rev" = 1 ] || rev=HEAD -command -v "$vfmt" >/dev/null 2>&1 || [ -x "$vfmt" ] || { - echo "no vfmt binary at $vfmt (cargo build --release? or set VFMT=)" >&2 +command -v "$lucisv" >/dev/null 2>&1 || [ -x "$lucisv" ] || { + echo "no lucisv binary at $lucisv (cargo build --release? or set LUCISV=)" >&2 exit 2 } @@ -54,7 +54,7 @@ for file in $files; do | awk '{ count = ($2 == "" ? 1 : $2); if (count > 0) printf "%s%d-%d", sep, $1, $1 + count - 1; sep = "," }') [ -n "$ranges" ] || continue # shellcheck disable=SC2086 # $mode is one optional flag, deliberately split. - "$vfmt" $mode --lines "$ranges" "$file" || status=$? + "$lucisv" $mode --lines "$ranges" "$file" || status=$? done exit $status diff --git a/tools/release.sh b/tools/release.sh index 8e92707..9e78a54 100755 --- a/tools/release.sh +++ b/tools/release.sh @@ -1,10 +1,10 @@ #!/usr/bin/env bash -# Build vfmt's release artifacts into dist/ and checksum them. +# Build lucisv's release artifacts into dist/ and checksum them. # # Produces, for the machine it runs on: -# dist/vfmt-- -# dist/vfmt-server-- -# dist/vfmt-.vsix (the VS Code extension; sideload it) +# dist/lucisv-- +# dist/lucisv-server-- +# dist/lucisv-.vsix (the VS Code extension; sideload it) # dist/SHA256SUMS # # Standard tooling only -- cargo, npm and shasum, nothing installed globally. @@ -40,18 +40,18 @@ esac echo "==> building release binaries" cargo build --release --manifest-path "$repo_root/Cargo.toml" \ - -p vfmt -p vfmt_server + -p lucisv -p lucisv_server # The binaries themselves are the authority on the version, not Cargo.toml: -# `vfmt --version` is what a user will quote in a bug report. -version=$("$repo_root/target/release/vfmt" --version | awk '{print $2}') +# `lucisv --version` is what a user will quote in a bug report. +version=$("$repo_root/target/release/lucisv" --version | awk '{print $2}') host=$(rustc -vV | awk '/^host:/{print $2}') -echo " vfmt $version, host $host" +echo " lucisv $version, host $host" rm -rf "$dist" mkdir -p "$dist" -cp "$repo_root/target/release/vfmt" "$dist/vfmt-$version-$host" -cp "$repo_root/target/release/vfmt-server" "$dist/vfmt-server-$version-$host" +cp "$repo_root/target/release/lucisv" "$dist/lucisv-$version-$host" +cp "$repo_root/target/release/lucisv-server" "$dist/lucisv-server-$version-$host" # Cross targets: each built only if its toolchain is available, each an # explicit failure otherwise -- a release with silently missing platforms is @@ -69,7 +69,7 @@ if [ "$want_cross" -eq 1 ]; then echo "==> building for $triple" env RUSTC="$tc/bin/rustc" "$@" \ "$tc/bin/cargo" build --release --manifest-path "$repo_root/Cargo.toml" \ - --target "$triple" -p vfmt -p vfmt_server + --target "$triple" -p lucisv -p lucisv_server } exe="" cross_build x86_64-apple-darwin @@ -93,9 +93,9 @@ if [ "$want_cross" -eq 1 ]; then fi for triple in x86_64-apple-darwin x86_64-unknown-linux-musl x86_64-unknown-linux-gnu x86_64-pc-windows-gnu; do case $triple in *windows*) exe=.exe ;; *) exe="" ;; esac - cp "$repo_root/target/$triple/release/vfmt$exe" "$dist/vfmt-$version-$triple$exe" - cp "$repo_root/target/$triple/release/vfmt-server$exe" "$dist/vfmt-server-$version-$triple$exe" - cross_built="$cross_built vfmt-$version-$triple$exe vfmt-server-$version-$triple$exe" + cp "$repo_root/target/$triple/release/lucisv$exe" "$dist/lucisv-$version-$triple$exe" + cp "$repo_root/target/$triple/release/lucisv-server$exe" "$dist/lucisv-server-$version-$triple$exe" + cross_built="$cross_built lucisv-$version-$triple$exe lucisv-server-$version-$triple$exe" done fi @@ -103,7 +103,7 @@ fi # `smoke.js` is plain node with no dependencies, so this runs before `npm ci`. if command -v node >/dev/null 2>&1; then echo "==> smoke-testing the server binary" - node "$repo_root/editors/vscode/smoke.js" "$dist/vfmt-server-$version-$host" + node "$repo_root/editors/vscode/smoke.js" "$dist/lucisv-server-$version-$host" else echo " note: no node on PATH, skipping the server smoke test" >&2 fi @@ -118,14 +118,14 @@ if [ "$want_vsix" -eq 1 ]; then ( cd "$repo_root/editors/vscode" npm ci - npx @vscode/vsce package --out "$dist/vfmt-$version.vsix" + npx @vscode/vsce package --out "$dist/lucisv-$version.vsix" ) fi echo "==> checksums" -artifacts="vfmt-$version-$host vfmt-server-$version-$host$cross_built" +artifacts="lucisv-$version-$host lucisv-server-$version-$host$cross_built" if [ "$want_vsix" -eq 1 ]; then - artifacts="$artifacts vfmt-$version.vsix" + artifacts="$artifacts lucisv-$version.vsix" fi ( # Relative names, so `shasum -c SHA256SUMS` works from inside dist/.