]> git.eshelyaron.com Git - emacs.git/commit
Eglot: unbreak activation/management of derived modes (bug#62907)
authorJoão Távora <joaotavora@gmail.com>
Tue, 18 Apr 2023 23:59:17 +0000 (00:59 +0100)
committerJoão Távora <joaotavora@gmail.com>
Tue, 18 Apr 2023 23:59:17 +0000 (00:59 +0100)
commit9093834d0b590bc15ed994bd62f18f7b47a48f55
tree99d53255ef1ed9be40db3fa51508c72c252df559
parent08b480e13facadcd3a6d205d604deeeab4bbedc6
Eglot: unbreak activation/management of derived modes (bug#62907)

After recent changes to how LSP "languageId" is computed from major
modes and stored in the eglot-lsp-server object, the activation of the
'eglot--managed-mode' minor mode in modes _derived_ from some
major-mode mentioned in 'eglot-server-programs' was broken.

This commit restores that by introducing a new helper which uses the
same logic to provide the current-buffer's "languageId" to the server
and to discover if the server should manage the mode at all.  This
ensures the two things stay in sync.

Also, this helper uses the function 'provided-mode-derived-p' to fix
this bug#62907.

* lisp/progmodes/eglot.el (eglot--languageId): New helper.
(eglot-current-server, eglot--TextDocumentItem): Use it.
lisp/progmodes/eglot.el