From 767934e2d4a77d964280ec8db75d935a052d91d7 Mon Sep 17 00:00:00 2001 From: Erwin Boskma Date: Wed, 6 Mar 2024 08:16:11 +0100 Subject: [PATCH] emacs: Switch to elixir-ts-mode and add lexical to eglot --- home-manager/modules/emacs/config.org | 28 ++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/home-manager/modules/emacs/config.org b/home-manager/modules/emacs/config.org index 1715ab3..a694643 100644 --- a/home-manager/modules/emacs/config.org +++ b/home-manager/modules/emacs/config.org @@ -1109,11 +1109,15 @@ Automatically use the =-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