]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix previous commit where workaround had been removed
authorJoão Távora <joaotavora@gmail.com>
Sat, 22 Dec 2018 15:27:27 +0000 (15:27 +0000)
committerJoão Távora <joaotavora@gmail.com>
Sat, 22 Dec 2018 15:27:27 +0000 (15:27 +0000)
Do remove the workaround, but not more than that.

* eglot.el (eglot-completion-at-point): set local var strings.

lisp/progmodes/eglot.el

index 43bc023509e47337f88ef61077d95bd39882fa7d..5861b05fcdf4aa5d24a63aef77f976783da68342 100644 (file)
@@ -1822,19 +1822,21 @@ is not active."
                                         :deferred :textDocument/completion
                                         :cancel-on-input t))
                  (items (if (vectorp resp) resp (plist-get resp :items))))
-            (mapcar
-             (jsonrpc-lambda (&rest all &key label insertText insertTextFormat
-                                    &allow-other-keys)
-               (let ((completion
-                      (cond ((and (eql insertTextFormat 2)
-                                  (eglot--snippet-expansion-fn))
-                             (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))))
+            (setq
+             strings
+             (mapcar
+              (jsonrpc-lambda (&rest all &key label insertText insertTextFormat
+                                     &allow-other-keys)
+                (let ((completion
+                       (cond ((and (eql insertTextFormat 2)
+                                   (eglot--snippet-expansion-fn))
+                              (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)))))
        :annotation-function
        (lambda (obj)
          (eglot--dbind ((CompletionItem) detail kind insertTextFormat)