Here's probably a better example to start from. This highlights/links to documentation for both sqr
and pi
, and shows arrows for math
, but doesn't show arrows or offer to go to the definition of either sqr
or pi
. I think if that can be fixed then Rhombus can be adjusted pretty easily.
#lang racket
(define-syntax math (syntax-rules ()))
(require racket/math)
(define-for-syntax tbl (hash 'pi #'pi
'sqr #'sqr))
(define-syntax (scope stx)
(syntax-case stx ()
[(_ mth id)
(free-identifier=? #'mth #'math)
(syntax-property (hash-ref tbl (syntax-e #'id))
'disappeared-use
(cons
(datum->syntax #'here
'math
#'mth
#'mth)
(datum->syntax #'here
(syntax-e #'id)
#'id
#'id)))]))
(provide scope math)
#lang racket/base
(require "a.rkt")
(scope math sqr)
(scope math pi)