Skip to content

Commit

Permalink
Fix joaotavora/eglot#285: unbreak Elm language server which does use …
Browse files Browse the repository at this point in the history
…: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.
  • Loading branch information
joaotavora committed Oct 5, 2019
1 parent 1dbb44f commit 01f854f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions eglot.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 01f854f

Please sign in to comment.