Reconfigure Elixir LSP server a little bit
All checks were successful
/ Test config on 20 (push) Successful in 32s

This commit is contained in:
Maciej 2026-04-29 11:12:51 +03:00
parent 1c0165a510
commit e7d2eb2271
Signed by: maciej
GPG key ID: 28243AF437E32F99
4 changed files with 46 additions and 18 deletions

View file

@ -3,10 +3,44 @@
;;; Global Language Server Protocol Config
;;; Code:
(eval-when-compile
(declare-function eglot-completion-at-point 'eglot)
(declare-function eglot-managed-p 'eglot))
(use-package eglot :ensure nil
:config
;; Use Ruby-Lsp instead of Solargraph
(add-to-list 'eglot-server-programs '((ruby-mode ruby-ts-mode) "ruby-lsp")))
(add-to-list 'eglot-server-programs '((ruby-mode ruby-ts-mode) "ruby-lsp"))
(setopt eglot-advertise-cancellation t)
;; Automatically kill eglot when last buffer associated with a project is
;; closed.
(setopt eglot-autoshutdown t)
;; Set up server specific switches globally
(setq-default eglot-workspace-configuration
;; Elixir configuration
'(:elixirLS (
:autoBuild t
:dialyzerEnabled t
:incrementalDialyzer :json-false
:autoInsertRequiredAlias :json-false
:suggestSpecs t
)))
;; Eglot insists on adding itself to the completion-at-point-functions but
;; that means that it overrides our combined value of (eglot + yasnippet)
(add-hook 'eglot-managed-mode-hook
(lambda ()
(when eglot--managed-mode
(remove-hook 'completion-at-point-functions
#'eglot-completion-at-point t)))))
(defun icejam-start-eglot ()
"Start eglot unless already started."
(unless (eglot-managed-p)
(eglot-ensure)))
(use-package eldoc-box
:ensure (:host github :repo "casouri/eldoc-box")