From d8a14e9ea84a7636f230ed4a9870b064f48d98fc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Fri, 6 Jul 2018 18:39:20 +0100 Subject: [PATCH] Unbreak completion when no possible annotation * 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 | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 509fe6c88dc..fd633388452 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -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) -- 2.39.2