Skip to content

Commit

Permalink
Support autoimporttext from pyright language server
Browse files Browse the repository at this point in the history
* eglot.el (eglot-completion-at-point): show autoImportText via company-docsig.

GitHub-reference: fix joaotavora/eglot#769
  • Loading branch information
fbergroth authored and skangas committed Jan 11, 2022
1 parent fde3892 commit 538bfe2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lisp/progmodes/eglot.el
Original file line number Diff line number Diff line change
Expand Up @@ -2416,6 +2416,13 @@ is not active."
(kind (alist-get (plist-get lsp-item :kind)
eglot--kind-names)))
(intern (downcase kind))))
:company-docsig
;; FIXME: autoImportText is specific to the pyright language server
(lambda (proxy)
(when-let* ((lsp-comp (get-text-property 0 'eglot--lsp-item proxy))
(data (plist-get (funcall resolve-maybe lsp-comp) :data))
(import-text (plist-get data :autoImportText)))
import-text))
:company-doc-buffer
(lambda (proxy)
(let* ((documentation
Expand Down

0 comments on commit 538bfe2

Please sign in to comment.