reddit / emacs
lsp-mode vs eglot
nieuweyork · 2022-03-28 20:05
I used LSP mode last week, and I'm using eglot this week.
My impression so far is that LSP-mode enables way more stuff (like things popping up on my screen), and eglot focuses on integrating the language server into some common emacs automagic packages.
How did you choose between the two?
(I'm using golang, and LSP mode didn't work for me over tramp. Edit: Eglot also doesn't work over tramp for me)
holgerschurig · 2022-03-28 20:32
I started with lsp-mode. Too much popped up, so I disabled most. Then I had some weird errors.
I installed eglot, not much popped up ...actually only things I had in lsp. And it worked out of the box. No customization needed. And so I am now happy with ~~lsp~~ eglot.
EDIT: fixed it
wargxs · 2022-03-28 22:13
Started with eglot then tried lsp-mode which is somewhat different from eglot … so I stayed with eglot. Probably both are awesome!
StrangeAstronomer · 2022-03-28 22:55
>And so I am now happy with lsp.
I'm confused - have you ended up with eglot or lsp?
aaronemassey · 2022-03-29 02:14
My preference is eglot, it's incredibly easy to use and I get what I want.
404cn · 2022-03-29 02:23
eglot
discursive_moth · 2022-03-29 02:28
There's a lot from lsp-mode and lsp-ui that I miss with eglot, but lsp-mode was hanging when starting in a container via tramp, while eglot simply worked without any problems..
J-ky · 2022-03-29 04:27
I started with lsp-mode. It was much more popular. But it was constantly disconnecting and restarting the server. And I could not get sourcekitlsp to work.
So I switch to eglot, it was much simpler. Most of the extra functions provided by lsp-mode was not necessary to me.
I just want auto-completion and error checking.
super-linux-nerd · 2022-03-29 04:43
Eglot "just works" and stays out of the way. It is extremely well integrated.
Horrih · 2022-03-29 06:39
For me it's simple : i wanted to be able to debug programs from emacs, and afik there is only one relevant DAP implémentation, dap-mode, Which sadly only works with lsp.
Another aspect : eglot does not want to deal with LSP extensions, I am not sure how relevant this is but some language specific features might not work.
Otherwise if you want a simple light weight experience eglot is great.
holgerschurig · 2022-03-29 07:34
You are right, I was not concentrated. I fixed it now.
ispinfx · 2022-03-29 07:38
If `lsp-ui` could work with `flymake`, I prefer `eglot`.
StrangeAstronomer · 2022-03-29 07:51
Makes sense now. Perhaps I too will try eglot.
shintak · 2022-03-29 07:58
LS I'm using uses lens feature which eglot doesn't support so I'm using lsp-mode. Once eglot supports lens, I'll try eglot again.
frozeninfate · 2022-03-29 08:29
I tried lsp-mode but couldnt get it working the way I wanted. It had too much junk i didnt want, required a mess of config to disable it all, and was overcomplicated compared to the neovim lsp I had come from.
I then tried eglot and it was almost perfect out of the box. Only had to disable company integration.
[deleted] · 2022-03-29 09:46
> Another aspect : eglot does not want to deal with LSP extensions, I am not sure how relevant this is but some language specific features might not work.
Could you elaborate on that? What are examples of LSP extensions?
polaris64 · 2022-03-29 11:14
I've been wanting to give Eglot a try too but I really like dap-mode and don't want to lose it. Do you know if there are any plans on allowing dap-mode to work with Eglot?
Horrih · 2022-03-29 12:37
Seems like too much work and the issue has been closed and not reopened since 2018 sadly. It looks like it won't be happening any time soon.
https://github.com/emacs-lsp/dap-mode/issues/2
Horrih · 2022-03-29 12:43
This package for example seems to want to cover some of them to give you some examples : [https://github.com/nemethf/eglot-x](https://github.com/nemethf/eglot-x)
They seem mostly language specific, personally I don't mind but you may encounter features you really like on VSCode which have no equivalent on eglot (or LSP)
polaris64 · 2022-03-29 13:14
Yes, I was looking through dap-mode's source too and it appears to be very closely tied to lsp-mode (which is understandable of course considering it's part of lsp-mode), so I think getting it to work with Eglot would be quite a lot of work.
I was reminded however of [RealGUD](https://github.com/realgud/realgud) so I'm currently trying that to see if it could be a viable replacement for dap-mode. Not quite the same of course, but if I can use it to debug in a relatively consistent manner in different languages then that's all I really need.
paretoOptimalDev · 2022-03-29 13:57
I wanted to try using eglot in hopes it made orderless and consult integration easier than lsp-mode, but it looks like it doesn't:
https://github.com/joaotavora/eglot/discussions/726
Nevertheless I tried it for the haskell lsp server and it:
1) seemed to "die" more often
2) had no way to restart the lsp session except restarting emacs I could find
So for now I use lsp-mode, but will try eglot again when I try to use "closer to emacs" packages again.
mdbergmann · 2022-03-29 14:40
I'm using eglot, more or less because lsp-mode didn't work for me for some reason. Once it was enabled it did freeze.
But eglot is ok. It's a single file approach vs. modules on lsp-mode, also for server integrations.
tadfisher · 2022-03-29 16:56
This is the ideal solution IMO. Eglot aims to be a lightweight core that is easy to upstream into Emacs or host on ELPA, and language extensions are best handled by language-specific packages.
Thanks for pointing out this package, though, I'm going to try it out!
paretoOptimalDev · 2022-03-29 18:56
That wasn't my experience, but your and others comments are motivating me to try again.
sebhoagie · 2022-03-30 02:45
I reca, from the docs, that it does.
Although I don't use almost anything out of lsp-ui myself.
Ghosty141 · 2022-04-01 14:33
I mean, try both. I personally prefer lsp-mode, for me it seemed more feature complete and you can still enable only the parts you want so it doesn't feel "bloated"
JDRiverRun · 2022-04-04 02:09
That got fixed. Eglot works well with corfu and orderless in-buffer.