Skip to content

Commit

Permalink
[Fixes clojure-emacs#3170] Skip ensure of repl avaiable on xref funct…
Browse files Browse the repository at this point in the history
…ions
  • Loading branch information
ericdallo committed Mar 24, 2022
1 parent 1e27eba commit 923fe32
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions cider-client.el
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,11 @@ nREPL connection."
(clojure-expected-ns path)))
(clojure-expected-ns path)))

(defun cider-nrepl-op-supported-p (op &optional connection)
(defun cider-nrepl-op-supported-p (op &optional connection skip-ensure)
"Check whether the CONNECTION supports the nREPL middleware OP."
(nrepl-op-supported-p op (or connection (cider-current-repl nil 'ensure))))
(nrepl-op-supported-p op (or connection (cider-current-repl nil (if skip-ensure
nil
'ensure)))))

(defun cider-ensure-op-supported (op)
"Check for support of middleware op OP.
Expand Down
2 changes: 1 addition & 1 deletion cider-find.el
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ thing at point."
"Used for xref integration."
;; 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")
(when (cider-nrepl-op-supported-p "ns-path" 'skip-ensure)
'cider))

(cl-defmethod xref-backend-identifier-at-point ((_backend (eql cider)))
Expand Down

0 comments on commit 923fe32

Please sign in to comment.