were found in eglot-server-programs, it meant that opening a .cpp file
and a .c file in the same project and enabling eglot for both would
lead to two clangd instances. Now only one instance is created to
handle all buffers of those major modes, as long as they are in the
same project.
This change accomplishes this with minimal changes and NO modification
to the already complicated syntax of eglot-server-programs.
Naturally, this means that a subtle backward-incompatibility was
introduced. If, instead of "clangd", someone is using some kind
"c++-or-c-but-not-both-at-once" server, this commit now breaks that
person's configuration.
After analysing the entries of this variable, an educated guess was
made that this situation is rare. If it's not rare, then some change
to the syntax of eglot-server-programs will have to ensue.
* eglot.el (eglot-server-programs): Update docstring.
(eglot-lsp-server): Replace major-mode -> major-modes.
(eglot--lookup-mode): Rework.
(eglot--guess-contact): Rework.
(eglot--connect): Reword first parameter.
(eglot-reconnect): Use eglot--major-modes.
(eglot--read-server): Rework.
(eglot--ensure-list): New helper.
(eglot-current-server): Rework.
(eglot-handle-request workspace/configuration): Use first of
managed major modes.
* NEWS.md: Mention change.
GitHub-reference: per https://github.com/joaotavora/eglot/issues/681