4 ms·
LSP-mode has really reinvigorated emacs, at least for me. With flycheck and a language server it's magical. Writing go, it even auto-formats your code and auto
by na85 5y ago
LSP-mode has really reinvigorated emacs, at least for me. With flycheck and a language server it's magical.
Writing go, it even auto-formats your code and auto-adds imports.
- lliamander 5y agoI've struggled a bit with LSP mode (at least for Elixir). I find it hard to use as a full-time IDE replacement, especially since IntelliJ has such good emacs keybindings. However, as a general text editor, emacs is still great. And I enjoy org-mode.
- ashton314 5y agoI write lots of Elixir at my day job. What’s been tricky for you setting up LSP mode?
- pdimitar 5y agoFor me it's not tricky, even on Spacemacs (where configuring modes is a bit more arcane but once you learn it it's happily easy), it's more like it's laggy. :(
- dpbriggs 5y agoI would recommend checking out the emacs native-comp feature. It may not entirely solve the lag, but in my experience it helps a lot.
- disgruntledphd2 5y agoEven if you don't run native-comp, use m-x lsp-doctor and do everything else it recommends. I did this a while back and haven't had many lsp problems since.
- lliamander 5y agoOne thing that isn't working for me is finding all the places in a project where a symbol is used.
- natrys 5y agoDoes IntelliJ support Elixir? I am writing Elixir now so would like to know that. However, I haven't encountered any problem while using elixir-ls with eglot (Emacs). For performance, I can recommend enabling native-comp. It's now merged into master which I recompile every month or so, it's pretty stable despite being git HEAD.
- Wonnk13 5y ago100% this. I learned Emacs in college for LaTeX and R (pre RStudio). I used it off and on for years after college to be a contrarian if I'm being honest. With LSP and the various client implementations I'm legitimately more productive in Emacs writing Python, Go, or Rust than whatever flavor of the month IDE thingamajig. Magit and Org are the cherry on top of the sundae. That said I don't push my beliefs on anyone in my team and I try to learn JetBrains products to make pair programming easier for folks that don't use Emacs.
- tptacek 5y agoJust for what it's worth, `goimports` has done this for many years: https://pkg.go.dev/golang.org/x/tools/cmd/goimports https://pkg.go.dev/golang.org/x/tools/cmd/goimports It's how Emacs handled inputs before there was lsp-mode, and presumably is easy to link into other editors too (it's just an implementation of gofmt that manages imports). I agree: it's an extremely nice feature to have.
- na85 5y agoAh, well, I only picked up go very recently so I have no experience writing go outside of the emacs+lsp environment.
- tptacek 5y agoDon't let me sound like I'm talking down lsp-mode, even though I have never gotten it to work reliably (railwaycat, Go, and Rust, and lots of TRAMP). lsp-mode is neat.
- na85 5y agoI use the railwaycat fork also, and it works fine for me writing go. I don't enjoy rust so I've never tried. If you're interested, my emacs config is here: https://github.com/nathanvy/dotemacs/blob/master/init.org https://github.com/nathanvy/dotemacs/blob/master/init.org
- truncate 5y agoBefore LSP, it was always annoying getting things setup. You want to get serious with a new language, spend a day configuring Emacs first. Or, fix your 3 year old config. Now it all pretty much just works! With native-comp its even better. Plus I'm using lot of modern features that I never did earlier, eg. renaming, automatically remove imports, see the inferred type in minibuffer. Flycheck still makes it a bit slow. I think, one big missing piece is lack of multiple threads, which often makes few things a bit laggy. For example, if I'm reading a big C++ source code with indentation guides[1], even with native-comp it can lag a bit. [1] https://github.com/DarthFennec/highlight-indent-guides https://github.com/DarthFennec/highlight-indent-guides
- weavie 5y agoHow are you finding the performance of LSP? I dropped Emacs for NeoVim because Emacs would frequently lockup for a second or more due to LSP. NeoVim doesn't have this problem. I would love to return to Emacs someday.
- cle 5y agoI don't experience any performance problems with lsp-mode, it is very snappy and never gets in my way of going from thought->code. In particular, Go's LSP support is excellent and very fast. I've found these days that the LSP perf is up to the LSP implementation, not Emacs.
- weavie 5y agoInteresting. I'm using Rust on a fairly large project. I guess that takes a hefty chunk of processor time to work with, which causes Emacs to lock up and NeoVim not to..
- na85 5y agoI only use some of the more mature ecosystems (C#, Microsoft's Python language server, golang, etc) but I've always found the performance to be good.
- natrys 5y agoFrom 27.1 Emacs could be configured to use a native library (jansson) for json parsing, it helped LSP a lot. And now there is a new native-comp feature, where you can AoT compile elisp bytecode to native code with libgccjit, which improves Emacs performance in general. Anecdotally, a few months ago I wrote some Flutter on a potato laptop, NeoVim native LSP client + nvim-compe was borderline unusable. The vim-lsc somehow fared much better - albeit still choppy - even though it's written in vimscript. Emacs + eglot is the only combination that was smooth.