aboutsummaryrefslogtreecommitdiffstats
path: root/exec/exec.c
diff options
context:
space:
mode:
authorJoão Távora2023-04-13 10:01:27 +0100
committerJoão Távora2023-04-13 17:42:37 +0100
commita74403adda0d67b6f0430d1c038a7c96579f3450 (patch)
tree66cba4c42ba2c57b0054eff4670cf4208417973e /exec/exec.c
parentd45f450cff757ed520a7ee36c632ab62387c7bc9 (diff)
downloademacs-a74403adda0d67b6f0430d1c038a7c96579f3450.tar.gz
emacs-a74403adda0d67b6f0430d1c038a7c96579f3450.zip
Eglot: fix LSP "languageId" detection
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.
Diffstat (limited to 'exec/exec.c')
0 files changed, 0 insertions, 0 deletions