summaryrefslogtreecommitdiff
path: root/src/geiser/geiser.ss
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-10-19 21:27:27 +0100
committerjao <jao@gnu.org>2022-10-19 21:27:27 +0100
commit5d9baf231bb4a7289585f88fcb168a81cd6ce7e7 (patch)
treec3e0251625dd2c5917537ee110afc6c7126b1395 /src/geiser/geiser.ss
parent61e68f2e2bd93263cd53b4c34eccbc7d169935d8 (diff)
downloadgeiser-chez-5d9baf231bb4a7289585f88fcb168a81cd6ce7e7.tar.gz
geiser-chez-5d9baf231bb4a7289585f88fcb168a81cd6ce7e7.tar.bz2
simple symbol-documentation, with type, lib and signature
Diffstat (limited to 'src/geiser/geiser.ss')
-rw-r--r--src/geiser/geiser.ss14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/geiser/geiser.ss b/src/geiser/geiser.ss
index ed305f9..0d3928c 100644
--- a/src/geiser/geiser.ss
+++ b/src/geiser/geiser.ss
@@ -21,7 +21,8 @@
geiser:macroexpand
geiser:symbol-location
geiser:module-location
- geiser:add-to-load-path)
+ geiser:add-to-load-path
+ geiser:symbol-documentation)
(import (chezscheme))
(import (geiser-data))
@@ -265,6 +266,17 @@
`(("file" . ,(with-extension obj (car exts)))))
(else (loop (cdr exts)))))))
+ (define (docstr lib id)
+ (format "A ~a defined in library ~a"
+ ((or (inspect/object (try-eval id)) (lambda (x) "value")) 'type)
+ lib))
+
+ (define (geiser:symbol-documentation id)
+ (let ((lib (symbol-lib id)))
+ (and lib
+ `(("docstring" . ,(docstr lib id))
+ ("signature" . ,(id-autodoc id))))))
+
(define geiser:no-values void)
(define geiser:newline newline)