emacs-lsp / lsp-mode

Emacs client/library for the Language Server Protocol
https://emacs-lsp.github.io/lsp-mode
GNU General Public License v3.0
4.79k stars 889 forks source link

lsp-install-server no longer works when called interactively #3794

Closed bclark-videra closed 2 years ago

bclark-videra commented 2 years ago

Thank you for the bug report

Bug description

With the addition of the nix-nil lsp in #3789 there is now an entry in lsp-clients with key nil. See: https://github.com/emacs-lsp/lsp-mode/pull/3789/files#diff-32a52f22910769f3a77dc26a6b03e754d28fc65eae884e25431b7500e810821fR60

This means that when calling lsp-install-server interactively (via M-x) this form returns the client info for nix-nil instead of an actual nil value: (gethash server-id lsp-clients). Which causes lsp-install-server to print a message about installing the "nil" language server manually.

Steps to reproduce

M-x lsp-install-server

Message appears in the minibuffer: There is no automatic installation for ‘nil’, you have to install it manually following lsp-mode’s documentation.

Expected behavior

Selected list of servers to install or update shown in the minibuffer.

Which Language Server did you use?

clojure-lsp primarily, but this bug is unrelated to the language server currently being used.

OS

MacOS

Error callstack

No response

Anything else?

Calling the function manually with the server-id parameter set installs/updates the requested server as expected. Example: (lsp-install-server t 'clojure-lsp)

bclark-videra commented 2 years ago

I'm unsure if renaming nix-nil in lsp-clients is the best way to fix this. If so, I'm happy to prepare a PR.

yyoncho commented 2 years ago

Proposed fix sounds fine