From d6a326ccc6dd01c80b64e66b36b990bac84e6686 Mon Sep 17 00:00:00 2001 From: Fredrik Bergroth Date: Wed, 15 Dec 2021 13:05:22 +0100 Subject: [PATCH] Fix #769: support autoImportText from pyright language server * eglot.el (eglot-completion-at-point): show autoImportText via company-docsig. --- eglot.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/eglot.el b/eglot.el index d8890209..b3a2f946 100644 --- a/eglot.el +++ b/eglot.el @@ -2394,6 +2394,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