reddit / emacs

eglot starts multiple clojure-lsp servers

witek_k · 2022-09-20 09:13
When I open the first `.clj` file in my project, eglot starts a server: [eglot] Connected! Server `EGLOT (clj/clojure-mode)' now managing `clojure-mode' buffers in project `clj'. After that, when I open the first `.cljc` file, eglot starts another server: [eglot] Connected! Server `EGLOT (clj/clojurec-mode)' now managing `clojurec-mode' buffers in project `clj'. Any ideas, how to configure eglot to use a single `clojure-lsp` server for all clojure modes (`clojure-mode`, `clojurescript-mode`, `clojurec-mode`,...) when files are opened in the same project?
konrad1977 · 2022-09-20 17:43
I do something like this for swift. I noticed that it was kind of heavy to open a new swift-buffer and after some reading this is what I ended up with. Works good for me. Hope it helps. (remember to remove hook if you have one in use-package, also a nice thing with eglot is to say it to stay-out-of 'company). (with-eval-after-load 'swift-mode (setup-swift-programming)) (defun setup-swift-programming () "My nifty swift setup." (setup-company-swift) (eglot-ensure) ... bunch of other stuff )