From 538bfe217297027eb38d131f5232c587e67e0d3a Mon Sep 17 00:00:00 2001 From: Fredrik Bergroth Date: Wed, 15 Dec 2021 13:05:22 +0100 Subject: [PATCH] Support autoimporttext from pyright language server * eglot.el (eglot-completion-at-point): show autoImportText via company-docsig. GitHub-reference: fix https://github.com/joaotavora/eglot/issues/769 --- lisp/progmodes/eglot.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 85220f2cd52..80eb58f5791 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -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