Due to the nested structure of eglot-server-programs, our advice would not correctly detect entries for some modes (like javascript modes), effectively disabling Eglot in those modes. I've replaced the advice with a solution baked into lsp!, so folks still have the option of using eglot-ensure directly if they want it activated unconditionally. Amend: #7219
13 lines
452 B
EmacsLisp
13 lines
452 B
EmacsLisp
;;; tools/lsp/autoload/common.el -*- lexical-binding: t; -*-
|
|
|
|
;;;###autodef (fset 'lsp! #'ignore)
|
|
(defun lsp! ()
|
|
"Dispatch to call the currently used lsp client entrypoint"
|
|
(interactive)
|
|
(if (modulep! +eglot)
|
|
(when (require 'eglot nil t)
|
|
(if (eglot--lookup-mode major-mode)
|
|
(eglot-ensure)
|
|
(eglot--message "No client defined for %s" major-mode)))
|
|
(unless (bound-and-true-p lsp-mode)
|
|
(lsp-deferred))))
|