关于用 language server protocol 来对 Python 进行补全的体验。

请问eldoc怎么关啊,lsp-ui-doc.el里只看见enable的函数,没看见disable的函数。eldoc-mode disable了也不行。

我就是直接在buffer里(eldoc-mode)的…可能可以加个hook?

我就是直接在buffer里(eldoc-mode),然后显示了eldoc-mode disabled。但是minibuffer还是会弹出来

试试这个 最好重启一下emacs

  (defun lsp-ui-doc--make-frame ()
    "Create the child frame and return it."
    (lsp-ui-doc--delete-frame)
    (let* ((after-make-frame-functions nil)
           (before-make-frame-hook nil)
           (name-buffer (lsp-ui-doc--make-buffer-name))
           (buffer (get-buffer name-buffer))
           (params (append lsp-ui-doc-frame-parameters
                           `(
                             ;; (default-minibuffer-frame . ,(selected-frame))
                             ;; (minibuffer . ,(minibuffer-window))
                             (background-color . ,(doom-blend 'blue 'bg 0.1)))))
           (window (display-buffer-in-child-frame
                    buffer
                    `((child-frame-parameters . ,params))))
           (frame (window-frame window)))
      (set-frame-parameter nil 'lsp-ui-doc-buffer buffer)
      (set-window-dedicated-p window t)
      ;; (redirect-frame-focus frame (frame-parent frame))
      (set-face-background 'internal-border lsp-ui-doc-border frame)
      (run-hook-with-args 'lsp-ui-doc-frame-hook frame window)
      frame))
1 个赞

刚才试了试感觉完全没作用啊 也没错误

系统 & emacs版本?

mac os 10.13, emacs26, lsp-mode啥的也装上了,难道还需要自己启动lsp server ? 一头雾水中。。

(lsp-python-enable)开了吗?

参考下我的配置?

就是参照你的弄的,等有空了再搞搞

装pyls了吗

找到问题了

  (setq lsp-enable-eldoc nil)

才能彻底禁止eldoc

1 个赞

还是不大好用,不够稳定,速度也有待优化。lsp-ui 有惊喜,不过稳定性欠缺,chile-frame还不成熟。

python的lsp性能不怎么样,和同为lsp的cquery体验差太远。

company,elpy,jedi……写python足够了
其他定制的feature,可以组合importmagic,isort……等等

這說得我很開心 :smile:

spacemacs 收+tools/lsp 的速度…… https://github.com/syl20bnr/spacemacs/pull/10211

另外, textDocument/references 有個 includeDeclaration 選項 Add include-declaration to lsp--make-reference-params by MaskRay · Pull Request #260 · emacs-lsp/lsp-mode · GitHub 但 lsp-ui-peek-find-references 現在是 false。不知道 pyls 上會有什麼差別

python补全最佳(至少个人认为,没用过lsp)不是jedi么

个人目前还是选择anaconda,稳定且快速。

您好,能麻烦您具体讲一下关于 lsp-python + virtualenv 的问题吗?发现用 lsp-python 后 virtualenv 里的库跳转不过去,比较影响使用,谢谢您

一个微软的工程师开源了 lsp-intellij: GitHub - Ruin0x11/intellij-lsp-server: Exposes IntelliJ IDEA features through the Language Server Protocol.

前几天试了一下,虽然还有些问题,但是基本可用

1 个赞

python的lsp有集成jedi的,可以说jedi的优点 lsp也有

1 个赞