想新写一个LSP Mode

lsp-mode确实太复杂,不过最近稳定性上好了很多,我日常使用已经不常碰到出错了。

Feel free to report bugs for the bugs you encounter no matter how minor they are. Also suggestions how to simplify it will be much appreciated. @seagle0128 can confirm that development of lsp-mode is very open and democratic.

4 个赞

Yes. I can confirm that the community is open, enthusiastic and democratic, and lsp-mode was improved a lot in recent months. And I’m glad to involve the development of lsp-python-ms, lsp-go and other stuffs. I like this community, and like the ideas as well.

1 个赞

最新的lsp-mode用了一周, go语言+gopls, 依然有卡顿, 而且很明显, 卡顿时大概三四百毫秒才能输入下一个字符. 不是所有的工程都出现, 有的工程出现, 有的不出现, 可能跟用的packages数量有关.

emacs 27即使性能提升50%, 这种情况下依然有一两百毫秒的卡顿.

总之这种单线程架构很难保证不卡顿.

I did some testing of emacs 26 vs emacs 27 performance:

When using emacs 27 it takes 3 seconds to perform 10 calls returning 3mb data. The same thing takes 15 seconds when using emacs 26(older versions of lsp-mode take 30+ seconds). I am not sure how to measure how much time it takes on the server but I guess it is at least 50% of the time. So, the client side handling in emacs 27 is ~1.5 seconds and ~14 seconds for the same in v26. So the speedup is not 50% but ~10 times.

This might be interesting as well: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=38561

1 个赞

Thanks for your testing result. I will try emacs 27 later.

用了一段时间emacs 27, 支持jansson, 比emacs26好不少, 但是依然不流畅, 平时微有卡顿, 偶尔卡顿明显

支持啊,但是感觉好像不会有很大性能提升啊。

我用了一下lsp-mode,就是lsp server内存消耗有点大,5个人做了快3年的javascript项目启动lsp server后消耗1.3G内存。cpu占用很小。我把自动完成代码和file link都关掉了因为company-ctagsfind-file-in-project 功能更强大,性能更好。还没有确定是否要关掉xref,因为我主要用counsel-etags。代码折叠也关掉了,因为我用evil-matchit

目前我对lsp-mode的用户体验还挺满意的。

具体配置见:

2 个赞

是 ts-ls server 占用内存大吧?用 LSP,个人觉得真的不需要 ctags/etags 之类的了。

1 个赞

我两个都用过的,ctags速度快得不是一点点,我写javascript,函数参数类型什么的我写快了的话根本就不关心,

还有这事儿。

ctags可以提供哪些功能?

https://docs.ctags.io/en/latest/

After turnning on the cache in company-lsp, completion is smooth now.

If the cache is turnned off, completion in emacs 27 still lags. But it is better than emacs 26.

With the cache on, completion is also smooth in emacs 26.

Are you talking about (setq company-lsp-cache-candidates 'auto)? Would auto and t make much difference in terms of performance? Which do you choose? Thanks!

I set it to t. And yes, big difference.

1 个赞