Commit 8ea426e 1 parent df6f165 commit 8ea426e Copy full SHA for 8ea426e
File tree 6 files changed +14
-20
lines changed
doc/modules/ROOT/pages/nrepl-api
test/clj/cider/nrepl/middleware
6 files changed +14
-20
lines changed Original file line number Diff line number Diff line change 6
6
7
7
* [ #667 ] ( https://github.com/clojure-emacs/cider-nrepl/pull/667 ) : Filter non file urls from classpath response.
8
8
9
+ ### Changes
10
+
11
+ * [ #679 ] ( https://github.com/clojure-emacs/cider-nrepl/pull/679 ) : Update to use bundled ClojureDocs documents.
12
+
9
13
## 0.25.2 (2020-06-07)
10
14
11
15
### Bugs fixed
Original file line number Diff line number Diff line change @@ -80,10 +80,6 @@ Required parameters::
80
80
* `:sym` The symbol to lookup.
81
81
82
82
83
- Optional parameters::
84
- * `:export-edn-url` EDN file URL exported from ClojureDocs. Defaults to "https://clojuredocs-edn.netlify.com/export.compact.edn".
85
-
86
-
87
83
Returns::
88
84
* `:clojuredocs` A map of information in ClojureDocs.
89
85
* `:status` "no-doc" if there is no document matching to ``ns`` and ``symbol``.
Original file line number Diff line number Diff line change 5
5
:url " http://www.eclipse.org/legal/epl-v10.html" }
6
6
:scm {:name " git" :url " https://github.com/clojure-emacs/cider-nrepl" }
7
7
:dependencies [[nrepl " 0.7.0" ]
8
- ^:inline-dep [cider/orchard " 0.5.11 " ]
8
+ ^:inline-dep [cider/orchard " 0.6.0 " ]
9
9
^:inline-dep [thunknyc/profile " 0.5.2" ]
10
10
^:inline-dep [mvxcvi/puget " 1.3.1" ]
11
11
^:inline-dep [fipp " 0.6.23" ] ; can be removed in unresolved-tree mode
Original file line number Diff line number Diff line change 512
512
{:doc " Return a map of information in ClojureDocs."
513
513
:requires {" ns" " The namespace where `sym` will be resolved."
514
514
" sym" " The symbol to lookup." }
515
- :optional {" export-edn-url" " EDN file URL exported from ClojureDocs. Defaults to \" https://clojuredocs-edn.netlify.com/export.compact.edn\" ." }
516
515
:returns {" clojuredocs" " A map of information in ClojureDocs."
517
516
" status" " \" no-doc\" if there is no document matching to `ns` and `symbol`." }}}})
518
517
Original file line number Diff line number Diff line change 7
7
[cider.nrepl.middleware.util.error-handling :refer [with-safe-transport]]
8
8
[orchard.clojuredocs :as docs]))
9
9
10
- (defn- clojuredocs-lookup-reply [{:keys [export-edn-url ns sym]}]
10
+ (defn- clojuredocs-lookup-reply [{:keys [ns sym]}]
11
11
(try
12
- (if-let [doc (if export-edn-url
13
- ; ; TODO: change this to `resolve-doc` once I've added the extra arity there
14
- (docs/resolve-and-find-doc (symbol ns ) (symbol sym) export-edn-url)
15
- (docs/resolve-and-find-doc (symbol ns ) (symbol sym)))]
12
+ ; ; TODO: change this to `resolve-doc` once I've added the extra arity there
13
+ (if-let [doc (docs/resolve-and-find-doc (symbol ns ) (symbol sym))]
16
14
{:clojuredocs (util/transform-value doc)}
17
15
{:status :no-doc })
18
16
; ; TODO: Handle a missing ns directly in Orchard
19
- (catch Exception e
17
+ (catch Exception _
20
18
{:status :no-doc })))
21
19
22
20
(defn clojuredocs-refresh-cache-reply [{:keys [export-edn-url]}]
23
21
(docs/clean-cache! )
24
22
(if export-edn-url
25
- (docs/load -cache! export-edn-url)
26
- (docs/load -cache! ))
23
+ (docs/update -cache! export-edn-url)
24
+ (docs/update -cache! ))
27
25
{:status :ok })
28
26
29
27
(defn handle-clojuredocs [handler msg]
Original file line number Diff line number Diff line change 24
24
(testing " Searching for non-existing documentation"
25
25
(let [response (session/message {:op " clojuredocs-lookup"
26
26
:ns " non-existing"
27
- :sym " non-existing"
28
- :export-edn-url test-url})]
27
+ :sym " non-existing" })]
29
28
(is (contains? (:status response) " no-doc" ))))
30
29
31
30
(testing " Searching for existing documentation"
32
31
(let [response (session/message {:op " clojuredocs-lookup"
33
32
:ns " clojure.core"
34
- :sym " first"
35
- :export-edn-url test-url})
33
+ :sym " first" })
36
34
doc (get response :clojuredocs {})]
37
35
(is (contains? (:status response) " done" ))
38
36
(is (= " clojure.core" (:ns doc)))
42
40
(testing " Resolves syms in the supplied ns"
43
41
(let [response (session/message {:op " clojuredocs-lookup"
44
42
:ns " cider.nrepl.middleware.clojuredocs-test"
45
- :sym " map"
46
- :export-edn-url test-url})
43
+ :sym " map" })
47
44
doc (get response :clojuredocs {})]
48
45
(is (contains? (:status response) " done" ))
49
46
(is (= " clojure.core" (:ns doc)))
You can’t perform that action at this time.
0 commit comments