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 265eb6d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Changes

* Use clojure-mode [5.14.0](https://github.com/clojure-emacs/clojure-mode/blob/v5.14.0/CHANGELOG.md#5140-2022-03-07).
* [#3170](https://github.com/clojure-emacs/cider/issues/3170) Skip ensure repl available on xref functions.

## 1.3.0 (2021-03-07)

Expand Down
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 265eb6d

Please sign in to comment.