Inline instantiation round 2: the space is the commitment, and every indexed module answers
Two owner rulings from live use. The ghost now fires only after 'name<space>' — aes alone may still be growing into aes_dft, so the typed space is what says the name is finished; an Ident ending at the cursor offers nothing at all. And a module declared in more than one file no longer declines: completion::nearest_definition picks the copy sharing the most leading path components with the asking buffer (a top_earlgrey buffer gets top_earlgrey's ast_dft), then the shallowest, then the lexicographically smallest — the depth term is QA's catch, fixed at review, so a direct sibling beats a deeper subdirectory copy that ties on the prefix. vlog_refactor::module_definition keeps its ambiguity refusal for its own callers. The refusal residue is now the enumerable inline::NoGhost, and QA's sweep proves the ruling: 1131/1131 opentitan module names ghost, zero declines (199 multiply-declared, tb 61 ways), ast_dft and io_osc verified from both tops over the wire, 0.05-0.08 ms per non-matching keystroke. Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
1 parent
f27fa1c045
commit
03a4958294
15 files changed
+1311
-220
No files matched your search
@@ -81,8 +81,14 @@ workspace index, from the same file list, and are replaced with it.
|
||||
- **Consumes `vlog_parser`**: `tokenize` for the word harvest, `KEYWORDS` for
|
||||
the keyword tier, `defines::DefineKind` to keep `` `undef`` entries out of the
|
||||
macro table.
|
||||
- **Consumes `vlog_refactor`** — `module_definition`, `instantiation_plan`,
|
||||
`render_with` — through `module_tier`. Nothing in `vlog_refactor` was
|
||||
- **Consumes `vlog_refactor`** — `instantiation_plan`, `render_with` —
|
||||
through the planning half (`plan_for`), which since 2026-08-30 serves only
|
||||
`inline.rs`'s ghost; `module_tier` itself reads no files. The
|
||||
`module_definition` consumption ended with round 2 of inline-instantiation:
|
||||
the file is chosen by `completion::nearest_definition` (most shared leading
|
||||
path components with the asking buffer, then shallowest, then
|
||||
lexicographic), which never refuses on multiplicity the way
|
||||
`module_definition` deliberately does. Nothing in `vlog_refactor` was
|
||||
touched, then or since.
|
||||
- **Stopped consuming `vlog_refactor::module_names` (2026-08-28).** That
|
||||
function is `WorkspaceIndex::workspace_symbols("")` filtered to modules, and
|
||||
@@ -140,8 +146,10 @@ alphabetically within a tier.
|
||||
|
||||
Tier 0 is first because at module-item position a module name is what the user
|
||||
is reaching for — and, since 2026-08-30, a *name* is all it inserts: the
|
||||
instantiation follows as ghost text once the name is spelled exactly
|
||||
(`docs/features/inline-instantiation/README.md`). It is still the only tier
|
||||
instantiation follows as ghost text once the name is spelled exactly and a
|
||||
space typed after it (`docs/features/inline-instantiation/README.md`). For a
|
||||
module declared in more than one file, the item's detail names the copy the
|
||||
ghost will read (`nearest_definition`'s pick for this buffer). It is still the only tier
|
||||
that is *position*-gated at all: M4's gate (nothing but whitespace before the word on its line, plus
|
||||
`pairs::analyze`'s scope chain) is unchanged and still declines inside a
|
||||
procedural block, a function, a class, a connection list and an expression.
|
||||
|
||||
Reference in new issue
Block a user