compiler: populate docs JSON exports from module at compile time
The CPS conversion rewrite moved export handling from compiler.c into cps-convert.c (cps-convert.c:2427), which calls sigilmoduleaddexport on the runtime SigilModule. But the DocCollection sidecar that emits the .json file never received a corresponding addexport call, so every module's docs JSON was {"module": null, ..., "exports": []} with doccollectionaddexport marked attribute_((unused)).
After sigilccompilefilewithdocs returns, look up the compile-time module by its canonical name and copy the external export names into the DocCollection. Also populate dc->modulename (previously only set for files without a define-library form). Docstrings and kinds are still not extracted — that's a future enhancement.
Also fix (sigil json), which called call-with-input-string without importing (sigil io); this crashed any caller of load-module-details that didn't transitively pull in (sigil io) itself, including the new sigil-lsp server.
Confirmed: build/dev/lib/sigil/json.json now contains {"module": "(sigil json)", "exports": [{"name": "json-read", ...}, ...]} and (load-module-details '(sigil json)) returns 6 exports.
Downstream in (sigil docs search), keyword->string on line 123 still fails on some index keys - a separate dormant bug that was masked while the exports list was empty. Left for follow-up.
src/sigil/json.sgl | 1 +
1 file changed, 1 insertion(+)src/sigil/json.sglmodified
(define-library (sigil json) (import (sigil string) (sigil io) (sigil math)) (export ;; Port-based I/O (primitives)