]> git.eshelyaron.com Git - emacs.git/commitdiff
Eglot: make better use of :company-docsig
authorJoão Távora <joaotavora@gmail.com>
Tue, 11 Feb 2025 13:59:46 +0000 (13:59 +0000)
committerEshel Yaron <me@eshelyaron.com>
Wed, 12 Feb 2025 10:48:22 +0000 (11:48 +0100)
* lisp/progmodes/eglot.el (eglot-completion-at-point): Make better
use of :company-docsig

(cherry picked from commit 4847168c5b4b015eec0e9feca0ccc3cfdf17e837)

lisp/progmodes/eglot.el

index e3af1862ac8bb3edd0f3c3ade61bd152ad68e4f3..db9c94289a2149377e2bf7fb93ab76590090227e 100644 (file)
@@ -3522,12 +3522,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