From 25a7b3d4a1ab26d96144155b06cde1052cebb4d3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Fri, 17 Aug 2018 23:23:31 +0100 Subject: [PATCH] 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 --- lisp/progmodes/eglot.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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. -- 2.39.2