From: João Távora Date: Mon, 30 Sep 2019 16:06:48 +0000 (+0200) Subject: Unbreak elm language server which does use :triggercharacters X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~311 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0e7e66fe2739a203dd2f2e5138e27f8b8dd04fb0;p=emacs.git 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 --- 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)