diff --git a/README.md b/README.md index a1e1956..6e8031f 100644 --- a/README.md +++ b/README.md @@ -88,8 +88,7 @@ thread count, where parallelism has already taken the easy win). 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 +would be reformatted, or that failed, is re-checked on every run. The store is one 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 @@ -97,6 +96,12 @@ default is relative to the current directory). Content hashing is 64-bit FNV-1a and a lookup never crosses files; `docs/features/format-cache/README.md` states the collision posture, the semantics table and the concurrency story. +In v0.49.0, the new `uvm-utils-indent` option is missing from this key. +After changing that option, use `--no-cache` or remove `.lucisv_cache/` (or +your custom cache directory); otherwise a cached clean verdict can hide a +formatting change. The reproduction and required fix are recorded in +[topology handshake 34](docs/topo.md). + ### Ignore files While walking a directory, lucisv reads a `.gitignore` in every directory it @@ -177,7 +182,7 @@ formatting choice lucisv leaves to the project, because it changes bytes in existing UVM code (21 of the 860 corpus files). An unknown key, a bad value, an out-of-range number, or any TOML beyond the -supported subset (tables other than `[lint]` and `[lint.]`, multi-line +supported subset (tables other than `[format]`, `[lint]` and `[lint.]`, multi-line arrays, unsupported string escapes) is a hard error naming the file and line — exit 2, with nothing written. This is deliberate: a silently ignored `line_length` typo costs more than a strict parser does. @@ -468,7 +473,7 @@ of document layout from language rules: | `crates/vlog_formatter/src/format/` | `ruff_python_formatter` | Per-node formatting rules, one module per grammar domain (`item`, `module`, `instance`, `decl`, `stmt`, `expr`, `class`, `cover`, `sva`, …) | | `crates/vlog_linter` | `ruff_linter` | Rule registry, violations, fix applicability, waivers | | `crates/vlog_semantic` | — | File scopes and references, workspace index, conservative cross-file resolution | -| `crates/vlog_refactor` | — | Verified rename, references, port refactors, instantiation plans | +| `crates/vlog_refactor` | — | Verified rename/references, ports, imports, extract/inline module, instantiation plans | | `crates/lucisv_core` | — | Shared config, filelists, walks, format cache, atomic replacement | | `crates/lucisv` | the `ruff` CLI | Parallel per-file formatting/linting, reports, stdin, in-place writes | | `crates/lucisv_server` | — | Synchronous LSP loop, open-buffer overlays, indexing, editor capabilities | @@ -480,7 +485,7 @@ Linting consumes the parser, semantics and `lucisv_core` (for the one refactoring consumes the parser and semantics. The CLI reaches semantics through the linter and has no refactoring dependency. The server composes all six libraries. See [topo.md](docs/topo.md) for the full graph, -including the linter's formatter dependency used only by tests. +including the linter’s and refactor’s formatter dependencies used only by tests. Key ideas carried over from ruff/prettier: @@ -620,12 +625,19 @@ into ranges. Full semantics, including what happens at a range boundary: ## Supported syntax +v0.49.0 adds real `randsequence` productions; nonblocking `->>` event +triggers with optional timing; streaming `with [range]`; constant-expression +and packed-type cast bases; net drive strengths; statement-level `let`; and +min:typ:max clocking skews. The parser, formatter and AST consumers share these +nodes. See [coverage gaps](docs/coverage_gaps.md) for the dated survey and +remaining semantic limits. + Basic Verilog-2001 and the common synthesizable SystemVerilog subset: - Modules (ANSI and non-ANSI headers), packages, parameter ports, `import`, `timeunit` - Net/variable declarations (`wire`/`reg`/`logic`/`int`/... , signing, - packed/unpacked dimensions, net delays), `parameter`/`localparam`, + packed/unpacked dimensions, net delays and net drive strengths), `parameter`/`localparam`, `genvar`, `defparam` - `assign` (with delays), `always`/`always_comb`/`always_ff`/`always_latch`, `initial`/`final` @@ -857,8 +869,8 @@ See `docs/features/corpus-check/README.md` for the 820-file corpus baseline: bucket (26 files) and moved the parse rate from 94.1% to 97.1%; 24 of the 26 files format, the other 2 advanced to a macro-items blocker and to the `new obj` shallow-copy expression. `randsequence` remained unsupported at - this point; the other vendor/formal constructs listed here landed later in - 0.30.0 + this point; it shipped as real nodes in 0.49.0. The other vendor/formal + constructs listed here landed in 0.30.0 11. ~~A macro statement that ends its line followed by a symbol on the next one, the `new obj` shallow copy (IEEE 1800 §8.12), and a based number whose digits come from a macro (`` 32'h`DM_ADDR ``)~~ — **done**; see @@ -898,6 +910,25 @@ go-to-definition, references and document/workspace symbols — the full list, and what is deliberately *not* advertised yet, is in `docs/features/lucisv-server/README.md`. +The editor now offers these refactorings alongside rename and port propagation: + +| Action | Behavior | +|---|---| +| Expand wildcard | Replace `.*` with declaration-order named connections; unmatched ports become `.p()` with a warning | +| Convert ports to ANSI | Merge a legacy module header and its body port declarations, preserving comments and attributes | +| Organize imports | Remove unused imports, merge exact duplicates and sort a top-of-scope run; uncertainty keeps the action conservative | +| Extract module | Move selected whole module items into a named module, infer its interface, and insert the replacement instance; create a file when supported or append below the source module | +| Inline module | Copy a separate-file module body into its instance site with simple named-connection substitution and collision-aware internal renaming | + +The [language-tools reference](docs/site/src/content/docs/reference/language-tools.md) +records commands and refusal limits. Inline-module has a known transitive +source-selection gap; review hierarchical uses through wrapper modules before +applying it (topology handshake 33). + +In the VS Code hierarchy, **Star as DUT** groups a module’s children and +parents into sections alongside Other Modules. Stars persist per workspace; +`lucisv.hierarchy.duts` adds team-configured names, which are locked in the menu. + **VS Code needs no separate binary**: every release on the [releases page](https://git.luci.ooo/lucio/lucisv/releases) carries a platform-specific `.vsix` with both binaries inside it — pick yours diff --git a/docs/coverage_gaps.md b/docs/coverage_gaps.md index 7d9f6d0..a112437 100644 --- a/docs/coverage_gaps.md +++ b/docs/coverage_gaps.md @@ -1,6 +1,6 @@ # Verilog/SystemVerilog coverage gaps — ranked (2026-09-01) -**Reading this report today (2026-09-05).** The survey below is a historical +**Reading this report today (2026-09-07).** The survey below is a historical v0.21.0 measurement with later amendments, not a fresh list of current failures. Use [repository-analysis.md](repository-analysis.md) and [topo.md](topo.md) for current implementation status. Original probe counts remain historical. @@ -12,12 +12,16 @@ The prior audit's atomic-write, project lint-selection and directory-cycle findings are also fixed. Bare item-level `begin` blocks are recovered for lint/editor consumers; strict formatting still refuses them. -At committed `9ef1058`, type-name spans replace `vlog_semantic/src/scan.rs`, -and package re-exports resolve through shared member edges (facts codec 18). -Both are accepted for the next release. The active hierarchical-tail work -proposes codec 19; QA is pending, and handshake 23 remains open. DPI-export -name binding is a separate remaining gap (handshake 31), and generate-block -hierarchy and cross-file macro expansion remain outside these fixes. +Current snapshot **`df4e714`**, latest release **v0.49.0**: type-name spans, +package re-exports and hierarchical tails shipped in v0.45.0 (facts codec +**19**, handshake 23 closed). v0.46–0.49 added five refactorings, the +`unused-import` rule (**74 rules** total), and the DUT hierarchy view. The +L3 grammar forms, L6 real `randsequence` nodes, L9 ANSI conversion and L10 +optional UVM indentation are delivered, as annotated below. DPI-export name +binding (handshake 31), generate-block hierarchy and cross-file macro expansion +remain gaps. Refactor handshakes 32–33 and the newly reproduced UVM-option +cache omission (34) are detailed in the current repository analysis. These +status updates do not replace the original survey with a new corpus sweep. What lucisv 0.21.0 does not yet handle, ranked by severity, from two independent sweeps crossed against each other: diff --git a/docs/repository-analysis.md b/docs/repository-analysis.md index c7b86d2..f381833 100644 --- a/docs/repository-analysis.md +++ b/docs/repository-analysis.md @@ -1,17 +1,17 @@ # Repository analysis -Refreshed **2026-09-05**. Latest release: **v0.44.0** (`66f3898`). This -review uses committed snapshot **`9ef1058`**, which also includes accepted -type-name-spans and package-reexports work intended for v0.45.0. The active -hierarchical-tail changes are described separately; their QA is still open. +Refreshed **2026-09-07** against committed snapshot **`df4e714`**. Latest +release: **v0.49.0** (`4c2dae3`). The working tree was clean at the start of +this review. Loop 2 is closed; no uncommitted feature work is included. ## Assessment and current status lucisv remains an eight-crate toolchain: six reusable Rust libraries, CLI and LSP binaries, editor integration, corpus/release tools, and a static docs site. The architecture still separates syntax, formatting, semantics, linting, -refactoring, and project inputs. The three issues raised by the September 4 -audit have been fixed; they should no longer be treated as open priorities. +refactoring, and project inputs. The September 4 audit findings are fixed. +This refresh reproduced a new cache-key omission, documented below alongside +the remaining refactor limits. | Change | Status at this refresh | Implementation and contract | |---|---|---| @@ -22,9 +22,13 @@ audit have been fixed; they should no longer be treated as open priorities. | Cycle-aware walks and net-delay comment slots | Released in v0.43.0 | Directory identity prevents cycles; comments around a delay's `#` are preserved | | Walk warnings, editor rule-name warnings, aggregate overrides and delay-list comments | Released in v0.44.0 | Recoverable walk problems warn and continue; editor name typos log once; aggregate override expressions and delay-list comment slots are handled | | didOpen cost | Released in v0.44.0 | `undriven-net` asks the workspace mention oracle after local guards; findings and synchronous request ordering stay unchanged | -| Type-name spans | Committed, accepted for v0.45.0 | `DataType::name_span()` / `segments()` and disable-target spans replace semantic name scanning; `scan.rs` is deleted | -| Package re-exports | Committed, accepted for v0.45.0 | Export name halves are references; the shared member walk follows cycle-guarded re-export edges; persisted facts gain `RX`, codec **18** | -| Hierarchical tails | **Working tree, QA pending** | Proposed codec **19**, tagged member/reference surfaces, instance-tail resolution and completion, and cross-file rename updates | +| Type-name spans | Released in v0.45.0 | `DataType::name_span()` / `segments()` and disable-target spans replace semantic name scanning; `scan.rs` is deleted | +| Package re-exports | Released in v0.45.0 | Export name halves are references; the shared member walk follows cycle-guarded re-export edges; persisted facts gain `RX`; current codec **19** | +| Hierarchical tails | Released in v0.45.0 | Codec **19**, tagged member/reference surfaces, instance-tail resolution and completion, and cross-file rename updates | +| Expand wildcard; convert ports to ANSI | Released in v0.46.0 | `.*` expands in declaration order with `.p()` and a warning for unmatched ports; legacy header/body declarations merge with comments and attributes preserved | +| Organize imports; unused-import; extract module | Released in v0.47.0 | Shared semantic import usage feeds linter and refactor; **74 rules**; extraction infers ports/parameters/imports and creates a file when supported, or appends below the source module | +| DUT hierarchy | Released in v0.48.0; packaging corrected in v0.48.2 | Client-only children/parents/other sections over the existing snapshot; saved workspace choices plus configured DUTs | +| Inline module; final coverage additions | Released in v0.49.0 | Separate-file body copy with connection substitution and collision-aware renaming; six grammar gaps closed; real `randsequence` nodes; optional UVM indentation, default off | The current source of truth for feature acceptance is each feature's QA/review log and [TODO.md](../TODO.md). The [topology](topo.md) records the interfaces @@ -37,20 +41,21 @@ two edits have disjoint ownership. |---|---| | `crates/vlog_parser` | Lexer/trivia, strict and tolerant recursive descent, AST/spans; `src/lib.rs`, `parser/`, `ast/` | | `crates/vlog_formatter` | AST → document IR → printer, alignment, fences/ranges, equivalence and convergence; `format/mod.rs`, `verify.rs` | -| `crates/vlog_semantic` | File binding/resolution, workspace facts and member lookup; `bind/`, `resolve.rs`, `workspace/`, `facts.rs`; committed `workspace/reexport.rs`, active `workspace/hierarchy.rs` | -| `crates/vlog_linter` | 73-rule registry, lazy semantics, options, severities, inline/external waivers and fixes; `lib.rs`, `context.rs`, `registry.rs`, `waiver_file.rs` | -| `crates/vlog_refactor` | Rename/references, port edits, instance plans; shared `scope.rs`, whole-edit verification in `check.rs` | +| `crates/vlog_semantic` | File binding/resolution, workspace facts and member lookup; `bind/`, `resolve.rs`, `workspace/`, `facts.rs`; `workspace/reexport.rs`, `workspace/hierarchy.rs`, shared import usage in `imports.rs` | +| `crates/vlog_linter` | 74-rule registry, lazy semantics, options, severities, inline/external waivers and fixes; `lib.rs`, `context.rs`, `registry.rs`, `waiver_file.rs` | +| `crates/vlog_refactor` | Rename/references, ports, imports, extract/inline module, instance plans; `scope.rs`, `ports/`, `imports.rs`, `extract/`, `inline/`, whole-edit verification and piece ledger in `check/` | | `crates/lucisv_core` | Config, filelists, cycle-aware walks and warning channel, format cache, atomic replacement; no language-engine dependency | | `crates/lucisv` | Argument handling, input discovery/dedup, worker pool, reports and source writes | -| `crates/lucisv_server` | Ordered LSP loop and workspace overlays; `server/`, `state.rs`, capability handlers; project lint validation/logging in `lint/project.rs` | -| `editors/` | VS Code client/grammar/settings/hierarchy UI and configuration for other editors | +| `crates/lucisv_server` | Ordered LSP loop and workspace overlays; `server/`, `state.rs`, capability handlers including `imports.rs`, `extract.rs`, `inline_module.rs`; project lint validation/logging in `lint/project.rs` | +| `editors/` | VS Code client/grammar/settings/hierarchy UI and other editor configuration; `hierarchySections.js` models DUT sections, `extract.js` supplies the module-name prompt | | `tools/`, `scripts/`, `.gitea/workflows/` | Resource guard, corpus evaluation, artifact checks and releases | | `docs/features/` | Implementation contracts, dated measurements, QA and acceptance records | | `docs/site/` | User-facing static documentation and tracked generated output | -The crate dependency graph is unchanged. Parser and core have no dependencies; -formatter and semantics each depend on parser; linter and refactor depend on -parser and semantics. The linter depends on the formatter only in tests. +Parser and core have no dependencies; formatter and semantics each depend on +parser; linter and refactor depend on parser and semantics. Linter also consumes +core’s path matcher for external waivers. Both linter and refactor depend on +the formatter **only in tests**. The CLI composes core/parser/formatter/linter; the server composes all six libraries. External Rust dependencies stay in the CLI worker pool and server LSP/JSON stack. @@ -77,24 +82,68 @@ can come from the index; members and open buffers use text-based positions. Refactor source selectors must include every file an engine might edit or refuse over, even when completion or navigation can answer from fewer files. -**New committed semantic contracts:** a type-name segment is derived from AST +**Semantic contracts:** a type-name segment is derived from AST span data and verified against the source by `Binder::exact_or_empty`. The source parameter to analysis remains necessary even though `scan.rs` is gone. A package re-export records reference edges without adding a local import. `export *::*` expands the package's imports into re-export facts; member lookup -follows those edges with cycle guards. Cache codec 18 prevents older stores +follows those edges with cycle guards. Cache codec 19 prevents older stores from silently omitting this information. -## Active work and remaining limits +The delivered hierarchical-tail contract uses `Surface::{Connection, +Hierarchical}`, a second member table, surface tags on persisted declarations +and references, and codec 19. Connection completion and port propagation retain +the ports/parameters view; instance tails additionally reach internal nets, +variables and nested instances. Topology handshake 23 is closed. -TODO §49 owns hierarchical-tail resolution. At this refresh, its working tree -adds `Surface::{Connection, Hierarchical}`, a second member table, surface tags -on persisted declarations/references, and codec 19. Connection completion and -port propagation retain the existing ports/parameters view; paths behind an -instance can additionally reach internal nets, variables and nested instances. -Member completion and rename fan-out are part of the same contract. The feature -README reports development checks; independent QA is still pending, so topology -handshake 23 remains open. No working-tree API is treated as released here. +`vlog_semantic::imports` supplies the shared usage judgement for organize-imports +and the Style, default-off `unused-import` rule. Package re-exports count as use; +unknown packages, macro/conditional uses and external inheritance are treated +conservatively. Refactor `check/ledger.rs` tracks comment/attribute text, +counts and positions for moves and copies, separately from formatter +normalization. `RefactorEdit::created` lists new paths whose initial contents +also appear as offset-zero insertions in `edits`; server resource operations +honor client file-creation support. Inline copies leave their source file +unchanged. + +## Remaining limits and open work + +**Confirmed cache omission (topology handshake 34).** The CLI applies the new +`Config::uvm_utils_indent` field, but `lucisv/src/main.rs::entry_for` and +`lucisv_core::cache::Entry` omit it from cache equality and serialization. +A private-cache probe using the archived CLI and this class reproduced: + +```systemverilog +class c extends uvm_object; + `uvm_object_utils_begin(c) + `uvm_field_int(a, UVM_DEFAULT) + `uvm_object_utils_end +endclass +``` + +1. `[format] uvm-utils-indent = false`, `--check`: exit **0**, unchanged. +2. Change only the option to `true`, `--check`: exit **0**, one cache hit. +3. Same config, `--no-cache --check`: exit **1**, would reformat. + +Use `--no-cache` or remove the format cache after changing this option. A fix +needs the setting in the cache key and a regression for both toggle directions. +This documentation refresh records the issue without changing Rust behavior. + +**Refactor limits:** inline-module requires a separate-file source module and +simple named connections. It refuses wildcards, positional/expression or +unconnected ports, unsupported port types, generate, initial/final, +macros/directives, and hierarchical uses found in its inputs. QA recorded a +source-selection gap: `module_sources` can omit a file reaching the instance +through an intermediate module, bypassing the hierarchical-use refusal +(**handshake 33**). The verifier also has a bounded testability gap for +same-file relocation of protected pieces (**32**); no current planner produces +that edit shape. See the [extract/inline QA record](features/extract-inline-module/README.md). + +TODO **§55** defers `state.rs` decomposition to Loop 3. The September 7 +measurement in `CLAUDE.md` reports 958 production lines there, `perf.rs` 900 +with a recorded reason, `lexer.rs` 763, and `format/stmt.rs` 604. TODO §57 +still has remote-artifact and memory bookkeeping unchecked; this review does +not certify remote releases or manual editor acceptance. Remaining constraints include generate-block-scoped hierarchical paths, cross-file macro expansion, and compiler elaboration. Package re-export support @@ -128,23 +177,25 @@ is part of this refresh. ## Validation of this refresh -Checks ran against an isolated archive of committed `9ef1058`, with a separate -build directory and the repository resource guard. This avoids the live agents' -target directory and does not certify their uncommitted changes. +Checks ran against an isolated archive of committed `df4e714`, with a separate +build directory and the repository resource guard. This validates a fixed +source snapshot without sharing another task’s build directory. - `cargo fmt --all -- --check`: passed. - `cargo clippy --offline --workspace --all-targets -- -D warnings`: passed. -- `cargo test --offline --workspace`: **3,829 passed, 0 failed, 44 ignored**, - across 49 harnesses, under `tools/guard.sh`. The archive did not include the +- `cargo test --offline --workspace`: **4,163 passed, 0 failed, 44 ignored**, + across 55 harnesses, under `tools/guard.sh`. The archive did not include the ignored/untracked corpus checkout, and ignored measurement tests were not run. +- `node --test editors/vscode/*_test.js`: **5 test files passed** (extract + input, hierarchy model/sections/view, restart behavior). The cache probe + above also ran under the resource guard. - `ASTRO_TELEMETRY_DISABLED=1 npm run build` in `docs/site`: passed; 13 pages, Pagefind search and sitemaps rebuilt. -- Generated-site validation: **820** local links, assets and anchors checked, - zero errors. Relative links in the root analysis/topology/coverage docs also - passed. `git diff --check` passed for these documentation changes. +- Generated-site validation: **836** local links, assets and anchors checked, + zero errors. All **26** relative file links in README, analysis, topology and + coverage docs also passed. `git diff --check` passed for these documentation changes. -The previous audit's 3,745 passing tests describe its September 4 snapshot; -they are not reused as the test result for this revision. This refresh changes -documentation only and leaves feature QA logs and backlog checkboxes to their +Earlier test totals describe earlier snapshots; the results above were +measured again for this revision. This refresh changes documentation only and leaves feature QA logs and backlog checkboxes to their owners. No corpus/OpenTitan sweep, new benchmark, release packaging or publishing was performed. diff --git a/docs/site/dist/guides/formatter/index.html b/docs/site/dist/guides/formatter/index.html index 6114239..c487811 100644 --- a/docs/site/dist/guides/formatter/index.html +++ b/docs/site/dist/guides/formatter/index.html @@ -70,7 +70,7 @@ })();

Formatter

lucisv uses a Wadler/Prettier-style document model. Breakable constructs render on one line when they fit and expand predictably when they do not. Comments are attached as trivia and preserved through formatting.

+

Formatter

lucisv uses a Wadler/Prettier-style document model. Breakable constructs render on one line when they fit and expand predictably when they do not. Comments are attached as trivia and preserved through formatting.

  • 2-space indentation and 100-column lines by default.
  • @@ -80,12 +80,22 @@
  • At most one preserved blank line between adjacent items.
  • Compiler directives, attributes, and supported verbatim constructs keep their source text.
+ +

To indent field macros inside UVM utilities blocks one additional level:

+
[format]
uvm-utils-indent = true
+

This v0.49.0 option is off by default. It applies to uvm_field_* macros +between uvm_*_utils_begin and uvm_*_utils_end. In editors, +lucisv.format.uvmUtilsIndent is the fallback; project configuration wins. +Short, comment-free enum bodies already fit on one line without another key.

+

After toggling this option, run the CLI with --no-cache or remove its format +cache: v0.49.0 does not include this option in the cache key. See +configuration.

lucisv recognizes existing columnar intent in adjacent ANSI ports, named connections, and parameter declarations. If a group is already aligned—or uses four or more spaces where one would suffice—it is normalized as a table. Flush-left input stays flush-left.

Groups end at blank lines, standalone comments, attributes, or compiler directives. If the widest row exceeds the line limit, the entire group falls back to flush-left, never a half-aligned mixture.

Use a standalone fence to protect hand-laid-out regions:

-
// verilog_format: off
localparam int A = 1;
localparam int LONGER = 22;
// verilog_format: on
+
// verilog_format: off
localparam int A = 1;
localparam int LONGER = 22;
// verilog_format: on

// lucisv: off and // lucisv: on are aliases. Fences preserve exact bytes between items (including class members) and between statements in blocks, forks, functions, tasks, and procedural bodies. They also prevent lint fixes there. A fence must begin on its own line; diff --git a/docs/site/dist/guides/linter/index.html b/docs/site/dist/guides/linter/index.html index b392ea3..6614816 100644 --- a/docs/site/dist/guides/linter/index.html +++ b/docs/site/dist/guides/linter/index.html @@ -87,10 +87,15 @@ fence-blind; callers performing automatic edits must apply that protection.

Use [lint.<rule>] in lucisv.toml or lucisv.lint.options in the editor for per-rule options. See configuration for precedence. -lucisv check --rules-doc prints all 73 registered rules, their severity, +lucisv check --rules-doc prints all 74 registered rules, their severity, default selection, fix applicability, and option defaults.

Text output uses FILE:LINE:COL: severity: message [rule]. JSON output is one array, with a severity field on each diagnostic.

+

unused-import is a Style rule, off by default even in a project. Enable it +explicitly to report unused module/package/class imports using the same +analysis as Organize Imports. It stays silent without package facts and +preserves uncertain macro or inherited uses. A finding on an import with a +comment has no automatic deletion fix.

wire a; // lucisv: waive no-tabs
// lucisv: waive no-tabs
wire b;
// lucisv: waive-start module-name-style
module LegacyName;
endmodule
// lucisv: waive-stop module-name-style

verilog_lint: is accepted in place of lucisv: for Verible compatibility. The unused-waiver rule reports malformed, unknown, or no-longer-needed suppressions when their target rule is enabled.

diff --git a/docs/site/dist/guides/syntax/index.html b/docs/site/dist/guides/syntax/index.html index f4090f0..09ce9d0 100644 --- a/docs/site/dist/guides/syntax/index.html +++ b/docs/site/dist/guides/syntax/index.html @@ -75,7 +75,7 @@
  • Modules, interfaces, programs, packages, classes, interface classes, generate regions, and nested classes.
  • ANSI and non-ANSI ports, parameter ports, header imports, timeunit, genvar, and defparam.
  • -
  • Net and variable declarations, signing, packed and unpacked dimensions, and net delays.
  • +
  • Net and variable declarations, signing, packed and unpacked dimensions, net delays, and net drive strengths.
  • typedef aliases, enums, packed structs/unions, forward class declarations, anonymous aggregate types, and type parameters.
  • Virtual interfaces, parameterized class types, properties, methods, constructors, prototypes, and out-of-body method definitions.
  • Functions and tasks in ANSI and legacy forms, DPI imports/exports, and package re-exports.
  • @@ -85,7 +85,8 @@
  • assign, always, always_comb, always_ff, always_latch, initial, and final.
  • Blocks, conditionals, every case kind, loops, foreach, fork/join*, waits, timing controls, events, force/release, and jump statements.
  • Immediate and concurrent assertions, sequences, properties, expect, cover sequence, and default disable iff. Property and sequence expressions use their LRM precedence and participate in formatting and semantic tools.
  • -
  • randomize() with, randcase, let, statement labels, array iterator methods, and omitted positional arguments.
  • +
  • randomize() with, randcase, real randsequence productions, statement-level let, statement labels, array iterator methods, and omitted positional arguments.
  • +
  • Nonblocking ->> event triggers with optional timing and min:typ:max clocking skews.
  • Constraint blocks and randomization constraint bodies, including soft, dist, implication, foreach, and solve before.
  • Covergroups with coverpoints, bins, transitions, crosses, with, and iff expressions.
@@ -99,7 +100,7 @@
    -
  • Full operator precedence, ternaries, concatenation and replication, slices, streaming concatenations, casts, and assignment patterns.
  • +
  • Full operator precedence, ternaries, concatenation and replication, slices, streaming concatenations with with [range], constant-expression and packed-type cast bases, and assignment patterns.
  • Hierarchical and package-scoped names, named call arguments, array methods, inside, and all supported new forms.
  • Dynamic arrays, queues, associative arrays, empty literals, and $-bound indexing.
  • Macro invocations in expression, statement, and item position; macro digits in based numbers.
  • @@ -107,6 +108,6 @@

    Some constructs are recognized structurally but emitted with their internal source layout intact: compiler directives, macro bodies, specify, UDP, checker and config blocks, and carefully recovered conditional-split declarations. Constraint, covergroup and SVA parsers also keep a byte-exact fallback for an unfamiliar body, so unsupported subgrammar does not block the surrounding file.

    -

    A small set of rare expression/port forms remains outside the formatter grammar. lucisv also does not run a preprocessor, so a file that becomes valid only after cross-file macro expansion may not format as a standalone input.

    +

    Parser acceptance does not imply full elaboration or semantic navigation: generate-block-scoped hierarchical paths and DPI-export name binding remain gaps. lucisv also does not run a preprocessor, so a file that becomes valid only after cross-file macro expansion may not format as a standalone input.

    -
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/site/dist/pagefind/fragment/en_34eb61a.pf_fragment b/docs/site/dist/pagefind/fragment/en_34eb61a.pf_fragment new file mode 100644 index 0000000..08e6aae Binary files /dev/null and b/docs/site/dist/pagefind/fragment/en_34eb61a.pf_fragment differ diff --git a/docs/site/dist/pagefind/fragment/en_4bf8b4a.pf_fragment b/docs/site/dist/pagefind/fragment/en_4bf8b4a.pf_fragment deleted file mode 100644 index 820e6f9..0000000 Binary files a/docs/site/dist/pagefind/fragment/en_4bf8b4a.pf_fragment and /dev/null differ diff --git a/docs/site/dist/pagefind/fragment/en_4d1ff91.pf_fragment b/docs/site/dist/pagefind/fragment/en_4d1ff91.pf_fragment new file mode 100644 index 0000000..ce22184 Binary files /dev/null and b/docs/site/dist/pagefind/fragment/en_4d1ff91.pf_fragment differ diff --git a/docs/site/dist/pagefind/fragment/en_4e3e312.pf_fragment b/docs/site/dist/pagefind/fragment/en_4e3e312.pf_fragment deleted file mode 100644 index b79adb0..0000000 Binary files a/docs/site/dist/pagefind/fragment/en_4e3e312.pf_fragment and /dev/null differ diff --git a/docs/site/dist/pagefind/fragment/en_4fcdd04.pf_fragment b/docs/site/dist/pagefind/fragment/en_4fcdd04.pf_fragment new file mode 100644 index 0000000..85a74be Binary files /dev/null and b/docs/site/dist/pagefind/fragment/en_4fcdd04.pf_fragment differ diff --git a/docs/site/dist/pagefind/fragment/en_57d1313.pf_fragment b/docs/site/dist/pagefind/fragment/en_57d1313.pf_fragment deleted file mode 100644 index ba4b940..0000000 Binary files a/docs/site/dist/pagefind/fragment/en_57d1313.pf_fragment and /dev/null differ diff --git a/docs/site/dist/pagefind/fragment/en_7a7f335.pf_fragment b/docs/site/dist/pagefind/fragment/en_7a7f335.pf_fragment new file mode 100644 index 0000000..74a3d0c Binary files /dev/null and b/docs/site/dist/pagefind/fragment/en_7a7f335.pf_fragment differ diff --git a/docs/site/dist/pagefind/fragment/en_a48254a.pf_fragment b/docs/site/dist/pagefind/fragment/en_a48254a.pf_fragment deleted file mode 100644 index 20792f0..0000000 Binary files a/docs/site/dist/pagefind/fragment/en_a48254a.pf_fragment and /dev/null differ diff --git a/docs/site/dist/pagefind/fragment/en_aec025f.pf_fragment b/docs/site/dist/pagefind/fragment/en_aec025f.pf_fragment new file mode 100644 index 0000000..da46f09 Binary files /dev/null and b/docs/site/dist/pagefind/fragment/en_aec025f.pf_fragment differ diff --git a/docs/site/dist/pagefind/fragment/en_bb5e837.pf_fragment b/docs/site/dist/pagefind/fragment/en_bb5e837.pf_fragment deleted file mode 100644 index b232d8a..0000000 Binary files a/docs/site/dist/pagefind/fragment/en_bb5e837.pf_fragment and /dev/null differ diff --git a/docs/site/dist/pagefind/fragment/en_c0f23d2.pf_fragment b/docs/site/dist/pagefind/fragment/en_c0f23d2.pf_fragment deleted file mode 100644 index 896ae11..0000000 Binary files a/docs/site/dist/pagefind/fragment/en_c0f23d2.pf_fragment and /dev/null differ diff --git a/docs/site/dist/pagefind/fragment/en_c5d4884.pf_fragment b/docs/site/dist/pagefind/fragment/en_c5d4884.pf_fragment new file mode 100644 index 0000000..cf30ccb Binary files /dev/null and b/docs/site/dist/pagefind/fragment/en_c5d4884.pf_fragment differ diff --git a/docs/site/dist/pagefind/fragment/en_e3a0d5d.pf_fragment b/docs/site/dist/pagefind/fragment/en_e3a0d5d.pf_fragment deleted file mode 100644 index 6f9e280..0000000 Binary files a/docs/site/dist/pagefind/fragment/en_e3a0d5d.pf_fragment and /dev/null differ diff --git a/docs/site/dist/pagefind/fragment/en_fb8679a.pf_fragment b/docs/site/dist/pagefind/fragment/en_fb8679a.pf_fragment new file mode 100644 index 0000000..047c735 Binary files /dev/null and b/docs/site/dist/pagefind/fragment/en_fb8679a.pf_fragment differ diff --git a/docs/site/dist/pagefind/index/en_7c4532a.pf_index b/docs/site/dist/pagefind/index/en_7c4532a.pf_index new file mode 100644 index 0000000..73d9242 Binary files /dev/null and b/docs/site/dist/pagefind/index/en_7c4532a.pf_index differ diff --git a/docs/site/dist/pagefind/index/en_84556bf.pf_index b/docs/site/dist/pagefind/index/en_84556bf.pf_index new file mode 100644 index 0000000..82c40cf Binary files /dev/null and b/docs/site/dist/pagefind/index/en_84556bf.pf_index differ diff --git a/docs/site/dist/pagefind/index/en_aa52ccd.pf_index b/docs/site/dist/pagefind/index/en_aa52ccd.pf_index deleted file mode 100644 index 93f404b..0000000 Binary files a/docs/site/dist/pagefind/index/en_aa52ccd.pf_index and /dev/null differ diff --git a/docs/site/dist/pagefind/index/en_fbd771d.pf_index b/docs/site/dist/pagefind/index/en_fbd771d.pf_index deleted file mode 100644 index 3822b7f..0000000 Binary files a/docs/site/dist/pagefind/index/en_fbd771d.pf_index and /dev/null differ diff --git a/docs/site/dist/pagefind/pagefind-entry.json b/docs/site/dist/pagefind/pagefind-entry.json index d154021..892f826 100644 --- a/docs/site/dist/pagefind/pagefind-entry.json +++ b/docs/site/dist/pagefind/pagefind-entry.json @@ -1 +1 @@ -{"version":"1.5.2","languages":{"en":{"hash":"en_e3346e8993","wasm":"en","page_count":12}},"include_characters":["_","‿","⁀","⁔","︳","︴","﹍","﹎","﹏","_"]} \ No newline at end of file +{"version":"1.5.2","languages":{"en":{"hash":"en_5a9cf9ce1e","wasm":"en","page_count":12}},"include_characters":["_","‿","⁀","⁔","︳","︴","﹍","﹎","﹏","_"]} \ No newline at end of file diff --git a/docs/site/dist/pagefind/pagefind.en_5a9cf9ce1e.pf_meta b/docs/site/dist/pagefind/pagefind.en_5a9cf9ce1e.pf_meta new file mode 100644 index 0000000..784a31d Binary files /dev/null and b/docs/site/dist/pagefind/pagefind.en_5a9cf9ce1e.pf_meta differ diff --git a/docs/site/dist/pagefind/pagefind.en_e3346e8993.pf_meta b/docs/site/dist/pagefind/pagefind.en_e3346e8993.pf_meta deleted file mode 100644 index c44b94b..0000000 Binary files a/docs/site/dist/pagefind/pagefind.en_e3346e8993.pf_meta and /dev/null differ diff --git a/docs/site/dist/reference/architecture/index.html b/docs/site/dist/reference/architecture/index.html index 0036089..19aa8c0 100644 --- a/docs/site/dist/reference/architecture/index.html +++ b/docs/site/dist/reference/architecture/index.html @@ -102,13 +102,13 @@ vlog_refactor -rename, references, port propagation, instantiation planning +rename/references, ports, imports, extract/inline module, instantiation planning language server lucisv_core configuration, filelists, walking, exclusions, cache, atomic replacement -CLI and language server +CLI, language server, linter waiver matching lucisv @@ -142,22 +142,24 @@ Only a verified string is returned. Ranges splice whole items; format fences also protect statement scopes, and verification covers the complete output.
  • Lint: ParsedSource bundles one tokenization and tolerant parse; LintContext supplies source facts and lazy semantics. The registry selects -73 rules with severities and validated options. Inline and external waivers filter findings, +74 rules with severities and validated options. Inline and external waivers filter findings, and the front ends protect fenced bytes before applying fixes.
  • Refactor: parsed spans and resolved references produce an edit plan; the engine checks the whole candidate edit before returning it. Server source selectors bound the input set but must include every file the engine might -edit or refuse over. No formatter dependency is involved.
  • +edit or refuse over. The formatter is a test-only dependency of this engine.
  • Editor: one ordered synchronous loop owns Workspace; open documents overlay disk facts. Scans publish index/include/completion batches together. -Committed closed-file facts persist under codec 18, including package re-exports; a bounded file-view cache serves +Closed-file facts persist under codec 19, including package re-exports and +tagged connection/hierarchical surfaces; a bounded file-view cache serves queries that still need source text. Lazy port actions defer the edit until selection; recorded file-scope definition positions avoid a closed-file read.
  • vlog_parser and lucisv_core depend on no other crates. Formatting and semantics each depend on the parser; linting and refactoring depend on parser -and semantics. The CLI composes core, parser, formatter, and linter; the server -composes all six libraries. The linter’s formatter dependency is test-only. +and semantics. Linting also consumes core’s exclusion matcher for waiver +locations. The CLI composes core, parser, formatter, and linter; the server +composes all six libraries. Both linter and refactor use the formatter only in tests. External dependencies are confined to the CLI worker pool (rayon) and the server’s synchronous LSP/JSON stack.

    The main change-impact boundaries are the AST and all its walkers, formatter @@ -171,12 +173,24 @@ cycle-aware directory walks with recoverable warnings, and inline aggregate overrides. The v0.44.0 undriven-net fix asks the workspace mention census only after local guards, reducing editor open/flush latency without changing the rule’s findings or the synchronous request-ordering contract.

    -

    Two accepted changes are committed after v0.44.0: type names now carry exact -AST spans (scan.rs is retired), and package re-exports are references and -cycle-guarded member edges in codec 18. Re-exporting a name does not import it -into the exporting package’s local scope. DPI-export names remain unbound. -The separate hierarchical-tail work proposes codec 19 and a module member -surface for instance paths; it is still under QA and is not a released API.

    +

    v0.45.0 shipped exact type-name spans (scan.rs is retired), package +re-exports and hierarchical tails, with facts codec 19. Re-exporting a +name does not import it into the package’s local scope. Instance paths reach +internal nets, variables and nested instances through a separate surface; +existing connection queries keep their interface view. Generate-scoped +hierarchical paths and DPI-export name binding remain gaps.

    +

    v0.46–0.49 added wildcard expansion, ANSI conversion, organize-imports, +extract-module and inline-module. Import usage lives in semantic imports.rs, +shared by the refactor and unused-import lint rule. Refactor check/ledger.rs +tracks protected comment/attribute pieces across moves and copies; +RefactorEdit::created carries new-file operations to the server. The inline +source selector still has a known gap for hierarchical uses through +intermediate modules; see the refactoring limits.

    +

    The DUT hierarchy is client-only over the existing server snapshot. +v0.49.0 also adds real randsequence nodes and opt-in UVM indentation, whose +CLI cache limitation is documented under configuration. +This page reflects committed df4e714; Loop 2 is closed, with state.rs +decomposition deferred to Loop 3.

    • Source fidelity: comments and blank-line intent survive the parser.
    • diff --git a/docs/site/dist/reference/language-tools/index.html b/docs/site/dist/reference/language-tools/index.html index a8a6c30..cd17893 100644 --- a/docs/site/dist/reference/language-tools/index.html +++ b/docs/site/dist/reference/language-tools/index.html @@ -289,7 +289,17 @@ index scope when the defining module lives outside the default folder scope.

      Port actions code actions / commands -Adds, removes, and propagates module ports; expands a .* wildcard into the named connections it stands for (a port with no same-named signal in scope becomes .p() and is named in a warning) — lucisv.expandWildcard; converts a Verilog-2001 header to ANSI, each body declaration merged into the port it described (IEEE 1800 §23.2.2.2) with its comments carried along — lucisv.convertToAnsi +Adds, removes, and propagates module ports + + +Expand wildcard +code action / lucisv.expandWildcard +Expands .* in declaration order; a port with no same-named signal becomes .p() and is named in a warning + + +Convert ports to ANSI +code action / lucisv.convertToAnsi +Merges a legacy header with its body port declarations, preserving comments and attributes Organize imports @@ -302,6 +312,11 @@ index scope when the defining module lives outside the default folder scope.

      Select whole module items and name the module: ports and parameters inferred from what the selection reads and drives, imports carried across, the items moved byte for byte, the replacing instantiation rendered from the new module’s own text; a new file where the editor can create one, below the source module otherwise. Refuses with a sentence wherever a direction cannot be known — lucisv.extractModule +Inline module +code action (refactor.inline) / lucisv.inlineModule +Copies a separate-file module body into the selected instance site, substitutes named connections and parameter values, and renames internal identifiers on collision + + Instantiate module inline completion / lucisv.instantiate Builds an instance from an indexed module interface, including in clients without ghost text @@ -318,6 +333,18 @@ index scope when the defining module lives outside the default folder scope.

      +

      Inline-module accepts simple named connections to names or literals; it +refuses .*, positional/expression or unconnected ports, output-to-literal +connections, unsupported port types, generate, initial/final and +macro/directive bodies. A hierarchical use found in its inputs also refuses +the action. There is a known source-selection gap for uses through an +intermediate module: a bench referencing wrap.u_S.x can be omitted when +inlining S. Review those uses before applying the edit.

      +

      The VS Code hierarchy also supports Star as DUT, Unstar DUT and +Clear DUTs. Each DUT gets children and parents sections, followed by Other +Modules. lucisv.hierarchy.duts unions team-configured names with workspace +stars; configured names are locked in the menu. This view consumes the +unchanged lucisv/moduleHierarchy snapshot; it adds no server protocol.

      diff --git a/docs/site/dist/reference/rust-api/index.html b/docs/site/dist/reference/rust-api/index.html index 23044da..ccff900 100644 --- a/docs/site/dist/reference/rust-api/index.html +++ b/docs/site/dist/reference/rust-api/index.html @@ -70,11 +70,10 @@ })();

      Rust API index

      Public functions indexed

      +

      Rust API index

      Public functions indexed

      This is a navigational API index, not source documentation. It summarizes the main public callable surface of the six reusable library crates in the workspace; command-line and language-server binaries are documented in their dedicated references.

      -

      The latest release is v0.44.0. This index includes the accepted type-name-span -and package-re-export additions committed at 9ef1058 for the next release; -it excludes the in-progress hierarchical-tail API and codec 19. For the complete signatures and fields, +

      This index reflects v0.49.0, reviewed at committed df4e714, including +hierarchical member surfaces, import usage and module refactorings. For the complete signatures and fields, run cargo doc --workspace --no-deps; this hand-maintained index is not an exhaustive replacement for rustdoc. The parser’s strict and tolerant entry points share one grammar; tolerant errors do not imply formatter acceptance. @@ -235,6 +234,9 @@ The CLI and server configure their worker threads accordingly.

      +

      Config exposes max_width, indent_width, and uvm_utils_indent (default +false, new in v0.49.0). Exhaustive struct literals must include the new field; +Config { max_width: 120, ..Config::default() } keeps the other defaults.

      @@ -368,11 +370,11 @@ The CLI and server configure their worker threads accordingly.

      - + - + @@ -459,7 +461,7 @@ The CLI and server configure their worker threads accordingly.

      - + @@ -495,10 +497,40 @@ The CLI and server configure their worker threads accordingly.

      LintContextnew, from_parse, with_tab_width, with_line_length, with_options, with_semantics, with_oracle, mentioned_elsewhere, has_oracle, module_interface, parsed_cleanly, line_length, options, option_bool, option_int, option_str, option_list, option_is_set, semantics, source, tokens, file, line_index, path, tab_width, line_text, touches_string, commentsnew, from_parse, with_tab_width, with_line_length, with_options, with_semantics, with_oracle, mentioned_elsewhere, has_oracle, module_interface, package_exports, parsed_cleanly, line_length, options, option_bool, option_int, option_str, option_list, option_is_set, semantics, source, tokens, file, line_index, path, tab_width, line_text, touches_string, comments
      MentionOracleSupply mentioned_outside and optional module_interface for project-aware checksSupply mentioned_outside and optional module_interface / package_exports for project-aware checks
      Violation
      WorkspaceIndexbuild, files, path, file_id, units, member, members_of, members_of_chain, member_unit, instantiations_of, subclasses_of, base_of, instantiations, subclasses, facts_for, defines, find_define, references_to, references_are_ambiguous, files_spelling, files_mentioning, files_naming_in_macros, mentioned_outside, workspace_symbols, units_of, instantiable_units, counts, update_file, update_facts, absorb, remove_file, fingerprintbuild, files, path, file_id, units, member, members_of, members_of_chain, member_unit, member_in, hierarchical_declarations, members_of_chain_in, member_unit_in, instantiations_of, subclasses_of, base_of, instantiations, subclasses, facts_for, defines, find_define, references_to, references_are_ambiguous, files_spelling, files_mentioning, files_naming_in_macros, mentioned_outside, workspace_symbols, units_of, instantiable_units, counts, update_file, update_facts, absorb, remove_file, fingerprint
      IndexBuilder
      -

      FACTS_FORMAT is 18 in the committed snapshot. Cached facts include -normal/macro identifier censuses and package re-export edges (the RX group); Def::lines.positions can carry DeclPositions with UTF-16 ranges +

      Surface::{Connection, Hierarchical} selects the existing interface view or +the wider instance-tail view. Hierarchical reads add nets, variables and nested +instances without making them legal named port connections.

      +

      FACTS_FORMAT is 19 in this snapshot. Cached facts include +normal/macro identifier censuses, package re-export edges (the RX group), +and declaration/reference surface tags; Def::lines.positions can carry DeclPositions with UTF-16 ranges for file-scope declarations. Any persisted shape or fact-census change needs a codec-version decision so stale caches cannot silently omit answers.

      + + + + + + + + + + + + + + + + + + + + + + +
      Function or typePurpose
      import_usage, import_scopes, unused_importsShared scope-aware usage analysis consumed by organize-imports and the linter
      PackageExports / ExportsPackage-member oracle and its known/unknown result; implemented by WorkspaceIndex
      ImportUse, ImportScope, UnusedImportUsage evidence, scope inputs and unused-import findings
      +

      These names are exported both from vlog_semantic::imports and the crate root. +Package exports count as use; unresolved or macro-hidden uses keep removal +conservative.

      @@ -541,6 +573,14 @@ a codec-version decision so stale caches cannot silently omit answers.

      + + + + + + + + @@ -593,11 +633,51 @@ a codec-version decision so stale caches cannot silently omit answers.

      - - + +
      expand_wildcardReplace .* with named connections and warnings for unmatched ports
      convert_to_ansiMerge a non-ANSI header and body port declarations
      add_port Add a port to a module interface
      instance_name, has_escaped_identifier, render, render_with
      WorkspaceEditfile_count, edit_count, edits_forRefactorEditfile_count, edit_count, edits_for; fields edits, warnings, created
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Function or typePurpose
      organize_importsRemove unused imports, merge duplicates and sort a scope’s initial import run
      organize_counts, organize_title, imported_packages, unused_importsAction preflight, labels, package source selection and unused-import ranges
      extract_site, extract_title, extract_modulePreflight selected module items, label the action and plan extraction
      ExtractSite, HomeExtraction source requirements and destination choice
      inline_site, inline_title, inline_modulePreflight an instance, label the action and plan body substitution
      InlineSiteInstance/module identities used to gather inline inputs
      +

      Apply a RefactorEdit as one complete operation. Each path in created also +has one offset-zero insertion in edits; create those files before applying +text edits. Engines do no I/O. Callers must supply every file needed for edits +and refusal checks; current inline source-selection and verifier limits are +recorded in the repository topology, handshakes 32–33.

      diff --git a/docs/site/dist/start/configuration/index.html b/docs/site/dist/start/configuration/index.html index c3edb45..850720f 100644 --- a/docs/site/dist/start/configuration/index.html +++ b/docs/site/dist/start/configuration/index.html @@ -72,9 +72,10 @@ StarlightThemeProvider.updatePickers();

      Configuration

      Place lucisv.toml or .lucisv.toml beside your project. Every key is optional.

      lucisv.toml
      line-length = 100
      indent = 2
      exclude = ["*_gen.sv", "build"]
      filelist = "rtl/files.f"
      +
      [format]
      uvm-utils-indent = false
      [lint]
      select = ["no-tabs", "unused-signal"]
      ignore = ["module-filename"]
      [lint.line-length]
      length = 120
      -
      [lint.signal-name-style]
      style_regex = "[a-z_0-9]+"
      +
      [lint.signal-name-style]
      style_regex = "[a-z_0-9]+"
      @@ -160,7 +161,7 @@ not enable a rule that is off by default.

      The first file wins; configuration files are never merged. CLI options override file values per setting. Exclusions are the exception: configuration and CLI patterns are combined.

      -

      Unknown keys, out-of-range numbers, invalid values, tables other than [lint] and [lint.<rule>], and multiline arrays are rejected. This is a deliberate TOML subset. Top-level strings reject backslashes; per-rule strings retain backslashes literally for the pattern dialect and reject embedded quotes. They do not decode TOML string escapes. A bad configuration is an error for the CLI, preventing partial writes. In an editor, the server reports the problem and falls back to the next available setting.

      +

      Unknown keys, out-of-range numbers, invalid values, tables other than [format], [lint] and [lint.<rule>], and multiline arrays are rejected. This is a deliberate TOML subset. Top-level strings reject backslashes; per-rule strings retain backslashes literally for the pattern dialect and reject embedded quotes. They do not decode TOML string escapes. A bad configuration is an error for the CLI, preventing partial writes. In an editor, the server reports the problem and falls back to the next available setting.

      @@ -222,6 +223,11 @@ not enable a rule that is off by default.

      + + + + + @@ -315,4 +321,9 @@ re-arms logging for newly introduced mistakes. An empty editor selection is the fallback sentinel, so it does not clear a non-empty project selection.

      Successful “already formatted” verdicts are cached under .lucisv_cache/. Entries are keyed by file, content hash, line length, indentation, and lucisv version. Files that would change or fail are never cached. Use --no-cache to disable reads and writes or --cache-dir to relocate the store.

      - \ No newline at end of file +

      In v0.49.0, the cache key omits uvm-utils-indent. Changing that option +alone can reuse an incorrect clean verdict, including in --check mode. +After toggling it, use --no-cache or delete .lucisv_cache/ (or your custom +cache directory) before formatting or checking again. Editor formatting does +not use this CLI format cache.

      + \ No newline at end of file diff --git a/docs/site/src/content/docs/guides/formatter.md b/docs/site/src/content/docs/guides/formatter.md index dea0f43..5228ce4 100644 --- a/docs/site/src/content/docs/guides/formatter.md +++ b/docs/site/src/content/docs/guides/formatter.md @@ -14,6 +14,24 @@ lucisv uses a Wadler/Prettier-style document model. Breakable constructs render - At most one preserved blank line between adjacent items. - Compiler directives, attributes, and supported verbatim constructs keep their source text. +## UVM utilities indentation + +To indent field macros inside UVM utilities blocks one additional level: + +```toml +[format] +uvm-utils-indent = true +``` + +This v0.49.0 option is off by default. It applies to `uvm_field_*` macros +between `uvm_*_utils_begin` and `uvm_*_utils_end`. In editors, +`lucisv.format.uvmUtilsIndent` is the fallback; project configuration wins. +Short, comment-free enum bodies already fit on one line without another key. + +After toggling this option, run the CLI with `--no-cache` or remove its format +cache: v0.49.0 does not include this option in the cache key. See +[configuration](/start/configuration/#cache). + ## Alignment is inferred lucisv recognizes existing columnar intent in adjacent ANSI ports, named connections, and parameter declarations. If a group is already aligned—or uses four or more spaces where one would suffice—it is normalized as a table. Flush-left input stays flush-left. diff --git a/docs/site/src/content/docs/guides/linter.md b/docs/site/src/content/docs/guides/linter.md index aead090..d56b8b9 100644 --- a/docs/site/src/content/docs/guides/linter.md +++ b/docs/site/src/content/docs/guides/linter.md @@ -35,12 +35,18 @@ fence-blind; callers performing automatic edits must apply that protection. Use `[lint.]` in `lucisv.toml` or `lucisv.lint.options` in the editor for per-rule options. See [configuration](/start/configuration/) for precedence. -`lucisv check --rules-doc` prints all 73 registered rules, their severity, +`lucisv check --rules-doc` prints all 74 registered rules, their severity, default selection, fix applicability, and option defaults. Text output uses `FILE:LINE:COL: severity: message [rule]`. JSON output is one array, with a `severity` field on each diagnostic. +`unused-import` is a Style rule, off by default even in a project. Enable it +explicitly to report unused module/package/class imports using the same +analysis as Organize Imports. It stays silent without package facts and +preserves uncertain macro or inherited uses. A finding on an import with a +comment has no automatic deletion fix. + ## Waivers ```system-verilog diff --git a/docs/site/src/content/docs/guides/syntax.md b/docs/site/src/content/docs/guides/syntax.md index f78e3b7..a1c86c9 100644 --- a/docs/site/src/content/docs/guides/syntax.md +++ b/docs/site/src/content/docs/guides/syntax.md @@ -9,7 +9,7 @@ lucisv targets Verilog-2001 and the common synthesizable SystemVerilog subset, p - Modules, interfaces, programs, packages, classes, interface classes, generate regions, and nested classes. - ANSI and non-ANSI ports, parameter ports, header imports, `timeunit`, `genvar`, and `defparam`. -- Net and variable declarations, signing, packed and unpacked dimensions, and net delays. +- Net and variable declarations, signing, packed and unpacked dimensions, net delays, and net drive strengths. - `typedef` aliases, enums, packed structs/unions, forward class declarations, anonymous aggregate types, and type parameters. - Virtual interfaces, parameterized class types, properties, methods, constructors, prototypes, and out-of-body method definitions. - Functions and tasks in ANSI and legacy forms, DPI imports/exports, and package re-exports. @@ -19,7 +19,8 @@ lucisv targets Verilog-2001 and the common synthesizable SystemVerilog subset, p - `assign`, `always`, `always_comb`, `always_ff`, `always_latch`, `initial`, and `final`. - Blocks, conditionals, every `case` kind, loops, `foreach`, `fork/join*`, waits, timing controls, events, `force`/`release`, and jump statements. - Immediate and concurrent assertions, sequences, properties, `expect`, `cover sequence`, and `default disable iff`. Property and sequence expressions use their LRM precedence and participate in formatting and semantic tools. -- `randomize() with`, `randcase`, `let`, statement labels, array iterator methods, and omitted positional arguments. +- `randomize() with`, `randcase`, real `randsequence` productions, statement-level `let`, statement labels, array iterator methods, and omitted positional arguments. +- Nonblocking `->>` event triggers with optional timing and min:typ:max clocking skews. - Constraint blocks and randomization constraint bodies, including `soft`, `dist`, implication, `foreach`, and `solve before`. - Covergroups with coverpoints, bins, transitions, crosses, `with`, and `iff` expressions. @@ -33,7 +34,7 @@ lucisv targets Verilog-2001 and the common synthesizable SystemVerilog subset, p ## Expressions -- Full operator precedence, ternaries, concatenation and replication, slices, streaming concatenations, casts, and assignment patterns. +- Full operator precedence, ternaries, concatenation and replication, slices, streaming concatenations with `with [range]`, constant-expression and packed-type cast bases, and assignment patterns. - Hierarchical and package-scoped names, named call arguments, array methods, `inside`, and all supported `new` forms. - Dynamic arrays, queues, associative arrays, empty literals, and `$`-bound indexing. - Macro invocations in expression, statement, and item position; macro digits in based numbers. @@ -44,7 +45,7 @@ Some constructs are recognized structurally but emitted with their internal sour ## Not supported -A small set of rare expression/port forms remains outside the formatter grammar. lucisv also does not run a preprocessor, so a file that becomes valid only after cross-file macro expansion may not format as a standalone input. +Parser acceptance does not imply full elaboration or semantic navigation: generate-block-scoped hierarchical paths and DPI-export name binding remain gaps. lucisv also does not run a preprocessor, so a file that becomes valid only after cross-file macro expansion may not format as a standalone input. :::caution[Safe failure] Whole-file formatting returns an error and writes nothing when parsing is incomplete. lucisv never emits a partially understood file. diff --git a/docs/site/src/content/docs/reference/architecture.md b/docs/site/src/content/docs/reference/architecture.md index 04f289b..ec2baef 100644 --- a/docs/site/src/content/docs/reference/architecture.md +++ b/docs/site/src/content/docs/reference/architecture.md @@ -11,8 +11,8 @@ lucisv follows the same separation of concerns that makes ruff fast and maintain | `vlog_formatter` | document IR, width-aware printer, formatting rules, fences, ranges, verification | CLI and language server | | `vlog_linter` | rule registry, diagnostics, fixes, waiver engine | CLI and language server | | `vlog_semantic` | scopes, symbols, references, workspace units, external resolution | linter, refactors, language server | -| `vlog_refactor` | rename, references, port propagation, instantiation planning | language server | -| `lucisv_core` | configuration, filelists, walking, exclusions, cache, atomic replacement | CLI and language server | +| `vlog_refactor` | rename/references, ports, imports, extract/inline module, instantiation planning | language server | +| `lucisv_core` | configuration, filelists, walking, exclusions, cache, atomic replacement | CLI, language server, linter waiver matching | | `lucisv` | argument parsing, parallel per-file processing, reports, write orchestration | command-line users and CI | | `lucisv_server` | LSP transport, overlays, indexing, capabilities, editor settings | all LSP clients | @@ -39,22 +39,24 @@ lucisv follows the same separation of concerns that makes ruff fast and maintain also protect statement scopes, and verification covers the complete output. - **Lint:** `ParsedSource` bundles one tokenization and tolerant parse; `LintContext` supplies source facts and lazy semantics. The registry selects - 73 rules with severities and validated options. Inline and external waivers filter findings, + 74 rules with severities and validated options. Inline and external waivers filter findings, and the front ends protect fenced bytes before applying fixes. - **Refactor:** parsed spans and resolved references produce an edit plan; the engine checks the whole candidate edit before returning it. Server source selectors bound the input set but must include every file the engine might - edit or refuse over. No formatter dependency is involved. + edit or refuse over. The formatter is a test-only dependency of this engine. - **Editor:** one ordered synchronous loop owns `Workspace`; open documents overlay disk facts. Scans publish index/include/completion batches together. - Committed closed-file facts persist under codec 18, including package re-exports; a bounded file-view cache serves + Closed-file facts persist under codec 19, including package re-exports and + tagged connection/hierarchical surfaces; a bounded file-view cache serves queries that still need source text. Lazy port actions defer the edit until selection; recorded file-scope definition positions avoid a closed-file read. `vlog_parser` and `lucisv_core` depend on no other crates. Formatting and semantics each depend on the parser; linting and refactoring depend on parser -and semantics. The CLI composes core, parser, formatter, and linter; the server -composes all six libraries. The linter's formatter dependency is test-only. +and semantics. Linting also consumes core’s exclusion matcher for waiver +locations. The CLI composes core, parser, formatter, and linter; the server +composes all six libraries. Both linter and refactor use the formatter only in tests. External dependencies are confined to the CLI worker pool (`rayon`) and the server's synchronous LSP/JSON stack. @@ -72,12 +74,26 @@ overrides. The v0.44.0 `undriven-net` fix asks the workspace mention census only after local guards, reducing editor open/flush latency without changing the rule's findings or the synchronous request-ordering contract. -Two accepted changes are committed after v0.44.0: type names now carry exact -AST spans (`scan.rs` is retired), and package re-exports are references and -cycle-guarded member edges in codec 18. Re-exporting a name does not import it -into the exporting package's local scope. DPI-export names remain unbound. -The separate hierarchical-tail work proposes codec 19 and a module member -surface for instance paths; it is still under QA and is not a released API. +v0.45.0 shipped exact type-name spans (`scan.rs` is retired), package +re-exports and hierarchical tails, with facts codec **19**. Re-exporting a +name does not import it into the package’s local scope. Instance paths reach +internal nets, variables and nested instances through a separate surface; +existing connection queries keep their interface view. Generate-scoped +hierarchical paths and DPI-export name binding remain gaps. + +v0.46–0.49 added wildcard expansion, ANSI conversion, organize-imports, +extract-module and inline-module. Import usage lives in semantic `imports.rs`, +shared by the refactor and `unused-import` lint rule. Refactor `check/ledger.rs` +tracks protected comment/attribute pieces across moves and copies; +`RefactorEdit::created` carries new-file operations to the server. The inline +source selector still has a known gap for hierarchical uses through +intermediate modules; see the [refactoring limits](/reference/language-tools/#refactoring). + +The DUT hierarchy is client-only over the existing server snapshot. +v0.49.0 also adds real `randsequence` nodes and opt-in UVM indentation, whose +CLI cache limitation is documented under [configuration](/start/configuration/#cache). +This page reflects committed `df4e714`; Loop 2 is closed, with `state.rs` +decomposition deferred to Loop 3. ## Design invariants diff --git a/docs/site/src/content/docs/reference/language-tools.md b/docs/site/src/content/docs/reference/language-tools.md index c4ed02c..683c031 100644 --- a/docs/site/src/content/docs/reference/language-tools.md +++ b/docs/site/src/content/docs/reference/language-tools.md @@ -68,13 +68,30 @@ index scope when the defining module lives outside the default folder scope. |---|---|---| | Prepare rename | `textDocument/prepareRename` | Verifies the target and returns its editable range | | Rename | `textDocument/rename` | Renames local or workspace-resolved symbols | -| Port actions | code actions / commands | Adds, removes, and propagates module ports; expands a `.*` wildcard into the named connections it stands for (a port with no same-named signal in scope becomes `.p()` and is named in a warning) — `lucisv.expandWildcard`; converts a Verilog-2001 header to ANSI, each body declaration merged into the port it described (IEEE 1800 §23.2.2.2) with its comments carried along — `lucisv.convertToAnsi` | +| Port actions | code actions / commands | Adds, removes, and propagates module ports | +| Expand wildcard | code action / `lucisv.expandWildcard` | Expands `.*` in declaration order; a port with no same-named signal becomes `.p()` and is named in a warning | +| Convert ports to ANSI | code action / `lucisv.convertToAnsi` | Merges a legacy header with its body port declarations, preserving comments and attributes | | Organize imports | code action (`source.organizeImports`) / command | Removes the `import pkg::*;` lines nothing in the scope reaches through, merges exact duplicates and sorts the run at the top of a module, package or class; refuses rather than guesses wherever a macro, a conditional directive, an unknown package or a base class in another file could hide a use — `lucisv.organizeImports` | | Extract module | code action (`refactor.extract`) / command | Select whole module items and name the module: ports and parameters inferred from what the selection reads and drives, `import`s carried across, the items moved byte for byte, the replacing instantiation rendered from the new module's own text; a new file where the editor can create one, below the source module otherwise. Refuses with a sentence wherever a direction cannot be known — `lucisv.extractModule` | +| Inline module | code action (`refactor.inline`) / `lucisv.inlineModule` | Copies a separate-file module body into the selected instance site, substitutes named connections and parameter values, and renames internal identifiers on collision | | Instantiate module | inline completion / `lucisv.instantiate` | Builds an instance from an indexed module interface, including in clients without ghost text | | Apply workspace edit | `workspace/applyEdit` | Delivers multi-file refactor changes to the client | | Show definition | `window/showDocument` | Opens a generated or resolved target after an action | +Inline-module accepts simple named connections to names or literals; it +refuses `.*`, positional/expression or unconnected ports, output-to-literal +connections, unsupported port types, generate, initial/final and +macro/directive bodies. A hierarchical use found in its inputs also refuses +the action. There is a known source-selection gap for uses through an +intermediate module: a bench referencing `wrap.u_S.x` can be omitted when +inlining `S`. Review those uses before applying the edit. + +The VS Code hierarchy also supports **Star as DUT**, **Unstar DUT** and +**Clear DUTs**. Each DUT gets children and parents sections, followed by Other +Modules. `lucisv.hierarchy.duts` unions team-configured names with workspace +stars; configured names are locked in the menu. This view consumes the +unchanged `lucisv/moduleHierarchy` snapshot; it adds no server protocol. + ## Semantic presentation | Tool | Protocol method | What it does | diff --git a/docs/site/src/content/docs/reference/rust-api.md b/docs/site/src/content/docs/reference/rust-api.md index 937a2aa..207af56 100644 --- a/docs/site/src/content/docs/reference/rust-api.md +++ b/docs/site/src/content/docs/reference/rust-api.md @@ -7,9 +7,8 @@ description: Navigational index of the main public APIs in lucisv’s reusable R This is a navigational API index, not source documentation. It summarizes the main public callable surface of the six reusable library crates in the workspace; command-line and language-server binaries are documented in their dedicated references. -The latest release is v0.44.0. This index includes the accepted type-name-span -and package-re-export additions committed at `9ef1058` for the next release; -it excludes the in-progress hierarchical-tail API and codec 19. For the complete signatures and fields, +This index reflects **v0.49.0**, reviewed at committed `df4e714`, including +hierarchical member surfaces, import usage and module refactorings. For the complete signatures and fields, run `cargo doc --workspace --no-deps`; this hand-maintained index is not an exhaustive replacement for rustdoc. The parser's strict and tolerant entry points share one grammar; tolerant errors do not imply formatter acceptance. @@ -68,6 +67,10 @@ The CLI and server configure their worker threads accordingly. | `verify_equivalence` | Re-lex and compare normalized tokens, including comments | | `verify_convergence` | Confirm a second formatting pass is identical | +`Config` exposes `max_width`, `indent_width`, and `uvm_utils_indent` (default +`false`, new in v0.49.0). Exhaustive struct literals must include the new field; +`Config { max_width: 120, ..Config::default() }` keeps the other defaults. + ### Document model and printer | Function | Purpose | @@ -111,8 +114,8 @@ The CLI and server configure their worker threads accordingly. | Type | Public surface | |---|---| | `ParsedSource` | `parse`, `lex_error`, `tokens`, `file`, `context` | -| `LintContext` | `new`, `from_parse`, `with_tab_width`, `with_line_length`, `with_options`, `with_semantics`, `with_oracle`, `mentioned_elsewhere`, `has_oracle`, `module_interface`, `parsed_cleanly`, `line_length`, `options`, `option_bool`, `option_int`, `option_str`, `option_list`, `option_is_set`, `semantics`, `source`, `tokens`, `file`, `line_index`, `path`, `tab_width`, `line_text`, `touches_string`, `comments` | -| `MentionOracle` | Supply `mentioned_outside` and optional `module_interface` for project-aware checks | +| `LintContext` | `new`, `from_parse`, `with_tab_width`, `with_line_length`, `with_options`, `with_semantics`, `with_oracle`, `mentioned_elsewhere`, `has_oracle`, `module_interface`, `package_exports`, `parsed_cleanly`, `line_length`, `options`, `option_bool`, `option_int`, `option_str`, `option_list`, `option_is_set`, `semantics`, `source`, `tokens`, `file`, `line_index`, `path`, `tab_width`, `line_text`, `touches_string`, `comments` | +| `MentionOracle` | Supply `mentioned_outside` and optional `module_interface` / `package_exports` for project-aware checks | | `Violation` | `new`, `with_fix` | | `Fix` | `safe`, `unsafe_fix` | | `Applicability` | `as_str` | @@ -140,7 +143,7 @@ The CLI and server configure their worker threads accordingly. | Function or type | Public methods | |---|---| -| `WorkspaceIndex` | `build`, `files`, `path`, `file_id`, `units`, `member`, `members_of`, `members_of_chain`, `member_unit`, `instantiations_of`, `subclasses_of`, `base_of`, `instantiations`, `subclasses`, `facts_for`, `defines`, `find_define`, `references_to`, `references_are_ambiguous`, `files_spelling`, `files_mentioning`, `files_naming_in_macros`, `mentioned_outside`, `workspace_symbols`, `units_of`, `instantiable_units`, `counts`, `update_file`, `update_facts`, `absorb`, `remove_file`, `fingerprint` | +| `WorkspaceIndex` | `build`, `files`, `path`, `file_id`, `units`, `member`, `members_of`, `members_of_chain`, `member_unit`, `member_in`, `hierarchical_declarations`, `members_of_chain_in`, `member_unit_in`, `instantiations_of`, `subclasses_of`, `base_of`, `instantiations`, `subclasses`, `facts_for`, `defines`, `find_define`, `references_to`, `references_are_ambiguous`, `files_spelling`, `files_mentioning`, `files_naming_in_macros`, `mentioned_outside`, `workspace_symbols`, `units_of`, `instantiable_units`, `counts`, `update_file`, `update_facts`, `absorb`, `remove_file`, `fingerprint` | | `IndexBuilder` | `new`, `add_file`, `add_facts`, `finish` | | `FileFacts` | `of`, `from_analysis`, `words`, `macro_words`, `path`, `encode`, `decode` | | `DefinitionKey` | `of` | @@ -150,11 +153,28 @@ The CLI and server configure their worker threads accordingly. | `index_order` | Sort workspace inputs into their deterministic index order | | `words::harvest` / `harvest_text` / `harvest_raw` | Build the shared identifier census from tokens or source text | -`FACTS_FORMAT` is **18** in the committed snapshot. Cached facts include -normal/macro identifier censuses and package re-export edges (the `RX` group); `Def::lines.positions` can carry `DeclPositions` with UTF-16 ranges +`Surface::{Connection, Hierarchical}` selects the existing interface view or +the wider instance-tail view. Hierarchical reads add nets, variables and nested +instances without making them legal named port connections. + +`FACTS_FORMAT` is **19** in this snapshot. Cached facts include +normal/macro identifier censuses, package re-export edges (the `RX` group), +and declaration/reference surface tags; `Def::lines.positions` can carry `DeclPositions` with UTF-16 ranges for file-scope declarations. Any persisted shape or fact-census change needs a codec-version decision so stale caches cannot silently omit answers. +### Import usage + +| Function or type | Purpose | +|---|---| +| `import_usage`, `import_scopes`, `unused_imports` | Shared scope-aware usage analysis consumed by organize-imports and the linter | +| `PackageExports` / `Exports` | Package-member oracle and its known/unknown result; implemented by `WorkspaceIndex` | +| `ImportUse`, `ImportScope`, `UnusedImport` | Usage evidence, scope inputs and unused-import findings | + +These names are exported both from `vlog_semantic::imports` and the crate root. +Package exports count as use; unresolved or macro-hidden uses keep removal +conservative. + ## `vlog_refactor` ### Rename and references @@ -171,6 +191,8 @@ a codec-version decision so stale caches cannot silently omit answers. | Function or type | Public methods | |---|---| +| `expand_wildcard` | Replace `.*` with named connections and warnings for unmatched ports | +| `convert_to_ansi` | Merge a non-ANSI header and body port declarations | | `add_port` | Add a port to a module interface | | `remove_port` | Remove a port from a module interface | | `propagate_ports` | Carry interface changes through instantiations | @@ -184,7 +206,24 @@ a codec-version decision so stale caches cannot silently omit answers. | `instantiation_plan` | Build an instantiation plan from an indexed module | | `PortAction` | `label` | | `InstantiationPlan` | `instance_name`, `has_escaped_identifier`, `render`, `render_with` | -| `WorkspaceEdit` | `file_count`, `edit_count`, `edits_for` | +| `RefactorEdit` | `file_count`, `edit_count`, `edits_for`; fields `edits`, `warnings`, `created` | + +### Imports and module transformations + +| Function or type | Purpose | +|---|---| +| `organize_imports` | Remove unused imports, merge duplicates and sort a scope’s initial import run | +| `organize_counts`, `organize_title`, `imported_packages`, `unused_imports` | Action preflight, labels, package source selection and unused-import ranges | +| `extract_site`, `extract_title`, `extract_module` | Preflight selected module items, label the action and plan extraction | +| `ExtractSite`, `Home` | Extraction source requirements and destination choice | +| `inline_site`, `inline_title`, `inline_module` | Preflight an instance, label the action and plan body substitution | +| `InlineSite` | Instance/module identities used to gather inline inputs | + +Apply a `RefactorEdit` as one complete operation. Each path in `created` also +has one offset-zero insertion in `edits`; create those files before applying +text edits. Engines do no I/O. Callers must supply every file needed for edits +and refusal checks; current inline source-selection and verifier limits are +recorded in the repository topology, handshakes 32–33. ## `lucisv_core` diff --git a/docs/site/src/content/docs/start/configuration.md b/docs/site/src/content/docs/start/configuration.md index fa552ed..f195112 100644 --- a/docs/site/src/content/docs/start/configuration.md +++ b/docs/site/src/content/docs/start/configuration.md @@ -11,6 +11,9 @@ indent = 2 exclude = ["*_gen.sv", "build"] filelist = "rtl/files.f" +[format] +uvm-utils-indent = false + [lint] select = ["no-tabs", "unused-signal"] ignore = ["module-filename"] @@ -55,7 +58,7 @@ The first file wins; configuration files are never merged. CLI options override ## Strict parsing -Unknown keys, out-of-range numbers, invalid values, tables other than `[lint]` and `[lint.]`, and multiline arrays are rejected. This is a deliberate TOML subset. Top-level strings reject backslashes; per-rule strings retain backslashes literally for the pattern dialect and reject embedded quotes. They do not decode TOML string escapes. A bad configuration is an error for the CLI, preventing partial writes. In an editor, the server reports the problem and falls back to the next available setting. +Unknown keys, out-of-range numbers, invalid values, tables other than `[format]`, `[lint]` and `[lint.]`, and multiline arrays are rejected. This is a deliberate TOML subset. Top-level strings reject backslashes; per-rule strings retain backslashes literally for the pattern dialect and reject embedded quotes. They do not decode TOML string escapes. A bad configuration is an error for the CLI, preventing partial writes. In an editor, the server reports the problem and falls back to the next available setting. ## Editor settings @@ -71,6 +74,7 @@ Unknown keys, out-of-range numbers, invalid values, tables other than `[lint]` a | `lucisv.lineLength` | `null` | Editor fallback for maximum width | | `lucisv.indent` | `null` | Editor fallback for indentation | | `lucisv.exclude` | `[]` | Extra workspace index exclusions | +| `lucisv.hierarchy.duts` | `[]` | DUT module names in the VS Code hierarchy; union with saved workspace stars, locked in the menu | | `lucisv.filelist` | `""` | Filelist that defines the workspace index | | `lucisv.index.scope` | `folder` | Index the configured folder or widen to the workspace | | `lucisv.index.scopeDepth` | `2` | Parent-directory depth used by folder-scope indexing | @@ -111,3 +115,9 @@ the fallback sentinel, so it does not clear a non-empty project selection. ## Cache Successful “already formatted” verdicts are cached under `.lucisv_cache/`. Entries are keyed by file, content hash, line length, indentation, and lucisv version. Files that would change or fail are never cached. Use `--no-cache` to disable reads and writes or `--cache-dir` to relocate the store. + +In **v0.49.0**, the cache key omits `uvm-utils-indent`. Changing that option +alone can reuse an incorrect clean verdict, including in `--check` mode. +After toggling it, use `--no-cache` or delete `.lucisv_cache/` (or your custom +cache directory) before formatting or checking again. Editor formatting does +not use this CLI format cache. diff --git a/docs/topo.md b/docs/topo.md index a995307..f45ef44 100644 --- a/docs/topo.md +++ b/docs/topo.md @@ -24,20 +24,21 @@ null-items (108 feature READMEs); updated 2026-09-02 through v0.33.0 for the testbench grammar/semantics wave, comment slots, bind semantics, SVA bodies, and the four decomposition rounds (125 feature READMEs). -**Code audit refreshed 2026-09-05.** Latest release: **v0.44.0** -(`66f3898`). Committed snapshot: **`9ef1058`**, including type-name-spans -(TODO §47) and package-reexports (§48), both accepted for v0.45.0. The -committed facts codec is **18**; the active **hierarchical-tail** work (§49) -uses **19** in the working tree and is awaiting QA. Public contracts below -describe committed code unless explicitly marked in progress. Do not treat -the working-tree codec or an unchecked QA item as a released guarantee. +**Code audit refreshed 2026-09-07.** Latest release: **v0.49.0** +(`4c2dae3`); committed snapshot: **`df4e714`**, clean at review start. +Type-name spans, package re-exports and hierarchical tails shipped in v0.45.0; +the current facts codec is **19**. v0.46–0.49 added five refactorings, +`unused-import` (74 rules), DUT hierarchy sections, real `randsequence` nodes, +and opt-in UVM indentation. These are released contracts, not pending lanes. -The original audit's atomic-write, lint-config and walk-cycle findings are -closed in v0.43.0. External waivers shipped in v0.42.0; walk warnings, -inline aggregate overrides and the didOpen cost fix shipped in v0.44.0. -See [repository-analysis.md](repository-analysis.md) for current priorities -and dated verification evidence. Feature QA logs and TODO checkboxes remain -the authority for work being completed by other agents. +Loop 2 is closed. TODO §55 defers `state.rs` decomposition to Loop 3; +§2.9 retains DPI-export binding (31), refactor-verifier relocation (32), +transitive inline source selection (33), and older open requests. This audit +adds the reproduced UVM-option cache omission (34). The September 4 +atomic-write, lint-config and walk-cycle findings remain closed in v0.43.0. +See [repository-analysis.md](repository-analysis.md) for evidence and validation. +Feature QA logs and TODO checkboxes remain the acceptance authority; remote +artifact verification and manual editor acceptance were not repeated here. **Edge notation, used in all three sections:** @@ -72,6 +73,7 @@ graph TD S[vlog_semantic] --> P L[vlog_linter] --> P L --> S + L --> C R[vlog_refactor] --> P R --> S CLI[lucisv (CLI)] --> C @@ -85,6 +87,7 @@ graph TD SRV --> F SRV --> L L -.dev-dep (fix harness).-> F + R -.dev-dep (refactor acceptance).-> F VSC[editors/vscode] -.spawn contract.-> SRV VSC -.KEYWORDS grammar lock.-> P NVIM[editors/nvim (docs)] -.spawn contract.-> SRV @@ -118,9 +121,9 @@ what a change on the pointed-to side must not silently break. | `vlog_formatter ──▶ vlog_parser` | depends | `parse(tokens, source)` / `parse_source`, the whole AST, `tokenize` (re-used by `verify.rs` to re-lex both sides of the safety net), trivia attachment (`Meta::{leading,trailing,before_sep,attrs}` — comments are never dropped), `RawText.col` (the dedent column for verbatim re-indent), spans. The formatter is the AST's primary consumer: **every new `ItemKind`/`StmtKind`/`ExprKind` variant costs an arm in `format/`** (its matches are exhaustive). | | `vlog_semantic ──▶ vlog_parser` | depends | The AST read-only, `parse_source_tolerant`/`parse_tolerant` (never fails; `Error` nodes are opaque leaves), the **name-span contract** `src[name_span] == name` on every declaring node, `token::is_keyword`, `defines::collect_defines`/`DefineTable`, `TextRange`. `bind/`'s `ItemKind`/`ExprKind`/`DimKind` matches are exhaustive — new variants cost an arm here too. | | `vlog_linter ──▶ vlog_parser` | depends | `ParsedSource::parse` = `tokenize` + `parse_tolerant` (one-parse bundle), `LineIndex`, `TextRange`, AST shapes walked by `visit.rs` (which ends in `_ => {}`, so new variants usually cost nothing here), token facts for text rules (a macro use is one `Ident` token; a directive is one `Directive` token). | -| `vlog_linter ──▶ vlog_semantic` | depends | `analyze`, `Semantics::{symbols, references, references_of}` for semantic rules, including signal usage and duplicate-declaration checks. `Semantics::duplicates()` was added by linter-expansion-1 without changing persisted facts. `LintContext::semantics()` computes analysis lazily when a rule asks for it. Justified in `vlog_linter/Cargo.toml`; adds no external code (`vlog_semantic` is `vlog_parser` + std). | +| `vlog_linter ──▶ vlog_semantic` | depends | `analyze`, `Semantics::{symbols, references, references_of}` and shared `imports::{import_usage, unused_imports, PackageExports}` for semantic rules, including signal usage and duplicate-declaration checks. `Semantics::duplicates()` was added by linter-expansion-1 without changing persisted facts. `LintContext::semantics()` computes analysis lazily when a rule asks for it. Justified in `vlog_linter/Cargo.toml`; adds no external code (`vlog_semantic` is `vlog_parser` + std). | | `vlog_linter ──▶ lucisv_core` | depends | `walk::is_excluded`, the `--exclude` matcher, reused for a waiver file's `--location` so one pattern language serves the whole tool (waiver-files, §39, 2026-09-04). `lucisv_core` still depends on nothing, so no cycle. | -| `vlog_linter ──▶ vlog_formatter` **(dev-only)** | depends (tests) | The `.lint` fix harness asserts a lint fix never produces text `format_source` refuses. **The library dependency list is still `vlog_parser` + `vlog_semantic` + std** — `cargo tree -p vlog_linter -e normal` is the pinned check. Do not promote this to a normal dep; the fence filter deliberately lives in the front ends instead (see shared-fence-filter, §2.4). | +| `vlog_linter ──▶ vlog_formatter` **(dev-only)** | depends (tests) | The `.lint` fix harness asserts a lint fix never produces text `format_source` refuses. **The library dependency list is `vlog_parser` + `vlog_semantic` + `lucisv_core` + std** — `cargo tree -p vlog_linter -e normal` is the pinned check. Do not promote this to a normal dep; the fence filter deliberately lives in the front ends instead (see shared-fence-filter, §2.4). | | `vlog_refactor ──▶ vlog_formatter` **(dev-only)** | depends (tests) | expand-wildcard (§50, 2026-09-05): the acceptance tests format and converge what an expansion writes. No production edge. | | `vlog_refactor ──▶ vlog_semantic` (organize-imports) | depends | `imports::{import_usage, import_scopes, unused_imports, PackageExports, Exports}` — the one "is this import used" judgement, shared with the linter (§52, 2026-09-05). | | `vlog_linter ──▶ vlog_semantic` (organize-imports) | depends | the same `imports::*` judgement behind the `unused-import` rule; `MentionOracle::package_exports` is a new default method, so no implementor broke (§52). | @@ -128,7 +131,7 @@ what a change on the pointed-to side must not silently break. | `lucisv_server ◀── vlog_refactor` (extract-module) | depends | `RefactorEdit::created` — the files an edit creates, read by `lucisv_server::extract` to emit `CreateFile` document changes when `ClientAbilities::create_files` (read at `initialize`: `workspace.workspaceEdit.documentChanges` + `resourceOperations: create`) allows, else the same-file fallback (§53.1, 2026-09-06). | | `vlog_refactor ──▶ vlog_parser` | depends | `tokenize`, `parse_source_tolerant` + diagnostics, `LineIndex`, `TextRange`, the port/instantiation/module AST shapes, `token::is_keyword` (new-name validity), `defines` via the index. Every edit span originates in a parsed node — no textual search-and-replace. | | `vlog_refactor ──▶ vlog_semantic` | depends | `Semantics` queries (`symbol_at`, `references_of`, `reference_id_at`, …), `Resolution` variants (three of them are refusal rules), `WorkspaceIndex` + `resolve_external` + `ExternalTarget`, and the exactness promise on `name_span` (re-checked before each edit is emitted). One historical exception: refactor-rename added `Target::Declaration` + end-label uses *into* `vlog_semantic` (lead-authorized, additive — see §2.6). | -| `lucisv ──▶ lucisv_core` | depends | `config::{FileConfig, Discovery}` (lucisv.toml discovery — `config::parse` is reached through `Discovery`, not called directly), `walk::{collect_files, EXTENSIONS}` (the `.gitignore`/`--exclude` walk), `filelist::read` (`-f`), `cache` (the format cache), `atomic::write_atomic` (formatter and lint-fix replacement). (`walk::is_excluded` is `pub` but currently has no consumer outside the crate.) | +| `lucisv ──▶ lucisv_core` | depends | `config::{FileConfig, Discovery}` (lucisv.toml discovery — `config::parse` is reached through `Discovery`, not called directly), `walk::{collect_files, EXTENSIONS}` (the `.gitignore`/`--exclude` walk), `filelist::read` (`-f`), `cache` (the format cache), `atomic::write_atomic` (formatter and lint-fix replacement). (`walk::is_excluded` also supplies the linter’s external-waiver location matcher.) | | `lucisv ──▶ vlog_formatter` | depends | `format_source` / `format_range` / `LineRanges` / `Config` / `FormatError`, and `fence::{protected_regions, is_protected}` (the `--fix` fence filter — the linter crate deliberately has no fence notion). | | `lucisv ──▶ vlog_linter` | depends | The public linter API for `lucisv check` — `lint` + `LintContext`/`ParsedSource`, `apply_fixes`, `select_rules` (the CLI does not call `run` itself). Relies on: rule names stable, linting never panics/writes, findings sorted by `(span.start, span.end, rule)`. | | `lucisv ──▶ vlog_parser` | depends | `LineIndex` / `TextRange` for lint report coordinates, plus `PARSE_STACK_SIZE` for both the named `lucisv` thread and rayon workers. (The CLI otherwise reaches the parser through the formatter and linter.) | @@ -138,8 +141,8 @@ what a change on the pointed-to side must not silently break. | `lucisv_server ──▶ vlog_semantic` | depends | `analyze`/`Semantics` (every navigation answer), `WorkspaceIndex` (build/incremental update, units/members/defines, `instantiations_of`/`subclasses_of` edge tables, `FileFacts` codec for the persistent cache), `resolve_external` overlay, `index_order`/`IndexBuilder` (watched builds). | | `lucisv_server ◀──▶ vlog_semantic` | handshake | Two negotiated additions, both 2026-08-28 and both additive: **`Symbol::detail_span` / `Def::detail_span`** (where a non-ANSI port's body declaration completes the header that names it — the server's hover card and `nav::definition` both read it, and they show/jump to it in the same order), and **`Semantics::symbols_named`** (name → declarations, built in `analyze`, in declaration order — the server replaced two scan-every-symbol loops with it and the *first-match tie-break must stay declaration order* or hover's choice between two live declarations of one name changes). `docs/features/port-detail-spans/README.md`. | | `lucisv_server ◀──▶ vlog_semantic` | handshake | Three later additive performance surfaces: **`DeclLines` / `Def::lines`** record declaration and detail lines at index time (`FACTS_FORMAT` 3 → 4); **`WorkspaceIndex::absorb`** folds a scan batch with one merge rather than one merge per file; and **`WorkspaceIndex::files_spelling`** finds external uses by spelling, resolved or not, for rename's dangling-use refusal. The first feeds hover-line-index, the second scan-interleave, and the third refactor-rename's six-rung fan-out. Changing the facts codec, reference-fact census or merge semantics breaks those consumers. | -| `lucisv_server ──▶ vlog_refactor` | depends | `prepare_rename`/`rename`, `find_references`, the port refactorings, `instantiation_plan`/`render_with`/`module_definition` (the inline instantiation ghost, signature help, inlay hints — the completion popup stopped consuming them 2026-08-30, names-only tier). Promise consumed: never a partial edit — `Ok` verified whole, `Err` is a sentence. | -| `lucisv_server ◀──▶ vlog_refactor` | handshake | Request-scope selectors added for the performance wave: `prepare_rename_here` must produce the same answer/refusal text as whole-scope `prepare_rename`; `rename_name_at` must name the target that the rename engine acts on; `port_action_modules` and `enclosing_module` must name every module the corresponding port action/command can edit. The server uses those names only to choose an index-derived superset of files; the engine remains the authority. | +| `lucisv_server ──▶ vlog_refactor` | depends | `prepare_rename`/`rename`, `find_references`, the port refactorings, `organize_imports`, `extract_module`, `inline_module`, `RefactorEdit::{edits,warnings,created}`, `instantiation_plan`/`render_with`/`module_definition` (the inline instantiation ghost, signature help, inlay hints — the completion popup stopped consuming them 2026-08-30, names-only tier). Promise consumed: never a partial edit — `Ok` verified whole, `Err` is a sentence. | +| `lucisv_server ◀──▶ vlog_refactor` | handshake | Request-scope selectors added for the performance wave: `prepare_rename_here` must produce the same answer/refusal text as whole-scope `prepare_rename`; `rename_name_at` must name the target that the rename engine acts on; `port_action_modules` and `enclosing_module` must name every module the corresponding port action/command can edit. The server uses those names to choose an index-derived file set; `extract_site`, `inline_site` and `imported_packages` also name source requirements. The engine remains the authority, and every selector must supply a superset of files needed for edits and refusals (inline gap: §2.9-33). | | `lucisv_server ──▶ vlog_formatter` | depends | `format_source`, `format_range`/`LineRanges` (range, ranges, on-type formatting), `Config`, `fence::protected_regions` (quick-fix filter). | | `lucisv_server ──▶ vlog_linter` | depends | `run`, `lint` + `LintContext::from_parse` (lints from the `Document`'s own parse — one-parse), `default_rules`, `apply_fixes`, `rule_by_name`. Same three promises the CLI relies on. | | `lucisv_server ──▶ lsp-server / lsp-types` | depends | The transport (synchronous, no async runtime) and the protocol data model. Both pinned exactly. cancel-request additionally relies on `lsp-server 0.10.0`'s stdio transport being a **rendezvous channel** (its own forwarder queue exists because of it) — a version bump must re-read that crate's `stdio.rs`. | @@ -150,21 +153,22 @@ what a change on the pointed-to side must not silently break. | `CI (Gitea Actions) ──▶ tools/` | depends | `release.yml` is (almost) all `tools/` one-liners — `release.sh --cross`, `audit_artifacts.sh`, `prune_release_assets.sh`, `release_notes.sh`, `publish_release.sh` — so every release step runs by hand too; its only inline logic is the tag-vs-`lucisv --version` check. `ci.yml` is plain `cargo fmt`/`clippy`/`test` plus `scripts/corpus_gate.sh` (which reaches `tools/corpus_fetch.sh` on a cache miss). Tag `vX.Y.Z` must equal the workspace version; release notes come from `CHANGELOG.md`'s `## — ` headings via `release_notes.sh`. | | `scripts/score.sh + tools/corpus_check.sh ──▶ lucisv` | depends | The frozen 0/1/2 exit-code contract, plus a **textual** dependency on the message prefixes `parse error:` / `lex error:` / `verification failed:` (a standing fragile coupling — rewording those means telling corpus-check; see §2.9). | -**Deliberately absent crate edges** (independence you can rely on): +**Deliberately absent production edges** (also check shared file ownership): - `lucisv` (CLI) does **not** depend on `vlog_semantic` or `vlog_refactor` — the CLI formats and lints; semantic lints reach it only *through* `vlog_linter`, and refactoring is server-only today. -- `vlog_refactor` does **not** depend on `vlog_formatter` — refactored output +- `vlog_refactor` has **no production dependency** on `vlog_formatter` — refactored output is edited source, not reformatted source (refactor README, by design). - Among `vlog_formatter`, `vlog_semantic`, `vlog_refactor`, `vlog_linter` - there are exactly two build-time inter-crate edges — `vlog_linter → + there are exactly two production inter-crate edges — `vlog_linter → vlog_semantic` and `vlog_refactor → vlog_semantic` — plus `vlog_linter → - vlog_formatter` as a **dev-dependency only**. All four depend on + vlog_formatter` and `vlog_refactor → vlog_formatter` as **test-only + dependencies**. All four depend on `vlog_parser`. `vlog_formatter` is the isolated one: nothing in this group - depends on it at build time and it depends on none of them. Formatter work - and semantic work are parallel-safe except where both touch - `vlog_parser::ast`. + depends on it in production and it depends on none of them. Formatter and + semantic lanes still need disjoint file ownership and + a check of shared AST changes and open handshakes before parallel work. - `lucisv_core` depends on nothing and nothing in it knows about Verilog — it is "which files, with what settings". - `vlog_parser` depends on nothing. It is also the **highest-contention @@ -183,9 +187,9 @@ grammar, depth/chain budgets from recursion-limit — since the 2026-09-02 decomposition one module per grammar domain: `cursor`, `recover`, `directive`, `split`, `verbatim`, `item`, `module`, `decl`, `tf`, `instance`, `recover_list` (header/list-local tolerant recovery), `stmt`, `keyword_stmt`, `expr`, `primary`, `class`, -`covergroup`, `assertion`, `sva`, tests in `parser/tests/`) → `ast/` +`covergroup`, `assertion`, `sva`, `randsequence`, tests in `parser/tests/`) → `ast/` (`mod` holds `Meta`/`Comment`/spans/`RawText`; `module`, `decl`, `stmt`, -`expr`, `class`, `covergroup`, `sva` hold the nodes, all re-exported as +`expr`, `class`, `covergroup`, `sva`, `randsequence` hold the nodes, all re-exported as `vlog_parser::ast::*`); `span.rs` (`TextRange`), `line_index.rs` (offset↔line:col), `defines.rs` (the `` `define`` table, reads the token stream, expands nothing). `tests/spans.rs` @@ -197,7 +201,7 @@ server queue and `lsp-server` I/O threads are proven not to parse. **`vlog_formatter`** — the pipeline is `format/` (per-node rules; since 2026-09-02 `mod` + `verbatim`, `comment`, `phrase`, `list`, `item`, `module`, -`instance`, `decl`, `routine`, `class`, `cover`, `sva`, `stmt`, `expr`) → +`instance`, `decl`, `routine`, `class`, `cover`, `sva`, `randsequence`, `stmt`, `expr`) → `doc.rs` (the Wadler IR) → `printer.rs` (width-aware printing); `verify.rs` (the runtime safety net: token equivalence + convergence — CLAUDE.md invariant #4 territory, see §3.3); `fence.rs` (format-off regions + @@ -213,13 +217,15 @@ an error means emit nothing. `workspace/` (`mod` = the tables, `index` = queries and `build`, `update` = incremental update and `fingerprint`, `record` = the `FileFacts` read-off, `external` = the overlay, `reexport` = cycle-guarded package member traversal; -active §49 adds `hierarchy` and a second member table; `WorkspaceIndex`: units, members, defines, instantiation and +`hierarchy` = tagged connection/hierarchical member tables; `WorkspaceIndex`: units, members, defines, instantiation and inheritance edge tables, incremental `update_file`/`remove_file`, reference postings, `files_spelling`, batch `absorb`, declaration `DeclLines`, `fingerprint`); `facts.rs` (`FileFacts` codec for the persistent cache; -`FACTS_FORMAT` is 18 in committed code (19 in the active §49 work)); +`FACTS_FORMAT` is **19**); `instantiations.rs`, `classes.rs` (the shared walks, lifted from the server -so the index census and the request handlers cannot drift). +so the index census and the request handlers cannot drift); `imports.rs` +(`import_usage`, `import_scopes`, `unused_imports`, `Exports`, `PackageExports`) +is the shared usage judgement consumed by organize-imports and the linter. **`lucisv_core`** — `config.rs` (`lucisv.toml` parsing + `Discovery`, the upward search with its per-instance cache), `walk.rs` (`collect_files`, @@ -243,7 +249,7 @@ lazy `semantics()`), `visit.rs` (the item/statement walk), `waiver.rs` (inline waivers), `waiver_file.rs` (`ExternalWaivers`, usage tracking, unused reports), `violation.rs` (+ `Fix`, `Applicability`), `signals.rs` (the shared signal table for the three semantic rules), `naming.rs`, `rule_docs.rs` -(`rules_markdown()` — docs generated from the registry). There are 73 rules; +(`rules_markdown()` — docs generated from the registry). There are 74 rules; `severity.rs` classifies them, `options.rs` validates per-rule configuration, `regex.rs` implements the bounded pattern dialect, and `vscode.rs` generates editor rule toggles. `decls.rs`, `module_decls.rs`, `exprs.rs`, `preproc.rs`, @@ -254,11 +260,17 @@ editor rule toggles. `decls.rs`, `module_decls.rs`, `exprs.rs`, `preproc.rs`, also the engine of `references.rs::find_references`; publishes the cheap `prepare_rename_here`/`rename_name_at` selectors whose parity with the full engine is test-pinned), `ports/` (one file per refactoring: `find`, `add`, -`remove`, `propagate`, `list`; +`remove`, `propagate`, `list`, `expand`, `ansi`, `merge`; `port_action_modules`/`enclosing_module`, the names the server uses to bound the input set), `instantiate.rs` (plans + rendering; the one layout both plain -and snippet spellings go through), `check.rs` (whole-edit verification: -re-tokenize + re-resolve, refuse everything on any drift). +and snippet spellings go through); `imports.rs` (organize-imports); +`extract/` (`mod`, `boundary`, `render`, `region`, `flow`) and `inline/` +(`mod`, `site`, `source`, `render`) plan module moves/copies. `check/` +(`mod`, `ledger`) verifies edits with re-tokenization/resolution and the exact +comment/attribute piece ledger. `RefactorEdit::created` lists new paths, each +also represented by one insertion at offset zero in `edits`; server `CreateFile` +operations must precede those edits. Same-file relocation verification and +inline source fan-out remain open in §2.9-32/33. **`lucisv` (CLI)** — `main.rs` (args → walk → per-file worker pool; `process_file` is the cache-aware unit of work; panic hook installed once at @@ -277,7 +289,7 @@ spans two layers — the include graph *and* the `documentLink` handler; | loop | `server/` (since 2026-09-02: `mod` = the loop; `dispatch`, `client`, `index`, `notification`, `progress`, `diagnostics`, `batch`, `formatting`, `large_file`, `semantic_tokens`; tests in `server/tests/`) | the message loop + queue/burst (cancel-request), dispatch, `Pending` map for server-initiated requests, stepped startup scans with mid-scan request drains, held-request ordering for rescans, reindex/widen orchestration, progress/log senders, optional `timing:` instrumentation | | state | `state.rs` | `Workspace` (roots, scope ladder, index, include graph, candidates, index cache, open `Document`s with overlay, bounded closed-file `FileView` cache), `Scan` (whole or additive widen), fan-out source selectors (`module_sources`, `rename_sources`, `include_sources`), and `Document` (text, tokens, tree, semantics, diagnostics, `large` flag) | | substrate | `convert.rs`, `uri.rs`, `locate.rs`, `pairs.rs`, `includes.rs`, `candidates.rs`, `index_cache.rs`, `watch.rs`, `settings.rs`, `templates.rs`, `sync.rs` | position math, URI↔path, location building, the begin/end scope matcher, the include graph, completion word/module tables and their scan-batch forms, the persistent index store, watcher registration, `lucisv.*` settings parsing, snippet registry, incremental text sync | -| handlers | one file per capability: `format.rs`, `diagnostics.rs`, `lint.rs`, `hover.rs`, `expand.rs`, `nav.rs`, `type_def.rs`, `type_hierarchy.rs`, `hierarchy.rs`, `design_hierarchy.rs`, `symbols.rs`, `tokens.rs`, `completion/` (`mod`, `member`, `module`, `tiers`, `word`, `site`; test harness in `harness`), `signature.rs`, `inlay.rs`, `inline.rs`, `lens.rs`, `code_action.rs`, `rename.rs`, `ports.rs`, `folding.rs`, `selection.rs`, `linked.rs`, `on_type.rs`, `includes.rs` (links), `file_ops.rs`, `instantiate.rs`, `large.rs` | each is a mostly-pure function over `Document`/`Workspace`; protocol only, no language analysis of its own (anything that looks like analysis in here is a bug or a Handshake request — lucisv-server README) | +| handlers | one file per capability: `format.rs`, `diagnostics.rs`, `lint.rs`, `hover.rs`, `expand.rs`, `nav.rs`, `type_def.rs`, `type_hierarchy.rs`, `hierarchy.rs`, `design_hierarchy.rs`, `symbols.rs`, `tokens.rs`, `completion/` (`mod`, `member`, `module`, `tiers`, `word`, `site`; test harness in `harness`), `signature.rs`, `inlay.rs`, `inline.rs`, `lens.rs`, `code_action.rs`, `rename.rs`, `ports.rs`, `imports.rs`, `extract.rs`, `inline_module.rs`, `folding.rs`, `selection.rs`, `linked.rs`, `on_type.rs`, `includes.rs` (links), `file_ops.rs`, `instantiate.rs`, `large.rs` | each is a mostly-pure function over `Document`/`Workspace`; protocol only, no language analysis of its own (anything that looks like analysis in here is a bug or a Handshake request — lucisv-server README) | **`editors/vscode`** — `extension.js` (spawn + rainbow decorations + storage path; ~everything else is `vscode-languageclient` driven off advertised @@ -286,7 +298,9 @@ colour ids), `syntaxes/` (hand-maintained grammar, test-locked to `KEYWORDS`), `snippets/` (static, server-independent), `restart.js` (the one serialized start/restart chain, so a `lucisv.verbose` toggle cannot be lost to an in-flight start — shipped, shared by the extension restart paths), -`hierarchyView.js`/`hierarchyModel.js` (the indexed instance hierarchy sidebar), +`hierarchyView.js`/`hierarchyModel.js`/`hierarchySections.js` (the indexed +instance hierarchy sidebar and client-only DUT sections), `extract.js` +(the module-name input and extract command), `smoke.js` (headless handshake check) and `restart_test.js` (headless check of that chain, against a scripted fake client), `README.md` (the Marketplace Details page, owned by editor-marketplace-page). @@ -310,7 +324,7 @@ output after content changes, and keep historical measurements dated. | header-recovery | parser `ListElem::{Ok,Error}`, `ExprKind::Error`, `recover_list.rs` → formatter, semantic, linter, refactor and server list walkers | Tolerant mode preserves valid siblings; strict formatting still rejects malformed input | | linter-expansion-1 | `Severity`, `Violation::severity`, `rules_named`, `MentionOracle::module_interface`, `Semantics::duplicates` ↔ CLI reports, server diagnostics/settings, generated VS Code toggles | Delivered; duplicate facts are in-memory only | | linter-expansion-2 | core `FileConfig::lint_options`/`LintOption` → linter `RuleOptions`; registry specs ↔ CLI validation, server option overlay and editor settings | Delivered; core records raw values and does not depend on the linter | -| linter-expansion-3 | shared scoped-item/expression/preprocessor walkers ↔ 73-rule registry, rule docs and generated editor toggles | Delivered; rule names and option keys are user-facing contracts | +| linter-expansion-3 | shared scoped-item/expression/preprocessor walkers ↔ registry (73 rules at delivery, now 74), rule docs and generated editor toggles | Delivered; rule names and option keys are user-facing contracts | | small-items-3 | parser `ItemKind::GenBlock` → every recursive item walker; `recover_list` lookahead; core `atomic::write_atomic` → CLI format/fix and format cache | Delivered in v0.40.0; per-operation temp ownership and canonical CLI dedup followed in v0.43.0 (§2.9-26) | | lazy-code-action | refactor `sites_phrase` ↔ server `ports.rs`; `ClientAbilities::code_action_resolve` ↔ dispatch and `{uri, position, title}` action data; indexed `DeclPositions` → `locate::definition_location` | Delivered in v0.41.0; clients without resolve support retain eager port actions, lint fixes remain eager | | parser-skips | parser `module.rs`/`split.rs` rival-header detection; `DataDecl::delay: Option` → formatter `format/decl.rs` and semantic `bind/decl.rs` | **Released in v0.42.0**; preserves the written delay position; no verifier normalization change | @@ -319,9 +333,14 @@ output after content changes, and keep historical measurements dated. | lint-config-contract | server `lint/project.rs` parses project selection/options/waivers; `ProjectLint` → lint selection, `ConfigProblems`/`ProblemLog` → diagnostics logging | Released in v0.43.0; editor lists override project lists when non-empty, separately for select and ignore | | walk-cycles / small-items-4 | core directory identity set and warning sink ↔ CLI/server walk callers; parser delay-comment fields and `ExprKind::Type` → formatter and instance planning | Released in v0.43–0.44; warning paths continue without changing CLI status, direct missing inputs remain errors | | didopen-cost | `undriven-net` local guards → existing `MentionOracle` predicate; diagnostics equality → server publish/request ordering | Released in v0.44.0; no new async work or index API | -| type-name-spans | parser `DataType::name_span`/`segments`, disable-target span → binder `exact_or_empty` and census | Committed after v0.44.0; `scan.rs` deleted; source text remains the exact-span oracle | -| package-reexports | binder export references → `FileFacts` RX group, codec 18 ↔ workspace `reexport.rs` and shared member queries | Committed after v0.44.0; package exports add no local import; DPI-export names remain unbound | -| hierarchical-tail | proposed `Surface` tags on declarations/references, codec 19 ↔ `workspace/hierarchy.rs`, member-tail resolution, completion and rename source selection | **In progress, QA pending (TODO §49)**; connection surface stays unchanged, instance tails read the new hierarchical surface | +| type-name-spans | parser `DataType::name_span`/`segments`, disable-target span → binder `exact_or_empty` and census | Released in v0.45.0; `scan.rs` deleted; source text remains the exact-span oracle | +| package-reexports | binder export references → `FileFacts` RX group (introduced at codec 18, now 19) ↔ workspace `reexport.rs` and shared member queries | Released in v0.45.0; package exports add no local import; DPI-export names remain unbound | +| hierarchical-tail | `Surface` tags on declarations/references, codec 19 ↔ `workspace/hierarchy.rs`, member-tail resolution, completion and rename source selection | Released in v0.45.0; §2.9-23 closed; connection surface stays unchanged, instance tails read the hierarchical surface | +| expand-wildcard / convert-to-ansi | `ports/{expand,ansi,merge}.rs` ↔ whole-edit verifier; server `ports.rs`, commands and action titles ↔ extension manifest; refactor → formatter test-only edge | Released in v0.46.0; explicit unmatched-port warnings and conservative merge/refusal rules | +| organize-imports | semantic `imports.rs` → linter `unused-import` and refactor `imports.rs`; server `imports.rs` ↔ `source.organizeImports` / `lucisv.organizeImports` | Released in v0.47.0; 74 rules, new rule default off; package re-exports count as usage | +| extract / inline module | refactor `extract/`, `inline/`, `check/ledger.rs`, `RefactorEdit::created` ↔ server `extract.rs`, `inline_module.rs`, source selectors and client resource capabilities; extension `extract.js` ↔ name prompt | Extract v0.47.0, inline v0.49.0; file copies/moves preserve protected pieces; open §2.9-32/33 | +| dut-hierarchy | extension `hierarchySections.js` ↔ model/view, manifest commands, `lucisv.hierarchy.duts`, workspace state; consumes unchanged `lucisv/moduleHierarchy` snapshot | Delivered in v0.48.0, package corrected in v0.48.2; configured DUTs are locked, saved and configured names union | +| coverage-gaps-l | new `randsequence` AST/parser/formatter modules and six grammar additions → all AST walkers and grammar keyword lock; `Config::uvm_utils_indent` ↔ core `[format]`, CLI config merge, server setting and extension manifest | Released in v0.49.0; default-off output option; cache-key omission open in §2.9-34 | The lazy action resolves against current workspace state and rejects a stale or inapplicable action. Indexed definition locations bypass closed-file reads @@ -660,7 +679,7 @@ update the filing README(s) and this file. | ~~20~~ | ~~Rename loses its heads-up for an **unresolvable member/hierarchical tail** spelling the renamed name (`unknown_mod u_x (); … u_x.sig` when `unknown_mod` is indexed nowhere): before class-member-access the tail had no reference and `rename.rs::stray_reason` warned "a hierarchical or member tail, which lucisv does not resolve"; since round 2 it carries an `ExternalCandidate` the workspace cannot answer, which the engine neither edits (correct) nor mentions. Wanted: a warning for candidate references that spell the old name and stayed unresolved through the overlay — one message per file. Pinned as a premise by `a_hierarchical_tail_that_cannot_resolve_is_left_alone_and_named_as_such`. Same class as item 18.~~ — **delivered 2026-09-02 by comment-slots**: `Scope::unresolved_candidate_warnings` — a reference that stayed `ExternalTarget::StillUnresolved` through the overlay (or an `InheritedCandidate` that missed) is reported one line per (file, unit), run over every file that spells the name. The premise pin is inverted. Surfaced item 23 in the process | class-member-access round 2 (lead) | ~~vlog_refactor (`rename.rs`)~~ done | | ~~21~~ | ~~`Parser::parse_scoped_name` joins a `pkg::name` chain into one `String`, erasing the segment boundary, so an escaped segment (`\my-pkg ::\state-t` as a type, an instantiated module or a `bind` target) is reprinted without its terminating space and **refused by the safety net** — an error, never a corruption. Wanted: the AST keeps the segments (as `parse_method_name` already does for `FunctionDecl::scope`). Pinned by `escaped_identifiers.cases`'s one `#SKIP` and `verification::an_escaped_name_in_a_scoped_type_is_rejected_rather_than_corrupted`, both of which must keep failing-to-format until delivered~~ — **delivered 2026-09-02 by comment-slots**: `Parser::push_scope_segment` is the one join for every `::` chain and writes the escaped segment's terminator; `parse_method_name` keeps real segments (`ScopeSeg`, one comment slot per `::`). The `#SKIP` is a live case and the verification pin is inverted, with a new pair asserting the tightened spelling is still refused | escaped-identifiers | ~~vlog_parser~~ done | | ~~22~~ | ~~**Comment slots in shared expression/name machinery** drop the comment and the safety net refuses the file: `q[/*c*/ i]` (index expressions), `x inside {[/*c*/ 0:3]}` and `n /*c*/ inside {` (`inside` / `parse_value_range`), `pkg/*c*/ ::cls::name` (`parse_method_name` chains), `foreach (q[/*c*/ i])` (`parse_foreach_target`), `static /*c*/ constraint` / `pure /*c*/ static function` (`take_member_prefix`). Found by constraint-bodies' exhaustive gap fuzzer (358 gaps; these 40 fail identically on v0.26.0 in the same constructs outside a constraint). Inside a constraint they are regressions relative to the verbatim era — but no opentitan file hits one (sweep unchanged). Wanted: a parser-wide round giving each slot a `Meta`/comments field, then re-running the fuzzer to zero.~~ — **delivered 2026-09-02 by comment-slots**: ~70 named comment fields across `ExprKind`/`Stmt`/declarations/headers/labels (`SegmentComments`, `BinaryComments`, `CastComments`, `LabelComments`, `Stmt::before_semi` + `StmtKind::takes_semi()`), three duplicated grammars folded into `parse_postfix_segment` / `parse_value_range`, and four gap fuzzers at zero — covergroup 329, fragment 153, constraint 395 (committed at last), RTL 352 (new). Corpus (860 files) and opentitan (3 975 files) byte-identical to v0.30.0. Deliberately left: `if`/`case` in-paren comments still recovered print-side by `header_parens` (only `after_kw` got a slot) — a real slot there would change existing layout A fifth fuzzer bar 2026-09-05 (small-items-4, TODO §45.4): the **delay list** — `#(1:2:3)` on nets and continuous assignments, `#(rise, fall)` on gates — gained `MinTypMaxComments`, `ast::DelayValue`, `ContAssign::{after_hash, after_delay}`, `GateInstantiation::{before_hash, after_hash, before_semi}`, `GateInstance::before_args`; `EXPECTED_RTL_GAPS` 374 → 419 at zero. | constraint-bodies (dev + QA) | ~~vlog_parser~~ done | -| ~~23~~ | ~~A **cross-file instance-member tail does not resolve for rename**: with `module sub` in `sub.sv` and `assign w = u_x.sig;` in `top.sv`, renaming `sub`'s `wire sig` edits `sub.sv` only — the same shape in one file resolves and is edited (`a_hierarchical_tail_that_resolves_is_renamed_with_its_declaration`). Since comment-slots the rename *says so* (item 20's warning); the edit itself is the gap. Modules export ports and parameters only (the class-member-access round 2 ruling), so an internal net is exactly what the cross-file hop refuses — the fix is either an export rule for nets named through an instance or a rename-time in-file fallback resolution of the tail. **Active owner: hierarchical-tail (TODO §49), working-tree implementation present; QA pending.** Keep this request open until acceptance.~~ — **delivered 2026-09-05 by hierarchical-tail (TODO §49):** a module has two member surfaces — the *connection* surface (ports, parameters; unchanged for every existing reader) and the *hierarchical* surface (plus nets, variables, instances; a second index table, `FACTS_FORMAT` 19) read only by the tail walk behind an instance head (`Surface::Hierarchical` from `resolve.rs::head_surface`). `assign w = u_x.sig;` resolves cross-file, the rename edits both files, the §2.9-20 warning is retired for a resolved tail. A generate-block-scoped net (`u_x.gen[0].sig`) is on neither surface and is still refused honestly. 514 references newly resolve over opentitan `hw/`. | comment-slots (dev, surfaced by the §2.9-20 control test) | vlog_semantic / vlog_refactor | +| ~~23~~ | ~~A **cross-file instance-member tail does not resolve for rename**: with `module sub` in `sub.sv` and `assign w = u_x.sig;` in `top.sv`, renaming `sub`'s `wire sig` edits `sub.sv` only — the same shape in one file resolves and is edited (`a_hierarchical_tail_that_resolves_is_renamed_with_its_declaration`). Since comment-slots the rename *says so* (item 20's warning); the edit itself is the gap. Modules export ports and parameters only (the class-member-access round 2 ruling), so an internal net is exactly what the cross-file hop refuses — the fix is either an export rule for nets named through an instance or a rename-time in-file fallback resolution of the tail.~~ — **delivered 2026-09-05 by hierarchical-tail (TODO §49):** a module has two member surfaces — the *connection* surface (ports, parameters; unchanged for every existing reader) and the *hierarchical* surface (plus nets, variables, instances; a second index table, `FACTS_FORMAT` 19) read only by the tail walk behind an instance head (`Surface::Hierarchical` from `resolve.rs::head_surface`). `assign w = u_x.sig;` resolves cross-file, the rename edits both files, the §2.9-20 warning is retired for a resolved tail. A generate-block-scoped net (`u_x.gen[0].sig`) is on neither surface and is still refused honestly. 514 references newly resolve over opentitan `hw/`. | comment-slots (dev, surfaced by the §2.9-20 control test) | vlog_semantic / vlog_refactor | | ~~24~~ | ~~A **half-typed `#(` parameter override whose value can read as a call** (`sub #(.W(` ⏎ `u0 (.a(x))`) — the greedy expression grammar swallows the next instance's name before any error fires, so the whole instantiation still degrades to an item-level `Error` node instead of getting header recovery's benefit. Found by §32's QA; the fix is a lookahead in the override grammar (an identifier followed by `(` on a later line is the next instance, not a call).~~ — **delivered 2026-09-04 by small-items-3 (TODO §36)** | header-recovery (QA) | vlog_parser | | ~~25~~ | ~~The parser **refuses** a module-scope `begin … end` and a bare `begin` inside a `generate` region (an `ItemKind::Error`) rather than recovering them as an unnamed generate block, so `module-begin-block` and `v2001-generate-begin` (TODO §35) fire on an error leaf and the rest of the unit is lost to recovery. Wanted: tolerant-mode recovery that keeps the block's items.~~ — **delivered 2026-09-04 by small-items-3 (TODO §36)** | linter-expansion-3 (dev) | vlog_parser | | ~~26~~ | ~~**Same-target atomic writers share a temp path.** `atomic::temp_path` uses canonical target + process ID; parallel workers following distinct symlink spellings can reach that same name, while CLI dedup is lexical. A bounded direct helper probe (100 rounds, two threads, 1 MiB each) returned 100 write errors in 200 calls; no mixed final bytes observed in that probe. Use exclusive per-operation temp creation and coordinate/deduplicate target writes. See repository-analysis.md for limits.~~ — **closed by §41 (0.43.0):** unique `O_EXCL` temps (`.{name}.{pid}.{n}.lucisv-tmp`), dedup on `fs::canonicalize`; two *processes* remain last-writer-wins by design, stated in `atomic.rs` | repository audit, 2026-09-04 | lucisv_core / lucisv | @@ -671,6 +690,7 @@ update the filing README(s) and this file. | 31 | **DPI-export name binding remains open.** Package re-export resolution closed §2.9-16, but the name in a DPI export is still not a semantic reference. Keep this separate from the delivered package-member traversal. | dpi-export request (b); package-reexports | vlog_semantic | | 32 | **The refactoring verifier does not catch a same-file relocation of a never-dropped piece written as two well-formed edits** (delete here, insert there): `verify_move` computes `after` by applying the edits, so `positions_match`'s reconstruction cannot diverge from it and equation 3 of the ledger is unreachable through any real caller. No planner produces the shape today. Wanted: an independent `after` (the client's applied text, or a second reconstruction) and a test that isolates equation 3. Found by extract-module's QA re-attack. | extract-inline-module (QA) | vlog_refactor | | 33 | **`module_sources`' fan-out has no rung for a file that reaches an instance through an intermediate module it does not itself instantiate** (a bench naming `wrap.u_S.x` where `wrap` instantiates `S`): inline-module's hierarchical-reference refusal sees only the handed files, so such a reference is missed. Wanted: a transitive-instantiators rung (§49's hierarchical surface knows the path) in `module_sources` for the refactorings that must see every hierarchical use. Found by §53.2's QA. | extract-inline-module (QA) | lucisv_server / vlog_refactor | +| 34 | **The format cache omits `Config::uvm_utils_indent`.** CLI `args.rs::config_with` applies the key, but `main.rs::entry_for` and core `cache::Entry` serialize/compare only content, line length and indent (plus the store version). On one UVM class: cache a clean verdict with the option false, change only the option to true, then cached `--check` exits 0 while `--no-cache --check` exits 1. Wanted: key/equality/codec coverage for the option and a regression for both toggle directions. Until fixed, use `--no-cache` or delete the format cache after toggling. See repository-analysis.md for the bounded reproduction. | repository audit, 2026-09-07 | lucisv_core / lucisv | --- @@ -691,13 +711,13 @@ untouched, reusing existing arms. |---|---| | `vlog_parser` | spans, name-spans, recursion-limit, error-recovery, define-table, lexer-cleanup, decomposition-parser, and the grammar lane: *macro-items*, *classes*, *bind*, *dynamic-types*, *types-decls*, *item-misc*, *directives-in-lists*, *directives-in-instances*, *dpi-export*, *assertions*, *interfaces*, *expressions-2*, *dv-statements*, *mop-up-2*, *directive-split*, *ansi-first-port*, *null-items*, *constraint-bodies*, *covergroup-bodies*, *fragment-mode*, *vendor-formal-grammar*, *comment-slots*, *bind-semantics*, *sva-bodies* (most also add formatter arms — parser+formatter pairs by default; directive-split and ansi-first-port reused existing arms and left `vlog_formatter/src` untouched) | | `vlog_formatter` | safety-net (`verify.rs`), case-tables, formatter-bug-fixes, corpus-bugs, comments-round, comments-round-2, alignment (`align.rs`), format-fences (`fence.rs`), range-formatting (`range.rs`), shared-fence-filter, decomposition-formatter, and the layout halves of constraint-bodies, covergroup-bodies, comment-slots, bind-semantics and sva-bodies (`format/`) | -| `vlog_semantic` | vlog-semantic (`bind/`, `resolve.rs`, `model.rs`), workspace-index (`workspace/`), decomposition-semantic, class-semantics, interface-semantics, class-member-access, struct-members, overlay-promotion, port-detail-spans (`Symbol`/`Def::detail_span` and `Semantics::symbols_named`), hover-line-index (`DeclLines`, facts codec), vscode-hierarchy-sidebar's declaration/instance positions, scan-interleave (`WorkspaceIndex::absorb`), semantic-lints-on's word census, bind-semantics and sva-bodies, refactor-rename's performance amendment (`files_spelling`), plus the index halves of indexing-ux (`index_order`/`IndexBuilder`), index-scope (order-insensitive `finish`, facts-from-analysis), incremental-index (`update_file`, edge/reference tables, `instantiations.rs`, `classes.rs`), index-persistence (`facts.rs`; committed `FACTS_FORMAT` 18; active §49 uses 19; plus a small `vlog_parser::defines` touch — `DefineTable::from_entries`, `Eq` derives) | +| `vlog_semantic` | vlog-semantic (`bind/`, `resolve.rs`, `model.rs`), workspace-index (`workspace/`), decomposition-semantic, class-semantics, interface-semantics, class-member-access, struct-members, overlay-promotion, port-detail-spans (`Symbol`/`Def::detail_span` and `Semantics::symbols_named`), hover-line-index (`DeclLines`, facts codec), vscode-hierarchy-sidebar's declaration/instance positions, scan-interleave (`WorkspaceIndex::absorb`), semantic-lints-on's word census, bind-semantics and sva-bodies, refactor-rename's performance amendment (`files_spelling`), plus the index halves of indexing-ux (`index_order`/`IndexBuilder`), index-scope (order-insensitive `finish`, facts-from-analysis), incremental-index (`update_file`, edge/reference tables, `instantiations.rs`, `classes.rs`), index-persistence (`facts.rs`; `FACTS_FORMAT` 19; plus a small `vlog_parser::defines` touch — `DefineTable::from_entries`, `Eq` derives) | | `vlog_linter` | linter-core, lint-harness, lint-rules-2, semantic-lints (`signals.rs`), semantic-lints-on (workspace oracle), one-parse (`context.rs`) | -| `vlog_refactor` | refactor (plan), refactor-rename (including `prepare_rename_here` / `rename_name_at` selector half), refactor-ports (including module-target selectors), refactor-instantiate, references-nav (whole-scope equivalence oracle), and the refactor half of decomposition-semantic | +| `vlog_refactor` | refactor (plan), refactor-rename (including `prepare_rename_here` / `rename_name_at` selector half), refactor-ports (including module-target selectors), refactor-instantiate, references-nav (whole-scope equivalence oracle), and the refactor half of decomposition-semantic; expand-wildcard and convert-to-ansi (`ports/`), organize-imports (`imports.rs`), extract-inline-module (`extract/`, `inline/`, `check/ledger.rs`) | | `lucisv_core` | lucisv-core-lift (`config.rs`, `walk.rs`), filelist (`filelist.rs`), format-cache (`cache.rs`) | | `lucisv` (CLI) | cli-polish, config-discovery (wiring), parallel-files, cli-filelist, linter-core (CLI half in `lint.rs`), one-parse (`lint.rs` parses once via `ParsedSource`), format-cache (wiring), release-prep (`--version` contract) | | `lucisv_server` | lucisv-server (trunk), decomposition-server (`server/`, `completion/`), and one or two modules per capability feature: editor-scopes→`pairs.rs`, filelist→scope ladder in `state.rs`, include-nav→`includes.rs`, completion-core/fuzzy-completion/member-completion→`completion/`+`candidates.rs`, completion-templates→`templates.rs`, inline-templates→`inline.rs`, inline-instantiation→`inline.rs`+`completion/`+`candidates.rs` (+`settings.rs` key), bind-semantics→`instantiate.rs`, macro-expansion→`expand.rs`, hierarchy→`hierarchy.rs`, vscode-hierarchy-sidebar→`design_hierarchy.rs`, type-hierarchy→`type_hierarchy.rs`, type-definition→`type_def.rs`, code-lens→`lens.rs`, inlay-hints→`inlay.rs`, server-lint→`lint.rs`+`lint/project.rs`+`code_action.rs`, one-parse→`lint.rs`+`state.rs` (`Document.tree`), refactor wiring/performance fan-outs→`rename.rs`/`ports.rs`+`state.rs`, apply-edit+folders-and-config+cancel-request+work-done-progress→`server/`, editor-settings+indexing-ux+index-scope+index-persistence→`settings.rs`+`state.rs`(+`index_cache.rs`), incremental-sync→`sync.rs`, file-watching→`watch.rs`, file-operations→`file_ops.rs` (+`include_sources` in `state.rs`), pull-diagnostics→`diagnostics.rs`+`server/`, semantic-tokens-delta→`tokens.rs`+`server/semantic_tokens.rs`, on-type-formatting→`on_type.rs`, will-save-wait-until→`format.rs` (+`settings.rs`/`main.rs`), selection-range→`selection.rs`, linked-editing→`linked.rs`, references-nav (server half)→`folding.rs`+`nav.rs`, large-file-mode→`large.rs`+`server/large_file.rs`, lsp-318-extras→`format.rs` (+`main.rs` capability), hover-declarations→`hover.rs`(+`nav.rs`), port-detail-spans (server half)→`hover.rs`+`nav.rs`, hover-line-index→`hover.rs`+`locate.rs`+`state.rs`, scan-interleave/change-debounce/verbose-timing→`server/`+`state.rs`, perf measurements→`src/perf.rs` (`docs/perf/README.md`, not a feature README), interactive-latency→`state.rs` (the two token searches) + `selection.rs`/`on_type.rs`/`completion/`/`inline.rs` (their callers) + `src/perf.rs`/`tests/e2e.rs` (its measurements), editor-packaging (grammar test)→`tests/grammar.rs` | -| `editors/vscode` | editor-packaging, editor-snippets, editor-settings (manifest half), editor-scopes (rainbow half), vscode-hierarchy-sidebar (`hierarchyView.js`/`hierarchyModel.js`), editor-platform-vsix, editor-marketplace-page, index-persistence (`storagePath` line), verbose-timing (`lucisv.verbose`, spawn args and restart in `extension.js`) | +| `editors/vscode` | editor-packaging, editor-snippets, editor-settings (manifest half), editor-scopes (rainbow half), vscode-hierarchy-sidebar (`hierarchyView.js`/`hierarchyModel.js`), dut-hierarchy (`hierarchySections.js`), extract-inline-module (`extract.js`), editor-platform-vsix, editor-marketplace-page, index-persistence (`storagePath` line), verbose-timing (`lucisv.verbose`, spawn args and restart in `extension.js`) | | `tools/` + CI | corpus-check, release-prep, ci-release, editor-platform-vsix (staging), range-formatting (`lucisv-changed.sh`) | ### 3.2 The combined picture @@ -717,7 +737,7 @@ graph TD lc[linter-core + rules + harness + semantic-lints] end subgraph refac [vlog_refactor] - ms[M2 rename / M3 ports / M4 instantiate / references] + ms[rename / ports / instantiate / references / imports / extract / inline] end subgraph corelib [lucisv_core] cw[config + walk + filelist + cache] @@ -736,6 +756,9 @@ graph TD sem --> parser lint --> parser lint --> sem + lint --> corelib + lint -.test-only.-> fmt + refac -.test-only.-> fmt refac --> parser refac --> sem srv --> parser @@ -782,13 +805,21 @@ ownership explicitly. | `lucisv_server/src/server/` | lucisv-server; amended by cancel-request, change-debounce, scan-interleave, index-scope, verbose-timing | every request/notification and every rebuild trigger | One ordered loop owns all mutable server state. A startup scan may publish a prefix and answer queued work between files; a request queued behind a rescan trigger is held until that rescan lands, and its cancel travels with it. Never make the distinction time-based: machine load must not change which index a request sees. Verbose timing may observe each wrapper/lifecycle but must be entirely silent when off and must not move protocol ordering. The queue thread only forwards protocol messages and must never parse. | | `lucisv_server/src/state.rs` | lucisv-server; amended by filelist, index-scope, scan-interleave, indexing-ux, incremental-index, index-persistence, hover-line-index, large-file-mode, one-parse (`Document.tree`), editor-settings + folders-and-config (`set_client_settings`/`change_roots`), include-nav (the include graph), completion-core (candidates), file-watching, interactive-latency (`first_token_reaching`/`first_token_from`), refactor performance fan-outs | every handler | `Workspace` is immutable through request handlers except the interior-mutable four-entry/8 MiB `FileView` cache. The scope ladder (filelist > `index.scope: "workspace"` > folder-scope at shipped depth 2; a rootless session never climbs; it reads flat at depth 0 and walks descendants at positive depth (including the default 2)) and open-buffer overlay are contracts. `Scan` has whole/widen shapes but one step/finish path; index/candidate/include prefixes publish together. `module_sources`, `rename_sources`, and `include_sources` must remain supersets of what their engines can edit/refuse over; `rename_sources` falls back to `sources()` when an ambiguous posting prevents a proven bound. `update_one` and a completed scan must equal a fresh build (`fingerprint`). Handlers reading `doc.text` instead of tokens/tree must check `doc.large`. | | `lucisv_server/src/settings.rs` | editor-settings | folders-and-config, indexing-ux, index-scope, index-persistence, inline-templates, will-save-wait-until, filelist, large-file-mode | One parser for both doors (push and pull, via `from_section` re-wrapping). Every key drops garbage independently; defaults that are not "silence" (1 MiB cap, log on, persist on, 4 MiB large-file threshold) are hand-written in `Default`. `set_client_settings` returns whether a reindex is owed — new keys must decide that question explicitly. | -| `vlog_semantic/src/workspace/` (+ `facts.rs`) | workspace-index; extended by incremental-index, index-persistence, index-scope, hover-line-index, scan-interleave, member semantics, semantic-lints-on, bind-semantics, SVA bodies and refactor-rename performance | server state, hierarchy/lens/type-hierarchy, refactor, completion, semantic lints | Determinism (same inputs → same index, any order), the `paths` spelling coupling with `resolve.rs`, `FACTS_FORMAT` bumped on any codec change (committed 18; active §49 uses 19), edge/posting tables built by the same lifted walks the engines use. `DeclLines` must round-trip and participate in `fingerprint`; `absorb` must equal one build over the resulting record set; `files_spelling` must continue to include unresolved non-empty external/inherited paths or rename loses its dangling-use refusal; `FileFacts::words` is the shared project mention/completion census. | +| `vlog_semantic/src/workspace/` (+ `facts.rs`) | workspace-index; extended by incremental-index, index-persistence, index-scope, hover-line-index, scan-interleave, member semantics, semantic-lints-on, bind-semantics, SVA bodies and refactor-rename performance | server state, hierarchy/lens/type-hierarchy, refactor, completion, semantic lints | Determinism (same inputs → same index, any order), the `paths` spelling coupling with `resolve.rs`, `FACTS_FORMAT` bumped on any codec change (current 19), edge/posting tables built by the same lifted walks the engines use. `DeclLines` must round-trip and participate in `fingerprint`; `absorb` must equal one build over the resulting record set; `files_spelling` must continue to include unresolved non-empty external/inherited paths or rename loses its dangling-use refusal; `FileFacts::words` is the shared project mention/completion census. | | `vlog_refactor/src/rename/` | refactor-rename; shared by references-nav and the performance wave | server rename/prepareRename/references and port refactor verification | `Scope` remains the whole-scope authority and `collect_occurrences` the one rename/references walk. The fast `prepare_rename_here` answer/refusal and `rename_name_at` target are parity contracts, not alternate semantics. Any new refusal must be expressible on the fast path or force a deferral; any new occurrence shape must be reflected in the server fan-out or trigger its all-sources fallback. | | `vlog_parser/src/token.rs` keyword table | completion-core (`KEYWORDS` export) | lexer, pairs.rs, editor grammar (test-locked), completion | Adding a keyword = lexer change + `pairs.rs` re-check + a hand edit to the grammar (`tests/grammar.rs` names the missing word) + potentially `verify.rs`-adjacent behavior. dv-statements added `randcase`/`let` to `is_keyword` and recorded it as shared with the adjacent lexer-cleanup round — the precedent for treating this file as coordinated even between back-to-back rounds. | | `editors/vscode/package.json` | editor-packaging | editor-settings, editor-scopes (colour ids), editor-snippets, index-persistence, verbose-timing, platform-vsix, marketplace-page | Settings/colour/snippet ids referenced from `extension.js` or the server must move in lockstep; mismatches are *silent* (VS Code ignores unknown ids). `lucisv.verbose` is special: it changes a spawn argument and therefore restarts the server instead of flowing through the ordinary settings push. Version number is one of the four version files. | | `tools/release.sh` artifact names | release-prep / editor-platform-vsix | ci-release (`prune_release_assets.sh`), `audit_artifacts.sh`, extension `bin/` layouts | Renaming a `.vsix` is a two-file change (`release.sh` + `prune_release_assets.sh`'s suffix list); renaming a per-triple binary is a two-file change (`release.sh` + `audit_artifacts.sh`, which skips `.vsix` and hard-fails on an unknown binary name). Get the wrong pair and the release fails by name. | | The frozen CLI contract | cli-polish | corpus scripts, CI users, every new CLI mode | Exit codes 0/1/2 forever; stdout stays machine-readable (JSON mode prints exactly one array; warnings to stderr). | +The 2026-09-07 size measurement in `CLAUDE.md` puts `state.rs` at 958 +production lines; its decomposition is deferred to Loop 3 (TODO §55). +Additional shared boundaries are `vlog_refactor/src/check/ledger.rs` (every +move/copy planner), `vlog_semantic/src/imports.rs` (linter and refactor usage +agreement), and `Config` → core config → CLI/server settings → format cache +(the newly missing cache field is §2.9-34). Changes to these require joint +contract review even when their source files are separate. + ### 3.4 Working rules distilled for parallel agents 1. **Pick lanes, not files.** The eight lanes in §2 are the intended
      Extra workspace index exclusions
      lucisv.hierarchy.duts[]DUT module names in the VS Code hierarchy; union with saved workspace stars, locked in the menu
      lucisv.filelist "" Filelist that defines the workspace index