Hi there!
Thanks for the guide!
I am using Spacemacs
and eglot
. The guide is not totally accurate.
package-install
is prohibited in Spacemacs.
-
You should add
eglot
indotspacemacs-additional-packages
instead. -
Then you need to add in
dotspacemacs/user-config
:
(require 'eglot)
(add-to-list 'eglot-server-programs '(elixir-mode "/home/nicolas/elixir-ls/release/language_server.sh"))
- To make your life easier and not having to type
M-x eglot
in any Elixir file, you may add indotspacemacs/user-config
AFTER(require 'eglot)
:
(add-hook 'elixir-mode-hook 'eglot-ensure)
Lastly, three things:
- The
elixir
layer in Spacemacs does not play well with Eglot. It callslsp-mode
from the Spacemacslsp
layer. If you want to useeglot
in Spacemacs, you should add directlyelixir-mode
indotspacemacs-additional-packages
. Do not add theelixir
layer. - If you fail to add the
require 'eglot
instruction appropriately,eglot
will randomly stop working on Emacs restart, and you will be prompted the error described in this GitHub issue. - You can find my full .spacemacs dot file for more guidance on my GitHub.