Skip to content

Commit f98ec22

Browse files
committed
3834 Update changelog, add test for new argument in cider-repls
1 parent fc3e130 commit f98ec22

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
- [#3837](https://github.com/clojure-emacs/cider/issues/3837): Fix broken stacktrace response when C-c C-p throws an exception.
2020
- [orchard#353](https://github.com/clojure-emacs/orchard/pull/353): Stacktrace: flag Clojure functions as duplicate.
2121
- [orchard#355](https://github.com/clojure-emacs/orchard/pull/355): Java: resolve source files for non-base JDK classes.
22+
- [#3834](https://github.com/clojure-emacs/cider/issues/3834): Fix cider-ns-refresh throwing an error when a clojure REPL exists, but cider-current-repl does not support the required operations.
2223

2324
## 1.19.0 (2025-07-10)
2425

doc/modules/ROOT/pages/usage/cider_mode.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ kbd:[C-u C-c C-c]
175175

176176
| `cider-ns-refresh`
177177
| kbd:[C-c M-n (M-)r]
178-
| Reload all modified files on the classpath. If invoked with a prefix argument, reload all files on the classpath. If invoked with a double prefix argument, clear the state of the namespace tracker before reloading. Uses a clojure REPL whenever one exists.
178+
| Reload all modified files on the classpath. If invoked with a prefix argument, reload all files on the classpath. If invoked with a double prefix argument, clear the state of the namespace tracker before reloading.
179179

180180
| `cider-doc`
181181
| kbd:[C-c C-d d] +

test/cider-connection-tests.el

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,8 @@
365365
(expect (cider-repls) :to-have-same-items-as (list l1 l2)))))))))
366366

367367
(describe "killed buffers"
368-
(it "do not show up in it"
368+
(it "do not show up in it
369+
"
369370
(let ((default-directory (expand-file-name "/tmp/some-dir")))
370371
(cider-test-with-buffers
371372
(a b)
@@ -398,7 +399,25 @@
398399
(append cider-connection-capabilities '(cljs))))
399400

400401
(expect (cider-repls) :to-equal (list a b))
401-
(sesman-unregister 'CIDER session)))))))
402+
(sesman-unregister 'CIDER session))))))
403+
404+
(describe "when ops-to-support is not nil"
405+
:var (nrepl-ops)
406+
(it "only returns the repls that support the given ops"
407+
(let ((proj-dir (expand-file-name "/tmp/proj-dir")))
408+
(let ((default-directory proj-dir))
409+
(with-repl-buffer ses-name 'clj b1
410+
(setq nrepl-ops (nrepl-dict "refresh" 't))
411+
(with-repl-buffer ses-name 'clj b2
412+
(with-repl-buffer ses-name 'cljs b3
413+
(expect (cider-repls nil nil '("refresh")) :to-equal (list b1))))))))
414+
(it "raises a user error when ensure is not nil and no repl that supports the ops exist"
415+
(let ((proj-dir (expand-file-name "/tmp/proj-dir")))
416+
(let ((default-directory proj-dir))
417+
(with-repl-buffer ses-name 'clj b1
418+
(with-repl-buffer ses-name 'cljs b2
419+
(expect (cider-repls nil 't '("refresh")) :to-throw 'user-error))))))))
420+
402421

403422
(describe "cider--connection-info"
404423
(before-each

0 commit comments

Comments
 (0)