Eglot: make better use of :company-docsig

* lisp/progmodes/eglot.el (eglot-completion-at-point): Make better
use of :company-docsig
This commit is contained in:
João Távora 2025-02-11 13:59:46 +00:00
parent 5f9982eded
commit 4847168c5b

View file

@ -3483,12 +3483,13 @@ for which LSP on-type-formatting should be requested."
1)
(eq t (plist-get lsp-item :deprecated)))))
: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 (ensure-resolved lsp-comp) :data))
(import-text (plist-get data :autoImportText)))
import-text))
(let ((detail (plist-get
(ensure-resolved (get-text-property 0 'eglot--lsp-item proxy))
:detail)))
(when (and (stringp detail) (not (string= detail "")))
;; Forces major-mode based fontification
(eglot--format-markup (list :value detail)))))
:company-doc-buffer
(lambda (proxy)
(let* ((resolved