5 comments

[ 203 ms ] story [ 1024 ms ] thread
I saw that LSP Mode has been posted a couple of time without ever getting more than a few points[1]. I think it deserves much more attention as it can be a game changer in Emacs user workflows. I just tried it with Typescript and it's incredible the speed at which it runs and the ease of setup.

The language server protocol is a way to implement one server for a particular language and many text editors can use it to add code suggestion, completion, type checking, warnings, etc. Having this supported in Emacs allows us to have many important features which were previously only straightforward when using VS Code.

[1] https://hn.algolia.com/?dateRange=all&page=0&prefix=false&qu...

lsp mode is great, but i prefer eglot. both are definitely worth looking into
Ok, I must have been living under a rock. I'm quite overwhelmed that there are 2 implementations of LSP for emacs. That's fantastic!

Why do you say you prefer eglot over lsp-mode?

I am not the person you asked, but I also use both lsp-mode and eglot and prefer eglot overall by a very small margin.

The main reason I prefer eglot is because it's much more integrated with emacs and in general a lot less complicated. An example, is eglot shows markdown formatted doc strings in the minibuffer with eldoc rather than opening a webkit based child frame like lsp-mode/lsp-ui does. It also uses the built in flymake package for displaying errors on the fly rather than flycheck (though lsp-mode can use flymake as well).

With this being said, lsp-mode is also a very nice package, and in some ways better than eglot. You could even consider the previous points advantages depending on what type of software you prefer. An example of lsp-mode using non-native packages/features in an advantageous way is it's integration with projectile. I've had many issues with eglot not being able to accurately determine the project's root due to limitations in emacs native project.el, with projectile you can just drop a ".projectile" file in the project root and it detects this automatically.

Overall they are very different packages, even though they are both lsp clients. It's really impossible to say that one is objectively better than the other, and I would recommend trying both out yourself to see which you prefer

i am unable to use lsp for javascript it freezes out my computer(may be i am on underpowerd machine). I mostly get by using ripgrep and dabbrev. I wonder if there is catgs based solution for languages other than c/c++ . I used to have global gtags and it was fast even on large codebases probably because no json marshal/unmarshal.