Emacs - Elixir Setup Configuration Wiki

I wonder if it could be the Emacs theme that you’re using.

I use vanilla Emacs but use a Doom theme …

(use-package doom-themes
  ;; Global settings (defaults)
  (setq doom-themes-enable-bold t    ; if nil, bold is universally disabled
        doom-themes-enable-italic t) ; if nil, italics is universally disabled
  (load-theme 'doom-one t)

  ;; Enable flashing mode-line on errors
  ;; Corrects (and improves) org-mode's native fontification.

I am on vanilla emacs and doom theme too.

I think, tree-sitter and the original elixir-mode were conflicting with each other.
This helped replace elixir-mode with elixir-ts-mode and fix things.

(setq major-mode-remap-alist
      '((yaml-mode . yaml-ts-mode)
       (elixir-mode . elixir-ts-mode)))

I have found that lsp mode is freezing emacs.
happening with anyone else too?

The first time you connect to the LSP server it can take several minutes to build the .elixir_ls file in your project root.

Usually if you have problems with LSP the first thing to do is delete that .elixir_ls file and then connect to the LSP server, so that it will build that file again from scratch.

Also, recent versions of Emacs comes with Eglot included so I use that to connect to the LSP server. This is what I have in my init.el

;; elixir-mode, elixir-ts-mode, heex-ts-mode
;; are setup in the eglot-server-programs variable to look for
;; language_server.sh
;; so just add that to the path in ~/.profile using...
;; PATH="/opt/elixir-ls/release:$PATH"
(require 'eglot)
(add-hook 'elixir-ts-mode-hook 'eglot-ensure)

The only other thing I can think of is to do a refresh install of the LSP server using an up-to-date version of Elixir.

1 Like

Are you able to paste the output from your lsp-log buffer?

Use M-x to find a command like lsp-workspace-show-log and paste that output here.

Sometimes you might need to specify directories to ignore. Search this forum for “lsp-file-watch-ignored” to see this.

1 Like