mirror of
https://github.com/zed-industries/zed.git
synced 2026-11-19 23:20:18 +01:00
da53a2b22e
Closes #45994 Per the JSON-RPC specification, `params` "MUST be provided as a Structured value" or the member "MAY be omitted." See specification here: https://www.jsonrpc.org/specification#request_object The code was passing in unit `()` for params which serde_json was serializing to `null` which is not valid. This pulls request adds an `is_unit` function and annotates the `params` fields in the `Request` and `Notification` structs with the following: ```rs #[serde(default, skip_serializing_if = "is_unit")] ``` so that the field will be omitted if the type is unit. This does also introduce a `'static` bound to these structs. > [!WARNING] > While this seems to me like a simple change, I am not super familiar with Rust, please look at this PR with extra scrutiny. The last thing I want to do is break everyone's LSP integration. Release Notes: - LSP integrations: send language server shutdown requests with correct parameters