GNU bug report logs -
#67463
30.0.50; Eglot may manage js-json-mode buffers with wrong server
Previous Next
Reported by: Pengji Zhang <kunhtkun <at> gmail.com>
Date: Sun, 26 Nov 2023 21:17:02 UTC
Severity: normal
Found in version 30.0.50
Done: Stefan Monnier <monnier <at> iro.umontreal.ca>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> From: Pengji Zhang <kunhtkun <at> 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?
This bug report was last modified 1 year and 125 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.