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
@@ -18,6 +18,7 @@ looks like language knowledge in here is a bug or a `Handshake` request.
|
||||
|---|---|---|
|
||||
| `textDocument/formatting` | `vlog_formatter::format_source` | One whole-document `TextEdit`, and only when the text actually changed |
|
||||
| `textDocument/rangeFormatting` | `vlog_formatter::format_range` | Same edit shape; the LSP `Range`'s *lines* become the engine's `--lines` (round 18) |
|
||||
| `textDocument/willSaveWaitUntil` | `vlog_formatter::format_source` | Format-on-save, protocol-native, for the editors that have no format-on-save of their own. **Off unless `lucisv.formatOnSave` is pushed**, and the decline is `null` — a capable client asks before every save, and a client with its own format-on-save would otherwise format twice. When on it is `textDocument/formatting` with a different trigger: the same engine, the same all-or-nothing edit, and the settings ladder minus its `tabSize` rung (the request carries no `FormattingOptions`). See `docs/features/will-save-wait-until/README.md` |
|
||||
| `textDocument/publishDiagnostics` | `vlog_parser::parse_source_tolerant` | Pushed on `didOpen`/`didChange`/`didSave`, once per notification — **only for a client that does not pull**. See `docs/features/pull-diagnostics/README.md` |
|
||||
| `textDocument/didChange` | `sync::apply_changes` | Incremental sync: the ranges are applied in order to the buffer the server holds, then one `set_document` + one `publish`. A rangeless change still replaces the whole buffer, so a full-sync client is unaffected. See `docs/features/incremental-sync/README.md` |
|
||||
| `textDocument/diagnostic`, `workspace/diagnostic` | the same parse+lint pass | The 3.17 pull model, served to a client that advertised `textDocument.diagnostic` — which is then pushed nothing at all. `resultId` is one generation counter, bumped by a buffer change and by an index rebuild; the workspace report covers the **open buffers**. Same feature README |
|
||||
|
||||
Reference in new issue
Block a user