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.