Reconfigure Elixir LSP server a little bit
All checks were successful
/ Test config on 20 (push) Successful in 32s
All checks were successful
/ Test config on 20 (push) Successful in 32s
This commit is contained in:
parent
1c0165a510
commit
e7d2eb2271
4 changed files with 46 additions and 18 deletions
|
|
@ -8,6 +8,7 @@
|
||||||
(declare-function cape-file 'cape)
|
(declare-function cape-file 'cape)
|
||||||
(declare-function cape-keyword 'cape)
|
(declare-function cape-keyword 'cape)
|
||||||
(declare-function cape-elisp-symbol 'cape)
|
(declare-function cape-elisp-symbol 'cape)
|
||||||
|
(declare-function cape-capf-prefix-length 'cape)
|
||||||
(declare-function cape-capf-super 'cape)
|
(declare-function cape-capf-super 'cape)
|
||||||
(declare-function yasnippet-capf 'yasnippet)
|
(declare-function yasnippet-capf 'yasnippet)
|
||||||
(declare-function nerd-icons-corfu-formatter 'nerd-icons-corfu)
|
(declare-function nerd-icons-corfu-formatter 'nerd-icons-corfu)
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,44 @@
|
||||||
;;; Global Language Server Protocol Config
|
;;; Global Language Server Protocol Config
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
|
(eval-when-compile
|
||||||
|
(declare-function eglot-completion-at-point 'eglot)
|
||||||
|
(declare-function eglot-managed-p 'eglot))
|
||||||
|
|
||||||
(use-package eglot :ensure nil
|
(use-package eglot :ensure nil
|
||||||
:config
|
:config
|
||||||
;; Use Ruby-Lsp instead of Solargraph
|
;; 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
|
(use-package eldoc-box
|
||||||
:ensure (:host github :repo "casouri/eldoc-box")
|
:ensure (:host github :repo "casouri/eldoc-box")
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
(declare-function yas--remove-template-by-uuid 'yasnippet)
|
(declare-function yas--remove-template-by-uuid 'yasnippet)
|
||||||
(declare-function icejam-set-indent 'icejam-prog-mode)
|
(declare-function icejam-set-indent 'icejam-prog-mode)
|
||||||
(declare-function icejam-set-eglot-capfs 'icejam-complete-at-point)
|
(declare-function icejam-set-eglot-capfs 'icejam-complete-at-point)
|
||||||
|
(declare-function icejam-start-eglot 'icejam-eglot)
|
||||||
(defvar icejam-language-transient-alist)
|
(defvar icejam-language-transient-alist)
|
||||||
(defvar icejam-elixir-lang-menu)
|
(defvar icejam-elixir-lang-menu)
|
||||||
(defvar apheleia-mode-alist))
|
(defvar apheleia-mode-alist))
|
||||||
|
|
@ -44,9 +45,8 @@
|
||||||
"All things Elixir."
|
"All things Elixir."
|
||||||
(icejam-set-indent 2)
|
(icejam-set-indent 2)
|
||||||
(column-enforce-n 98)
|
(column-enforce-n 98)
|
||||||
(eglot-ensure)
|
|
||||||
|
|
||||||
(icejam-set-eglot-capfs)
|
(icejam-set-eglot-capfs)
|
||||||
|
(icejam-start-eglot)
|
||||||
(icejam-delete-elixir-snippets))
|
(icejam-delete-elixir-snippets))
|
||||||
|
|
||||||
(add-hook 'heex-ts-mode-hook 'icejam-activate-elixir-ts-mode)
|
(add-hook 'heex-ts-mode-hook 'icejam-activate-elixir-ts-mode)
|
||||||
|
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
# -*- mode: snippet -*-
|
|
||||||
# name: desc
|
|
||||||
# key: desc
|
|
||||||
# --
|
|
||||||
describe "$1" do
|
|
||||||
$0
|
|
||||||
end
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue