LSP §9b: willSaveWaitUntil — protocol-native format-on-save
textDocument/willSaveWaitUntil is advertised and served, gated on a new lucisv.formatOnSave setting that defaults to off (a server that formats uninvited fights the editor's own format-on-save and doubles up); the decline is one comparison, before any buffer lookup. When on, the hook is textDocument/formatting with a different trigger: the same engine, the same all-or-nothing verified-output contract, settings resolved by the new format::settings_without_editor_options — the ladder minus the tabSize rung the protocol simply does not carry here, with the honest consequence (save-format can differ from manual format without a lucisv.toml) documented in the README, the VS Code setting description and the nvim README. Every save reason formats; refusals are shown per save, on purpose. 18 tests added across settings/format/server/e2e, including QA's executable proofs of the tab-size gap and its lucisv.toml resolution, a no-reindex/no-generation-bump guard for the new setting, and an idempotency round-trip through a real didChange. QA also fixed the stale 'not advertised' feature list in editors/nvim/README.md and sharpened the config-warning dedup claim to what the code does (once per buffer state) — reworded in the README, pinned by test. docs/features/will-save-wait-until/README.md Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
1 parent
c2ea1a11f6
commit
80b9afdfe3
11 files changed
+939
-11
No files matched your search
@@ -703,9 +703,19 @@ and are not gaps.
|
||||
publish — per notification. Advertised as `TextDocumentSyncOptions`
|
||||
with the open/close and `save.includeText: false` values a bare `Kind`
|
||||
already implied, so no client's save behavior moved.
|
||||
- [ ] **`textDocument/willSaveWaitUntil`** — the protocol-native
|
||||
- [x] **`textDocument/willSaveWaitUntil`** — the protocol-native
|
||||
format-on-save hook (client-side `editor.formatOnSave` already works;
|
||||
this serves the editors without it).
|
||||
→ `docs/features/will-save-wait-until/README.md`; advertised as
|
||||
`willSaveWaitUntil: true` (the plain `willSave` notification stays
|
||||
unadvertised — there is nothing for us in it), and gated on a new
|
||||
`lucisv.formatOnSave` setting that is **off** by default, so a client
|
||||
with its own format-on-save never formats twice. On, it is
|
||||
`textDocument/formatting` with a different trigger: same engine, same
|
||||
all-or-nothing edit, same `[]` for an already-formatted buffer, and the
|
||||
settings ladder minus its `tabSize` rung because the request carries no
|
||||
`FormattingOptions`. Every save reason formats; an unopened buffer and
|
||||
the off state both answer `null`.
|
||||
- [ ] **Semantic tokens `range` + `full/delta`** — we set
|
||||
`range: None` and no delta, so clients re-request whole-file token
|
||||
sets on every edit. Delta needs `resultId` bookkeeping per buffer.
|
||||
|
||||
Reference in new issue
Block a user