From 21c2bb18d898b5d70750688a51346b2b867e3265 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Wed, 16 Oct 2019 23:13:09 +0100 Subject: [PATCH] Protect against zero-length completions Apparently the Vue Language Server sends such things (see https://github.com/joaotavora/eglot/issues/319). * eglot.el (eglot-completion-at-point): Protect against zero-length completions. --- lisp/progmodes/eglot.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index aa64fe6a2a9..cba8c341b34 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1907,7 +1907,8 @@ is not active." (string-trim-left label)) (t (or insertText (string-trim-left label)))))) - (put-text-property 0 1 'eglot--lsp-item item proxy) + (unless (zerop (length proxy)) + (put-text-property 0 1 'eglot--lsp-item item proxy)) proxy)) items)) (bounds -- 2.39.2