Skip to content

Commit

Permalink
Merge pull request #537 from jeffvalk/master
Browse files Browse the repository at this point in the history
Support Java method description from middleware.
  • Loading branch information
bbatsov committed Apr 25, 2014
2 parents f1387a7 + 863cf7a commit d1c5df9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
11 changes: 11 additions & 0 deletions cider-client.el
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,17 @@ it if it's not a dict."
:value)))
(cider--dict-to-alist val))))

(defun cider-member-info (class member)
"Return the CLASS MEMBER's info as an alist with list cdrs."
(when (and class member)
(let ((val (plist-get (nrepl-send-request-sync
(list "op" "info"
"session" (nrepl-current-session)
"class" class
"member" member))
:value)))
(cider--dict-to-alist val))))

(defun cider-get-var-attr (var attr)
"Return VAR's ATTR."
(cadr (assoc attr (cider-var-info var))))
Expand Down
19 changes: 12 additions & 7 deletions cider-stacktrace.el
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,18 @@ Update `cider-stacktrace-hidden-frame-count' and indicate filters applied."
(sit-for 5)))

(defun cider-stacktrace-navigate (button)
"Navigate to the stack frame represented by the BUTTON."
"Navigate to the stack frame source represented by the BUTTON."
(let ((var (button-get button 'var))
(class (button-get button 'class))
(method (button-get button 'method))
(line (button-get button 'line)))
(condition-case nil
(let* ((info (cider-var-info var))
(file (cadr (assoc "file" info))))
(cider-jump-to-def-for (vector file file line)))
(error "No source info"))))
(let* ((info (if var
(cider-var-info var)
(cider-member-info class method)))
(file (cadr (assoc "file" info))))
(if (and file line)
(cider-jump-to-def-for (vector file file line))
(error "No source info")))))


;; Rendering
Expand Down Expand Up @@ -254,7 +258,8 @@ This associates text properties to enable filtering and source navigation."
(if (member 'repl flags) "REPL" file) line
(if (member 'clj flags) ns class)
(if (member 'clj flags) fn method))
'name name 'var var 'line line 'flags flags
'var var 'class class 'method method
'name name 'line line 'flags flags
'follow-link t
'action 'cider-stacktrace-navigate
'help-echo "View source at this location"
Expand Down

0 comments on commit d1c5df9

Please sign in to comment.