From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Brian Leung Newsgroups: gmane.emacs.bugs Subject: bug#58769: [PATCH] eglot-server-programs: Account for new modes Date: Tue, 25 Oct 2022 04:01:09 +0000 Message-ID: <87k04osgai.fsf@posteo.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34381"; mail-complaints-to="usenet@ciao.gmane.io" To: 58769@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 25 06:02:40 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1onB9D-0008iw-NG for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 25 Oct 2022 06:02:39 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1onB8i-0001IJ-IJ; Tue, 25 Oct 2022 00:02:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1onB8e-0001Hq-98 for bug-gnu-emacs@gnu.org; Tue, 25 Oct 2022 00:02:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1onB8c-0004O2-Kj for bug-gnu-emacs@gnu.org; Tue, 25 Oct 2022 00:02:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1onB8c-0000TW-5q for bug-gnu-emacs@gnu.org; Tue, 25 Oct 2022 00:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Brian Leung Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Oct 2022 04:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 58769 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16666704861775 (code B ref -1); Tue, 25 Oct 2022 04:02:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 25 Oct 2022 04:01:26 +0000 Original-Received: from localhost ([127.0.0.1]:49979 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1onB81-0000SY-Gb for submit@debbugs.gnu.org; Tue, 25 Oct 2022 00:01:25 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:40810) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1onB7y-0000SP-EG for submit@debbugs.gnu.org; Tue, 25 Oct 2022 00:01:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1onB7x-0000Uk-FH for bug-gnu-emacs@gnu.org; Tue, 25 Oct 2022 00:01:21 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1onB7t-0004LD-Bf for bug-gnu-emacs@gnu.org; Tue, 25 Oct 2022 00:01:20 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 8C2A2240028 for ; Tue, 25 Oct 2022 06:01:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1666670473; bh=wvCl9w/eDjpKaiR4MDWSqtBinkHgnMQHsdFJvBylyyc=; h=From:To:Subject:Date:From; b=QFB0mMbL9fzZpsNtVQSZdQPBFtEtD7zRhIegBwQB3KKwGqpGTJtUsxGb1kPRiY11Y /nHaWc3eyiukDMVD5HbSp5zg3z4n8h/7Ik4mwbbK+SAR8W77jekNVMWs1RMf0PvpzT qFVMXdtQYkY3N7Ky936or0R2Dhv4R5wPX4CpBkLVOAKBp0158GW/KR5kMzfLE2jOx9 yZHsNcOua7x5Y3t8kXNd1d4N6561s8KT8VHt483DniX9SgxBecFho5nPa8Ef8VzcC8 zEV+v/sngYOw1DV7rKhcZYZxTYEgnwDUO7xU92kajVKlKvdqQzSVB2yrLjPNboCDZO aPWmVHxy5Lmew== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MxJCC4RLBz6tmK for ; Tue, 25 Oct 2022 06:01:11 +0200 (CEST) Received-SPF: pass client-ip=185.67.36.65; envelope-from=leungbk@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246129 Archived-At: --=-=-= Content-Type: text/plain 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' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-eglot-server-programs-Account-for-new-js-json-mode.patch >From 2365a02ac3fecafcffea2e35b3852835bf0177c9 Mon Sep 17 00:00:00 2001 From: Brian Leung 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 --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0002-eglot-server-programs-Account-for-new-ts-mode.patch >From b022569c136dc6a23e1b4cfe5e23e94cb05e233e Mon Sep 17 00:00:00 2001 From: Brian Leung 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 --=-=-=--