Skip to content

Commit 623d3d6

Browse files
rpkarlssonbbatsov
authored andcommitted
Properly extract jar paths in cider.nrepl.middleware.ns/ns-path
Fixes clojure-emacs/cider#2681 (comment) Allowing cider-find-ns to open files in jars.
1 parent 691fc2c commit 623d3d6

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/cider/nrepl/middleware/ns.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
(:file (info/info* {:dialect :cljs
8484
:env cljs-env
8585
:sym (symbol ns)}))
86-
(.getPath (ns/canonical-source ns))))
86+
(str (ns/canonical-source ns))))
8787

8888
(defn ns-list-reply [msg]
8989
{:ns-list (ns-list msg)})

test/clj/cider/nrepl/middleware/ns_test.clj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@
101101
core-path (:path (session/message {:op "ns-path"
102102
:ns "clojure.core"}))]
103103
(is (.endsWith ns-path "cider/nrepl/middleware/ns.clj"))
104-
(is (.endsWith core-path "clojure/core.clj"))))
104+
(is (.endsWith core-path "clojure/core.clj"))
105+
(is (.startsWith core-path "jar:"))))
105106

106107
(deftest ns-load-all-integration-test
107108
(let [loaded-ns (:loaded-ns (session/message {:op "ns-load-all"}))]

0 commit comments

Comments
 (0)