formatDocument
Format the whole document via the language server.
Ports upstream @codemirror/lsp-client's formatDocument command:
resolves this editor's FormatServer binding from the formatServer facet; returns false (command not handled) when none is installed,
returns false when the server explicitly lacks
documentFormattingProvider,otherwise flushes pending edits (LSPClient.sync), issues
textDocument/formattingwith the derived FormattingOptions (formattingOptions), and applies the returnedTextEdit[]as a singleformatTransactionSpec (via the shared textEditsToChangeSpec).
The suspending work runs on the client scope (consistent with the other LSP commands) so the request and its edit application outlive the synchronous command return. Cancellation of the in-flight LSP call is cooperative through structured concurrency.
Deviation from upstream: range formatting and on-type formatting are out of scope for this command — only whole-document formatting is implemented (see issue #44).
Return
true when the command is handled (a binding exists and the server advertises the capability), so the keymap stops here; false to fall through.