From: João Távora Date: Fri, 17 Aug 2018 22:23:31 +0000 (+0100) Subject: Fix eglot-capabilities when querying for multiple features X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~444 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=25a7b3d4a1ab26d96144155b06cde1052cebb4d3;p=emacs.git Fix eglot-capabilities when querying for multiple features * eglot-tests.el (eglot-capabilities): New test. * eglot.el (eglot--server-capable): Fix problems with queries for multiple capabilities. GitHub-reference: per https://github.com/joaotavora/eglot/issues/74 --- diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 88c6b45141a..63fbce205d5 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -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.