So I took a first shot on processing the metadata that Lassi created here - code (for Gauche) is appended below. For now that's just picking to metadata values from an implementation-specific metadata file and using that information to build two Scheme functions - most simple thing to do was to just return the URL of the Scheme's index page plus one to query for documentation for symbol-at-point.

I'm not sure what you're ideas would be how to process the metadata, my thoughts were:

  1. Download the metadata as S-expressions and process with Emacs lisp, similar to the Scheme code below. For any other editor (e.g. VS code) something JSON-based could be done as well.
  2. Download the metadata as S-expressions and process in the Scheme REPL of the respective Scheme implementation and communicate with the REPL from the editor. "Processing" here again means something similar to the Scheme code below, assuming that we can mostly resort to returning strings (URLs, bits of documentation, ...) from the Scheme REPL to the editor.
  3. Download the metadata as S-expressions and process in a (socket-) server implemented for the respective Scheme implementation and communicate with that server from the editor.
  4. Anything more clever you come up with ;)


--- Gauche-scheme:

;; Gauche:
(use file.util)
(use sxml.sxpath)
(use util.match)

;; default helper functions with reasonable URLs to generic documentation:

(define scheme-index-url
  (lambda () "https://practical-scheme.net/wiliki/schemexref.cgi?R7RS"))

(define scheme-query-url
  (lambda (arg) "https://practical-scheme.net/wiliki/schemexref.cgi?"))

(define (read-meta-data implementation-name)

  (define-syntax make-nullary
    (syntax-rules ()
      [(_ symbol-to-bind)
       (lambda (child) (set! symbol-to-bind (lambda () child)))]))

  (define-syntax make-unary
    (syntax-rules ()
      [(_ symbol-to-bind)
       (lambda (child) (set! symbol-to-bind (lambda (query-arg)
                                         (string-append child query-arg))))]))

  (define (try-set-match! form path set-child!)
    ;; Prepend *TOP*, so that we can add the car of the metadata from to the sxpath.
    (let ((child ((sxpath path) (cons '*TOP* form))))
      (when (and child (not (null? child)))
        (set-child! (car child)))))

  (call-with-input-file (string-append implementation-name ".scm")
    (lambda (p)
      (let loop ((form (read p)))
        (unless (eof-object? form)
          (begin
            (try-set-match! form '(// documentation web-url *text*)    (make-nullary scheme-index-url))
            (try-set-match! form '(// documentation search-url *text*) (make-unary scheme-query-url))
            (loop (read p))))))))

(read-meta-data "gauche")

;; most simply debug output:
(display (list (and scheme-index-url (scheme-index-url))
                    (and scheme-query-url (scheme-query-url "define"))))