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

Support Java method description from middleware. #537

Merged
merged 1 commit into from
Apr 25, 2014
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
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