From: João Távora Date: Mon, 11 Feb 2019 21:34:50 +0000 (+0000) Subject: * eglot.el (xref-backend-references): don't use return-from. X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~332 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=aed8e9732b1cff2c9d24b0010ae47337afb072c7;p=emacs.git * eglot.el (xref-backend-references): don't use return-from. --- diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 4fdd5c4e5be..df6a1b3ecb3 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1767,24 +1767,24 @@ Try to visit the target file for a richer summary line." locations)))) (cl-defmethod xref-backend-references ((_backend (eql eglot)) identifier) - (unless (eglot--server-capable :referencesProvider) - (cl-return-from xref-backend-references nil)) - (let ((params - (or (get-text-property 0 :textDocumentPositionParams identifier) - (let ((rich (car (member identifier eglot--xref-known-symbols)))) - (and rich (get-text-property 0 :textDocumentPositionParams rich)))))) - (unless params - (eglot--error "Don' know where %s is in the workspace!" identifier)) - (eglot--handling-xrefs - (mapcar - (eglot--lambda ((Location) uri range) - (eglot--xref-make identifier uri range)) - (jsonrpc-request (eglot--current-server-or-lose) - :textDocument/references - (append - params - (list :context - (list :includeDeclaration t)))))))) + (when (eglot--server-capable :referencesProvider) + (let ((params + (or (get-text-property 0 :textDocumentPositionParams identifier) + (let ((rich (car (member identifier eglot--xref-known-symbols)))) + (and rich + (get-text-property 0 :textDocumentPositionParams rich)))))) + (unless params + (eglot--error "Don' know where %s is in the workspace!" identifier)) + (eglot--handling-xrefs + (mapcar + (eglot--lambda ((Location) uri range) + (eglot--xref-make identifier uri range)) + (jsonrpc-request (eglot--current-server-or-lose) + :textDocument/references + (append + params + (list :context + (list :includeDeclaration t))))))))) (cl-defmethod xref-backend-apropos ((_backend (eql eglot)) pattern) (when (eglot--server-capable :workspaceSymbolProvider)