python language server 补全很慢?

下午试了下把 python layer backend 换成 lsp,发现补全特别慢,有时还没有,以及偶尔会出现下面的问题,是我的姿势不对么。

LSP :: jedi.api.environment.InvalidPythonEnvironment: Could not get version information for '/usr/local/opt/python/bin/python3.7': OSError(24, 'Too many open files') [24 times]

System Info :computer:

  • OS: darwin
  • Emacs: 26.1.92
  • Spacemacs: 0.300.0
  • Spacemacs branch: develop (rev. b28f1a2ab)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
(lsp
 (python :variables python-backend 'anaconda python-pipenv-activate t python-enable-yapf-format-on-save t python-sort-imports-on-save t))

我也感觉这个很慢,不知道是什么原因。 profile-report 之后发现好像是什么 time-event 之类的耗时最多,进去发现是 which-key 耗时最多。可是不用 lsp 的时候就没有问题。

好几次尝试 lsp 感觉都用不起来。:sob:

虽然也挺想用 LSP 的。

我是转用了M$的language server就流畅了

是嘛,那我也去试试 M¥ 的 Language Server :full_moon_with_face:

怎么专用 m s 的 Language Server

供参考 readme有build guide

其实client都有大佬写好了 直接用就行了

(use-package lsp-python-ms)

最近好点了,之前感觉有 Bug,现在还算可以用了

好好,多谢,我试试看。

大家有没有试过lsp python结合tramp?lsp的git网页上说可以通过:remote ?来实现,但是我没有成功(一个月前的尝试),你们呢

1 个赞