From: Pengji Zhang <kunhtkun@gmail.com>
To: "João Távora" <joaotavora@gmail.com>
Cc: 67463@debbugs.gnu.org, Eli Zaretskii <eliz@gnu.org>
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 [thread overview]
Message-ID: <CANOCUix03PiubZHwDuHb0cJjXBw-4MJsov1=-9LVFMzvcq=qhQ@mail.gmail.com> (raw)
In-Reply-To: <CALDnm50AptZ7gh-642oZemA9H7ejVwGcvUJi81u2JOORo1tGWg@mail.gmail.com>
Hi João,
On Sun, Dec 3, 2023 at 3:51 PM João Távora <joaotavora@gmail.com> 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
next prev parent reply other threads:[~2023-12-07 1:32 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-26 21:15 bug#67463: 30.0.50; Eglot may manage js-json-mode buffers with wrong server Pengji Zhang
2023-12-02 12:51 ` Eli Zaretskii
2023-12-03 18:14 ` João Távora
2023-12-03 20:51 ` João Távora
2023-12-07 1:32 ` Pengji Zhang [this message]
2023-12-16 9:30 ` Eli Zaretskii
2023-12-16 12:01 ` João Távora
2024-01-06 16:01 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-06 18:04 ` Dmitry Gutov
2024-01-07 1:57 ` João Távora
2024-01-07 5:20 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-08 0:20 ` João Távora
2024-01-08 3:21 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-15 3:17 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CANOCUix03PiubZHwDuHb0cJjXBw-4MJsov1=-9LVFMzvcq=qhQ@mail.gmail.com' \
--to=kunhtkun@gmail.com \
--cc=67463@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=joaotavora@gmail.com \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.