Bind semantics, the spaced macro call and the directive inside a connection, and lucisv.instantiate

TODO section 26; closes docs/topo.md 2.9-15 and 2.9-19; coverage_gaps
M4/M5/M6 corrected against a fresh opentitan census.
A bind directive's target is a path of segments with optional indices
(bind top.gen[0].u_core chk u_chk (...)); a lone target binds as a
module reference, an instance path records nothing rather than a guess.
Each connection's port half resolves against the module being bound in
and its expression half in the target module's scope first, the
workspace's member path when the target lives elsewhere, the writing
scope last (Target::BindScope, resolve::in_bind_target - the
inline-constraint shape). FACTS_FORMAT 14 -> 15: binds now post
references and an instantiation edge.
Expression-position spaced macro calls (assign x = `WIDTH (a + b);)
keep the author's gap, read from the source as glued_null_item reads
its gap; verify.rs untouched, both pins stand. A conditional directive
inside a connection value becomes ExprKind::Verbatim, byte-exact
through raw_inline as Doc::Inline, with the closing paren's line and
the list's break read from the source - so the instantiation keeps its
edge, lens and port references instead of collapsing to opaque bytes
(opentitan: the two padring sites in chip_earlgrey_{asic,cw340}.sv,
+2 edges, everything else byte-identical to 0.31.0).
lucisv.instantiate [uri, position, module] renders the inline ghost's
plan as plain text through workspace/applyEdit for clients without
inline completion; the Neovim README documents it.
QA: 3186 tests / 47 binaries, corpus 814/820, independent binary diff
over corpus and 2 645 opentitan files: only the two named files differ.

docs/features/bind-semantics/README.md.

Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
lucioandClaude Fable 5 committed 2026-09-02 13:15:21 -07:00
1 parent a0c290ccc2
commit 81df63d942
27 files changed
+2038 -134

No files matched your search

+11
View File
@@ -67,6 +67,13 @@ already are, so support costs one AST leaf rather than a grammar.
position is unchanged and still parses `` `A (b) `` as a call. The space is
reproduced as written, not tightened. See
`docs/features/item-misc/README.md`.)**
**(2026-09-02: the *expression* half of that sentence was only half true —
the file parsed, but the formatter then printed the call tight and the
safety net refused the whole file, so `` assign x = `WIDTH (a + b); `` was
unformattable. `Fmt::spaced_macro_callee` prints the author's gap back,
read from `src`; `verify.rs` is still untouched and both spacing pins still
reject a rewrite in either direction. See
`docs/features/bind-semantics/README.md`.)**
- **Whitespace next to a line break inside a *string literal* is data, not
layout.** This is the premise the first round of this feature got wrong; see
the QA finding and the fix under Handshakes and Design. Everywhere else in a
@@ -251,6 +258,10 @@ From QA round 1 (2026-08-19):
- [x] Non-blocking note recorded in Assumptions: `` `M (a, b); `` with a space
before the paren is not treated as an invocation-with-args and
parse-errors; workaround documented, fix deferred with a reason.
*(Item and statement position: closed 2026-08-20 by item-misc.
Expression position: the file parsed but the formatter tightened the
gap and the net refused it — closed 2026-09-02 by bind-semantics,
formatter side only.)*
- [x] Corpus acceptance: 3 named files, before/after recorded below.
- [x] Full corpus re-run; new parse rate recorded below.
- [x] `README.md` supported-syntax updated, roadmap item 1 struck.