
Kirill BulatovandPiotr Osiewicz
95c045ad93
Fix LSP violation when dismissing server notifications (#23531)
Part of https://github.com/zed-industries/zed/issues/22606
Closes https://github.com/zed-industries/zed/issues/23509
When a user sees an odd notification from the language server like
<img width="508" alt="image"
src="https://github.com/user-attachments/assets/6f5ef1aa-0f09-4705-a02a-aaf81dd8620c"
/>
they usually dismiss that.
Zed uses channels to wait and handle user interactions with such
notifications, and, due to `?`, sends back
```json
{"jsonrpc":"2.0","id":1,"error":{"message":"receiving from an empty and closed channel"}}
```
which is not spec-compliant:
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#window_showMessageRequest
> Response:
>
> * result: the selected
[MessageActionItem](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#messageActionItem)
| null if none got selected.
> * error: code and message set in case an exception happens during
showing a message.
Unfortunately, vtsls (and, potentially, others) crash if receive such
non-compliant requests, and do not get back.
After the fix, the message is correct:
```json
{"jsonrpc":"2.0","id":1,"result":null}
```
Release Notes:
- Fixed vtsls crashing on notification dismiss
Co-authored-by: Piotr Osiewicz <piotr@zed.dev>
2025-01-23 13:30:35 +00:00
..
2024-09-10 15:51:01 -04:00
2025-01-23 12:03:37 +00:00
2025-01-10 13:38:00 +00:00
2025-01-15 19:31:21 +00:00
2024-09-06 11:58:39 +02:00
2024-09-06 11:58:39 +02:00
2024-10-16 12:14:40 +02:00
2025-01-14 17:13:55 +00:00
2025-01-22 18:04:14 -05:00
2024-12-10 15:01:14 +01:00
2025-01-22 21:00:04 +00:00
2025-01-11 21:59:06 +00:00
2025-01-23 13:30:35 +00:00
2025-01-22 21:19:02 +01:00
2025-01-06 18:33:04 +00:00
2025-01-22 21:19:02 +01:00
2025-01-22 21:19:02 +01:00
2025-01-23 11:17:32 +00:00
2024-04-02 11:13:18 +02:00
2024-12-19 02:20:35 +00:00
2025-01-04 01:00:16 +00:00
2025-01-17 01:23:28 +00:00
2025-01-23 12:32:21 +01:00
2024-12-02 21:03:31 +01:00
2025-01-21 18:11:53 -05:00
2024-09-06 11:58:39 +02:00