emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/eglot e8b9cbf 16/22: Slightly simplify eglot-completion


From: João Távora
Subject: [elpa] externals/eglot e8b9cbf 16/22: Slightly simplify eglot-completion-at-point
Date: Sat, 5 Jan 2019 09:31:04 -0500 (EST)

branch: externals/eglot
commit e8b9cbf617e78daae4656cfa20d8a7c3db32eb33
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>

    Slightly simplify eglot-completion-at-point
    
    * eglot.el (eglot-completion-at-point): Don't propertize
    completion string with all LSP properties.
---
 eglot.el | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/eglot.el b/eglot.el
index d60fc07..a335f16 100644
--- a/eglot.el
+++ b/eglot.el
@@ -1844,7 +1844,6 @@ is not active."
                                    (string-trim-left label))
                                   (t
                                    (or insertText (string-trim-left label))))))
-                       (add-text-properties 0 1 all completion)
                        (put-text-property 0 1 'eglot--lsp-completion all 
completion)
                        completion))
                    items)))))
@@ -1869,15 +1868,15 @@ is not active."
        :company-doc-buffer
        (lambda (obj)
          (let* ((documentation
-                 (or (get-text-property 0 :documentation obj)
-                     (and (eglot--server-capable :completionProvider
-                                                 :resolveProvider)
-                          (plist-get
-                           (jsonrpc-request server :completionItem/resolve
-                                            (get-text-property
-                                             0 'eglot--lsp-completion obj)
-                                            :cancel-on-input t)
-                           :documentation))))
+                 (let ((lsp-comp
+                        (get-text-property 0 'eglot--lsp-completion obj)))
+                   (or (plist-get lsp-comp :documentation)
+                       (and (eglot--server-capable :completionProvider
+                                                   :resolveProvider)
+                            (plist-get
+                             (jsonrpc-request server :completionItem/resolve
+                                              lsp-comp :cancel-on-input t)
+                             :documentation)))))
                 (formatted (and documentation
                                 (eglot--format-markup documentation))))
            (when formatted



reply via email to

[Prev in Thread] Current Thread [Next in Thread]