From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#67463: 30.0.50; Eglot may manage js-json-mode buffers with wrong server Date: Sat, 16 Dec 2023 11:30:27 +0200 Message-ID: <834jgio5os.fsf@gnu.org> References: <83fs0k938h.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7725"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 67463@debbugs.gnu.org, joaotavora@gmail.com To: Pengji Zhang Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 16 10:31:29 2023 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 1rER17-0001sB-8y for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 16 Dec 2023 10:31:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rER0h-0004QN-QL; Sat, 16 Dec 2023 04:31:03 -0500 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 1rER0g-0004QA-Lh for bug-gnu-emacs@gnu.org; Sat, 16 Dec 2023 04:31:02 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rER0g-0003Bi-Al for bug-gnu-emacs@gnu.org; Sat, 16 Dec 2023 04:31:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rER0g-0000d6-E5 for bug-gnu-emacs@gnu.org; Sat, 16 Dec 2023 04:31:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Dec 2023 09:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67463 X-GNU-PR-Package: emacs Original-Received: via spool by 67463-submit@debbugs.gnu.org id=B67463.17027190561816 (code B ref 67463); Sat, 16 Dec 2023 09:31:02 +0000 Original-Received: (at 67463) by debbugs.gnu.org; 16 Dec 2023 09:30:56 +0000 Original-Received: from localhost ([127.0.0.1]:53955 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rER0a-0000SE-2G for submit@debbugs.gnu.org; Sat, 16 Dec 2023 04:30:56 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51088) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rER0X-0000CT-VP for 67463@debbugs.gnu.org; Sat, 16 Dec 2023 04:30:54 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rER0R-00022y-Mf; Sat, 16 Dec 2023 04:30:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=qTwiA1oDOE7Qtg7ddlD7eO6bRqChDyjRmGKkupqvCq4=; b=mXySfHSPD8A3K/U2kKyB b1ul3jxn6qDuqqu3zzRZqXASMZyCgQ/1Ne7r2XP5HynrM5gW+RY3f+0gUnnLyvs8cgob7Z5PebzJ0 7Nf4sXw7IwE4S+8jmMhCRwvy7LTpr0ZDP64dODxYOJF1RWOu2q9PxDmWlhp2r+gBy1InEy7aPh2k3 8LeDE37Hu7F5L16TG0YKQqdrjxbS8pSY/+hrtVsxDyCoAwET5GvUw1RrhuFg0jQwskFvrbKwzi6bT 2NN9rl0zThxGwbnhuJCe7eqZBP3PVwZQkD0mG0p+PoTdmuikPufMdMzujOSBFNo6s5Av+kCfHF1BW j3olIEAOHnZoOQ==; In-Reply-To: (message from Pengji Zhang on Wed, 6 Dec 2023 20:32:39 -0500) 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:276302 Archived-At: > From: Pengji Zhang > Date: Wed, 6 Dec 2023 20:32:39 -0500 > Cc: 67463@debbugs.gnu.org, Eli Zaretskii > > Hi João, > > On Sun, Dec 3, 2023 at 3:51 PM João Távora wrote: > > > > Nope this doesn't work. Even the slightly more involved patch after > > my sig doesn't work, and it correctly reports the :languageId as "json" > > > > So I think the best courses of action are 3 and 4, in that order. > > > > I also think option 3 could be the best. JSON is indeed a subset of > JavaScript but that does not mean valid JSON files are also valid > JavaScript files. For instance, a bare object literal '{"a": 10}' is > not accepted by perhaps all JavaScript runtimes because it is parsed > as a block of statements. That is also why we get those invalid errors > in the example. > > > Another workaround is to first start M-x eglot in some json file > > in your project. If you have one of: > > > > . ,(eglot-alternatives '(("vscode-json-language-server" "--stdio") > > ("vscode-json-languageserver" "--stdio") > > ("json-languageserver" "--stdio")))) > > > > installed, then these json-specific servers should start to manage > > js-json-mode files in your project. If afterwards you start M-x > > eglot in a plain js file, that server won't be (erroneously) used > > to manage JSON files. > > > > Thanks! This workaround indeed works, even though it is a bit tedious > (and I honestly do not quite need a language server for JSON). So should we now close this bug? Or is there something left to do here?