Use print-module-entry function to display docstring

This commit is contained in:
Michael Camilleri 2021-01-20 10:16:59 +09:00
parent 28076b9385
commit 4dd512ad28
No known key found for this signature in database
GPG Key ID: 7EB218A48DF8B572
1 changed files with 6 additions and 2 deletions

View File

@ -2848,6 +2848,7 @@
(cond
(x :ref) (string :var " (" (type (in (x :ref) 0)) ")")
(x :macro) :macro
(x :module) (string :module " (" (x :kind) ": " (x :path) ")")
(type (x :value)))
"\n"))
(def sm (x :source-map))
@ -2873,9 +2874,12 @@
(def x (dyn sym))
(if (not x)
(do
(def [fullpath _] (module/find (string sym)))
(def [fullpath mod-kind] (module/find (string sym)))
(if-let [mod-env (in module/cache fullpath)]
(in mod-env :doc)
(print-module-entry {:module true
:path fullpath
:kind mod-kind
:doc (in mod-env :doc)})
(print "symbol " sym " not found.")))
(print-module-entry x)))