From 5d9baf231bb4a7289585f88fcb168a81cd6ce7e7 Mon Sep 17 00:00:00 2001 From: jao Date: Wed, 19 Oct 2022 21:27:27 +0100 Subject: simple symbol-documentation, with type, lib and signature --- src/geiser/geiser.ss | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src') 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) -- cgit v1.2.3