mirror of
https://github.com/doomemacs/doomemacs.git
synced 2025-12-06 02:30:33 -08:00
feat(lsp): set-eglot-client!: support fallback alternatives
This commit is contained in:
parent
18eb710c34
commit
da5d22ad35
1 changed files with 9 additions and 4 deletions
|
|
@ -2,12 +2,17 @@
|
||||||
;;;###if (modulep! +eglot)
|
;;;###if (modulep! +eglot)
|
||||||
|
|
||||||
;;;###autodef
|
;;;###autodef
|
||||||
(defun set-eglot-client! (mode server-call)
|
(defun set-eglot-client! (mode &rest alternatives)
|
||||||
"Add SERVER-CALL list as a possible lsp server for given major MODE.
|
"Set ALTERNATIVES as the given eglot lsp server for given major MODE.
|
||||||
|
|
||||||
Example : (set-eglot-client! 'python-mode `(,(concat doom-data-dir \"lsp/mspyls/Microsoft.Python.LanguageServer\")))"
|
MODE and ALTERNATIVES take after MAJOR-MODE and CONTACT in
|
||||||
|
`eglot-server-programs'. MODE can be one major mode symbol or a list thereof.
|
||||||
|
ALTERNATIVES specifies how to connect to a server in those modes."
|
||||||
(after! eglot
|
(after! eglot
|
||||||
(add-to-list 'eglot-server-programs `(,mode . ,server-call))))
|
(add-to-list 'eglot-server-programs
|
||||||
|
(cons mode (if (cdr alternatives)
|
||||||
|
(eglot-alternatives alternatives)
|
||||||
|
alternatives)))))
|
||||||
|
|
||||||
;; HACK Eglot removed `eglot-help-at-point' in joaotavora/eglot@a044dec for a
|
;; HACK Eglot removed `eglot-help-at-point' in joaotavora/eglot@a044dec for a
|
||||||
;; more problematic approach of deferred to eldoc. Here, I've restored it.
|
;; more problematic approach of deferred to eldoc. Here, I've restored it.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue