File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 977
977
(or (= 'js x)
978
978
(= " js" (namespace x)))))
979
979
980
+ (defn ->pre [x]
981
+ (->> (string/split (name x) #"\. " ) (map symbol)))
982
+
980
983
(defn normalize-js-tag [x]
981
984
; ; if not 'js, assume constructor
982
985
(if-not (= 'js x)
983
- (let [props (->> ( string/split ( name x) #" \. " ) ( map symbol) )
986
+ (let [props (->pre x )
984
987
[xs y] ((juxt butlast last) props)]
985
988
(with-meta 'js
986
989
{:prefix (vec (concat xs [(with-meta y {:ctor true })]))}))
Original file line number Diff line number Diff line change 218
218
([state]
219
219
(keys (get @state ::ana/namespaces ))))
220
220
221
+ (defn resolve-extern
222
+ " Given a symbol attempt to look it up in the provided externs"
223
+ ([sym]
224
+ (resolve-extern env/*compiler* sym))
225
+ ([state sym]
226
+ (let [pre (ana/->pre sym)]
227
+ (env/with-compiler-env state
228
+ (:info (ana/resolve-extern pre))))))
229
+
221
230
(defn find-ns
222
231
" Given a namespace return the corresponding namespace analysis map. Analagous
223
232
to clojure.core/find-ns."
Original file line number Diff line number Diff line change @@ -1447,6 +1447,11 @@ itself (not its value) is returned. The reader macro #'x expands to (var x)."}})
1447
1447
(keyword? name)
1448
1448
`(cljs.repl/print-doc {:spec ~name :doc (cljs.spec.alpha/describe ~name)})
1449
1449
1450
+ (= " js" (namespace name))
1451
+ `(cljs.repl/print-doc
1452
+ (quote ~(merge (select-keys (ana-api/resolve-extern name) [:doc :arglists ])
1453
+ {:name name})))
1454
+
1450
1455
(ana-api/find-ns name)
1451
1456
`(cljs.repl/print-doc
1452
1457
(quote ~(select-keys (ana-api/find-ns name) [:name :doc ])))
You can’t perform that action at this time.
0 commit comments