From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pengji Zhang Newsgroups: gmane.emacs.bugs Subject: bug#67463: 30.0.50; Eglot may manage js-json-mode buffers with wrong server Date: Wed, 6 Dec 2023 20:32:39 -0500 Message-ID: References: <83fs0k938h.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13829"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 67463@debbugs.gnu.org, Eli Zaretskii To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 07 02:34:10 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 1rB3HG-0003Rs-Ct for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 07 Dec 2023 02:34:10 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rB3Gy-0004gs-0w; Wed, 06 Dec 2023 20:33:52 -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 1rB3Gw-0004gN-9O for bug-gnu-emacs@gnu.org; Wed, 06 Dec 2023 20:33:50 -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 1rB3Gw-0007r2-1g for bug-gnu-emacs@gnu.org; Wed, 06 Dec 2023 20:33:50 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rB3H8-0003Ep-2N for bug-gnu-emacs@gnu.org; Wed, 06 Dec 2023 20:34:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Pengji Zhang Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Dec 2023 01:34: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.170191279112387 (code B ref 67463); Thu, 07 Dec 2023 01:34:02 +0000 Original-Received: (at 67463) by debbugs.gnu.org; 7 Dec 2023 01:33:11 +0000 Original-Received: from localhost ([127.0.0.1]:40737 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rB3GJ-0003Dj-Bs for submit@debbugs.gnu.org; Wed, 06 Dec 2023 20:33:11 -0500 Original-Received: from mail-qv1-xf2a.google.com ([2607:f8b0:4864:20::f2a]:51317) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rB3GH-0003DW-29 for 67463@debbugs.gnu.org; Wed, 06 Dec 2023 20:33:10 -0500 Original-Received: by mail-qv1-xf2a.google.com with SMTP id 6a1803df08f44-67adac40221so2952906d6.2 for <67463@debbugs.gnu.org>; Wed, 06 Dec 2023 17:32:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701912771; x=1702517571; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=cLDUqF7qLhoDuhdL/Phav1pMizH5TC3pK/v4/jUnMok=; b=XqKt+UcmJcHNI67Y2eNxcH2JT0iGV/EZUiymQ6nnifndrcWc64Lb0eY1gfB+plX/2P 6LG3R69Hxy2DCDYm23XMHZhe4wAN59f8uoqYvEpbX8BXk0wq97evT9kj47YKlyWG73Vi X+R5R9j5kvIgZCzFSaQmf4RIf7ykUTz9Doxtwj9HF966xtFDRQhw5tGcvlkaO0fouTdo zm4nD9B3SD97RC/VdeDnXBBGvSz1kzkqLmioOEouCtCOXle5euD5sp6hJqvXDZRC2FiQ JWjiCMbAVOp5WobhYAm1OxE+UqGDDxkshsnXJ7vsFkc5ENx2HUjmq2iK6XvmpPvM4GJW uUOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701912771; x=1702517571; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cLDUqF7qLhoDuhdL/Phav1pMizH5TC3pK/v4/jUnMok=; b=uj3NN9vic7QiIMeWiEpoXEXlP0Qn38MCDsPJiGbl32D/XNRicgtp7Ldp7FTuYsfL5o WdJkMVxX1diNEJKykmCcz8zw5XVnKn3f4wC9zwtTs6MvVGluTtifQ2kRMwSia2om6G2e r8COR9nGZPI8giEU4sAcBv2STTDekslKXwpwIpmmTMXPCtV9P/Ngg1jQGYyMlVpBteDX /xHBvIm/kRXHSdowBN0T94K4zV68f9FprQBKNXFFXRW0m0yXyKgPJHm5S/2K7fJuygP8 paEK7BlrL03yXfqCzEXpFeSvzay+pRhstzuzeEegfTWVSkNRX1gmi18r+s72wlLAPHyB 1J8A== X-Gm-Message-State: AOJu0YwRjQ4t0S189/MeTZwDniNfWyCftEDiiVTgGcQoBnZoQfYxK0tr gKw6yQZ0vs/q7ElbKRNEB3HEyEPpCNb/LlEUsew= X-Google-Smtp-Source: AGHT+IEPTaanZlYEENxm70CGBO1lwd/2znvxA0IxA1LOow+O7GivYTukU3t1d/+l2mFwQPVH78GEcWJKNS18MYFhnio= X-Received: by 2002:a05:6214:5011:b0:66d:28b3:798 with SMTP id jo17-20020a056214501100b0066d28b30798mr2368115qvb.10.1701912771329; Wed, 06 Dec 2023 17:32:51 -0800 (PST) In-Reply-To: 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:275637 Archived-At: Hi Jo=C3=A3o, On Sun, Dec 3, 2023 at 3:51=E2=80=AFPM Jo=C3=A3o T=C3=A1vora 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). Pengji