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.
This commit is contained in:
+16
-5
@@ -209,12 +209,23 @@ Returns answer with org-roam links to sources."
|
|||||||
(when yas-was-active (yas-minor-mode 1)))
|
(when yas-was-active (yas-minor-mode 1)))
|
||||||
(message "No @glm-search or @gptel-search query found on current line"))))
|
(message "No @glm-search or @gptel-search query found on current line"))))
|
||||||
|
|
||||||
;; Elixir language server. Moved out of the shared config.el, where this
|
;; Elixir language server. Moved out of the shared config.el (where a
|
||||||
;; macOS path was hard-coded and therefore dead on any other machine.
|
;; 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
|
(with-eval-after-load 'eglot
|
||||||
(add-to-list 'eglot-server-programs
|
(let ((server (cond ((executable-find "expert")
|
||||||
'(elixir-ts-mode
|
'("expert" "--stdio"))
|
||||||
. ("sh" "/Users/willem/.elixir-ls/release/language_server.sh"))))
|
((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
|
;; Blog export destinations. Kept in this file rather than in the shared
|
||||||
;; config.el because the jekyll checkout sits under ~/MyDocuments on macOS and
|
;; config.el because the jekyll checkout sits under ~/MyDocuments on macOS and
|
||||||
|
|||||||
Reference in New Issue
Block a user