Skip to content
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

Configurable print-level and length for debugger values #1191

Merged
merged 1 commit into from
Jul 10, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### New features

* [#1191](https://github.com/clojure-emacs/cider/pull/1191): New custom variables `cider-debug-print-level` and `cider-debug-print-length`.
* [#1188](https://github.com/clojure-emacs/cider/pull/1188): New debugging tool-bar.
* [#1187](https://github.com/clojure-emacs/cider/pull/1187): The list of keys displayed by the debugger can be configured with `cider-debug-prompt`.
* [#1187](https://github.com/clojure-emacs/cider/pull/1187): While debugging, there is a menu on the menu-bar listing available commands.
Expand Down
20 changes: 19 additions & 1 deletion cider-debug.el
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,22 @@ configure `cider-debug-prompt' instead."
:group'cider-debug
:package-version"0.9.1")

(defcustom cider-debug-print-level nil
"print-level for values displayed by the debugger.
This variable must be set before starting the repl connection."
:type '(choice (const :tag "No limit" nil)
(integer :tag "Max depth" 2))
:group 'cider-debug
:package-version '(cider-debug . "0.10.0"))

(defcustom cider-debug-print-length nil
"print-length for values displayed by the debugger.
This variable must be set before starting the repl connection."
:type '(choice (const :tag "No limit" nil)
(integer :tag "Max depth" 4))
:group 'cider-debug
:package-version '(cider-debug . "0.10.0"))


;;; Implementation
(defun cider--update-instrumented-defs (defs)
Expand Down Expand Up @@ -134,7 +150,9 @@ configure `cider-debug-prompt' instead."
(defun cider--debug-init-connection ()
"Initialize a connection with clj-debugger."
(nrepl-send-request
'("op" "init-debugger")
'("op" "init-debugger"
"print-level" cider-debug-print-level
"print-length" cider-debug-print-length)
(lambda (response)
(nrepl-dbind-response response (status id instrumented-defs ns)
(if (not (member "done" status))
Expand Down