From 0e7e66fe2739a203dd2f2e5138e27f8b8dd04fb0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Mon, 30 Sep 2019 18:06:48 +0200 Subject: [PATCH] Unbreak elm language server which does use :triggercharacters Only query completionProvider -> triggerCharacter information if the server has provided it. Elm's, and probaly other's, do not provide it, which doesn't mean they don't support completion. * eglot.el (eglot-completion-at-point): Check that completion capability is a list before treating it like one. GitHub-reference: fix https://github.com/joaotavora/eglot/issues/285 --- lisp/progmodes/eglot.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index d1a1a3d0b20..cfcfaa7d68a 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1958,10 +1958,11 @@ is not active." :company-prefix-length (save-excursion (when (car bounds) (goto-char (car bounds))) - (looking-back - (regexp-opt - (cl-coerce (cl-getf completion-capability :triggerCharacters) 'list)) - (line-beginning-position))) + (when (listp completion-capability) + (looking-back + (regexp-opt + (cl-coerce (cl-getf completion-capability :triggerCharacters) 'list)) + (line-beginning-position)))) :exit-function (lambda (comp _status) (let ((comp (if (get-text-property 0 'eglot--lsp-completion comp) -- 2.39.2