File tree Expand file tree Collapse file tree 2 files changed +21
-12
lines changed Expand file tree Collapse file tree 2 files changed +21
-12
lines changed Original file line number Diff line number Diff line change @@ -166,16 +166,24 @@ loaded."
166
166
(buffer-local-value 'nrepl-repl-buffer
167
167
(get-buffer (nrepl-current-connection-buffer)))))
168
168
169
+ (defun cider--dict-to-alist (val )
170
+ " Transforms a nREPL bdecoded dict VAL into an alist. Simply returns
171
+ it if it's not a dict."
172
+ (if (and (listp val)
173
+ (eq (car val) 'dict ))
174
+ (-map '-cons-to-list (cdr val))
175
+ val))
176
+
169
177
(defun cider-var-info (var )
170
- " Return VAR's info as an alist."
178
+ " Return VAR's info as an alist with list cdrs ."
171
179
(when var
172
180
(let ((val (plist-get (nrepl-send-request-sync
173
181
(list " op" " info"
174
182
" session" (nrepl-current-session)
175
183
" ns" (cider-current-ns)
176
184
" symbol" var))
177
185
:value )))
178
- (-partition 2 val))))
186
+ (cider--dict-to-alist val))))
179
187
180
188
(defun cider-get-var-attr (var attr )
181
189
" Return VAR's ATTR."
Original file line number Diff line number Diff line change 66
66
(ert-deftest test-cider-var-info ()
67
67
(noflet ((nrepl-send-request-sync (list )
68
68
`(:value
69
- (" arglists" " ([] [x] [x & ys])"
70
- " ns" " clojure.core"
71
- " name" " str"
72
- " column" 1
73
- " added" " 1.0"
74
- " static" " true"
75
- " doc" " stub"
76
- " line" 504
77
- " file" " jar:file:/clojure-1.5.1.jar!/clojure/core.clj"
78
- " tag" " class java.lang.String" )
69
+ (dict
70
+ (" arglists" . " ([] [x] [x & ys])" )
71
+ (" ns" . " clojure.core" )
72
+ (" name" . " str" )
73
+ (" column" . 1 )
74
+ (" added" . " 1.0" )
75
+ (" static" . " true" )
76
+ (" doc" . " stub" )
77
+ (" line" . 504 )
78
+ (" file" . " jar:file:/clojure-1.5.1.jar!/clojure/core.clj" )
79
+ (" tag" . " class java.lang.String" ))
79
80
:done t ))
80
81
(nrepl-current-session () nil )
81
82
(cider-current-ns () " user" ))
You can’t perform that action at this time.
0 commit comments