]> git.eshelyaron.com Git - emacs.git/commitdiff
Consider mode derivation when guessing servers
authorJoão Távora <joaotavora@gmail.com>
Mon, 14 Jan 2019 15:31:26 +0000 (15:31 +0000)
committerJoão Távora <joaotavora@gmail.com>
Mon, 14 Jan 2019 15:32:26 +0000 (15:32 +0000)
* 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

index 799ab10fa295a4364822e10ed8055e125d930a51..2d1c3676f224224cb2af037efb343820b2b530fe 100644 (file)
@@ -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))