[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/cider 2bc5f1e876 1/3: Allow fallback to xref backends if c
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/cider 2bc5f1e876 1/3: Allow fallback to xref backends if cider-nrepl is unloaded |
Date: |
Fri, 4 Feb 2022 04:57:55 -0500 (EST) |
branch: elpa/cider
commit 2bc5f1e87671929abb26654ff0a5997bc57d82a8
Author: Vedang Manerikar <ved.manerikar@gmail.com>
Commit: Bozhidar Batsov <bozhidar@batsov.dev>
Allow fallback to xref backends if cider-nrepl is unloaded
This commit addresses the following use-case: Connecting to a running
REPL which does not have `cider-nrepl` middleware loaded.
This can happen when connecting to remote REPLs, and even
locally (admittedly minor use-case) if you don't want to turn the
middleware on.
If `cider--xref-backend` returns nil, `xref` will move on to the next
backend. This allows using something like `dumb-jump` to move around
in the code-base, while also getting the benefits of a REPL window.
---
cider-find.el | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/cider-find.el b/cider-find.el
index ed2b92f34c..ea43dc11dd 100644
--- a/cider-find.el
+++ b/cider-find.el
@@ -232,7 +232,10 @@ thing at point."
;; CIDER's xref backend was added in CIDER 1.2.
(defun cider--xref-backend ()
"Used for xref integration."
- 'cider)
+ ;; Check if `cider-nrepl` middleware is loaded. Allows fallback to other xref
+ ;; backends, if cider-nrepl is not loaded.
+ (when (cider-nrepl-op-supported-p "ns-path")
+ 'cider))
(cl-defmethod xref-backend-identifier-at-point ((_backend (eql cider)))
"Return the relevant identifier at point."