Commit Graph

6 Commits (9c4c66d41758013fbfbd11f5096166d90c32ec12)

Author SHA1 Message Date
Michael Davis 0f64f31d8b
LSP: Add request ID to request timeout message (#6010)
This improves error logging for requests - without the ID it's hard to
know which request is the one that timed out.
2 years ago
Michael Davis 22298434f1
jsonrpc: Skip serializing params if params are None (#5471)
The JSONRPC spec says:

> If present, parameters for the rpc call MUST be provided as a
> Structured value

https://www.jsonrpc.org/specification#parameter_structures

(Where a "Structured value" is elsewhere defined as either a map or
array.)

This change skips the serialization of the `params` field for JSONRPC
method calls and notifications if the `params` field is the `None`
variant. This fixes compatibility with LSP servers which adhere closely
to that part of the spec: `ocamllsp` in the wild.
2 years ago
Blaž Hrastnik c2c1280f02
Resolve a bunch of upcoming clippy lints 2 years ago
Blaž Hrastnik 425de09d21 Fix tests again 2 years ago
Blaž Hrastnik 24f03097e3 Remove some more unwraps 2 years ago
Michael Davis 45ce1ebdb6
embed jsonrpc types from jsonrpc-core crate (#2801)
We should not depend on jsonrpc-core anymore:

* The project just announced it's no longer actively maintained[^1],
  preferring their new implementation in `jsonrpsee`.
* The types are too strict: we would benefit from removing some
  `#[serde(deny_unknown_fields)]` annotations to allow language
  servers that disrespect the spec[^2].
* We don't use much of the project. Just the types out of core.
  These are easy to embed directly into the `helix-lsp` crate.

[^1]: https://github.com/paritytech/jsonrpc/pull/674
[^2]: https://github.com/helix-editor/helix/issues/2786
2 years ago