This gist is for anyone who's trying to use emacs + eglot + monorepo (with Clojure or any other language).
When you open a file in a buffer, eglot needs to determine the scope or folder to run the language server in.
By default, the folder eglot will pick as the assumed project root is the repo root (the ancestory directory containing .git
).
But in a monorepo, that's rarely what you want.
In a large repo, analyzing all the *.clj
files with clojure-lsp could take a minute or longer.
As a limiting case, imagine Google with its gargantuan monorepo. Analyzing all the source files would
take an indefinite period of time.