Skip to content

Conversation

trueneu
Copy link

@trueneu trueneu commented May 17, 2025

Add command to eval sexp, pretty-print the result and replace the sexp with the result.

It may come in handy should the CIDER user need to define a large datastructure to debug their code, and change it slightly later.

The behaviour is the same as cider-eval-print-last-sexp with optional argument, but with additional replacing the original sexp.

NOTE:

  • I haven't found tests related to printing, apologies if I missed them.
  • I feel there is refactoring potential here since I just copy-pasted the function essentially, but my elsip-fu is too weak to carry it out ATM.

Closes #3822


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.

Add command to eval sexp, pretty-print the result and replace the sexp with the result. It may come in handy should the CIDER user need to define a large datastructure to debug their code, and change it slightly later.
@trueneu
Copy link
Author

trueneu commented May 17, 2025

Scratch this, @rrudakov was kind enough to point out cider-format-edn-last-sexp.

@trueneu trueneu closed this May 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant