-
-
Notifications
You must be signed in to change notification settings - Fork 645
Add command to print the current value of the inspector. #3810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
This PR adds the interactive `cider-inspector-print-current-value` command that prints the current value of the inspector to the `cider-inspector-value-buffer` with the usual pretty printing machinery.
6350c4c
to
34637f1
Compare
@@ -2,6 +2,9 @@ | |||
|
|||
## master (unreleased) | |||
|
|||
- [#3810](https://github.com/clojure-emacs/cider/pull/3810) Add the `cider-inspector-print-current-value` command to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You forgot the :
after the PR link. Also - this should be under "New features".
I'm fine with this suggestion. @alexander-yakushev what do you think? |
With pretty-printing mode now merged, do you still desire to have this feature, @r0man? If so, we'll need some other key binding. |
Hi @alexander-yakushev and @bbatsov, yes, I'm still interested in it. I take a look at it later or tomorrow and look for a new keybinding. |
(require 'cider-eval) | ||
|
||
;; =================================== | ||
;; Inspector Key Map and Derived Mode | ||
;; =================================== | ||
|
||
(defconst cider-inspector-buffer "*cider-inspect*") | ||
(defconst cider-inspector-value-buffer "*cider-inspect-value*") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to reuse *cider-result*
buffer for this instead of creating yet another buffer type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was actually using that before, but then thought a new buffer is better. But, yes, I can change it to use that one instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is best to reuse the existing facility that powers *cider-result*
so that we don't need to add any new code for setting up the buffer, making it readonly, establishing q
binding, etc.
This PR adds the interactive
cider-inspector-print-current-value
command that prints the current value of the inspector to thecider-inspector-value-buffer
with the usual pretty printing machinery.The NREPL part is here: clojure-emacs/cider-nrepl#933
When pressing "P" in the inspector the currently inspected value is printed in a new popup buffer (on the left side in the picture).
I see it as the inspectors brother of
cider-pprint-eval-last-sexp
which I use all the time.This is the functionality I initially suggested, before working on the pretty mode. I think it is still useful. What I would like to have is a quick way to pretty print the current value of the inspector in the same familiar way my eye is used to, as the Clojure pretty printer (or what we are using in CIDER).
The new pretty mode does print more pretty, but differently, it uses "inspector mode" printing.
That's why I think this could be a useful addition.
Wdyt?
Before submitting the PR make sure the following things have been done (and denote this
by checking the relevant checkboxes):
eldev test
)eldev lint
) which is based onelisp-lint
and includescheckdoc
, check-declare, packaging metadata, indentation, and trailing whitespace checks.