unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Brian Leung <leungbk@posteo.net>
To: 58769@debbugs.gnu.org
Subject: bug#58769: [PATCH] eglot-server-programs: Account for new modes
Date: Tue, 25 Oct 2022 04:01:09 +0000	[thread overview]
Message-ID: <87k04osgai.fsf@posteo.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 548 bytes --]

Tags: patch





In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo
version 1.16.0, Xaw3d scroll bars)
Repository revision: 8f16578c45fc1d23aacecdb48111f816088c7b83
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12014000
System Description: NixOS 22.11 (Raccoon)

Configured using:
 'configure
 --prefix=/nix/store/044ilan524hm57j9lhz7fqg2nxfga5n7-emacs-git-20221024.0
 --disable-build-details --with-modules --with-x-toolkit=lucid
 --with-xft --with-cairo --with-native-compilation'


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-eglot-server-programs-Account-for-new-js-json-mode.patch --]
[-- Type: text/patch, Size: 2258 bytes --]

From 2365a02ac3fecafcffea2e35b3852835bf0177c9 Mon Sep 17 00:00:00 2001
From: Brian Leung <leungbk@posteo.net>
Date: Mon, 24 Oct 2022 20:43:50 -0700
Subject: [PATCH 1/2] eglot-server-programs: Account for new js-json-mode

* 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.

js-json-mode derives from js-mode, so the reordering is necessary to
prevent js-mode's eglot server from starting if a user has something
like

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

in their config.
---
 lisp/progmodes/eglot.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 71001ba680..9dca05d5f0 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -186,6 +186,7 @@ eglot-server-programs
                                 (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 @@ eglot-server-programs
                                 (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"))
-- 
2.38.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-eglot-server-programs-Account-for-new-ts-mode.patch --]
[-- Type: text/patch, Size: 1423 bytes --]

From b022569c136dc6a23e1b4cfe5e23e94cb05e233e Mon Sep 17 00:00:00 2001
From: Brian Leung <leungbk@posteo.net>
Date: Mon, 24 Oct 2022 20:46:41 -0700
Subject: [PATCH 2/2] eglot-server-programs: Account for new ts-mode

* lisp/progmodes/eglot.el (eglot-server-programs): Add new major mode
to be used with the typescript-language-server.

At the time of writing, this exists only in the unmerged tree-sitter
branch.  It is not harmful to include, however.
---
 lisp/progmodes/eglot.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 9dca05d5f0..54756dd21a 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -187,7 +187,7 @@ eglot-server-programs
                                  . ,(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)
+                                ((js-mode ts-mode typescript-mode)
                                  . ("typescript-language-server" "--stdio"))
                                 (sh-mode . ("bash-language-server" "start"))
                                 ((php-mode phps-mode)
-- 
2.38.0


             reply	other threads:[~2022-10-25  4:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-25  4:01 Brian Leung [this message]
2022-10-25 10:25 ` bug#58769: [PATCH] eglot-server-programs: Account for new modes Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k04osgai.fsf@posteo.net \
    --to=leungbk@posteo.net \
    --cc=58769@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).