TODO §64: loop 3 round 2 — cross-file references for hierarchical-surface-only declarations
Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
1 parent
5d70cb89cc
commit
9d1eb1671e
1 file changed
+72
@@ -6814,3 +6814,75 @@ code_action.rs}`, `crates/vlog_parser/src/{lexer.rs,parser/,lib.rs}`,
|
||||
release 0.54.0 with assets verified — done 2026-09-12: **0.54.0**
|
||||
(da32237, v0.54.0), 8 assets, the darwin-arm64 vsix at 0.54.0 with
|
||||
both binaries, `hierarchySections.js`, `extract.js`, no `*_test.js`.
|
||||
|
||||
## 64. Loop 3, round 2 (planned 2026-09-12) — cross-file references for hierarchical-surface-only declarations
|
||||
|
||||
One lane. The dev half runs in the owner's spawned session
|
||||
(`task_d8afe80f`, its own worktree); QA (Sonnet) and the lead's review run
|
||||
on that result in the main tree after it lands. Same rules as §63: guard
|
||||
every suite and sweep, no `sleep` over 60 s, no `pgrep -f`, opentitan
|
||||
read-only. Ships as 0.55.0.
|
||||
|
||||
### 64.1 `references` stops at the connection surface (QA §63.1, `task_d8afe80f`)
|
||||
|
||||
`crates/lucisv_server/src/nav.rs`: `leaves_this_file` (~148) and
|
||||
`indexed_def_in_file` (~235; `indexed_def_for_symbol` is shared with
|
||||
`hover.rs`) decide whether a declaration can be referenced from another file
|
||||
by `WorkspaceIndex::member(unit, name)` — the **connection** surface, ports
|
||||
and parameters. A module's net, variable or instance lives on the
|
||||
**hierarchical** surface only (`workspace/hierarchy.rs`, since 2026-09-05), so
|
||||
both functions treat such a declaration as unable to leave its file. Two
|
||||
symptoms, pinned by
|
||||
`nav.rs::a_binds_connection_expression_is_reachable_by_definition_not_yet_by_references`:
|
||||
`references` from the *declaration* of a hierarchically reached net falls to
|
||||
the single-file fallback and never sees a cross-file use (a `bind`
|
||||
connection or an ordinary `u_x.sig` tail alike); `references` from a *use*
|
||||
that does resolve cross-file cannot re-identify the open buffer's own
|
||||
in-file use of the same declaration, because `indexed_def_in_file` maps the
|
||||
live symbol back the same wrong way. Not `bind`-specific; reproduced with a
|
||||
plain `assign w = u_leaf.sig;`.
|
||||
|
||||
The contract to reach: a declaration's cross-file reachability is judged on
|
||||
the surface a use can actually reach it by — `member_in(unit, name,
|
||||
Surface::Hierarchical)` in both call sites (the connection answer is a prefix
|
||||
of the hierarchical one, so package/class/struct members and ports keep
|
||||
their answers byte-for-byte). `references_are_ambiguous` and the
|
||||
single-record rule (`defs.len() != 1`) keep their meaning over the wider
|
||||
answer — a name declared both as a port and as an internal net of the same
|
||||
unit is ambiguous, not silently the port. Hover and definition, which share
|
||||
`indexed_def_for_symbol`, must not change what they say for anything they
|
||||
already answered. No new index field, so no `FACTS_FORMAT` bump; if one
|
||||
turns out to be needed, say why in the README.
|
||||
|
||||
Feature README: `docs/features/references-hierarchical-surface/README.md`.
|
||||
Files: `crates/lucisv_server/src/{nav.rs,hover.rs}` and the server's wire
|
||||
tests (`server/tests/`), `crates/vlog_semantic/src/workspace/hierarchy.rs`
|
||||
only if `member_in` needs a case it lacks (a Handshake entry either way).
|
||||
Nothing else.
|
||||
|
||||
- [ ] the fixture sweep first, asserting today's answers, then flipped:
|
||||
`definition`, `references` (from the declaration and from each use,
|
||||
`includeDeclaration` both ways), `hover`, `documentHighlight` over
|
||||
(a) a `bind` connection's bare name, (b) a `u_x.sig` tail from an
|
||||
instantiating file, (c) a two-level tail, (d) a port of the same
|
||||
unit (unchanged answers), (e) a package member (unchanged), (f) a
|
||||
name that is both a port and an internal net of one unit (ambiguous
|
||||
— the single-file fallback, as today), (g) an unsaved buffer
|
||||
(`untitled:`), (h) the open buffer's own in-file use seen from a
|
||||
cross-file use
|
||||
- [ ] the fix in both call sites; the §63.1 QA test renamed to say what it
|
||||
now asserts
|
||||
- [ ] on the real opentitan tree (read-only): `references` on
|
||||
`entropy_masking_req` from `aes.sv` lists `aes_bind.sv`; on
|
||||
`state_q` from `entropy_src_main_sm.sv` lists `entropy_src_core.sv`;
|
||||
the `nav`/`navqueue` harness rows within noise (the hierarchical
|
||||
lookup is one more map probe)
|
||||
- [ ] QA: fixtures re-attacked (a generate-scoped net; a net shadowed by a
|
||||
port of the same name in a *different* unit; a class member — must
|
||||
stay on the connection answer), opentitan census, gates
|
||||
|
||||
### 64.2 Closing
|
||||
|
||||
- [ ] `docs/perf/README.md` note if any harness number moved; topo row
|
||||
(`lucisv_server ──▶ vlog_semantic`: nav asks the hierarchical
|
||||
surface); release 0.55.0 with assets verified
|
||||
Reference in new issue
Block a user