[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#67463: 30.0.50; Eglot may manage js-json-mode buffers with wrong ser
From: |
Eli Zaretskii |
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 |
> 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?
- bug#67463: 30.0.50; Eglot may manage js-json-mode buffers with wrong server,
Eli Zaretskii <=