]> git.eshelyaron.com Git - emacs.git/commitdiff
Unbreak completion when no possible annotation
authorJoão Távora <joaotavora@gmail.com>
Fri, 6 Jul 2018 17:39:20 +0000 (18:39 +0100)
committerJoão Távora <joaotavora@gmail.com>
Fri, 6 Jul 2018 17:39:34 +0000 (18:39 +0100)
* eglot.el (eglot-completion-at-point): Handle case where no doc,
detail or kind.

GitHub-reference: close https://github.com/joaotavora/eglot/issues/37

lisp/progmodes/eglot.el

index 509fe6c88dc225e90778fba2509681edd58ca977..fd633388452ebed1e46c9744e3eb325000c81d66 100644 (file)
@@ -1225,11 +1225,14 @@ DUMMY is ignored."
        (lambda (obj)
          (cl-destructuring-bind (&key detail documentation kind &allow-other-keys)
              (text-properties-at 0 obj)
-           (concat " " (propertize
-                        (or (and documentation
-                                 (replace-regexp-in-string "\n.*" "" documentation))
-                            detail (cdr (assoc kind eglot--kind-names)))
-                        'face 'font-lock-function-name-face))))
+           (let ((annotation
+                  (or (and documentation
+                           (replace-regexp-in-string "\n.*" "" documentation))
+                      detail
+                      (cdr (assoc kind eglot--kind-names)))))
+             (when annotation
+               (concat " " (propertize annotation
+                                       'face 'font-lock-function-name-face))))))
        :display-sort-function
        (lambda (items)
          (sort items (lambda (a b)