Skip to content

Commit e633401

Browse files
[stacktrace] Visual improvements, expand causes by 1 by default
1 parent ee35c30 commit e633401

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- [#3782](https://github.com/clojure-emacs/cider/issues/3782): **(Breaking)** Drop official support for Emacs 26.
88
- [#3777](https://github.com/clojure-emacs/cider/issues/3777): Inspector no longer displays parsed Javadoc for Java classes and members.
99
- [#3784](https://github.com/clojure-emacs/cider/issues/3784): Inspector: make point less erratic when navigating between inspector screens.
10+
- [#3790](https://github.com/clojure-emacs/cider/issues/3790): Stacktrace: show messages and data for all exception causes by default.
1011

1112
## 1.17.1 (2025-02-25)
1213

cider-stacktrace.el

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ The error types are represented as strings."
209209
(setq-local electric-indent-chars nil)
210210
(setq-local cider-stacktrace-hidden-frame-count 0)
211211
(setq-local cider-stacktrace-filters cider-stacktrace-default-filters)
212-
(setq-local cider-stacktrace-cause-visibility (make-vector 10 0))
212+
(setq-local cider-stacktrace-cause-visibility (make-vector 10 1))
213213
(buffer-disable-undo))
214214

215215

@@ -707,8 +707,7 @@ This associates text properties to enable filtering and source navigation."
707707
(put-text-property p1 p4 'font-lock-face 'cider-stacktrace-ns-face)
708708
(put-text-property p2 p3 'font-lock-face 'cider-stacktrace-fn-face)
709709
(put-text-property (line-beginning-position) (line-end-position)
710-
'cider-stacktrace-frame t)))
711-
(insert "\n")))))))
710+
'cider-stacktrace-frame t)))))))))
712711

713712
(defun cider-stacktrace-render-compile-error (buffer cause)
714713
"Emit into BUFFER the compile error CAUSE, and enable jumping to it."
@@ -844,41 +843,38 @@ make INSPECT-INDEX actionable if present."
844843
,cider-stacktrace-exception-map)
845844
(insert (format "%d. " num)
846845
(propertize note 'font-lock-face 'font-lock-comment-face) " "
847-
(propertize class 'font-lock-face class-face 'mouse-face 'highlight)
848-
"\n"))
846+
(propertize class 'font-lock-face class-face 'mouse-face 'highlight)))
849847
;; Detail level 1: message + ex-data
850848
(cider-propertize-region '(detail 1)
849+
(insert "\n")
851850
(if (equal class "clojure.lang.Compiler$CompilerException")
852851
(cider-stacktrace-render-compile-error buffer cause)
853852
(cider-stacktrace-emit-indented
854853
(propertize (or message "(No message)")
855854
'font-lock-face message-face)
856855
indent t))
857-
(insert "\n")
858856
(when spec
857+
(insert "\n")
859858
(cider-stacktrace--emit-spec-problems spec (concat indent " ")))
860859
(when data
860+
(insert "\n")
861861
(cider-stacktrace-emit-indented data indent nil t)))
862862
;; Detail level 2: stacktrace
863863
(cider-propertize-region '(detail 2)
864-
(insert "\n")
865864
(let ((beg (point))
866865
(bg `(:background ,cider-stacktrace-frames-background-color :extend t)))
867866
(dolist (frame stacktrace)
867+
(insert "\n")
868868
(cider-stacktrace-render-frame buffer frame))
869869
(overlay-put (make-overlay beg (point)) 'font-lock-face bg)))
870870
;; Add line break between causes, even when collapsed.
871871
(cider-propertize-region '(detail 0)
872-
(insert "\n")))))))
872+
(insert "\n\n")))))))
873873

874874
(defun cider-stacktrace-initialize (causes)
875875
"Set and apply CAUSES initial visibility, filters, and cursor position."
876876
(nrepl-dbind-response (car causes) (class)
877877
(let ((compile-error-p (equal class "clojure.lang.Compiler$CompilerException")))
878-
;; Partially display outermost cause if it's a compiler exception (the
879-
;; description reports reader location of the error).
880-
(when compile-error-p
881-
(cider-stacktrace-cycle-cause (length causes) 1))
882878
;; Fully display innermost cause. This also applies visibility/filters.
883879
(cider-stacktrace-cycle-cause 1 cider-stacktrace-detail-max)
884880
;; Move point (DWIM) to the compile error location if present, or to the

0 commit comments

Comments
 (0)