Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lsp-mode: Fix sending shutdown message #4167

Merged
merged 1 commit into from
Sep 10, 2023

Conversation

alanz
Copy link
Contributor

@alanz alanz commented Sep 9, 2023

This fixes two related problems.

First, according to the spec the shutdown message should have no parameters.

rust-analyzer and erlang-language-platform respond with an "unable to deserialized error" when given an empty map instead. e.g.

LSP :: (error Failed to deserialize shutdown: invalid type: map, expected unit; {})

But this was hidden because the condition case swallows the error info and always reports timeout.

A genuine timeout is now reported as

LSP :: (error Timeout while waiting for response. Method: shutdown)

This fixes two related problems.

First, according to the spec
(https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#shutdown)
the shutdown message should have no parameters.

rust-analyzer and erlang-language-platform respond with an "unable to
deserialized error" when given an empty map instead.  e.g.

LSP :: (error Failed to deserialize shutdown: invalid type: map, expected unit; {})

But this was hidden because the condition case swallows the error info
and always reports timeout.

A genuine timeout is now reported as

LSP :: (error Timeout while waiting for response.  Method: shutdown)
@alanz alanz requested a review from yyoncho September 9, 2023 14:23
@yyoncho yyoncho merged commit e31cacc into emacs-lsp:master Sep 10, 2023
13 of 14 checks passed
nverno added a commit to nverno/lsp-mode that referenced this pull request Oct 16, 2023
* master: (27 commits)
  Rename blacklist to blocklist (emacs-lsp#4173)
  Introduce a function to disable a call for particular method for a server (emacs-lsp#4171)
  Fix `lsp-completion--company-match` freezing emacs-lsp#4192 (emacs-lsp#4193)
  Bump the magik language server to 0.8.1 (emacs-lsp#4195)
  Add configuration to use new experimental ondisk cache for lsp-kotlin (emacs-lsp#4138)
  lsp-erlang: add setting for types on hover (emacs-lsp#4188)
  Make it possible to override lsp-cmake server command (emacs-lsp#4182)
  lsp-erlang: update erlang-language-platform download file names (emacs-lsp#4187)
  clojure: add paredit refactorings
  Fix typo in php-guide.md (emacs-lsp#4183)
  Bump magik language server to 0.8.0 (emacs-lsp#4176)
  Bump elixir-ls version (emacs-lsp#4178)
  Remove unbalanced parenthesis and double-quote in comments (emacs-lsp#4177)
  MDX support (emacs-lsp#4141)
  lsp-erlang: Add semantic token support for erlang-language-platform (emacs-lsp#4166)
  lsp-mode: Fix sending shutdown message (emacs-lsp#4167)
  lsp-erlang: update ELP download file names (emacs-lsp#4165)
  Add Move language client (emacs-lsp#4155)
  Add support for python-lsp-server pyls-isort plugin. (emacs-lsp#4163)
  Updating Crystal LSP (emacs-lsp#4156)
  ...
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.

2 participants