File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 12
12
13
13
(defn print-doc [{n :ns nm :name :as m}]
14
14
(println " -------------------------" )
15
- (println (str (when-let [ns (:ns m)] (str ns " /" )) (:name m)))
15
+ (println (or ( :spec m) ( str (when-let [ns (:ns m)] (str ns " /" )) (:name m) )))
16
16
(when (:protocol m)
17
17
(println " Protocol" ))
18
18
(cond
38
38
(do
39
39
(when (:macro m)
40
40
(println " Macro" ))
41
+ (when (:spec m)
42
+ (println " Spec" ))
41
43
(when (:repl-special-function m)
42
44
(println " REPL Special Function" ))
43
45
(println " " (:doc m))
Original file line number Diff line number Diff line change @@ -1231,7 +1231,8 @@ itself (not its value) is returned. The reader macro #'x expands to (var x)."}})
1231
1231
:repl-special-function true ))
1232
1232
1233
1233
(defmacro doc
1234
- " Prints documentation for a var or special form given its name"
1234
+ " Prints documentation for a var or special form given its name,
1235
+ or for a spec if given a keyword"
1235
1236
[name]
1236
1237
`(print
1237
1238
(binding [cljs.core/*print-newline* true ]
@@ -1245,6 +1246,9 @@ itself (not its value) is returned. The reader macro #'x expands to (var x)."}})
1245
1246
(repl-special-doc-map name)
1246
1247
`(cljs.repl/print-doc (quote ~(repl-special-doc name)))
1247
1248
1249
+ (keyword? name)
1250
+ `(cljs.repl/print-doc {:spec ~name :doc (cljs.spec.alpha/describe ~name)})
1251
+
1248
1252
(ana-api/find-ns name)
1249
1253
`(cljs.repl/print-doc
1250
1254
(quote ~(select-keys (ana-api/find-ns name) [:name :doc ])))
You can’t perform that action at this time.
0 commit comments