summaryrefslogtreecommitdiff
path: root/cider-client.el
diff options
context:
space:
mode:
authorBozhidar Batsov <bozhidar@batsov.com>2017-12-18 12:10:28 +0200
committerBozhidar Batsov <bozhidar@batsov.com>2017-12-18 12:14:38 +0200
commitf357cf07c7f686728c9959734fc4b98386b5b87c (patch)
treeefeb5af01a808794ad0030b64e1e30d571cf3703 /cider-client.el
parent4036705aef16f26ba7e6fcbebd6a5bb4217dace2 (diff)
Update cider-sync-request:resources-list to track some cider-nrepl changes
The return value for the "resources-list" op changed in https://github.com/clojure-emacs/cider-nrepl/pull/459 It used to return just a list of relative paths, now it returns a list of dictionaries that include both the relative and the absolute path to a resource.
Diffstat (limited to 'cider-client.el')
-rw-r--r--cider-client.el11
1 files changed, 7 insertions, 4 deletions
diff --git a/cider-client.el b/cider-client.el
index e2a7cc0c..68c2513f 100644
--- a/cider-client.el
+++ b/cider-client.el
@@ -1045,10 +1045,13 @@ returned."
(nrepl-dict-get "resource-path")))
(defun cider-sync-request:resources-list ()
- "Return a list of all resources on the classpath."
- (thread-first '("op" "resources-list")
- (cider-nrepl-send-sync-request)
- (nrepl-dict-get "resources-list")))
+ "Return a list of all resources on the classpath.
+
+The result entries are relative to the classpath."
+ (when-let* ((resources (thread-first '("op" "resources-list")
+ (cider-nrepl-send-sync-request)
+ (nrepl-dict-get "resources-list"))))
+ (seq-map (lambda (resource) (nrepl-dict-get resource "relpath")) resources)))
(defun cider-sync-request:format-code (code)
"Perform nREPL \"format-code\" op with CODE."