Endless Parentheses

Ramblings on productivity and technical subjects.

profile for Malabarba on Stack Exchange

Debugger improvements in Cider 0.10.0

Over the last couple of weeks I had a few more days to work on the Cider debugger, and it’s getting a slew of improvements on the next release (0.10.0). This starts with a complete rewrite, so it now supports almost everything, and ends with some small features and UI improvements. Without further delay, here’s a video.

There’s a lot going on in there, so let’s start dissecting.

  1. Maps are now supported. This may sound trivial, but the previous version couldn’t debug inside maps (it’s trickier than it seems).
  2. More specifically, prepost-maps are supported! If this sounds sweet, that’s because it is. cider-debug-prepost.png
  3. Even some code-rewriting stuff is supported, like the beloved threading macros. cider-debug-threading-macros.png
  4. Function literals are also supported. cider-debug-function-literals.png
  5. The n, c, i, and q keys were already available in the previous version, so I’ll just link you to the previous post on them.
  6. The o key, showcased halfway through the video, moves you *o*ut of a sexp, without moving back in. It’s useful in while loops and in map-like operations.
  7. The l key presents an inspector buffer detailing local variables. cider-debug-inspect-locals.png
  8. Unlike in the previous version, you are allowed to move around and do other stuff while the debugger waits for input. You can even evaluate stuff in the current lexical environment with e or the usual C-x C-e.
  9. In addition to the command used the video (which simply debugs an entire function) you can also debug specific forms with #dbg, and you can place a single breakpoint anywhere with #break. If you use one of these, just evaluate the form with your usual evaluation commands (like C-x C-e or C-c C-c) and you’re good to go.
  10. Functions which are currently instrumented are marked with a red box around the name. cider-debug-red-box.png
  11. You can list all instrumented functions with M-x cider-browse-instrumented-defs. cider-debug-browse-instrumented.png

The next planned step for the debugger is ClojureScript support, but that’s likely going to take a while. In the meantime, why not try the Cider 0.10.0 snapshots and help us find any bugs?

comments powered by Disqus