]> git.eshelyaron.com Git - emacs.git/commitdiff
Unbreak elm language server which does use :triggercharacters
authorJoão Távora <joaotavora@gmail.com>
Mon, 30 Sep 2019 16:06:48 +0000 (18:06 +0200)
committerJoão Távora <joaotavora@gmail.com>
Sat, 5 Oct 2019 10:50:47 +0000 (11:50 +0100)
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

index d1a1a3d0b20a4abb4233372918435fda1cab9069..cfcfaa7d68aa604a342053062db4b92fb5ece2c0 100644 (file)
@@ -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)