summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)