emacs: Switch to elixir-ts-mode and add lexical to eglot

This commit is contained in:
Erwin Boskma 2024-03-06 08:16:11 +01:00
parent 181d0624dd
commit 767934e2d4
Signed by: erwin
SSH key fingerprint: SHA256:/Wk1WZdLg+vQHs3in9qq7PsIp8SMzwGSk/RLZ5zPuZk

View file

@ -1109,11 +1109,15 @@ Automatically use the =<lang>-ts-mode= when it is available
(fset #'json--log-event #'ignore) ;; Performance boost by not logging every event
(add-to-list 'eglot-server-programs
'((toml-mode toml-ts-mode conf-toml-mode) . ("taplo" "lsp" "stdio")))
;; (add-to-list 'eglot-server-programs
;; `((elixir-mode elixir-ts-mode heex-ts-mode) .
;; ,(eglot-alternatives '(("nextls" "--stdio=true"
;; :initializationOptions (:experimental (:completions (:enable t))))
;; "elixir-ls"))))
;;
(add-to-list 'eglot-server-programs
`((elixir-mode elixir-ts-mode heex-ts-mode) .
,(eglot-alternatives '(("nextls" "--stdio=true"
:initializationOptions (:experimental (:completions (:enable t))))
"elixir-ls"))))
`((elixir-ts-mode heex-ts-mode) .
,(eglot-alternatives '("lexical" "elixir-ls"))))
(add-to-list 'eglot-server-programs
'(dhall-mode . ("dhall-lsp-server")))
(add-to-list 'eglot-stay-out-of 'flymake)
@ -1283,22 +1287,20 @@ Prefer local packages from =node_modules= to global ones
Add support for Elixir with [[https://github.com/elixir-editors/emacs-elixir][elixir-mode]]. The =elixir-format= hook sets up the correct formatter configuration when in a =projectile= project.
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle no
(use-package elixir-mode
:after eglot
:hook ((elixir-mode . eglot-ensure))
;; ((elixir-format . (lambda ()
;; (if (projectile-project-p)
;; (setq elixir-format-arguments
;; (list "--dot-formatter"
;; (concat (locate-dominating-file buffer-file-name ".formatter.exs") ".formatter.exs")))
;; (setq elixir-format-arguments nil))))
;; (elixir-mode . (lambda () (add-hook 'before-save-hook 'elixir-format nil t)))
:config
;; (setq lsp-elixir-server-command '("elixir-ls"))
(add-to-list 'auto-mode-alist '("\\.[hl]eex\\'" . elixir-mode)))
#+end_src
#+begin_src emacs-lisp
(use-package elixir-ts-mode
:after eglot
:hook ((elixir-ts-mode . eglot-ensure)))
#+end_src
Add a [[https://github.com/ayrat555/mix.el][mix]] minor mode to call =mix= tasks from emacs.
#+begin_src emacs-lisp