Add editor-packaging and vfmt-core-lift (round 12: TODO §6 closes)
editor-packaging: a minimal VS Code extension (41-line plain JS on
vscode-languageclient =9.0.1, one setting vfmt.serverPath, languages
verilog/systemverilog) with a zero-dependency smoke.js that validates
the extension's exact spawn contract against the real binary, plus
Neovim/Vim/coc setup docs (including the load-bearing
vim.filetype.add — Vim maps *.v by content heuristic and *.vh not at
all). Everything headless-validatable was validated: the .vsix
builds, smoke passes with negative controls, npm ci reproduces.
vfmt-core-lift: config.rs and walk.rs moved to a new std-only
vfmt_core crate as byte-identical 100% renames (CLI suite untouched,
corpus TSV md5 equal from HEAD and lifted builds). The LSP server
now discovers vfmt.toml per document with precedence config > client
tabSize > built-in default (an editor default is not a deliberate
override), warns once per document change on a broken config while
formatting with defaults, and scans the workspace with the lifted
gitignore-aware walk. QA drove every claim live over stdio.
With these, every TODO §6 item is delivered: spans, tolerant
parsing, define table, single-file semantics, workspace index, the
server, and both editors. Lead trued up the caveats this round made
stale across five documents.
Dev: 2 Opus agents; QA: 2 Sonnet agents; reviews in
docs/features/{editor-packaging,vfmt-core-lift}/README.md.
Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
1 parent
c8b936a741
commit
832bf4afc6
27 files changed
+2070
-108
No files matched your search
@@ -27,8 +27,9 @@ looks like language knowledge in here is a bug or a `Handshake` request.
|
||||
|
||||
Deferred, deliberately, and named in Status/TODO below: range formatting
|
||||
(waits on TODO.md §2 `--lines`), lint diagnostics (waits on `vlog_linter`),
|
||||
completion / rename / signature help, cross-file references, and `vfmt.toml`
|
||||
discovery.
|
||||
completion / rename / signature help, and cross-file references.
|
||||
(`vfmt.toml` discovery and `.gitignore`-aware indexing, deferred when this
|
||||
was written, were delivered by vfmt-core-lift the same day — lead note.)
|
||||
|
||||
## Dependencies, and the justification CLAUDE.md asks for
|
||||
|
||||
@@ -206,9 +207,11 @@ not see.
|
||||
on a POSIX path legitimately named `/C:`.
|
||||
- **The workspace walk is plain.** `initialize`'s `workspace_folders` (falling
|
||||
back to `root_uri`) are walked recursively for `*.v`/`*.sv`/`*.vh`/`*.svh`.
|
||||
`.gitignore` and `--exclude` are **not** honored — `crates/vfmt` owns that
|
||||
logic (`walk.rs`) and it is not public. Recorded as a Handshake below. A
|
||||
depth cap of 64 directories keeps a symlink cycle from spinning.
|
||||
~~`.gitignore` and `--exclude` are **not** honored~~ **Superseded by
|
||||
vfmt-core-lift (lead note): the scan now uses the lifted `vfmt_core` walk —
|
||||
`.gitignore` always on, workspace-root config excludes applied. The old
|
||||
64-directory depth cap is gone for CLI parity (symlink-cycle exposure now
|
||||
shared with the CLI, filed as a follow-up in that feature's README).**
|
||||
- **A file that does not lex has no tokens.** The lexer is all-or-nothing
|
||||
(`docs/features/error-recovery/README.md`), so `semanticTokens` returns an
|
||||
empty set and hover's macro lookup finds nothing for such a buffer. The
|
||||
@@ -219,10 +222,11 @@ not see.
|
||||
becomes a second error item. Symbols and diagnostics in that state are
|
||||
oddly-placed but never wrong about their spans. This is the documented
|
||||
shape, not a bug in this crate.
|
||||
- **`vfmt.toml` is not discovered.** Config discovery lives in `crates/vfmt`
|
||||
(`config.rs`) and is not exposed as a library. The server uses
|
||||
`Config::default()` (100 columns, 2-space indent) with the client's tab
|
||||
size overriding the indent when it is sane. Handshake filed below.
|
||||
- ~~**`vfmt.toml` is not discovered.**~~ **Superseded by vfmt-core-lift
|
||||
(lead note): discovery now runs per formatting request via `vfmt_core`,
|
||||
with precedence config > client tabSize > built-in default, and a broken
|
||||
config warns once and formats with defaults. See
|
||||
`docs/features/vfmt-core-lift/README.md`.**
|
||||
|
||||
## Handshakes
|
||||
|
||||
@@ -249,7 +253,10 @@ the binary's name and its stdio contract, nothing else.
|
||||
**Requested of other modules** — none of these block this round, and none was
|
||||
done here:
|
||||
|
||||
1. **`crates/vfmt`: make config discovery reusable.** `vfmt.toml` search,
|
||||
1. **DELIVERED** by `docs/features/vfmt-core-lift/README.md` (round 12):
|
||||
`config.rs` now lives in `crates/vfmt_core`, and formatting discovers
|
||||
`vfmt.toml` anchored at the document's own path. **`crates/vfmt`: make
|
||||
config discovery reusable.** `vfmt.toml` search,
|
||||
parsing and precedence live in `crates/vfmt/src/config.rs`, inside a binary
|
||||
crate, so the server cannot call it. The LSP needs exactly the same
|
||||
answer the CLI gives for the same file, and duplicating the search rule is
|
||||
@@ -258,7 +265,10 @@ done here:
|
||||
`discover(path) -> Config`-shaped entry point. Until then the server
|
||||
formats with defaults, which is wrong for any project that sets
|
||||
`line-length`.
|
||||
2. **`crates/vfmt`: make the ignore-aware walk reusable.** Same shape of
|
||||
2. **DELIVERED** by `docs/features/vfmt-core-lift/README.md` (round 12):
|
||||
`walk.rs` now lives in `crates/vfmt_core`, and the index scan uses it, so
|
||||
the index skips what the CLI skips. **`crates/vfmt`: make the ignore-aware
|
||||
walk reusable.** Same shape of
|
||||
problem for `walk.rs` (`.gitignore` + `--exclude`). The server's plain walk
|
||||
will index generated netlists a `vfmt` run would skip.
|
||||
3. **`vlog_parser`: token-kind detail the lexer folds away.** Two spellings
|
||||
@@ -367,8 +377,8 @@ it was written rather than starting mid-line.
|
||||
answering across the workspace means resolving every other file's
|
||||
references *into* this one — an inverted index the workspace layer does
|
||||
not build. It is a real feature, not a small addition.
|
||||
- [ ] **Not done:** `vfmt.toml` discovery, `.gitignore`-aware indexing — both
|
||||
blocked on the two Handshake requests above.
|
||||
- [x] ~~**Not done:**~~ `vfmt.toml` discovery, `.gitignore`-aware indexing —
|
||||
delivered by vfmt-core-lift (both Handshakes below marked DELIVERED).
|
||||
- [ ] **Not done:** editor packaging (the VS Code extension and the
|
||||
`lspconfig` snippet are their own TODO.md §6 item).
|
||||
|
||||
|
||||
Reference in new issue
Block a user