helix: LSP crashes with `missing content length`

Reproduction steps

I can’t reproduce that, I just write some code and after some time it suddenly breaks.

Environment

  • Platform: Linux
  • Helix version: 0.3.0
~/.cache/helix/helix.log Last 10 lines
2021-07-25T18:09:09.370 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"127/240 (expandtest)","percentage":52}}}
2021-07-25T18:09:09.371 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"131/240 (io_copy)","percentage":54}}}
2021-07-25T18:09:09.371 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"133/240 (task_blocking)","percentage":55}}}
2021-07-25T18:09:09.371 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"138/240 (tcp_socket)","percentage":57}}}
2021-07-25T18:09:09.371 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"146/240 (votate)","percentage":60}}}
2021-07-25T18:09:09.374 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/completion","params":{"position":{"character":56,"line":94},"textDocument":{"uri":"file:///home/gbaranski/code/votate/src/main.rs"}},"id":272}
2021-07-25T18:09:09.375 helix_lsp::transport [ERROR] err: <- Err(Other(missing content length))
2021-07-25T18:09:09.375 mio::poll [TRACE] deregistering event source from poller
2021-07-25T18:09:09.375 mio::poll [TRACE] deregistering event source from poller
2021-07-25T18:09:09.375 mio::poll [TRACE] deregistering event source from poller

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 19 (19 by maintainers)

Most upvoted comments

I have the same issue with rust-analyzer ea105f939 2021-07-19 stable. I wanted to listen to language server exit code and restart it, but looks like it would be a bit hard to implement. It would be nice to have reload option for LSP, since it can crash not only because of protocol error described here, but be killed by user or OS OOM killer as well as crash on its own. Nowadays it’s required to restart Helix to reload language server.

maybe we should add new command :restart or :lsp-restart as a temporarily solution for issues like this?