I observed that `eglot' would happily start dozens of language server
processes, but each one of them only seemed to know about a tiny
fraction of my code. I tracked this down and found a minor bug in
project.el.
In `project-try-vc', when `vc-handled-backends' is nil, the value of
`marker-re' computed here:
https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/progmodes/project.el?id=207901457c018d94b1ce9e13a897d8241b1f3af2#n516
<https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/progmodes/project.el?id=207901457c018d94b1ce9e13a897d8241b1f3af2#n516>
is the empty string.
If no vc backends are enabled, no directory should be treated as a vc
root. But the empty regexp matches everything, so *all* directories are
treated as vc roots.
Consequently, `eglot' spawned a lot of processes, because it starts one
per project.
The workaround is to set `vc-handled-backends' to any other value. (I
suppose I configured it to nil long ago, when working in a huge
Mercurial repository. Back then, commonplace hg commands in that repo
were unreasonably slow.)