]> git.eshelyaron.com Git - emacs.git/commitdiff
eglot-server-programs: Account for new js-json-mode
authorBrian Leung <leungbk@posteo.net>
Tue, 25 Oct 2022 03:43:50 +0000 (20:43 -0700)
committerStefan Kangas <stefankangas@gmail.com>
Tue, 25 Oct 2022 10:13:25 +0000 (12:13 +0200)
js-json-mode derives from js-mode, so this reordering is necessary to
prevent js-mode's eglot server from starting if a user has something
like this in their config:

    (add-to-hook 'js-json-mode #'eglot-ensure)
    (add-to-hook 'js-mode #'eglot-ensure)

* lisp/progmodes/eglot.el (eglot-server-programs): Move the
json-language-server info before the entry for js-mode, and add on
js-json-mode.  (Bug#58769)

lisp/progmodes/eglot.el

index 827a5e984831a6051f8d2838ae337977f1e98a91..9264a5b0f08815a7cbbb4531d4d37727a75af75d 100644 (file)
@@ -186,6 +186,7 @@ chosen (interactively or automatically)."
                                 (python-mode
                                  . ,(eglot-alternatives
                                      '("pylsp" "pyls" ("pyright-langserver" "--stdio") "jedi-language-server")))
+                                ((js-json-mode json-mode) . ,(eglot-alternatives '(("vscode-json-language-server" "--stdio") ("json-languageserver" "--stdio"))))
                                 ((js-mode typescript-mode)
                                  . ("typescript-language-server" "--stdio"))
                                 (sh-mode . ("bash-language-server" "start"))
@@ -227,7 +228,6 @@ language-server/bin/php-language-server.php"))
                                 (zig-mode . ("zls"))
                                 (css-mode . ,(eglot-alternatives '(("vscode-css-language-server" "--stdio") ("css-languageserver" "--stdio"))))
                                 (html-mode . ,(eglot-alternatives '(("vscode-html-language-server" "--stdio") ("html-languageserver" "--stdio"))))
-                                (json-mode . ,(eglot-alternatives '(("vscode-json-language-server" "--stdio") ("json-languageserver" "--stdio"))))
                                 (dockerfile-mode . ("docker-langserver" "--stdio"))
                                 ((clojure-mode clojurescript-mode clojurec-mode)
                                  . ("clojure-lsp"))