Inspector
The value inspector allows you inspect and navigate the structure of data. While you can use it for pretty much anything (e.g. primitive data types, var, ref types) it’s most useful when you’re dealing with (deeply) nested collection-like data types (e.g. a vector of maps).
Usage
Typing C-c M-i (cider-inspect
) after some form in a source
buffer or the REPL will show you the structure for the result of the
form in a new buffer. You can also use C-u C-c M-i to inspect
the result of the current top-level form and C-u C-u C-c M-i to
read an expression from the minibuffer and inspect its result.
Alternatively, after a regular eval command, you can inspect the last
evaluated value using cider-inspect-last-result
. When a inspector
buffer is visible in the background, it is automatically updated with
the last result. This behavior can be controlled with the variable
cider-auto-inspect-after-eval
.
The inspector can also be invoked in the middle of a debugging session, see here for more details. |
You’ll have access to additional keybindings in the inspector buffer
(which is internally using cider-inspector-mode
):
Keyboard shortcut | Description |
---|---|
Tab and Shift-Tab |
Navigate inspectable sub-objects |
Return |
Inspect sub-objects |
l |
Pop to the parent object |
g |
Refresh the inspector (e.g. if viewing an atom/ref/agent) |
SPC |
Jump to next page in paginated view |
M-SPC |
Jump to previous page in paginated view |
s |
Set a new page size in paginated view |
d |
Defines a var in the REPL namespace with current inspector value |
Configuration
By default, navigation skips over values like nils, numbers and
keywords, which are not interesting to inspect. You can control this
behavior using the variable cider-inspector-skip-uninteresting
.
The inspector buffer is automatically selected by default. You
can disable the auto selection with the variable
cider-inspector-auto-select-buffer
.