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
@@ -168,6 +168,11 @@
|
||||
"default": true,
|
||||
"markdownDescription": "Show grey ghost text that finishes a block as you open it: `if (` suggests `) begin … end`, a `case (` suggests its arms and `endcase`, and a `begin`, `fork`, `generate` or `module` at the end of a line suggests its closer. Tab accepts it as a snippet, so the cursor lands in the condition first and in the body second; where more than one shape fits (`always @(`), `Alt+]` cycles them. The accepted text is indented with the editor's own `editor.tabSize`/`editor.insertSpaces`, not with `#lucisv.indent#`. Requires `editor.inlineSuggest.enabled`."
|
||||
},
|
||||
"lucisv.formatOnSave": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"markdownDescription": "Let the server format the file when you save it, over `textDocument/willSaveWaitUntil`. Off by default, and **not** what a VS Code user wants: `#editor.formatOnSave#` already formats through lucisv and turning both on formats twice. This exists for the editors that have no format-on-save of their own. The indent comes from the project's `lucisv.toml`, then `#lucisv.indent#`, then the built-in 2 — never from `#editor.tabSize#`, which the protocol does not send with this request."
|
||||
},
|
||||
"lucisv.lineLength": {
|
||||
"type": [
|
||||
"number",
|
||||
|
||||
Reference in new issue
Block a user