From 4f62b503b9c0eaaf35515b4e9c3f73d035665ba6 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 22 Sep 2025 20:17:48 -0400 Subject: [PATCH] fix(elixir): use elixir-ls if in $PATH And if the user hasn't themselves changed `lsp-elixir-server-command`. --- modules/lang/elixir/config.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/lang/elixir/config.el b/modules/lang/elixir/config.el index 2161113c1..f74c592c9 100644 --- a/modules/lang/elixir/config.el +++ b/modules/lang/elixir/config.el @@ -32,6 +32,14 @@ (sp-local-pair "fn " " end" :unless '(sp-in-comment-p sp-in-string-p))) (when (modulep! +lsp) + ;; HACK: lsp-elixir is hardcoded to use the server `lsp-install-server' + ;; installs, ignoring any system-provided executables. This fixes that, so + ;; long as the user hasn't changed `lsp-elixir-server-command' themselves, + (when (and (member lsp-elixir-server-command + '(("language_server.bat") + ("language_server.sh"))) + (executable-find "elixir-ls")) + (setq lsp-elixir-server-command "elixir-ls")) (add-hook (intern (format "%s-local-vars-hook" mode)) #'lsp! 'append)) (use-package! flycheck-credo