diff options
author | jao <jao@gnu.org> | 2022-10-19 21:27:27 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2022-10-19 21:27:27 +0100 |
commit | 5d9baf231bb4a7289585f88fcb168a81cd6ce7e7 (patch) | |
tree | c3e0251625dd2c5917537ee110afc6c7126b1395 /src | |
parent | 61e68f2e2bd93263cd53b4c34eccbc7d169935d8 (diff) | |
download | geiser-chez-5d9baf231bb4a7289585f88fcb168a81cd6ce7e7.tar.gz geiser-chez-5d9baf231bb4a7289585f88fcb168a81cd6ce7e7.tar.bz2 |
simple symbol-documentation, with type, lib and signature
Diffstat (limited to 'src')
-rw-r--r-- | src/geiser/geiser.ss | 14 |
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) |