reddit / emacs

Is lsp volar extremely slow or is it just me?

mandatorylamp · 2022-12-14 02:56
I've been trying to use volar with some nuxt3 projects and having major issues with cpu usage spiking out of control, even with most of the fancy lsp-mode features disabled. Just typing and navigating vue files is causing freezes of several seconds. It's completely unusable to the point where I'm just giving up on lsp in vue for now so I can get some work done. LSP mode is fine otherwise in plain typescript files. Has anyone had the same experience? Not looking for solutions neccassirily, just wondering if it's worth it for me to debug further, whether it's even possible to have a pleasant experience with volar right now.
hrtkmztn · 2022-12-14 05:55
I'm facing the same problem. When I edit a Vue file using typescript with volar as the server in a Nuxt project, at some point the input gets completely stuck (cursor not responding at all). I thought it might be an LSP-mode problem, so I changed it to Eglot, but it didn't improve. Yesterday, I found this comment and set it up. [https://github.com/joaotavora/eglot/discussions/993#discussioncomment-3110688](https://github.com/joaotavora/eglot/discussions/993#discussioncomment-3110688) Completion will be a bit delayed, but so far I'm satisfied.
mandatorylamp · 2022-12-14 06:31
Yeah same thing. Everything gets stuck constantly, all I do is hammer `C-g`. I'll try tweaking the delays. As long as I can type without everything locking up I can live with less than instant completions. Unfortunate though since plain ts lsp feels quite snappy, even with nuxt (with volar takeover mode disabled).
yyoncho · 2022-12-14 08:35
Sounds like the issue is caused by IO and there is nothing `lsp-mode` can do with vanilla Emacs. Most likely the issue will go away when using LSP Emacs: https://github.com/emacs-lsp/emacs
yyoncho · 2022-12-14 08:39
lsp-mode is async, but sending the messages is not. If the server is busy and not reading the input messages then lsp-mode will block. The only way ATM to avoid the issue is to use https://github.com/emacs-lsp/emacs .
[deleted] · 2022-12-14 12:23
[deleted]
mandatorylamp · 2022-12-14 14:58
I tried this briefly, it helps to some extent but still not getting a good experience with volar. Not really sure what's happening, but seems the lsp requests just pile up until they take forever to respond. Have to do look into this more thoroughly when I have time. Thinking maybe it's an issue with volar combined with nuxt, cause nuxt is constantly generating code files while editing. I haven't had such dramatic performance issues with other lsp servers, and things like elpy which is not lsp but uses its own RPC setup is very snappy even in large projects.
mandatorylamp · 2022-12-14 14:59
This sounds promising. Thanks!
ManateeLazyCat · 2022-12-14 15:15
lsp-bridge support volar, it can provie completion speed as fast as VSCode, and it never block Emacs. Use lsp-bridge, you don't need change Emacs source code, all Emacs above 28.2 can works out of box. https://github.com/manateelazycat/lsp-bridge