Skip to content

Notify the client when the project build crashes - #1289

Open
mvanhorn wants to merge 1 commit into
elixir-lsp:masterfrom
mvanhorn:fix/1025-notify-client-of-build-crashes
Open

mvanhorn wants to merge 1 commit into
elixir-lsp:masterfrom
mvanhorn:fix/1025-notify-client-of-build-crashes

Conversation

@mvanhorn

Copy link
Copy Markdown

Background

When the project build crashes, for example after a branch switch leaves dependencies out of date, the editor never warns that the language server has stopped working. The failure is only written to the language server log, so the needed recovery step is easy to miss.

The build monitor already receives the abnormal exit and continues into the existing result handling, which records diagnostics, but that path never sent a message to the client. Ordinary compiler diagnostics and a normal build completion are left without a popup, so a Mix exception stays invisible in the editor.

Summary of the fix

On an abnormal monitored-build exit, the server formats the exit reason and sends an error show-message containing that text plus a pointer to the build diagnostics and output. When the text mentions dependencies, the message also says to check dependencies and that running mix deps.get is a possible recovery step. A normal exit still produces no popup, and a rebuild that was already pending is still scheduled.

Tests

  • ./scripts/tcp_to_stdio_bridge.exs could not run in this environment for the elixir-ls change (./scripts/tcp_to_stdio_bridge.exs is not executable).
  • Tests for the elixir-ls change live in apps/language_server/test/server_test.exs.

Fixes #1025

On an abnormal monitored-build exit, the server formats the exit reason
and sends an error show-message containing that text plus a pointer to
the build diagnostics and output. When the text mentions dependencies,
the message also says to check dependencies and that running mix
deps.get is a possible recovery step. A normal exit still produces no
popup, and a rebuild that was already pending is still scheduled.

Fixes elixir-lsp#1025

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't continue due to errors on dependencies error: tell the client

1 participant