lsp 2025-01-29

OMG, I just tried lsp-bridge and it's SO GOOD! SO FAST!

FWIW I went back to Eglot, at least for now. There were too many things I need that I couldn't get to work in lsp-bridge (although I liked the completion and the speed), in particular jumping "find def" that led me into jars. (We have a lot of internal libraries, with no public documentation sites.) The startup speed in particular was amazing though, so I might make another attempt.

πŸ‘ 1

I can't quite tell from the README... is lsp-bridge a replacement for eglot, or an addition to? my bad, it's a replacement πŸ™‚

Yep, it replaces eglot completely. It also has its own completion system so it doesn't require cofru/company/etc

Which I was wondering about at first but now I really like it

I don't have appetite for replacing eglot right now, but thanks to this thread I now know about eglot-booster, which I've just installed... πŸ˜„

How does it work with with other completion-at-point stuff? I am using Eglot + Cider + Cape together, does lsp-bridge auto-suggestion support this?

If, like me, you've been suffering from slow eglot for years: https://github.com/manateelazycat/lsp-bridge

I still need to test https://github.com/blahgeek/emacs-lsp-booster since I'm a lsp-mode user

Yeah that's worth checking out as well

I used emacs-lsp-booster via eglot-booster for a year, but it still locked up my Emacs for 5 seconds after some an hour of hacking

Maybe too early to tell but lsp-bridge seems to have fixed that problem altogether

interesting

Its tagline is "Blazingly fast: Offload LSP request and data analysis to an external process, preventing Emacs from getting stuck due to delays or large data triggering garbage collection"

I was put off before by its requirement of a few python dependencies,, but those are quick to install

this is the one thing i’m really jealous of vim and neovim users about. the lsp story is much smoother

(i also don’t love modern python packaging being a requisite but maybe i’ll have to try)

πŸ‘ 1

yup, I think with lsp-bridge the experience is on par (except for the install-some-python-packages part)

πŸŽ‰ 1

give it a try – it's overall very well done

thanks for highlighting it

the somewhat rambling readme doesn't do it justice

I just noticed it doesn’t support native compilation but it supports other completion systems, nice. Although I am still put off by Python requirement as I would have to probably manage some venv.

I found that I could just use the system python, avoiding venv shenanigans

in macos

/usr/bin/pip3 install epc orjson sexpdata six setuptools paramiko rapidfuzz watchdog packaging

(note that /usr/bin to override what's installed via homebrew)

and then in your emacs config

(setq lsp-bridge-python-command "/usr/bin/python3")

I just discovered that lsp-bridge is in nixpkgs, which should simplify installation a lot for some users (like me!) πŸ™‚

2️⃣ 1

@pesterhazy Nice! And have you tried it with native-comp?

No I'm on 29.4. I think it's a red herring honestly

Clearly eglot and lsp-mode have an incredibly inefficient approach, given how much faster lsp-bridge is

No amount of compilation is going to help with the wrong algorithm

the major problems is emacs json parsing sucks so much, what lsp-bridge and emacs-lsp-booster did was to ask for help of rust and external tricks

That's definitely one of the problems

But I think lsp-bridge does a lot more

C'mon people get over your fear of 🐍

πŸ˜‚ 1

Yeah, I don't have a problem with how they fix it, it's just that I'm used to lsp-mode well tested features, custom integrations with treemacs for some features, I don't feel this big performance issue but I agree is not ideal

πŸ‘ 1

I empathize. I'm just thrilled to be able to type without outrageous input latency again. You can really feel the difference

πŸ‘ 1

I am giving lsp-bridge a spin and I'm blown away by the difference between it and Eglot in terms of responsiveness 😡

Yeah, I'll have to give it a try hehe

(I haven't managed to hook it into xref yet though πŸ˜„ )

It was a drop in replacement for eglot for me, I kept the same shortcuts

πŸ‘ 1

forgot to push

Thanks, but I'm not using evil πŸ˜„ I didn't have anything customised with eglot, except for https://github.com/stig/dotfiles/blob/trunk/emacs/init.el#L460 the default xref bindings "just worked". Guess I'll be looking through lsp-bridge's customise options to see if I can find one that enables that.

just installed on doom-emacs, noticed it doesn't work out of the box for some reason, will check configs

Emacs@30 json parser makes a difference too. There is also https://github.com/zbelial/lspce which is also fast.

🧑 1