docs(lsp): format the handwritten part #29295

(cherry picked from commit 7ce261c064)
This commit is contained in:
Yi Ming
2024-06-18 07:04:40 +08:00
committed by github-actions[bot]
parent 446b05f85a
commit f7d8650616

View File

@ -213,26 +213,26 @@ Each response handler has this signature: >
function(err, result, ctx, config) function(err, result, ctx, config)
< <
Parameters: ~ Parameters: ~
- {err} (table|nil) Error info dict, or `nil` if the request {err} (`table|nil`) Error info dict, or `nil` if the request
completed. completed.
- {result} (Result | Params | nil) `result` key of the |lsp-response| or {result} (`Result|Params|nil`) `result` key of the |lsp-response| or
`nil` if the request failed. `nil` if the request failed.
- {ctx} (table) Table of calling state associated with the {ctx} (`table`) Table of calling state associated with the
handler, with these keys: handler, with these keys:
- {method} (string) |lsp-method| name. {method} (`string`) |lsp-method| name.
- {client_id} (number) |vim.lsp.Client| identifier. {client_id} (`number`) |vim.lsp.Client| identifier.
- {bufnr} (Buffer) Buffer handle. {bufnr} (`Buffer`) Buffer handle.
- {params} (table|nil) Request parameters table. {params} (`table|nil`) Request parameters table.
- {version} (number) Document version at time of {version} (`number`) Document version at time of
request. Handlers can compare this to the request. Handlers can compare this to the
current document version to check if the current document version to check if the
response is "stale". See also |b:changedtick|. response is "stale". See also |b:changedtick|.
- {config} (table) Handler-defined configuration table, which allows {config} (`table`) Handler-defined configuration table, which allows
users to customize handler behavior. users to customize handler behavior.
For an example, see: For an example, see:
|vim.lsp.diagnostic.on_publish_diagnostics()| |vim.lsp.diagnostic.on_publish_diagnostics()|
To configure a particular |lsp-handler|, see: To configure a particular |lsp-handler|, see:
|lsp-handler-configuration| |lsp-handler-configuration|
Returns: ~ Returns: ~
Two values `result, err` where `err` is shaped like an RPC error: > Two values `result, err` where `err` is shaped like an RPC error: >