From 5292c4b6f01c2ac680eb5a032100486ce6047412 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Mon, 14 Jan 2019 15:31:26 +0000 Subject: [PATCH] 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 --- lisp/progmodes/eglot.el | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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)) -- 2.39.2