From 7b040d4d1866b2be31ca4809b1bbb341921c8f73 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Fri, 1 Jun 2018 17:52:00 +0100 Subject: [PATCH] Fix completionitem/resolve Should fix interoperation with company-quickhelp. * eglot.el (eglot-completion-at-point): Correctly pass properties to completionItem/resolve. --- lisp/progmodes/eglot.el | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index b133ffbbb20..3c842976344 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -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)) -- 2.39.2