DUT-centred hierarchy view: star a module as DUT, its children and its parents in their own sections, everything else re-rooted
TODO §56 (docs/features/dut-hierarchy), the owner's request of 2026-09-06.
Client-only, over the flat `lucisv/moduleHierarchy` snapshot the server
already sends. `hierarchySections.js`: per starred DUT, in starred
order, the DUT's forward subtree (the DUT at the top) and an upward tree
from the DUT through every module that instantiates it (labelled `via
<instance>`, cycles cut with one `recursive` row), then one section for
every module in no DUT's subtree or ancestor closure, re-rooted where
its only parents are DUT ancestors (the review ruling — a monitor beside
the DUT under the same bench stays on screen); a module both below one
DUT and above another appears in both DUT sections; a starred name the
index lacks keeps its sections with a "not in the index" row. Star and
unstar from the webview row menu (the pane is a WebviewView, so the
menu is the renderer's, driven by a `menuTable()` per render), the
`lucisv.hierarchy.{starDut,unstarDut,clearDuts}` commands and title
actions, persistence in `workspaceState` in starred order, and the
`lucisv.hierarchy.duts` setting whose entries show locked. With nothing
starred the pane is byte-identical to before (pinned).
opentitan `hw/ip` (847 modules): `aes` → 3 sections with `tb` in its
parents and 5 modules under `aes_tb` re-rooted into others; `aes` +
`hmac` → 5 sections; every module reachable in both configurations; QA's
200-trial fuzz found no overlap and no gap. `extract_test.js` added to
`.vscodeignore`.
(Committed after the 0.48.0 version commit: the release chain broke at a
test-output grep and cut the tag one commit early; the tag is moved here.)
Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
1 parent
4d342367b9
commit
449b874798
25 files changed
+2158
-38
No files matched your search
@@ -0,0 +1,662 @@
|
||||
# dut-hierarchy
|
||||
|
||||
## Goal
|
||||
|
||||
A design holds hundreds of modules and one — or a few — that matter: the DUT,
|
||||
usually with a testbench above it. The hierarchy pane treats every module the
|
||||
same, so the module the user actually works on is buried among roots that are
|
||||
alphabetically ahead of it and its DV bench is a root of its own. This feature
|
||||
lets the user **star a module as DUT** from the pane's context menu and splits
|
||||
the pane into sections: per starred DUT, **the DUT with its children** (its
|
||||
forward instance subtree, the DUT at the very top) and **the DUT's parents** (an
|
||||
upward tree from the DUT through every module that instantiates it,
|
||||
transitively — typically the DV), then one **all other modules** section. One
|
||||
DUT gives three sections, two DUTs five. Unstar from the same menu. Everything
|
||||
is composed in the extension over the snapshot the server already sends
|
||||
(`lucisv/moduleHierarchy`: `files`, `modules`, `instances`, flat) — the server
|
||||
changes nothing in this round.
|
||||
|
||||
## Assumptions
|
||||
|
||||
- **The pane is a `WebviewView`, not a `TreeDataProvider`.** That was decided in
|
||||
`docs/features/vscode-hierarchy-sidebar` (a webview is the only API at the
|
||||
extension's VS Code floor with a persistent search input inside the view).
|
||||
Consequences for this feature are in Handshakes: there is no `viewItem`
|
||||
context key and no `view/item/context` menu; the row menu is the pane's own
|
||||
HTML menu, driven by a per-row `contextValue` the host computes.
|
||||
- The reverse edge "module → modules that instantiate it" is exactly the
|
||||
forward edge read backwards: an instance contributes an edge only when its
|
||||
type resolves to exactly one declaration (`instance.targetId`), which is the
|
||||
same rule the forward tree uses. An unresolved or ambiguous type contributes
|
||||
no upward edge, so an ambiguous DUT name has an empty parents tree — the same
|
||||
answer the forward view gives for ambiguity.
|
||||
- Two declarations of one module name are two modules. A starred *name* that
|
||||
several declarations carry is resolved to the first in the model's
|
||||
deterministic order and the section is marked `ambiguous`; the other
|
||||
declarations keep their ordinary place in the pane.
|
||||
- **`others` is additive** (the lead's ruling, 2026-09-05, replacing the
|
||||
question this bullet used to ask). The owner's spec is "any dangling module
|
||||
that is not a child of the DUT would be put in a different section", so
|
||||
`others` holds **every module that is in no DUT's forward subtree and in no
|
||||
DUT's ancestor closure** — not `model.roots` minus that set. Its roots are the
|
||||
members of that set with no parent left inside it: a monitor the DV bench
|
||||
instantiates beside the DUT is not a child of the DUT, and with the bench
|
||||
excluded it has no parent on screen, so it is re-rooted at the top of
|
||||
`others`. A module that still has an ordinary parent stays under it and is not
|
||||
re-rooted, so nothing is shown twice. An `others` root's forward subtree is
|
||||
the plain, unfiltered one: a module that is also below a DUT is still shown
|
||||
under its parent here, exactly as before. A DUT itself can never appear in
|
||||
`others` — everything that instantiates it is in its ancestor closure and is
|
||||
therefore excluded.
|
||||
- Starring is an explicit user act, so it may expand rows on the user's behalf:
|
||||
the two new sections and the DUT row inside each open once, when the DUT list
|
||||
changes. This is the second exception to the owner's 2026-08-29 rule that
|
||||
nothing expands by itself (the first is a bookmark's ancestor chain).
|
||||
- **A bookmark is painted wherever its own path is on screen**, and a path is
|
||||
what is stored — not an instance. Bookmarking inside a DUT section stores the
|
||||
DUT-relative path (`aes.u_ctrl`) and is painted there; bookmarking under a
|
||||
root stores the full path and is painted there. The two are different paths
|
||||
to one instantiation, so a bookmark made in one place is not painted in the
|
||||
other, and a bookmark whose path runs through an excluded module
|
||||
(`tb.u_dut.…` while `dut` is starred) is not painted at all until the DUT is
|
||||
unstarred — the module it names may well still be on screen, but not at that
|
||||
path. Nothing is ever *lost*: the model
|
||||
still resolves the path, so `refresh()` never drops it. Tested in
|
||||
`hierarchySections_test.js::aBookmarkIsPaintedWhereverItsPathIsShown`.
|
||||
- The `lucisv.hierarchy.duts` setting is a workspace-level list a team checks
|
||||
in. Its entries cannot be unstarred from the pane, because the pane cannot
|
||||
edit a checked-in file on the user's behalf; the menu says so.
|
||||
|
||||
## Handshakes
|
||||
|
||||
### `hierarchyModel.js` — three additive changes, no behaviour change
|
||||
|
||||
Consumed: `buildHierarchy`'s flat model (`modules`, `byId`, `roots`, per-instance
|
||||
`targetId`), `childrenOf`, `treeRows`, `idForPath`, `searchHierarchy`.
|
||||
|
||||
Promised/changed by this feature (all additive, the plain pane byte-identical):
|
||||
|
||||
- `rootNode` is now exported. `hierarchySections.js` builds a section's root
|
||||
from it and re-ids it with the section prefix; every descendant id is derived
|
||||
from the parent id, so one prefix moves a whole subtree into its section.
|
||||
- `treeRows`' rows and `searchRow`'s rows carry `moduleName` (for a tree
|
||||
instance row, the instantiated type — the same string the label shows in
|
||||
parentheses). It is what lets the star/unstar decision be a pure function of a
|
||||
row.
|
||||
- `bookmarkChain` keeps its roots-first walk and, **only when that finds
|
||||
nothing**, retries over every module. A row inside a DUT section has a
|
||||
DUT-relative full path (`aes.u_ctrl`), and without the retry bookmarking such
|
||||
a row would store a path that can never be re-resolved. Every path that
|
||||
resolved before resolves to the same chain.
|
||||
|
||||
### `hierarchyView.js` ← `hierarchySections.js`
|
||||
|
||||
- `sections(model, duts)` → the section list (below).
|
||||
- `sectionRows(model, sections, expanded, bookmarkPath)` → `{ rows, nodes }` in
|
||||
exactly the shape `treeRows` returns, with the section header at depth 0 and
|
||||
everything under it shifted one level.
|
||||
- `decorate(rows, duts, locked)` → the same rows with a `contextValue`
|
||||
(`module`, `module.dut`, `module.dut.locked`, `instance`, …) and, for a locked
|
||||
DUT, a `title` tooltip.
|
||||
- `menuTable()` → `contextValue` → the menu items that row offers. Sent once per
|
||||
render; the webview renders `payload.menus[row.contextValue]` and has no rule
|
||||
of its own.
|
||||
- `sectionPrefixes(duts)` → the id prefixes, so the bookmark's ancestor
|
||||
expansion reaches the copy of the chain inside each section.
|
||||
- `defaultOpenIds(sections)` / `OTHERS_ID` → what a star opens once, and the
|
||||
one section it closes.
|
||||
|
||||
### `media/hierarchy.js` (the renderer)
|
||||
|
||||
- Builds the row menu from `payload.menus[row.contextValue]` instead of a fixed
|
||||
list, and opens it for any row whose `contextValue` has items (module rows
|
||||
included — previously only instances had a menu).
|
||||
- Renders `row.icon` when the host sends one (section and notice rows) and
|
||||
`row.title` as the row tooltip.
|
||||
|
||||
### The server — nothing
|
||||
|
||||
No request, notification or schema change. The upward tree is one pass over the
|
||||
snapshot already sent.
|
||||
|
||||
### Requested of the lead (docs this lane may not edit)
|
||||
|
||||
See "Docs to apply at merge (lead)".
|
||||
|
||||
## Status / TODO
|
||||
|
||||
- [x] 56.1 model: reverse map, `sections()`, others-exclusion, cycle cut
|
||||
(`editors/vscode/hierarchySections.js`)
|
||||
- [x] 56.2 view: section nodes, icons, context values, persistence, setting
|
||||
union (`editors/vscode/hierarchyView.js`, `media/hierarchy.js`)
|
||||
- [x] 56.3 commands, menus, `package.json`, tests, acceptance checklist row
|
||||
- [x] Gates: `node --test editors/vscode/*_test.js`; server smoke; the vsix
|
||||
package step; the plain view pinned unchanged
|
||||
- [x] A real opentitan snapshot through `sections()` with `aes`, then
|
||||
`aes` + `hmac`
|
||||
- [x] Rework (lead's ruling): `others` is additive — every module outside every
|
||||
DUT, re-rooted where the exclusion took its parents
|
||||
(`editors/vscode/hierarchySections.js`, `hierarchySections_test.js`)
|
||||
- [x] Hygiene: `extract_test.js` in `.vscodeignore`
|
||||
- [ ] Docs the lead applies: `README.md`, `docs/site/` editors page
|
||||
- [ ] QA
|
||||
|
||||
## Work log
|
||||
|
||||
### 2026-09-05 — dev (the whole of §56)
|
||||
|
||||
**Shipped.**
|
||||
|
||||
- `editors/vscode/hierarchySections.js` (new, 284 production lines): the reverse
|
||||
index, `sections()`, the upward tree, `sectionRows()`, `decorate()` and
|
||||
`menuTable()`.
|
||||
- `editors/vscode/hierarchySections_test.js` (new): every shape §56 lists.
|
||||
- `editors/vscode/hierarchyModel.js`: `rootNode` exported, `moduleName` on
|
||||
tree/search rows, `bookmarkChain`'s all-modules retry.
|
||||
- `editors/vscode/hierarchyView.js`: the DUT list (workspaceState + setting),
|
||||
the three commands, section rendering, the seeded default expansion, the
|
||||
menu table in the render payload.
|
||||
- `editors/vscode/media/hierarchy.js`, `media/hierarchy.css`: a menu built from
|
||||
the payload, section/notice icons, row tooltips.
|
||||
- `editors/vscode/package.json`: three commands, three more `view/title`
|
||||
entries, the `lucisv.hierarchy.duts` setting.
|
||||
- `editors/vscode/.vscodeignore`: the new test file is not shipped.
|
||||
- `editors/vscode/README.md`, `docs/manual-acceptance.md`: the user-facing text.
|
||||
|
||||
**The section algorithm.** `sections(model, duts)` walks the starred list in
|
||||
order. For each name it emits `{ kind: 'dut', name, root }` — `rootNode` for the
|
||||
named module, re-ided `dut:<name>/root:<id>`, so the subtree under it is exactly
|
||||
the one the plain pane shows — and `{ kind: 'parents', name, root }`, whose root
|
||||
is the same module as an *upward* node (`parents:<name>/up:<id>`) and whose
|
||||
children come from the reverse index: one child per (module, instance) pair with
|
||||
`instance.targetId === node.moduleId`, labelled with the instantiating module
|
||||
and `via <instance name>`. The walk carries a `seen` set down the path, so a
|
||||
cycle (`a` instantiates `b` instantiates `a`) closes with one row marked
|
||||
`recursive` that does not open again — the same shape the forward tree uses.
|
||||
Both trees are lazy: children are built when a row is opened, never before.
|
||||
|
||||
While walking, the DUT's forward subtree and its full ancestor closure are
|
||||
collected into one `excluded` set of module ids. `{ kind: 'others', roots }` is
|
||||
`model.roots` filtered by that set. Two consequences, both intended and tested:
|
||||
|
||||
- **Both below and above.** A module below DUT1 and above DUT2 is in both DUT
|
||||
sections (it is reached by two different walks, with two different id
|
||||
prefixes, and opens independently in each) and is excluded from `others`.
|
||||
- **The excluded-root cost.** `others` loses a root that is an ancestor of a
|
||||
DUT, and with it anything only reachable through that root. See Assumptions.
|
||||
|
||||
A starred name the snapshot does not hold keeps both of its sections; each shows
|
||||
a single non-expandable notice row, so the section count stays `2 × DUTs + 1`
|
||||
whatever the index says.
|
||||
|
||||
**Persistence and the setting.** The starred list lives in `workspaceState`
|
||||
under `lucisv.hierarchy.duts`, an array of names in the order starred, written
|
||||
on every star/unstar/clear and read (and sanitized — non-strings and blanks
|
||||
dropped) in the constructor. The `lucisv.hierarchy.duts` *setting* (string
|
||||
array, `window` scope — the pane is workspace-wide, not per file) is read on
|
||||
every render and on
|
||||
`onDidChangeConfiguration`. The effective list is the union, **setting entries
|
||||
first in setting order, then starred entries the setting does not already
|
||||
name**; setting entries are "locked": starring one again is a no-op, unstarring
|
||||
one is refused with the reason, and their rows carry the locked `contextValue`
|
||||
whose menu holds one disabled item whose tooltip says where the DUT comes from.
|
||||
`lucisv.hierarchy.clearDuts` empties the starred list only, and says so when the
|
||||
setting still names DUTs.
|
||||
|
||||
**Deviation from the plan, and why.** §56.3 asks for `view/item/context` entries
|
||||
gated on `viewItem`. The pane is a `WebviewView`; VS Code has no `viewItem`
|
||||
context key for it and would never show such a menu, so contributing one would
|
||||
be dead configuration. The intent — "the menu shows Unstar DUT on a starred
|
||||
module and Star as DUT on any other" — is delivered by the pane's own HTML menu:
|
||||
the host stamps every row with a `contextValue` and ships one `menuTable()` per
|
||||
render, and the renderer shows exactly the items that table names. The three
|
||||
commands are contributed and work from the palette (each takes an optional
|
||||
module name, and prompts with a Quick Pick when invoked without one), and
|
||||
`view/title` carries "Clear DUTs" and the existing entries. The `when` clauses
|
||||
that do exist (`view == lucisv.hierarchy`) and the whole `contextValue` → menu
|
||||
table are asserted in `hierarchySections_test.js`.
|
||||
|
||||
**Second deviation.** The plan's "others" is exclusive (see Assumptions); the
|
||||
owner's sentence "all other modules" could be read as additive, which would
|
||||
re-root a DV bench's monitor when its bench is excluded. The plan won; the lead
|
||||
should rule if the manual pass finds it surprising on opentitan. On `hw/ip` the
|
||||
whole cost of the exclusion is three roots out of 295, all of them benches, so
|
||||
it reads as intended there. *(Superseded the same day: the lead ruled for the
|
||||
additive reading — see the rework entry below. Everything above describes what
|
||||
the first round shipped, `others` included.)*
|
||||
|
||||
**Two corrections made while reviewing my own code, both with the reasoning
|
||||
written next to them.** (1) `treeOrSections` records the "already seeded" key
|
||||
even when the DUT list is empty, so starring the same module again after a
|
||||
"Clear DUTs" seeds its sections again instead of trusting a stale key; it is
|
||||
only weakly observable (the expansion set keeps the ids), so the test asserts
|
||||
the re-starred sections are open rather than the key itself. (2)
|
||||
`collectSubtree` walks with its own visited set rather than the shared
|
||||
exclusion set: a module already excluded as DUT1's *ancestor* would otherwise
|
||||
stop DUT2's downward walk at it, leaving that walk short. With today's root
|
||||
choice the difference cannot change `others.roots` (nothing below a module is a
|
||||
root), so it is a defensive correction with no test of its own — said here
|
||||
rather than left silent.
|
||||
|
||||
**Files touched outside the plan's expected set.** Three, all consequences of
|
||||
the two above: `editors/vscode/media/hierarchy.js` and `media/hierarchy.css`
|
||||
(the pane's renderer is where a webview's row menu lives, so the star/unstar
|
||||
items had to be built there), and `editors/vscode/.vscodeignore` (the new test
|
||||
file must not ship). Noted while there and **not** fixed, because it is not
|
||||
this feature's: `extract_test.js` is missing from `.vscodeignore` and is
|
||||
therefore packaged into the .vsix — a one-line hygiene fix for whoever owns
|
||||
that file next.
|
||||
|
||||
**Not done.** Nothing in the plan is unfinished. Two things a later round could
|
||||
take further, both written down rather than smuggled in: the additive reading
|
||||
of `others` above, and a bookmark that follows an instantiation rather than a
|
||||
path (see Assumptions).
|
||||
|
||||
**Opentitan, real snapshot** (release server over `hw/ip`, `index.scope` pushed
|
||||
to `workspace`, scratch `storagePath`, read-only — `git status --porcelain` on
|
||||
the checkout showed the same three pre-existing modified files before and
|
||||
after). 835 files, 847 modules, 295 roots, `complete: true`.
|
||||
|
||||
| starred | sections | DUT section | parents section | others |
|
||||
|---|---|---|---|---|
|
||||
| — | 1 | — | — | 295 roots |
|
||||
| `aes` | **3** | `aes`, 5 direct children, 577 rows fully open | `aes` → `aes_tb`, `aes_wrap`, **`tb`**; `aes_wrap` → `aes_wrap_tb` (5 rows) | 292 roots |
|
||||
| `aes`, `hmac` | **5** | + `hmac`, 11 direct children, 302 rows | + `hmac` → `tb` (2 rows) | 291 roots |
|
||||
|
||||
The DV bench is in `aes`'s parents section, which is the point of the feature.
|
||||
The three roots `aes` drops from `others` are `aes_tb`, `aes_wrap_tb` and `tb`
|
||||
— exactly its transitive ancestors; `hmac` drops the *other* declaration named
|
||||
`tb` (two files declare one, and they are two modules). `sections()` over the
|
||||
whole of `hw/ip` costs 2.85 ms the first time (it builds the reverse index) and
|
||||
0.15 ms after.
|
||||
|
||||
**Gates.** `tools/guard.sh -- node --test editors/vscode/*_test.js`: 5 files,
|
||||
all pass. `cargo build --release -p lucisv_server` + `tools/guard.sh -- node
|
||||
editors/vscode/smoke.js target/release/lucisv-server`: OK. `npx @vscode/vsce
|
||||
package` into the scratchpad: OK (the contributions validate).
|
||||
|
||||
### 2026-09-05 — dev (rework: `others` is additive)
|
||||
|
||||
The lead ruled on the question the first round left open (Assumptions, now
|
||||
rewritten): the owner's "any dangling module that is not a child of the DUT
|
||||
would be put in a different section" is additive, so a monitor beside the DUT
|
||||
under the same bench belongs in `others`, and the exclusive formula that put it
|
||||
in *no* section was wrong. Only `others` changed — the two DUT sections, the id
|
||||
scheme, the memoized reverse index and the seeded expansion are untouched.
|
||||
|
||||
**The algorithm.** `othersRoots(model, excluded)` replaces
|
||||
`model.roots.filter(…)`. The set is every module not in `excluded` (unchanged:
|
||||
each DUT's forward subtree plus its ancestor closure); its roots are the members
|
||||
with no parent left in the set, emitted in three passes over one shared
|
||||
`covered` set:
|
||||
|
||||
1. `model.roots` minus the excluded — today's answer, and with nothing starred
|
||||
it is still the whole answer, byte-identical to `model.roots`. Each one marks
|
||||
its forward subtree covered.
|
||||
2. Every remaining module that is neither excluded nor covered and has no
|
||||
parent in the set: re-rooted. This is the monitor whose bench is in the
|
||||
DUT's parents section.
|
||||
3. Whatever is still uncovered is inside a recursive component no root enters —
|
||||
the model's own fallback rule, and marked `recursive` the way the model
|
||||
marks it.
|
||||
|
||||
Roots come out in the model's order (alphabetically, then the fallbacks), which
|
||||
is exactly how `buildHierarchy` orders `model.roots`, so the section does not
|
||||
grow an odd tail. Coverage is what prevents duplicates: a module reachable from
|
||||
one excluded and one ordinary parent is covered by the ordinary parent's walk in
|
||||
pass 1 and is never re-rooted. It cannot be duplicated the long way round
|
||||
either, and that is a property of the exclusion rather than of the pass order: a
|
||||
path from one module of the set to another can never leave the set, because a
|
||||
module above an ancestor of the DUT is itself an ancestor, and a module below
|
||||
the DUT's subtree is itself in it — both excluded. So a pass-2 candidate is
|
||||
reachable from no other root in the section. A root's forward subtree is still the plain,
|
||||
unfiltered one — a module that is also below a DUT is shown under its parent
|
||||
here as before, and a *DUT* can never turn up in it, because everything that
|
||||
instantiates a DUT is in that DUT's ancestor closure. Coverage skips a module it
|
||||
has already descended through, so the whole pass is one walk over the graph.
|
||||
|
||||
**Tests** (`hierarchySections_test.js`, 16 → 21). A `graph({ module: [types] })`
|
||||
helper builds the small snapshots. New: the monitor beside the DUT (`bench →
|
||||
{dut, monitor}` — `monitor` is a root of `others`, `bench` is in the parents
|
||||
section, and every module in the snapshot is asserted to be on screen
|
||||
somewhere); a module under **two** excluded benches (re-rooted once, not twice);
|
||||
a module with one excluded and one ordinary parent (shown once, under the
|
||||
ordinary parent); two DUTs whose benches nest (`bench → {dut1, sub_bench}`,
|
||||
`sub_bench → {dut2, monitor}` — five sections, `monitor` re-rooted); and a cycle
|
||||
reachable only through an excluded bench (pass 3 — opened at a `recursive`
|
||||
root). The existing exclusion test keeps its name's meaning but is renamed
|
||||
`othersHoldsEveryModuleOutsideEveryDut`: starring `leaf2` now re-roots `leaf1`
|
||||
and `leaf3`, which it used to hide. `thePlainViewIsUntouched` is unchanged and
|
||||
green.
|
||||
|
||||
**Opentitan, re-derived** (release server over `hw/ip`, `index.scope` pushed to
|
||||
`workspace`, scratch `storagePath`; `git status --porcelain` on the checkout
|
||||
showed the same three pre-existing modified files before and after). 835 files,
|
||||
847 modules, 295 roots, `complete: true`.
|
||||
|
||||
| starred | others before | others after | re-rooted |
|
||||
|---|---|---|---|
|
||||
| — | 295 | 295 | — |
|
||||
| `aes` | 292 | **297** | `aes_tb_c_dpi`, `aes_tb_reqs`, `tlul_adapter_tb_reqs`, `tlul_delayer`, `vh_regs` |
|
||||
| `aes`, `hmac` | 291 | **297** | the five above + `hmac_if` |
|
||||
|
||||
All five are instantiated only by `aes_tb` (`hw/ip/aes/pre_dv/aes_tb/rtl/`),
|
||||
which is one of `aes`'s excluded ancestors; `hmac_if` is instantiated only by
|
||||
`hmac`'s `tb`. Every one of them was in no section at all before this rework.
|
||||
No root the old formula kept was lost, and a walk over the new `others` roots
|
||||
plus the DUT sections reaches every one of the 847 modules — nothing is off
|
||||
screen with `aes` or with `aes` + `hmac` starred.
|
||||
|
||||
**Cost.** `sections(model, ['aes'])` over the whole of `hw/ip`: 1.9 ms → 3.5 ms
|
||||
on the first call (both dominated by building the reverse index) and 0.03 ms →
|
||||
0.33 ms on later ones — one extra walk over 847 modules per render of a starred
|
||||
pane. With nothing starred the pane never calls `sections()` at all
|
||||
(`treeOrSections` returns `treeRows`), so the plain view pays nothing.
|
||||
|
||||
**Also fixed here** (the hygiene item the first round found and left):
|
||||
`extract_test.js` is now in `editors/vscode/.vscodeignore`, so no `*_test.js`
|
||||
ships in the .vsix — confirmed against the packaged file list.
|
||||
|
||||
**Gates.** `tools/guard.sh -- node --test editors/vscode/*_test.js`: 5 files, 5
|
||||
pass, 0 fail. `npx @vscode/vsce package` into the scratchpad: OK, 338 files.
|
||||
|
||||
## QA log
|
||||
|
||||
### 2026-09-06 — QA (Sonnet 5)
|
||||
|
||||
**Scope.** Read the plan (TODO §56), the dev's account (this README, both
|
||||
work-log entries), and the diffs of every file it lists. Attacked the model
|
||||
and view with scratch tests (removed afterwards, none of the lane's files
|
||||
touched besides this log and the TODO checkbox), re-derived the opentitan
|
||||
numbers against the real, read-only checkout, and ran every gate.
|
||||
|
||||
**1. Sections — attacked on the existing fixtures, `graph()`, and new scratch
|
||||
graphs (`/private/tmp/.../scratchpad/attack_sections.js`, removed).** All of
|
||||
the following hold, matching the algorithm's own description and this
|
||||
README's Assumptions:
|
||||
|
||||
- Zero/one/two DUTs: `2n+1` sections, order = starred order (pinned by the
|
||||
dev's `oneDutIsThreeSectionsAndTwoAreFive`).
|
||||
- A DUT that is a root: its parents section holds only the DUT row, no
|
||||
children (`parents.root.hasChildren === false`) — verified with a fresh
|
||||
`dut → leaf` graph.
|
||||
- A DUT that is a leaf: its DUT section is the DUT alone
|
||||
(`dut.root.hasChildren === false`) — verified with `bench → dut`.
|
||||
- A DUT instantiated twice by one parent: the parents tree shows the parent
|
||||
**twice**, one row per instance, each with its own `via <instance>` label
|
||||
and its own row id — a 2-way explore tree, as the plan asked. Verified with
|
||||
`bench → [[dut,u_dut_a],[dut,u_dut_b]]`.
|
||||
- A module instantiated by two benches, itself instantiating the DUT: the
|
||||
upward tree branches at that node (two children under `mid`). Verified.
|
||||
- A parent chain of depth 6: the upward walk climbs all six levels,
|
||||
`depth` incrementing by one per hop. Verified.
|
||||
- Two DUTs where DUT2 is inside DUT1's subtree (`dut1 → dut2 → leaf`): DUT2
|
||||
appears both under DUT1's forward tree (unfiltered — `dutSection`'s root is
|
||||
always the plain subtree) and as its own two sections; DUT1 appears in
|
||||
DUT2's parents tree. Five sections, all present and correctly shaped.
|
||||
Verified, and the mirror (starring DUT2 before DUT1) changes only section
|
||||
*order*, never content.
|
||||
- The same module starred twice: `sections()` itself performs **no dedup** —
|
||||
`sections(model, ['dut','dut'])` yields 5 sections (two DUT×2 pairs plus
|
||||
others). Dedup is the caller's job: `hierarchyView.js`'s `moduleNames()`
|
||||
wraps every stored/configured list in a `Set` before it ever reaches
|
||||
`sections()`, and this is exercised in the dev's own `hierarchyView_test.js`
|
||||
(`configuredDuts = ['top', '']`, the blank and any repeat dropped). Pinning
|
||||
this contract here so a future caller of `sections()` that skips
|
||||
`moduleNames()` doesn't get a silent surprise (see LOW finding below).
|
||||
- A starred name absent from the snapshot: both its sections keep a single
|
||||
non-expandable "not in the index" notice row; section count stays `2n+1`
|
||||
(dev's `aStarredNameTheSnapshotLacksKeepsItsSections`, re-run, green).
|
||||
- A starred name matching two declarations: `ambiguous: true` on both
|
||||
sections, header says "ambiguous", the **first** declaration in the model's
|
||||
order is what is shown (dev's `twoDeclarationsOfOneNameAreMarkedAmbiguous`).
|
||||
Went one step further than the existing test: confirmed the Assumptions
|
||||
claim that "an ambiguous DUT name has an empty parents tree" actually holds
|
||||
— with two declarations of `dut`, `tb`'s instance of `dut` becomes
|
||||
itself ambiguous (`instance.definitions.length === 2`), so `targetId` is
|
||||
unset and the reverse index carries no edge to either declaration;
|
||||
`parents.root.hasChildren` is `false`. This isn't special-cased code, it
|
||||
falls out of `parentIndex` using `instance.targetId` — correct and matches
|
||||
the forward view's own ambiguity answer, as documented.
|
||||
- A cycle through the DUT itself (`a → b → a`, starred `a`): both the forward
|
||||
walk and the upward walk terminate at one `recursive`-marked row that does
|
||||
not reopen (dev's `theParentsWalkCutsACycle`); re-verified.
|
||||
- **Others is additive and complete.** Re-ran the dev's own reasoning as a
|
||||
fuzz test: a seeded-random 40-module DAG (0.15 edge probability, i < j only
|
||||
so it's acyclic — plus deliberately keeping a couple of exact-duplicate
|
||||
edges to also exercise the twice-instantiated case), 200 random DUT
|
||||
selections (1–3 DUTs each). For every trial: every one of the 40 modules is
|
||||
on screen in some section, and no module is both an `others` root and a
|
||||
member of any starred DUT's forward subtree. 200/200 trials passed with no
|
||||
failures.
|
||||
- No module appears in `others` *and* in a DUT subtree: covered by the fuzz
|
||||
test above (assertion is exactly this) and by the dev's own
|
||||
`othersHoldsEveryModuleOutsideEveryDut`/`aModuleUnderAnExcludedBenchIsReRootedInOthers`.
|
||||
- A module both below DUT1 and above DUT2: dev's
|
||||
`aModuleBothBelowOneDutAndAboveAnotherIsInBothSections` — two rows, two ids,
|
||||
neither in `others`; re-run, green.
|
||||
- Re-rooted module ordering: `othersRoots` emits in `model.roots`' own order
|
||||
(alphabetical, then fallbacks) — confirmed by reading `othersRoots` and by
|
||||
the passing `aModuleUnderTwoExcludedBenchesIsReRootedOnce` /
|
||||
`aCycleReachableOnlyThroughAnExcludedBenchStillHasARoot` tests (recursive
|
||||
fallback root correctly marked).
|
||||
- A module with one excluded and one ordinary parent: shown once, under the
|
||||
ordinary parent, never re-rooted (dev's
|
||||
`aModuleWithOneOrdinaryParentIsNotReRooted`; re-run, green).
|
||||
- **The plain view is byte-identical to `model.roots` with no DUT.** Read
|
||||
`thePlainViewIsUntouched`: it is a real deep-equality check over every
|
||||
visible field (`id, kind, label, detail, depth, hasChildren, expanded,
|
||||
warning, bookmarked`) between `decorate(treeRows(...).rows, [], [])` and
|
||||
`treeRows(...).rows` directly — not a placeholder. Also confirmed
|
||||
structurally: `treeOrSections()` in `hierarchyView.js` calls `treeRows`
|
||||
directly and never calls `sections()` at all when `duts.length === 0`, so
|
||||
the plain pane pays zero extra cost, exactly as claimed.
|
||||
|
||||
**2. View/persistence.** Read and re-ran `hierarchyView_test.js`'s DUT block
|
||||
(lines ~199–330): the fake-`workspaceState` round trip (star, "reload" via a
|
||||
second `HierarchyView` over the same `state` map, order kept, `7` and `''`
|
||||
dropped by `moduleNames`'s sanitizer); the setting union (setting entries
|
||||
first, locked, unstar refused with the exact reason string, re-star a
|
||||
no-op with an information message); `onDidChangeConfiguration` re-render
|
||||
(`configurationChanged({...})` reshapes the section list); `clearDuts` clears
|
||||
stars only (locked setting DUT's section survives, with a message naming it);
|
||||
the seeded expansion opens the two new sections and the DUT row at depth 1 in
|
||||
each, `others` stays closed, and — the dev's own "two corrections" note —
|
||||
re-starring the same module after a `clearDuts` reseeds (`seededFor` keeps
|
||||
recording even at `duts.length === 0`). All green as shipped.
|
||||
|
||||
Added one attack of my own the plan explicitly asked for and the existing
|
||||
tests don't cover directly: **collapsing a DUT section survives an unrelated
|
||||
snapshot refresh.** Built a second fake-`vscode` harness
|
||||
(`attack_sections.js`, removed after the run) that stars a DUT, collapses its
|
||||
section via a `toggle` message, then fires the `lucisv/moduleHierarchyChanged`
|
||||
notification handler with the *same* starred list and waits out the refresh
|
||||
debounce. The section stayed collapsed. This is exactly what
|
||||
`seedExpansion`'s `if (this.seededFor === key) return;` guard promises (`key`
|
||||
is unchanged when the DUT list doesn't change), and it held.
|
||||
|
||||
**Search inside sections and reveal-on-open — read, not just tested, because
|
||||
the plan's phrasing assumed more than the feature does.** `render()` in
|
||||
`hierarchyView.js` sends search results (`searchHierarchy`) as a **flat** list
|
||||
whenever the query box is non-empty, entirely independent of which sections
|
||||
are open or which DUTs are starred — this is pre-existing behaviour from
|
||||
`vscode-hierarchy-sidebar`, unchanged by §56. A search hit still gets a
|
||||
correct `contextValue` via `decorate(found.rows, duts, locked)`, so
|
||||
star/unstar works from a search result, but there is no per-section grouping
|
||||
of search results to "resolve into" — search was never section-shaped, before
|
||||
or after this feature, and nothing in the README's Handshakes claims
|
||||
otherwise ("the existing search... behaviour work[s] inside every section"
|
||||
means it keeps working, not that it becomes section-aware). Not a defect.
|
||||
Likewise, **no "reveal a file's module when it is opened" feature exists
|
||||
anywhere in this codebase** — grepped `editors/vscode` for
|
||||
`onDidOpenTextDocument`/`activeTextEditor`/`revealOnOpen` and found nothing,
|
||||
in this feature or the sidebar it builds on. The QA brief's "reveal-on-open of
|
||||
a file whose module is only in a parents section" item does not correspond to
|
||||
an implemented or claimed capability; the only reveal behaviour that exists is
|
||||
bookmark-driven (`setBookmark` expands the bookmarked row's ancestors), which
|
||||
*is* implemented per-section (`sectionPrefixes`) and is covered by
|
||||
`aBookmarkIsPaintedWhereverItsPathIsShown` — re-run, green, and its claims
|
||||
(DUT-relative path painted inside the section, ordinary path painted at the
|
||||
root, a path through an excluded module painted nowhere but never dropped)
|
||||
all hold on inspection of `isBookmarked`/`bookmarkChain`'s retry.
|
||||
|
||||
**Bookmark painting inside a DUT section.** Matches the README exactly: a
|
||||
bookmark is a stored *path*, painted wherever that exact path resolves to an
|
||||
id on screen (`isBookmarked` matches the bookmark id or `.../<id>` suffix per
|
||||
section prefix). Re-verified `bookmarkChain`'s all-modules retry does not
|
||||
change any *previously resolving* path's id (the retry only changes which
|
||||
node search order finds a match through; `rootNode(model, module, false)`'s
|
||||
`false` for `fallback` affects only `detail`/`warning` display fields on a
|
||||
node that is never rendered — the chain is an array of ids, and `rootNode`'s
|
||||
`id` field does not depend on `fallback`). No crash, no incorrect painting in
|
||||
any of the model/view tests or the scratch attacks.
|
||||
|
||||
**3. Menus/commands.**
|
||||
|
||||
- `menuTable()` per render: read and re-verified against
|
||||
`contextValuesAndMenusSayWhatEachRowOffers` — a starred row → `[UNSTAR]`, an
|
||||
ordinary row → `[STAR]` (or `INSTANCE_ACTIONS + STAR/UNSTAR` for an
|
||||
instance), a locked row → one disabled item with the setting-naming
|
||||
tooltip. Every `contextValue` `decorate()` can produce has a menu entry
|
||||
(asserted by the same test's closing loop) — no row can silently offer
|
||||
nothing.
|
||||
- The three commands exist in `package.json`'s `contributes.commands`
|
||||
(`starDut`, `unstarDut`, `clearDuts`) and in `view/title` gated
|
||||
`"when": "view == lucisv.hierarchy"` — confirmed by reading `package.json`
|
||||
directly and by the dev's `packageJsonContributesTheCommandsMenusAndSetting`
|
||||
test, both green.
|
||||
- Ran every command through the extension's registered handler with the
|
||||
dev's fake `vscode` (`commands.get(...)`), with and without a module name:
|
||||
`starDut('top')` (named) and `starDut()` (Quick Pick, `picked` captures the
|
||||
candidate list — confirmed sorted, deduped, and scoped correctly: "every
|
||||
module name" for starring, "only what this workspace starred" for
|
||||
unstarring). Both paths work; re-run, green.
|
||||
- The `lucisv.hierarchy.duts` setting's `contributes.configuration` entry:
|
||||
`type: "array"`, `items.type: "string"`, `scope: "window"`,
|
||||
`default: []`, with a `markdownDescription` naming both the checked-in and
|
||||
starred routes and the lock — read directly in `package.json` and pinned by
|
||||
the dev's test.
|
||||
- `.vscodeignore` excludes every `*_test.js`: listed all five
|
||||
(`extract_test.js`, `hierarchyModel_test.js`, `hierarchySections_test.js`,
|
||||
`hierarchyView_test.js`, `restart_test.js`) against the file and confirmed
|
||||
none of them, nor any other `*_test.js`, appears in `npx @vscode/vsce
|
||||
package`'s file listing (§5 below).
|
||||
|
||||
**4. Opentitan (read-only, scratch index store).** Re-derived the dev's table
|
||||
independently, with my own hand-rolled LSP client
|
||||
(`/private/tmp/.../scratchpad/opentitan_client.js`, removed after the run) —
|
||||
`initializationOptions.storagePath` under the scratchpad,
|
||||
`lucisv.index.scope: "workspace"` pushed via `workspace/didChangeConfiguration`,
|
||||
`rootUri`/`workspaceFolders` pointed at `hw/ip`, polling
|
||||
`lucisv/moduleHierarchy` until `complete: true`.
|
||||
|
||||
| starred | sections | others roots | direct parents |
|
||||
|---|---|---|---|
|
||||
| — | 1 | 295 | — |
|
||||
| `aes` | 3 | 297 | `aes_tb`, `aes_wrap`, `tb` |
|
||||
| `aes`, `hmac` | 5 | 297 | `aes`: same three; `hmac`: `tb` |
|
||||
|
||||
835 files, 847 modules, 295 roots, `complete: true` — matches the dev's
|
||||
numbers exactly. The five re-rooted names the dev called out
|
||||
(`aes_tb_c_dpi`, `aes_tb_reqs`, `tlul_adapter_tb_reqs`, `tlul_delayer`,
|
||||
`vh_regs`) are present in the `others` list for `aes`; `hmac_if` joins them
|
||||
only once `hmac` is also starred — matches. Verified independently (not just
|
||||
by trusting the label) that opentitan really does declare 31 separate modules
|
||||
named `tb` across `hw/ip` (`grep -rl '^module tb\b'`), so `aes`'s `tb` and
|
||||
`hmac`'s `tb` genuinely are two different modules, as the dev's note claims.
|
||||
`sections(['aes'])`: 4.2 ms cold, 0.6 ms warm (my machine/session, not a
|
||||
controlled comparison against the dev's 2.85 ms/0.15 ms, but the same order of
|
||||
magnitude and the same qualitative shape — most of the cost is the one-time
|
||||
reverse-index build). **Full-reachability check**: walked the module graph
|
||||
directly (not the rendered tree, to stay linear over 847 nodes) from every
|
||||
DUT's forward+ancestor closure plus every `others` root's forward subtree —
|
||||
**847 of 847 modules reachable** for both `['aes']` and `['aes','hmac']`. No
|
||||
module is off screen in either configuration.
|
||||
|
||||
`git -C /Users/guoliangchen/repo/opentitan status --porcelain` before and
|
||||
after this session's use: unchanged, exactly the three pre-existing modified
|
||||
files (`hw/ip/aes/dv/tb/tb.sv`, `hw/top_darjeeling/ip/ast/rtl/ast.sv`,
|
||||
`hw/top_earlgrey/ip/ast/rtl/ast.sv`).
|
||||
|
||||
**5. Gates.**
|
||||
|
||||
- `tools/guard.sh -- node --test editors/vscode/*_test.js`: 5 files, 5 pass, 0
|
||||
fail (`extract_test.js`, `hierarchyModel_test.js`,
|
||||
`hierarchySections_test.js`, `hierarchyView_test.js`, `restart_test.js`).
|
||||
- `tools/guard.sh -m 8 -t 900 -- cargo build --release -p lucisv_server`:
|
||||
already up to date (0.02 s, no crate source changed by this lane — verified
|
||||
`git status --porcelain -- crates/` is empty), binary present.
|
||||
- `tools/guard.sh -- node editors/vscode/smoke.js target/release/lucisv-server`:
|
||||
OK, 20 messages, includes a passing `lucisv/moduleHierarchy` round trip.
|
||||
- `npx @vscode/vsce package` into the scratchpad: OK, 338 files, 3.1 MB, no
|
||||
`*_test.js` in the listing; guard not required (not a test/fuzzer/sweep, and
|
||||
it finished in a few seconds well under any memory concern, consistent with
|
||||
how the dev logged the same step).
|
||||
- No guard kill on any run.
|
||||
|
||||
**Findings.**
|
||||
|
||||
- LOW — `sections(model, duts)` performs no de-duplication of its own `duts`
|
||||
argument (confirmed by direct test: two identical names cost two identical
|
||||
section pairs). Today's only caller (`hierarchyView.js`'s `treeOrSections`)
|
||||
always passes `this.duts()`, which is already deduped through
|
||||
`moduleNames()`'s `Set`, so this is not reachable from the shipped extension
|
||||
today. Worth a one-line doc comment on `sections()` saying the caller owns
|
||||
dedup, so a future caller (a test, a second view) doesn't get a surprise
|
||||
five-section render from `['aes','aes']`. Not blocking.
|
||||
- LOW — the QA brief's "search inside every section" and "reveal-on-open of a
|
||||
file" items don't correspond to implemented behaviour: search has always
|
||||
been flat/section-independent (pre-existing, unchanged by §56), and no
|
||||
file-open reveal feature exists in this extension at all (verified by grep
|
||||
across `editors/vscode` for `onDidOpenTextDocument`/`activeTextEditor`/
|
||||
`revealOnOpen`). Recorded here so the brief isn't silently treated as
|
||||
satisfied; nothing to fix in the dev's code — the feature never promised
|
||||
either shape.
|
||||
- No MEDIUM or HIGH findings. Every shape in TODO §56, the model's own
|
||||
Assumptions, and the rework's stated invariants held under direct testing,
|
||||
fuzzing (200 random DUT selections over a random 40-module DAG), and a real
|
||||
847-module snapshot.
|
||||
|
||||
**Verdict: PASS.** No rework needed. The two LOW items above are hygiene notes
|
||||
for a later round, not conditions on this one.
|
||||
|
||||
## Review
|
||||
|
||||
**2026-09-06 — lead.** Accepted after one ruling; ships in 0.48.0. This is
|
||||
the owner's request built as asked — star from the row menu, the DUT with
|
||||
its children at the very top, its parents as an upward tree, all other
|
||||
modules in one collapsible section, two sections per DUT plus one — and
|
||||
built where it belongs, in the extension over the snapshot the server
|
||||
already sends, with no server change. The one deviation (a webview row
|
||||
menu rather than `view/item/context`, because the pane is a `WebviewView`)
|
||||
delivers the intent exactly. The ruling: the first version's "others"
|
||||
dropped any module reachable only through a DUT's ancestors — a monitor
|
||||
beside the DUT under the same bench — which the owner's "any dangling
|
||||
module not a child of the DUT" does not allow; the rework re-roots them,
|
||||
and on opentitan that put five real modules under `aes_tb` back on screen,
|
||||
with a walk over every section reaching all 847 modules in both
|
||||
configurations and QA's 200-trial fuzz finding no overlap and no gap. The
|
||||
setting-with-lock for a team's checked-in DUTs is a good addition. QA's
|
||||
LOWs (a doc comment on `sections()`'s de-dup contract; two brief items
|
||||
that name no shipped capability) need nothing.
|
||||
|
||||
## Docs to apply at merge (lead)
|
||||
|
||||
`docs/topo.md`: one new node, `dut-hierarchy`, with a single inbound edge from
|
||||
`vscode-hierarchy-sidebar` (it consumes that feature's model and renderer and
|
||||
adds nothing the server sees). No edge to any Rust crate — the server is
|
||||
untouched by this round.
|
||||
|
||||
For `README.md`'s VS Code section and the site's editors page:
|
||||
|
||||
> **DUT-centred hierarchy.** Right-click a module in the Hierarchy pane and
|
||||
> choose **Star as DUT**. The pane splits into sections: the DUT with its
|
||||
> children, the DUT's parents (an upward tree through everything that
|
||||
> instantiates it — usually the testbench), and every module in neither —
|
||||
> including whatever the bench held beside the DUT, which that last section
|
||||
> re-roots rather than hide. Star a
|
||||
> second DUT and you get five sections. Unstar from the same menu, or clear
|
||||
> every DUT from the pane's title bar. Starred DUTs are remembered per
|
||||
> workspace; a team can also check them in with
|
||||
> `"lucisv.hierarchy.duts": ["aes", "hmac"]`, and DUTs that come from the
|
||||
> setting are shown locked.
|
||||
@@ -21,6 +21,9 @@ hour. Record the release, the date and any failure in the table at the end.
|
||||
| 12 | Old server: point `lucisv.server.path` at `~/.cache/lucisv-baselines/lucisv-0.39.0`'s sibling server if kept, else skip. | Extension warns about the version mismatch and still works. Reset the setting. |
|
||||
| 13 | The other VSIX shape: install the `lucisv-<v>-universal.vsix` (no bundled server) with the CLI on PATH. | Same behaviour as steps 1–5. |
|
||||
| 14 | Restart the server (command palette: "lucisv: Restart Server"). | Diagnostics return within a few seconds; no duplicate status items. |
|
||||
| 15 | Hierarchy pane: right-click `aes` → "Star as DUT". | Three sections: "DUT: aes" (open, `aes` and its five children), "Parents of aes" (open, `aes` above `aes_tb`, `aes_wrap`, `tb`), "Other modules" (closed, 297 roots — the 292 plain ones plus the five `aes_tb` held beside `aes`, re-rooted). Right-click `aes` again → "Unstar DUT" puts the plain tree back exactly as it was. |
|
||||
| 16 | Star `aes`, then `hmac`. | Five sections in that order; "Other modules" has 297 roots; each section opens and closes on its own; a module under both keeps its own open state in each. Title bar "Clear DUTs" removes both. |
|
||||
| 17 | Add `"lucisv.hierarchy.duts": ["aes"]` to the workspace `.vscode/settings.json`. | The section appears without starring; right-clicking `aes` offers only a greyed "DUT from settings" whose tooltip names the setting; "Clear DUTs" leaves it. Remove the setting again. |
|
||||
|
||||
## Runs
|
||||
|
||||
|
||||
+10
-1
@@ -73,8 +73,17 @@
|
||||
</script></div></div></div></div></nav><div class="main-frame astro-gqpr5s5a"><script type="module">var e=document.getElementById(`starlight__sidebar`),t=e?.querySelector(`sl-sidebar-state-persist`),n=`sl-sidebar-state`,r=()=>{let r=[],i=t?.dataset.hash||``;try{let e=sessionStorage.getItem(n),t=JSON.parse(e||`{}`);Array.isArray(t.open)&&t.hash===i&&(r=t.open)}catch{}return{hash:i,open:r,scroll:e?.scrollTop||0}},i=e=>{try{sessionStorage.setItem(n,JSON.stringify(e))}catch{}},a=()=>i(r()),o=(e,t)=>{let n=r();n.open[t]=e,i(n)};t?.addEventListener(`click`,e=>{if(!(e.target instanceof Element))return;let t=e.target.closest(`summary`)?.closest(`details`);if(!t)return;let n=t.querySelector(`sl-sidebar-restore`),r=parseInt(n?.dataset.index||``);isNaN(r)||o(!t.open,r)}),addEventListener(`visibilitychange`,()=>{document.visibilityState===`hidden`&&a()});</script><div class="lg:sl-flex astro-abfeecmu"><aside class="right-sidebar-container print:hidden astro-abfeecmu"><div class="right-sidebar astro-abfeecmu"><div class="lg:sl-hidden astro-q5mffni3"><mobile-starlight-toc data-min-h="2" data-max-h="3" class="astro-5ulgm6bh"><nav aria-labelledby="starlight__on-this-page--mobile" class="astro-5ulgm6bh"><details id="starlight__mobile-toc" class="astro-5ulgm6bh"><summary id="starlight__on-this-page--mobile" class="sl-flex astro-5ulgm6bh"><span class="toggle sl-flex astro-5ulgm6bh">On this page<svg aria-hidden="true" class="caret astro-5ulgm6bh astro-n5k4ipy7" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg></span><span class="display-current astro-5ulgm6bh"></span></summary><div class="dropdown astro-5ulgm6bh"><ul class="isMobile astro-cxyftcne" style="--depth: 0;"><li style="--depth: 0;" class="astro-cxyftcne"><a href="#_top" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Overview</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#vs-code" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">VS Code</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#neovim-011" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Neovim 0.11+</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#workspace-indexing" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Workspace indexing</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#smoke-test" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Smoke test</span></a></li></ul></div></details></nav></mobile-starlight-toc><script type="module" src="/_astro/MobileTableOfContents.astro_astro_type_script_index_0_lang.BcSo_yiZ.js"></script></div><div class="right-sidebar-panel sl-hidden lg:sl-block astro-q5mffni3"><div class="sl-container astro-q5mffni3"><starlight-toc data-min-h="2" data-max-h="3"><nav aria-labelledby="starlight__on-this-page"><h2 id="starlight__on-this-page">On this page</h2><ul class="astro-cxyftcne" style="--depth: 0;"><li style="--depth: 0;" class="astro-cxyftcne"><a href="#_top" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Overview</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#vs-code" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">VS Code</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#neovim-011" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Neovim 0.11+</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#workspace-indexing" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Workspace indexing</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#smoke-test" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Smoke test</span></a></li></ul></nav></starlight-toc><script type="module" src="/_astro/TableOfContents.astro_astro_type_script_index_0_lang.Csloo1VZ.js"></script></div></div></div></aside><div class="main-pane astro-abfeecmu"><main data-pagefind-body class="astro-vdxcvpsm" lang="en" dir="ltr"><div class="content-panel astro-oil7k7jf"><div class="sl-container astro-oil7k7jf"><h1 id="_top" class="astro-2sm4b3ln">Editors & LSP</h1></div></div><div class="content-panel astro-oil7k7jf"><div class="sl-container astro-oil7k7jf"><div class="sl-markdown-content"><p><code dir="auto">lucisv-server</code> is a synchronous language server over stdio. It keeps open buffers as in-memory overlays, updates the workspace index incrementally, and returns the same formatting and lint behaviLine truncated
|
||||
<div class="sl-heading-wrapper level-h2"><h2 id="vs-code">VS Code</h2><a class="sl-anchor-link" href="#vs-code"><span aria-hidden="true" class="sl-anchor-icon"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 1 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 0 0-1.42-1.42m8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 1 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l3.88-3.89a4.49 4.49 0 0 0 0-6.33M8.83 15.17a1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.92-4.92a1 1 0 1 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42"></path></svg></span><span class="sr-only" data-pagefind-ignore>Section titled “VS Code”</span></a></div>
|
||||
<p>Install the <code dir="auto">.vsix</code> attached to a lucisv release:</p>
|
||||
<div class="expressive-code"><link rel="stylesheet" href="/_astro/ec.w36nc.css"><script type="module" src="/_astro/ec.0vx5m.js"></script><figure class="frame is-terminal not-content"><figcaption class="header"><span class="title"></span><span class="sr-only">Terminal window</span></figcaption><pre data-language="bash"><code><div class="ec-line"><div class="code"><span style="--0:#82AAFF;--1:#3B61B0">code</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#82AAFF;--1:#3B61B0">--install-extension</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#ECC48D;--1:#3B61B0">lucisv-0.9.0.vsix</span></div></div></code></pre><div class="copy"><div aria-live="polite"></div><button title="Copy to clipboard" data-copied="Copied!" data-code="code --install-extension lucisv-0.9.0.vsix"><div></div></button></div></figure></div>
|
||||
<div class="expressive-code"><link rel="stylesheet" href="/_astro/ec.w36nc.css"><script type="module" src="/_astro/ec.0vx5m.js"></script><figure class="frame is-terminal not-content"><figcaption class="header"><span class="title"></span><span class="sr-only">Terminal window</span></figcaption><pre data-language="bash"><code><div class="ec-line"><div class="code"><span style="--0:#82AAFF;--1:#3B61B0">code</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#82AAFF;--1:#3B61B0">--install-extension</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#ECC48D;--1:#3B61B0">lucisv-<version>-darwin-arm64.vsix</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#919F9F;--1:#5F636F"># or the linux/windows package for your machine</span></div></div></code></pre><div class="copy"><div aria-live="polite"></div><button title="Copy to clipboard" data-copied="Copied!" data-code="code --install-extension lucisv-<version>-darwin-arm64.vsix # or the linux/windows package for your machine"><div></div></button></div></figure></div>
|
||||
<p>The extension registers Verilog/SystemVerilog file types, syntax highlighting, snippets, color settings, configuration, and starts <code dir="auto">lucisv-server</code> from <code dir="auto">PATH</code> by default.</p>
|
||||
<p><strong>DUT-centred hierarchy.</strong> Right-click a module in the Hierarchy pane and
|
||||
choose <strong>Star as DUT</strong>. The pane splits into sections: the DUT with its
|
||||
children, the DUT’s parents (an upward tree through everything that
|
||||
instantiates it — usually the testbench), and all other modules, re-rooted
|
||||
where their only parents are the DUT’s ancestors. Star a second DUT and you
|
||||
get five sections. Unstar from the same menu, or clear every DUT from the
|
||||
pane’s title bar. Starred DUTs are remembered per workspace; a team can also
|
||||
check them in with <code dir="auto">"lucisv.hierarchy.duts": ["aes", "hmac"]</code>, and DUTs that
|
||||
come from the setting are shown locked.</p>
|
||||
<div class="sl-heading-wrapper level-h2"><h2 id="neovim-011">Neovim 0.11+</h2><a class="sl-anchor-link" href="#neovim-011"><span aria-hidden="true" class="sl-anchor-icon"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 1 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 0 0-1.42-1.42m8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 1 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l3.88-3.89a4.49 4.49 0 0 0 0-6.33M8.83 15.17a1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.92-4.92a1 1 0 1 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42"></path></svg></span><span class="sr-only" data-pagefind-ignore>Section titled “Neovim 0.11+”</span></a></div>
|
||||
<div class="expressive-code"><figure class="frame not-content"><figcaption class="header"></figcaption><pre data-language="lua"><code><div class="ec-line"><div class="code"><span style="--0:#C5E478;--1:#3B61B0">vim</span><span style="--0:#D6DEEB;--1:#403F53">.filetype.</span><span style="--0:#C5E478;--1:#3B61B0">add</span><span style="--0:#D6DEEB;--1:#403F53">({ </span><span style="--0:#C5E478;--1:#3B61B0">extension</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#7FDBCA;--1:#096E72">=</span><span style="--0:#D6DEEB;--1:#403F53"> {</span></div></div><div class="ec-line"><div class="code"><span class="indent"> </span><span style="--0:#C5E478;--1:#3B61B0">v</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#7FDBCA;--1:#096E72">=</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#D9F5DD;--1:#111111">'</span><span style="--0:#ECC48D;--1:#984E4D">verilog</span><span style="--0:#D9F5DD;--1:#111111">'</span><span style="--0:#D6DEEB;--1:#403F53">, </span><span style="--0:#C5E478;--1:#3B61B0">vh</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#7FDBCA;--1:#096E72">=</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#D9F5DD;--1:#111111">'</span><span style="--0:#ECC48D;--1:#984E4D">verilog</span><span style="--0:#D9F5DD;--1:#111111">'</span><span style="--0:#D6DEEB;--1:#403F53">,</span></div></div><div class="ec-line"><div class="code"><span class="indent"> </span><span style="--0:#C5E478;--1:#3B61B0">sv</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#7FDBCA;--1:#096E72">=</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#D9F5DD;--1:#111111">'</span><span style="--0:#ECC48D;--1:#984E4D">systemverilog</span><span style="--0:#D9F5DD;--1:#111111">'</span><span style="--0:#D6DEEB;--1:#403F53">, </span><span style="--0:#C5E478;--1:#3B61B0">svh</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#7FDBCA;--1:#096E72">=</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#D9F5DD;--1:#111111">'</span><span style="--0:#ECC48D;--1:#984E4D">systemverilog</span><span style="--0:#D9F5DD;--1:#111111">'</span></div></div><div class="ec-line"><div class="code"><span style="--0:#D6DEEB;--1:#403F53">} })</span></div></div><div class="ec-line"><div class="code">
|
||||
</div></div><div class="ec-line"><div class="code"><span style="--0:#C5E478;--1:#3B61B0">vim</span><span style="--0:#D6DEEB;--1:#403F53">.lsp.</span><span style="--0:#C5E478;--1:#3B61B0">config</span><span style="--0:#D6DEEB;--1:#403F53">(</span><span style="--0:#D9F5DD;--1:#111111">'</span><span style="--0:#ECC48D;--1:#984E4D">lucisv</span><span style="--0:#D9F5DD;--1:#111111">'</span><span style="--0:#D6DEEB;--1:#403F53">, {</span></div></div><div class="ec-line"><div class="code"><span class="indent"> </span><span style="--0:#C5E478;--1:#3B61B0">cmd</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#7FDBCA;--1:#096E72">=</span><span style="--0:#D6DEEB;--1:#403F53"> { </span><span style="--0:#D9F5DD;--1:#111111">'</span><span style="--0:#ECC48D;--1:#984E4D">lucisv-server</span><span style="--0:#D9F5DD;--1:#111111">' </span><span style="--0:#D6DEEB;--1:#403F53">},</span></div></div><div class="ec-line"><div class="code"><span class="indent"> </span><span style="--0:#C5E478;--1:#3B61B0">filetypes</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#7FDBCA;--1:#096E72">=</span><span style="--0:#D6DEEB;--1:#403F53"> { </span><span style="--0:#D9F5DD;--1:#111111">'</span><span style="--0:#ECC48D;--1:#984E4D">verilog</span><span style="--0:#D9F5DD;--1:#111111">'</span><span style="--0:#D6DEEB;--1:#403F53">, </span><span style="--0:#D9F5DD;--1:#111111">'</span><span style="--0:#ECC48D;--1:#984E4D">systemverilog</span><span style="--0:#D9F5DD;--1:#111111">' </span><span style="--0:#D6DEEB;--1:#403F53">},</span></div></div><div class="ec-line"><div class="code"><span class="indent"> </span><span style="--0:#C5E478;--1:#3B61B0">root_markers</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#7FDBCA;--1:#096E72">=</span><span style="--0:#D6DEEB;--1:#403F53"> { </span><span style="--0:#D9F5DD;--1:#111111">'</span><span style="--0:#ECC48D;--1:#984E4D">lucisv.toml</span><span style="--0:#D9F5DD;--1:#111111">'</span><span style="--0:#D6DEEB;--1:#403F53">, </span><span style="--0:#D9F5DD;--1:#111111">'</span><span style="--0:#ECC48D;--1:#984E4D">.lucisv.toml</span><span style="--0:#D9F5DD;--1:#111111">'</span><span style="--0:#D6DEEB;--1:#403F53">, </span><span style="--0:#D9F5DD;--1:#111111">'</span><span style="--0:#ECC48D;--1:#984E4D">.git</span><span style="--0:#D9F5DD;--1:#111111">' </span><span style="--0:#D6DEEB;--1:#403F53">},</span></div></div><div class="ec-line"><div class="code"><span style="--0:#D6DEEB;--1:#403F53">})</span></div></div><div class="ec-line"><div class="code"><span style="--0:#C5E478;--1:#3B61B0">vim</span><span style="--0:#D6DEEB;--1:#403F53">.lsp.</span><span style="--0:#C5E478;--1:#3B61B0">enable</span><span style="--0:#D6DEEB;--1:#403F53">(</span><span style="--0:#D9F5DD;--1:#111111">'</span><span style="--0:#ECC48D;--1:#984E4D">lucisv</span><span style="--0:#D9F5DD;--1:#111111">'</span><span style="--0:#D6DEEB;--1:#403F53">)</span></div></div></code></pre><div class="copy"><div aria-live="polite"></div><button title="Copy to clipboard" data-copied="Copied!" data-code="vim.filetype.add({ extension = { v = 'verilog', vh = 'verilog', sv = 'systemverilog', svh = 'systemverilog'} })vim.lsp.config('lucisv', { cmd = { 'lucisv-server' }, filetypes = { 'verilog', 'systemverilog' }, root_markers = { 'lucisv.toml', '.lucisv.toml', '.git' },})vim.lsp.enable('lucisv')"><div></div></button></div></figure></div>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1
-1
@@ -1 +1 @@
|
||||
{"version":"1.5.2","languages":{"en":{"hash":"en_63f86fa784","wasm":"en","page_count":12}},"include_characters":["_","‿","⁀","⁔","︳","︴","﹍","﹎","﹏","_"]}
|
||||
{"version":"1.5.2","languages":{"en":{"hash":"en_ccc426eeeb","wasm":"en","page_count":12}},"include_characters":["_","‿","⁀","⁔","︳","︴","﹍","﹎","﹏","_"]}
|
||||
Binary file not shown.
Binary file not shown.
+1
-1
@@ -352,4 +352,4 @@ index scope when the defining module lives outside the default folder scope.</p>
|
||||
</table>
|
||||
<div class="sl-heading-wrapper level-h2"><h2 id="workspace-lifecycle">Workspace lifecycle</h2><a class="sl-anchor-link" href="#workspace-lifecycle"><span aria-hidden="true" class="sl-anchor-icon"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 1 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 0 0-1.42-1.42m8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 1 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l3.88-3.89a4.49 4.49 0 0 0 0-6.33M8.83 15.17a1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.92-4.92a1 1 0 1 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42"></path></svg></span><span class="sr-only" data-pagefind-ignore>Section titled “Workspace lifecycle”</span></a></div>
|
||||
<p>The server handles <code dir="auto">didOpen</code>, incremental <code dir="auto">didChange</code>, <code dir="auto">didSave</code>, <code dir="auto">didClose</code>, watched-file changes, configuration changes, cancellation, shutdown, and exit. It dynamically registers file watchers, emits work-done progress while building large indexes, coalesces code-lens refreshes, and promotes open-buffer overlays into the workspace without waiting for disk writes.</p>
|
||||
</div><footer class="sl-flex astro-xhxjzfa7"><div class="meta sl-flex astro-xhxjzfa7"><a href="https://git.luci.ooo/lucio/verilogrustformatter/src/branch/master/docs/site/src/content/docs/reference/language-tools.md" class="sl-flex print:hidden astro-xk5gmzsg"><svg aria-hidden="true" class="astro-xk5gmzsg astro-n5k4ipy7" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.2em;"><path d="M22 7.24a1 1 0 0 0-.29-.71l-4.24-4.24a1 1 0 0 0-1.1-.22 1 1 0 0 0-.32.22l-2.83 2.83L2.29 16.05a1 1 0 0 0-.29.71V21a1 1 0 0 0 1 1h4.24a1 1 0 0 0 .76-.29l10.87-10.93L21.71 8c.1-.1.17-.2.22-.33a1 1 0 0 0 0-.24v-.14l.07-.05ZM6.83 20H4v-2.83l9.93-9.93 2.83 2.83L6.83 20ZM18.17 8.66l-2.83-2.83 1.42-1.41 2.82 2.82-1.41 1.42Z"/></svg>Edit page</a><p>Last updated: <time datetime="2026-09-06T01:00:31.000Z">Sep 6, 2026</time></p></div><div class="pagination-links print:hidden astro-jgq3vlii" dir="ltr"><a href="/reference/rules/" rel="prev" class="astro-jgq3vlii"><svg aria-hidden="true" class="astro-jgq3vlii astro-n5k4ipy7" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.5rem;"><path d="M17 11H9.41l3.3-3.29a1.004 1.004 0 1 0-1.42-1.42l-5 5a1 1 0 0 0-.21.33 1 1 0 0 0 0 .76 1 1 0 0 0 .21.33l5 5a1.002 1.002 0 0 0 1.639-.325 1 1 0 0 0-.219-1.095L9.41 13H17a1 1 0 0 0 0-2Z"/></svg><span class="astro-jgq3vlii">Previous<br class="astro-jgq3vlii"><span class="link-title astro-jgq3vlii">Lint rules</span></span></a><a href="/reference/rust-api/" rel="next" class="astro-jgq3vlii"><svg aria-hidden="true" class="astro-jgq3vlii astro-n5k4ipy7" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.5rem;"><path d="M17.92 11.62a1.001 1.001 0 0 0-.21-.33l-5-5a1.003 1.003 0 1 0-1.42 1.42l3.3 3.29H7a1 1 0 0 0 0 2h7.59l-3.3 3.29a1.002 1.002 0 0 0 .325 1.639 1 1 0 0 0 1.095-.219l5-5a1 1 0 0 0 .21-.33 1 1 0 0 0 0-.76Z"/></svg><span class="astro-jgq3vlii">Next<br class="astro-jgq3vlii"><span class="link-title astro-jgq3vlii">Rust API index</span></span></a></div></footer></div></div></main></div></div></div></div></body></html>
|
||||
</div><footer class="sl-flex astro-xhxjzfa7"><div class="meta sl-flex astro-xhxjzfa7"><a href="https://git.luci.ooo/lucio/verilogrustformatter/src/branch/master/docs/site/src/content/docs/reference/language-tools.md" class="sl-flex print:hidden astro-xk5gmzsg"><svg aria-hidden="true" class="astro-xk5gmzsg astro-n5k4ipy7" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.2em;"><path d="M22 7.24a1 1 0 0 0-.29-.71l-4.24-4.24a1 1 0 0 0-1.1-.22 1 1 0 0 0-.32.22l-2.83 2.83L2.29 16.05a1 1 0 0 0-.29.71V21a1 1 0 0 0 1 1h4.24a1 1 0 0 0 .76-.29l10.87-10.93L21.71 8c.1-.1.17-.2.22-.33a1 1 0 0 0 0-.24v-.14l.07-.05ZM6.83 20H4v-2.83l9.93-9.93 2.83 2.83L6.83 20ZM18.17 8.66l-2.83-2.83 1.42-1.41 2.82 2.82-1.41 1.42Z"/></svg>Edit page</a><p>Last updated: <time datetime="2026-09-06T04:04:14.000Z">Sep 6, 2026</time></p></div><div class="pagination-links print:hidden astro-jgq3vlii" dir="ltr"><a href="/reference/rules/" rel="prev" class="astro-jgq3vlii"><svg aria-hidden="true" class="astro-jgq3vlii astro-n5k4ipy7" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.5rem;"><path d="M17 11H9.41l3.3-3.29a1.004 1.004 0 1 0-1.42-1.42l-5 5a1 1 0 0 0-.21.33 1 1 0 0 0 0 .76 1 1 0 0 0 .21.33l5 5a1.002 1.002 0 0 0 1.639-.325 1 1 0 0 0-.219-1.095L9.41 13H17a1 1 0 0 0 0-2Z"/></svg><span class="astro-jgq3vlii">Previous<br class="astro-jgq3vlii"><span class="link-title astro-jgq3vlii">Lint rules</span></span></a><a href="/reference/rust-api/" rel="next" class="astro-jgq3vlii"><svg aria-hidden="true" class="astro-jgq3vlii astro-n5k4ipy7" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.5rem;"><path d="M17.92 11.62a1.001 1.001 0 0 0-.21-.33l-5-5a1.003 1.003 0 1 0-1.42 1.42l3.3 3.29H7a1 1 0 0 0 0 2h7.59l-3.3 3.29a1.002 1.002 0 0 0 .325 1.639 1 1 0 0 0 1.095-.219l5-5a1 1 0 0 0 .21-.33 1 1 0 0 0 0-.76Z"/></svg><span class="astro-jgq3vlii">Next<br class="astro-jgq3vlii"><span class="link-title astro-jgq3vlii">Rust API index</span></span></a></div></footer></div></div></main></div></div></div></div></body></html>
|
||||
@@ -10,11 +10,21 @@ description: Set up lucisv-server in VS Code, Neovim, Vim, and other Language Se
|
||||
Install the `.vsix` attached to a lucisv release:
|
||||
|
||||
```bash
|
||||
code --install-extension lucisv-0.9.0.vsix
|
||||
code --install-extension lucisv-<version>-darwin-arm64.vsix # or the linux/windows package for your machine
|
||||
```
|
||||
|
||||
The extension registers Verilog/SystemVerilog file types, syntax highlighting, snippets, color settings, configuration, and starts `lucisv-server` from `PATH` by default.
|
||||
|
||||
**DUT-centred hierarchy.** Right-click a module in the Hierarchy pane and
|
||||
choose **Star as DUT**. The pane splits into sections: the DUT with its
|
||||
children, the DUT's parents (an upward tree through everything that
|
||||
instantiates it — usually the testbench), and all other modules, re-rooted
|
||||
where their only parents are the DUT's ancestors. Star a second DUT and you
|
||||
get five sections. Unstar from the same menu, or clear every DUT from the
|
||||
pane's title bar. Starred DUTs are remembered per workspace; a team can also
|
||||
check them in with `"lucisv.hierarchy.duts": ["aes", "hmac"]`, and DUTs that
|
||||
come from the setting are shown locked.
|
||||
|
||||
## Neovim 0.11+
|
||||
|
||||
```lua
|
||||
|
||||
@@ -533,6 +533,7 @@ promise:
|
||||
| `vscode-hierarchy-sidebar ◀──▶ index-persistence / hover-line-index / incremental-index` | handshake | **`FACTS_FORMAT` 4 → 5**, one bump for three additions: `Def::decl_span`; `InstantiationEdge::instances` (a `Vec<InstanceOccurrence>` — the statement edge stays one-per-statement, so call hierarchy and code-lens counts are unchanged and the census is still the one `instantiations::sites` walk); and client positions — `DeclLines::positions: Option<DeclPositions>` on **file-scope declarations only**, plus `Utf16Range` on every instance occurrence. Members deliberately carry none: they outnumber units by two orders of magnitude, and the `U`/`M` groups are separate, so a member costs no field at all. `FileFacts::from_analysis` grew a `src: &str` parameter (a position cannot be read off a line table). Measured store cost of the positions: +1.69 % on the 820-file corpus, +1.86 % on opentitan. |
|
||||
| `vscode-hierarchy-sidebar ──▶ vlog_parser` | depends | `LineIndex::utf16_position` — byte offset to (0-based line, UTF-16 column), moved down beside the line table so the semantic index and `lucisv_server::convert::Positions` cannot answer differently. `Positions::position` is now a wrapper over it; the cross-crate equality is test-pinned. |
|
||||
| `vscode-hierarchy-sidebar ◀──▶ workspace-index` | handshake | `WorkspaceIndex::units_of(kind)` — file-scope declarations of one kind, in name order, walking the unit table alone. The cheap half of `workspace_symbols("")` for a caller that never wants members; 15 ms per snapshot on opentitan. |
|
||||
| `dut-hierarchy ──▶ vscode-hierarchy-sidebar` | depends | TODO §56 (2026-09-06): `hierarchySections.js` consumes the sidebar's model (`rootNode`, the reverse instance index memoised on the model) and its webview renderer's row menu; no edge to any Rust crate — the server is untouched. |
|
||||
| `hover-line-index ──▶ port-detail-spans / index-persistence` | depends + handshake | `DeclLines { name, detail }` rides each indexed `Decl`, so ordinary and split-port hover headings do not reread a file just to compute a line. The record grew again and **`FACTS_FORMAT` went 3 → 4**; the server's bounded `FileView` cache supplies the text/`LineIndex` only when a snippet or a non-indexed position still needs it. Its four invalidation points are `set_document`, `close_document`, `update_one`, and a whole rebuild. |
|
||||
| `scan-interleave ◀──▶ workspace-index` | handshake | A scan is a stepped `Scan` value; staged `FileFacts` land through `WorkspaceIndex::absorb`, one whole-index merge per queue drain rather than per file. `Candidates::absorb` and `IncludeGraph::absorb` publish their tables in the same drain, so “the workspace as far as scanned” cannot mean three different prefixes. |
|
||||
| `scan-interleave ──▶ hover-line-index` | depends | Delivers hover-line-index's measured startup-wait request: a startup scan above 64 files drains queued messages between files. A rescan deliberately still holds requests; what an answer sees never depends on elapsed wall time. |
|
||||
|
||||
Reference in new issue
Block a user