cider 2025-06-11

I'm using cider-ns-refresh in a project (with before/after functions for stopping/starting the system), but I've found I can't use it while I have a ClojureScript file in my buffer, as those have their own REPL connection. Is there a way to force cider-ns-refresh to always use the Clojure nREPL for a project, regardless of the mode of the buffer I'm in?

I guess I could create a custom function, cider-clj-ns-refresh , that uses cider-current-repl to search for a Clojure REPL. Would that work?

Hmm, I never thought about this much to be honest - probably we can just force the use of a Clojure connection as it doesn't work with ClojureScript anyways.

Feel free to file a ticket about this. As a workaround you can just copy the current Elisp function to your Emacs config and load a modified version from there. (but a similar function with a different name will get the job done as well)

FYI - we're considering dropping cider-ns-refresh completely down the road in favor of the newer clj-reload based commands.

I'll open an issue then! Thanks for the response!

👍 1

(I mean today it's configurable, but originally the design was influenced by clojure.tools.namespace and that's what we're considering dropping)

I was considering swapping over to clj-reload as well, though I should add that there are plenty of projects that use tools.namespace, so dropping support for that would require that everyone update their existing libraries. I'd need to update integrant-repl for example.

Yeah, that's fair and that's why we're not in a rush to make such a change. But overall it seems that these days clj-reload is the better tool for the job.

Agreed. I've been meaning to get round to updating my libraries.

👍 1