Skip to content

Commit

Permalink
Fall back to file from stacktrace when info middleware fails
Browse files Browse the repository at this point in the history
  • Loading branch information
vspinu committed Feb 1, 2015
1 parent 68de950 commit 83dbbe3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cider-stacktrace.el
Original file line number Diff line number Diff line change
Expand Up @@ -403,9 +403,12 @@ it wraps to 0."
(method (button-get button 'method))
(info (or (and var (cider-var-info var))
(and class method (cider-member-info class method))
`(dict "file" ,(button-get button 'file))))
(nrepl-dict)))
;; stacktrace returns more accurate line numbers
(info (nrepl-dict-put info "line" (button-get button 'line))))
(info (nrepl-dict-put info "line" (button-get button 'line)))
;; info middleware returns full paths, but sometimes fails
(info (nrepl-dict-put info "file" (or (nrepl-dict-get info "file")
(button-get button 'file)))))
(cider--jump-to-loc-from-info info t)))

(defun cider-stacktrace-jump ()
Expand Down
4 changes: 4 additions & 0 deletions nrepl-client.el
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,10 @@ If so ask the user for confirmation."

;;; nREPL dict

(defun nrepl-dict (&rest key-vals)
"Create nREPL dict from KEY-VALS."
(cons 'dict key-vals))

(defun nrepl-dict-p (object)
"Return t if OBJECT is a nREPL dict."
(and (listp object)
Expand Down

0 comments on commit 83dbbe3

Please sign in to comment.