mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-24 05:22:04 -08:00
This sweeping fix has been planned for a while, but a user recently hit this bug as described in https://github.com/joaotavora/eglot/discussions/1206. More and more servers today are "multi-language", meaning can handle more than one file type. This relies on the ':languageId' string being set to the correct value for every buffer managed by Eglot (TextDocumentItem in LSP parlance). Previously this string was calculated based on an imperfect heuristic and was wrong quite often. Many servers don't even care but some others do, so we have to fix it. * lisp/progmodes/eglot.el (eglot-lsp-server): Remove slots 'major-modes' and 'language-id'. Add slot 'languages'. (eglot--major-modes, eglot--language-ids): New helpers. (eglot--lookup-mode): Simplify or maybe complicate. (eglot--guess-contact): Use new eglot--looup-mode. Change return value. (eglot): Rework docstring. (eglot-reconnect): Use eglot--language-ids, not id. (eglot--connect): Setup eglot--languages slot in server. (eglot--TextDocumentItem): Finally, get correct language id. * test/lisp/progmodes/eglot-tests.el (eglot--guessing-contact): Enhance macro. (eglot-test-server-programs-guess-lang): Update test. |
||
|---|---|---|
| .. | ||
| c-ts-mode-resources | ||
| cperl-mode-resources | ||
| elisp-mode-resources | ||
| elixir-ts-mode-resources | ||
| flymake-resources | ||
| go-ts-mode-resources | ||
| heex-ts-mode-resources | ||
| java-ts-mode-resources | ||
| js-resources | ||
| project-resources | ||
| ruby-mode-resources | ||
| sh-script-resources | ||
| typescript-ts-mode-resources | ||
| xref-resources | ||
| asm-mode-tests.el | ||
| autoconf-tests.el | ||
| bat-mode-tests.el | ||
| bug-reference-tests.el | ||
| c-ts-mode-tests.el | ||
| cc-mode-tests.el | ||
| compile-tests.el | ||
| cperl-mode-tests.el | ||
| eglot-tests.el | ||
| elisp-mode-tests.el | ||
| elixir-ts-mode-tests.el | ||
| etags-tests.el | ||
| executable-tests.el | ||
| f90-tests.el | ||
| flymake-tests.el | ||
| gdb-mi-tests.el | ||
| glasses-tests.el | ||
| go-ts-mode-tests.el | ||
| grep-tests.el | ||
| heex-ts-mode-tests.el | ||
| hideshow-tests.el | ||
| java-ts-mode-tests.el | ||
| js-tests.el | ||
| octave-tests.el | ||
| opascal-tests.el | ||
| pascal-tests.el | ||
| perl-mode-tests.el | ||
| project-tests.el | ||
| ps-mode-tests.el | ||
| python-tests.el | ||
| ruby-mode-tests.el | ||
| ruby-ts-mode-tests.el | ||
| scheme-tests.el | ||
| sh-script-tests.el | ||
| sql-tests.el | ||
| subword-tests.el | ||
| tcl-tests.el | ||
| typescript-ts-mode-tests.el | ||
| xref-tests.el | ||