]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix completionitem/resolve
authorJoão Távora <joaotavora@gmail.com>
Fri, 1 Jun 2018 16:52:00 +0000 (17:52 +0100)
committerJoão Távora <joaotavora@gmail.com>
Fri, 1 Jun 2018 16:53:59 +0000 (17:53 +0100)
Should fix interoperation with company-quickhelp.

* eglot.el (eglot-completion-at-point): Correctly pass properties
to completionItem/resolve.

lisp/progmodes/eglot.el

index b133ffbbb2082a8eec7ae8391434f3c2e8f4ca98..3c842976344de1ca06a7acc7c3e956230dc49a12 100644 (file)
@@ -1372,7 +1372,9 @@ DUMMY is ignored"
             (mapcar
              (eglot--lambda (&rest all &key label insertText &allow-other-keys)
                (let ((insert (or insertText label)))
-                 (add-text-properties 0 1 all insert) insert))
+                 (add-text-properties 0 1 all insert)
+                 (put-text-property 0 1 'eglot--lsp-completion all insert)
+                 insert))
              items))))
        :annotation-function
        (lambda (obj)
@@ -1391,13 +1393,15 @@ DUMMY is ignored"
                         (or (get-text-property 0 :sortText b) "")))))
        :company-doc-buffer
        (lambda (obj)
-         (let ((documentation
-                (or (get-text-property 0 :documentation obj)
-                    (and (eglot--server-capable :completionProvider
-                                                :resolveProvider)
-                         (plist-get (eglot--request server :completionItem/resolve
-                                                    (text-properties-at 0 obj))
-                                    :documentation)))))
+         (let* ((documentation
+                 (or (get-text-property 0 :documentation obj)
+                     (and (eglot--server-capable :completionProvider
+                                                 :resolveProvider)
+                          (plist-get
+                           (eglot--request server :completionItem/resolve
+                                           (get-text-property
+                                            0 'eglot--lsp-completion obj))
+                           :documentation)))))
            (when documentation
              (with-current-buffer (get-buffer-create " *eglot doc*")
                (insert (eglot--format-markup documentation))