unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Pengji Zhang" <kunhtkun@gmail.com>,
	"João Távora" <joaotavora@gmail.com>
Cc: 67463@debbugs.gnu.org
Subject: bug#67463: 30.0.50; Eglot may manage js-json-mode buffers with wrong server
Date: Sat, 02 Dec 2023 14:51:42 +0200	[thread overview]
Message-ID: <83fs0k938h.fsf@gnu.org> (raw)
In-Reply-To: <CANOCUiyMd_yi6gFSdVLA9qwZxuqSkcC_ZFHCdHfuPZYwRsR5Sw@mail.gmail.com> (message from Pengji Zhang on Sun, 26 Nov 2023 16:15:54 -0500)

> From: Pengji Zhang <kunhtkun@gmail.com>
> Date: Sun, 26 Nov 2023 16:15:54 -0500
> 
> It seems that buffers in `js-json-mode', the default mode for JSON
> files, could be wrongly managed by JavaScript language servers of Eglot,
> perhaps because:
> 
>   - `js-json-mode' is derived from `js-mode';
>   - Eglot uses `provided-mode-derived-p' to determine whether a buffer
>     should be managed by a server.
> 
> Here is a recipe to reproduce the problem I encountered:
> 
>   1. Install Node.js[0] and NPM[1]. (Sorry, but I could not find an
>      easier way to set up the environment. They may be installable with
>      your system's package manager.)
>   2. mkdir /tmp/repro && cd /tmp/repro
>   3. npm install typescript typescript-language-server (This will install
>      the language server locally in the directory.)
>   4. emacs -Q
>   5. C-x C-f main.js RET
>   6. C-u M-x eglot; enter "npx typescript-language-server --stdio"
>   7. C-x C-f package.json RET (This file is automatically created by
>      `npm install'.)
> 
> I expect that the 'package.json' buffer is not managed by Eglot, but it
> is actually managed by typescript-language-server, which does not really
> understand JSON and is reporting some invalid errors.
> 
> Thanks!
> 
> [0] https://nodejs.org/en
> [1] https://docs.npmjs.com/downloading-and-installing-node-js-and-npm

João, any suggestions?





  reply	other threads:[~2023-12-02 12:51 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 [this message]
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
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

  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=83fs0k938h.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=67463@debbugs.gnu.org \
    --cc=joaotavora@gmail.com \
    --cc=kunhtkun@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 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).