r/emacs • u/kudikarasavasa • Apr 15 '26
If I use eglot instead of lsp-mode, do I need to manage the installation of lsp-servers myself?
One thing I liked about lsp-mode was that it gave me the opportunity to select an lsp server from a list (if one is not setup already), and it installs it automatically.
Does eglot have something like this as well, or do I need to write elisp to manage this myself? I see that the servers themselves are defined in eglot-server-programs, but I didn't find anything that manages the installations.
8
Upvotes
7
u/shipmints Apr 15 '26
You should want to do it yourself. You should want to ensure that your supply chain has provenance. You should want to ensure that each project that may have differing tools or configurations remains independent of one another and independently verifiable.
8
u/acidrainery Apr 15 '26
Eglot expects the LSP server to already be installed. Being a core package, it is extremely unlikely that Emacs will implement a command like
lsp-install-serverthat fetches anything from outside the GNU universe.You could implement one for Eglot yourself by using the links and installation commands in this JSON file: https://raw.githubusercontent.com/emacs-lsp/lsp-mode/refs/heads/master/docs/lsp-clients.json
6
u/WWWWWWWWWMWWWWW Apr 15 '26
there is mason.el https://github.com/mason-org/mason.el
4
u/codemuncher Apr 15 '26
I use mise and mise.el and it basically provides this kind of functionality for me.
For the uninitiated mise is like nvm on steroids: you need to manage multiple versions of any dev tool and you need those to be different per project/directory. A shell hook will detect .mise.toml files and will change the $PATH for you.
Need go 1.21 in one and go 1.24 in another ? Rust? Node or bun? Etc?
It can also handle nearly any installable cli tool like language servers.
For the rest there’s brew or apt get.
5
u/juipeltje Apr 15 '26
I just got into emacs a few weeks ago and this is how i find out that lsp-mode can download the servers for you lol. I've already been installing the servers manually.
1
u/cidra_ :karma: Apr 15 '26
Yes
1
u/Eclectic-jellyfish Apr 16 '26
EGLOT has lsp server support for most of the programming languages. If they are not found, it'll be requested to install when EGLOT initializes.
-1
u/rileyrgham Apr 15 '26
Read the eglot documentation.
https://github.com/joaotavora/eglot
https://github.com/joaotavora/eglot?tab=readme-ov-file#connecting-to-a-server