Skip to content

Conversation

wilbrt
Copy link

@wilbrt wilbrt commented Sep 6, 2025

Change cider-ns-refresh to use a Clojure REPL whenever one exists, by wrapping the function body in a with-current-buffer with the clj-repl connection if it exists. If not, throw a no-repls-user-error. Fixes #3834.

Not sure if this is a reasonable way to handle this, so all critiques and comments are more than welcome, thanks!


Before submitting the PR make sure the following things have been done (and denote this
by checking the relevant checkboxes):

  • The commits are consistent with our contribution guidelines
  • You've added tests (if possible) to cover your change(s)
  • All tests are passing (eldev test)
  • All code passes the linter (eldev lint) which is based on elisp-lint and includes
  • You've updated the changelog (if adding/changing user-visible functionality)
  • You've updated the user manual (if adding/changing user-visible functionality)

Thanks!

If you're just starting out to hack on CIDER you might find this section of its
manual
extremely useful.

@wilbrt wilbrt force-pushed the 3834-ns-refresh-to-use-clj-repl branch from 90b2135 to 6d723a1 Compare September 6, 2025 10:25
@bbatsov
Copy link
Member

bbatsov commented Sep 9, 2025

Hmm, seems to me something's wrong with cider-map-repls, as I see it's invoked with :clj in this context which should be enough if things were working properly. (basically it filters out the non-Clojure connections)

@wilbrt
Copy link
Author

wilbrt commented Sep 9, 2025

There doesn't seem to be anything wrong with cider-map-repls. It's just that the lines
(cider-ensure-op-supported "refresh") (cider-ensure-op-supported "cider.clj-reload/reload") (cider-ns-refresh--save-modified-buffers) throw when the current buffers cider-current-repl does not give a Clojure repl.

I thought about extending the cider-ensure-op-supported-function to take an optional parameter for the repl type we want to use but figured it would change existing functionality too much for this kind of change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cider-ns-refresh should always use Clojure REPL
2 participants