cider

weavejester 2025-06-11T19:33:47.560369Z

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?

weavejester 2025-06-16T13:22:00.657819Z

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?

bozhidar 2025-06-23T13:17:21.548069Z

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.

bozhidar 2025-06-23T13:18:27.692649Z

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)

bozhidar 2025-06-23T13:19:15.402089Z

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

weavejester 2025-06-23T13:19:26.996189Z

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

👍 1
bozhidar 2025-06-23T13:20:43.284909Z

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

weavejester 2025-06-23T13:21:26.140339Z

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.

bozhidar 2025-06-23T13:22:16.564699Z

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.

weavejester 2025-06-23T13:23:21.309319Z

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

👍 1