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 977977 (or (= 'js x)
978978 (= " js" (namespace x)))))
979979
980+ (defn ->pre [x]
981+ (->> (string/split (name x) #"\. " ) (map symbol)))
982+
980983(defn normalize-js-tag [x]
981984 ; ; if not 'js, assume constructor
982985 (if-not (= 'js x)
983- (let [props (->> ( string/split ( name x) #" \. " ) ( map symbol) )
986+ (let [props (->pre x )
984987 [xs y] ((juxt butlast last) props)]
985988 (with-meta 'js
986989 {:prefix (vec (concat xs [(with-meta y {:ctor true })]))}))
Original file line number Diff line number Diff line change 218218 ([state]
219219 (keys (get @state ::ana/namespaces ))))
220220
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+
221230(defn find-ns
222231 " Given a namespace return the corresponding namespace analysis map. Analagous
223232 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)."}})
14471447 (keyword? name)
14481448 `(cljs.repl/print-doc {:spec ~name :doc (cljs.spec.alpha/describe ~name)})
14491449
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+
14501455 (ana-api/find-ns name)
14511456 `(cljs.repl/print-doc
14521457 (quote ~(select-keys (ana-api/find-ns name) [:name :doc ])))
You can’t perform that action at this time.
0 commit comments