rust-lang / rust-analyzer

A Rust compiler front-end for IDEs
https://rust-analyzer.github.io/
Apache License 2.0
13.68k stars 1.5k forks source link

fix: Report both IO errors and main_loop errors #17208

Closed Wilfred closed 3 weeks ago

Wilfred commented 3 weeks ago

If rust-analyzer receives a malformed LSP request, the IO thread terminates with a meaningful error, but then closes the channel.

Once the channel has closed, the main_loop also terminates, but it only has RecvError and can't show a meaningful error. As a result, rust-analyzer would incorrectly claim that the client forgot to shutdown.

$ buggy_lsp_client | rust-analyzer
Error: client exited without proper shutdown sequence

Instead, include both error messages when the server shuts down.

Veykril commented 3 weeks ago

@bors r+

bors commented 3 weeks ago

:pushpin: Commit d993f9d1c9e686a3bdcb1de5440122ebc3393132 has been approved by Veykril

It is now in the queue for this repository.

bors commented 3 weeks ago

:hourglass: Testing commit d993f9d1c9e686a3bdcb1de5440122ebc3393132 with merge 5bf2f85c8054d80424899fa581db1b192230efb5...

bors commented 3 weeks ago

:sunny: Test successful - checks-actions Approved by: Veykril Pushing 5bf2f85c8054d80424899fa581db1b192230efb5 to master...