From 243bc8ba2a1d9db7bdf3edddd912cc130a0e8dd2 Mon Sep 17 00:00:00 2001 From: Willem van den Ende Date: Thu, 5 Nov 2026 10:08:59 +0000 Subject: [PATCH] fix(mac): configure the elixir server that actually exists The old hard-coded ~/.elixir-ls path no longer exists on this machine, so eglot had no usable Elixir server (and .heex files had none at all). Mirror the Linux logic from config-linux.el: prefer `expert` (installed at /opt/homebrew/bin/expert), else any language_server.sh on PATH, else leave eglot at its default. Covers elixir-mode, elixir-ts-mode and heex-ts-mode, closing the heex gap left when b425df9 moved server ownership to the OS files. Verified on the mac only. --- config-mac.el | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/config-mac.el b/config-mac.el index d548f35..2b2fff4 100644 --- a/config-mac.el +++ b/config-mac.el @@ -209,12 +209,23 @@ Returns answer with org-roam links to sources." (when yas-was-active (yas-minor-mode 1))) (message "No @glm-search or @gptel-search query found on current line")))) -;; Elixir language server. Moved out of the shared config.el, where this -;; macOS path was hard-coded and therefore dead on any other machine. +;; Elixir language server. Moved out of the shared config.el (where a +;; hard-coded macOS path leaked to Linux); that ~/.elixir-ls checkout no +;; longer exists on this machine either. Mirrors config-linux.el: prefer +;; `expert' if it is installed, else any elixir-ls on PATH, else leave eglot +;; alone rather than configuring a server that cannot start. Covers all +;; three Elixir modes, including heex-ts-mode. (with-eval-after-load 'eglot - (add-to-list 'eglot-server-programs - '(elixir-ts-mode - . ("sh" "/Users/willem/.elixir-ls/release/language_server.sh")))) + (let ((server (cond ((executable-find "expert") + '("expert" "--stdio")) + ((executable-find "language_server.sh") + (list (or (executable-find "bash") "sh") + (executable-find "language_server.sh")))))) + (when server + (setf (alist-get '(elixir-mode elixir-ts-mode heex-ts-mode) + eglot-server-programs + nil nil #'equal) + server)))) ;; Blog export destinations. Kept in this file rather than in the shared ;; config.el because the jekyll checkout sits under ~/MyDocuments on macOS and