Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make cider-repl-set-ns more reliable on Piggieback connections
Fixes #3503
Partially reverts 5f705b
  • Loading branch information
vemv committed Oct 8, 2023
1 parent d6a1ebb commit 47d9a95
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Expand Up @@ -37,8 +37,9 @@
- [#3250](https://github.com/clojure-emacs/cider/issues/3250): Don't lose the CIDER session over TRAMP files.
- [#3413](https://github.com/clojure-emacs/cider/issues/3413): Make jump-to-definition work in projects needing `cider-path-translations` (i.e. Dockerized projects).
- [#2436](https://github.com/clojure-emacs/cider/issues/2436): Prevent malformed `cider-repl-history-file`s from failing `cider-jack-in`.
- [#3456](https://github.com/clojure-emacs/cider/issues/3456): restore xref-based jump-to-definition in Babashka (and any nREPL clients not having cider-nrepl).
- [#3456](https://github.com/clojure-emacs/cider/issues/3456): Restore xref-based jump-to-definition in Babashka (and any nREPL clients not having cider-nrepl).
- [#3466](https://github.com/clojure-emacs/cider/issues/3466): Restore usual `cider--connected-handler` performance for JVM Clojure repls.
- [#3503](https://github.com/clojure-emacs/cider/issues/3503): Make `cider-repl-set-ns` more reliable on Piggieback connections.
- Fix the `xref-find-definitions` CIDER backend to return correct filenames.
- Fix the `cider-xref-fn-deps` buttons to direct to the right file.
- Fix the `cider-find-keyword` overall reliability and correctness, particularly for ClojureScript.
Expand Down
11 changes: 9 additions & 2 deletions cider-repl.el
Expand Up @@ -1321,8 +1321,15 @@ command will prompt for the name of the namespace to switch to."
;; That's why we eval them separately instead of combining them with `do'.
(when cider-repl-require-ns-on-set
(cider-sync-tooling-eval (format "(require '%s)" ns) nil connection))
(cider-tooling-eval (format "(in-ns '%s)" ns)
(cider-repl-switch-ns-handler connection)))))
(let ((f (if (equal 'cljs
(with-current-buffer connection
cider-repl-type))
;; For cljs, don't use cider-sync-tooling-eval, because Piggieback will later change the ns (issue #3503):
#'cider-nrepl-request:eval
;; When possible, favor cider-sync-tooling-eval because it preserves *1, etc (commit 5f705b):
#'cider-sync-tooling-eval)))
(funcall f (format "(in-ns '%s)" ns)
(cider-repl-switch-ns-handler connection))))))


;;; Location References
Expand Down

0 comments on commit 47d9a95

Please sign in to comment.