Skip to content

Commit

Permalink
Fix #285: unbreak Elm language server which does use :triggerCharacters
Browse files Browse the repository at this point in the history
Only query :triggerCharacter information if the server has provided
it.  Elm's doesn't, apparently.

* eglot.el (eglot-completion-at-point): Check that completion
capability is a list before treating it like one.
  • Loading branch information
joaotavora committed Sep 30, 2019
1 parent 36b7cf3 commit 15b9762
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 @@ -1952,10 +1952,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)

This comment has been minimized.

Copy link
@nemethf

nemethf Sep 30, 2019

Collaborator

@joaotavora, are you sure this is necessary? With commit 6d87de1 completion-capability will be nil in the elm-case, I think.

This comment has been minimized.

Copy link
@joaotavora

joaotavora via email Sep 30, 2019

Author Owner
(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 15b9762

Please sign in to comment.