From 34a4a62c04a8faae570f42496a6c95f2a81334c4 Mon Sep 17 00:00:00 2001 From: Suvayu Ali Date: Mon, 31 Jul 2023 15:50:44 +0200 Subject: [PATCH 1/2] clients/lsp-credo.el: remove redundant checks from `make-lsp-client` --- clients/lsp-credo.el | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/clients/lsp-credo.el b/clients/lsp-credo.el index 0452b76e7b..567e676aac 100644 --- a/clients/lsp-credo.el +++ b/clients/lsp-credo.el @@ -75,12 +75,7 @@ be available here: https://github.com/elixir-tools/credo-language-server/release (lsp-register-client (make-lsp-client - :new-connection - (lsp-stdio-connection - (lambda () - `(,(or (executable-find (cl-first lsp-credo-command)) - (lsp-package-path 'credo-language-server)) - ,@(cl-rest lsp-credo-command)))) + :new-connection (lsp-stdio-connection lsp-credo-command) :activation-fn (lsp-activate-on "elixir") :priority -1 :add-on? t From 01190241c4ccc907a549348d3a7a535792053bb4 Mon Sep 17 00:00:00 2001 From: Suvayu Ali Date: Mon, 31 Jul 2023 15:51:50 +0200 Subject: [PATCH 2/2] docs/page/adding-new-language.md: add note about common mistake --- docs/page/adding-new-language.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/page/adding-new-language.md b/docs/page/adding-new-language.md index de3b3ae974..b9d8c0d2b0 100644 --- a/docs/page/adding-new-language.md +++ b/docs/page/adding-new-language.md @@ -31,6 +31,17 @@ corresponding mode -\> language id - in this case `(python-mode . buffer language. When the `major-mode` is not sufficient to determine the language (e.g. `web-mode` is used for `javascript`, `html`, and `css`) you can put regex. +**Note:** In the above example, when a new client is created using +`make-lsp-client`, a new connection to the language server is created +using `lsp-stdio-connection`. Please carefully check its +documentation, as the function checks for various things (e.g. testing +for the executable in PATH) and handles respective errors. Often +while adding a server, the LSP client author might do these checks +themselves, but without handling the errors correctly. This leads to +features like `lsp-install-server` breaking for other users; e.g. see +[this issue](https://github.com/emacs-lsp/lsp-mode/issues/3415). This +is a common mistake that keeps reoccurring. + Here's an example of how to set up a custom language server in your `init.el` file: ```elisp