(error response body)Indicate that a JSON-RPC response was an error by adding a error to it.
The body should conform to the JSON-RPC spec for error objects, which can be
constructed with the helpers in lsp4clj.lsp.errors.
Indicate that a JSON-RPC response was an error by adding a error to it. The body should conform to the JSON-RPC spec for error objects, which can be constructed with the helpers in `lsp4clj.lsp.errors`.
(infer response body)Infer whether to update the response with result or error depending on
the shape of the body.
If body is a map containing the key :error, uses the value as the error
body. Otherwise uses body as the result.
Infer whether to update the response with `result` or `error` depending on the shape of the `body`. If `body` is a map containing the key `:error`, uses the value as the `error` body. Otherwise uses `body` as the `result`.
(preserve-kebab-case m)Recursively convert map keywords to kebab-case strings, to avoid automatic camelCase conversion. This is useful for servers when the client expects Clojure style JSON, or when a map needs to be round-tripped from the server to the client and back without case changes.
Recursively convert map keywords to kebab-case strings, to avoid automatic camelCase conversion. This is useful for servers when the client expects Clojure style JSON, or when a map needs to be round-tripped from the server to the client and back without case changes.
(response id)(response id body)Create a JSON-RPC response object. A response should be extend with a
:result or :error either by using the arity-2 version, or via the helpers
result, error, or infer.
Create a JSON-RPC response object. A response should be extend with a `:result` or `:error` either by using the arity-2 version, or via the helpers `result`, `error`, or `infer`. https://www.jsonrpc.org/specification#response_object
(result response body)Indicate that a JSON-RPC response was successful by adding a result to it.
Indicate that a JSON-RPC response was successful by adding a result to it.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |