From 0d7575d2c074bd6f5a4efc64084f5279702d131d 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. #769: 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 85220f2cd5..80eb58f579 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