Skip to content

Commit

Permalink
Fix eglot-capabilities when querying for multiple features
Browse files Browse the repository at this point in the history
* eglot-tests.el (eglot-capabilities): New test.

* eglot.el (eglot--server-capable): Fix problems with queries for
multiple capabilities.

GitHub-reference: per joaotavora/eglot#74
  • Loading branch information
joaotavora committed Aug 17, 2018
1 parent b72a4e4 commit 25a7b3d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lisp/progmodes/eglot.el
Original file line number Diff line number Diff line change
Expand Up @@ -728,12 +728,12 @@ under cursor."
feats)
(cl-loop for caps = (eglot--capabilities (eglot--current-server-or-lose))
then (cadr probe)
for feat in feats
for (feat . more) on feats
for probe = (plist-member caps feat)
if (not probe) do (cl-return nil)
if (eq (cadr probe) :json-false) do (cl-return nil)
if (not (listp (cadr probe))) do (cl-return (cadr probe))
finally (cl-return (or probe t)))))
if (not (listp (cadr probe))) do (cl-return (if more nil (cadr probe)))
finally (cl-return (or (cadr probe) t)))))

(defun eglot--range-region (range &optional markers)
"Return region (BEG . END) that represents LSP RANGE.
Expand Down

0 comments on commit 25a7b3d

Please sign in to comment.