From: João Távora Date: Mon, 14 Jan 2019 15:31:26 +0000 (+0000) Subject: Consider mode derivation when guessing servers X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~336 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5292c4b6f01c2ac680eb5a032100486ce6047412;p=emacs.git Consider mode derivation when guessing servers * eglot.el (eglot-server-programs): Remove js2-mode and rjsx-mode. (eglot--guess-contact): Use provided-mode-derived-p GitHub-reference: per https://github.com/joaotavora/eglot/issues/177 --- diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 799ab10fa29..2d1c3676f22 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -81,8 +81,6 @@ (defvar eglot-server-programs '((rust-mode . (eglot-rls "rls")) (python-mode . ("pyls")) ((js-mode - js2-mode - rjsx-mode typescript-mode) . ("javascript-typescript-stdio")) (sh-mode . ("bash-language-server" "start")) @@ -635,8 +633,9 @@ be guessed." (project (or (project-current) `(transient . ,default-directory))) (guess (cdr (assoc managed-mode eglot-server-programs (lambda (m1 m2) - (or (eq m1 m2) - (and (listp m1) (memq m2 m1))))))) + (cl-find + m2 (if (listp m1) m1 (list m1)) + :test #'provided-mode-derived-p))))) (guess (if (functionp guess) (funcall guess interactive) guess))