lsp: Skip serializing of params if unit type (#46027)
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
da53a2b22eMichael Barth committed on 1/22/2026, 1:06:02 PM· committed by GitHubparentccedb24