diff --git a/pkgs/drracket-pkgs/drracket-tool-lib/drracket/private/syncheck/traversals.rkt b/pkgs/drracket-pkgs/drracket-tool-lib/drracket/private/syncheck/traversals.rkt index a0796d9468..fce049e9e9 100644 --- a/pkgs/drracket-pkgs/drracket-tool-lib/drracket/private/syncheck/traversals.rkt +++ b/pkgs/drracket-pkgs/drracket-tool-lib/drracket/private/syncheck/traversals.rkt @@ -545,7 +545,7 @@ prop)]))) (define mouse-over-tooltip-prop? - (vector/c #:flat? #t any/c exact-nonnegative-integer? exact-nonnegative-integer? string?)) + (vector/c #:flat? #t syntax? exact-nonnegative-integer? exact-nonnegative-integer? string?)) (define (add-mouse-over-tooltips stx) (let loop ([prop (syntax-property stx 'mouse-over-tooltips)]) (cond @@ -553,7 +553,7 @@ (loop (car prop)) (loop (cdr prop))] [(mouse-over-tooltip-prop? prop) - (add-mouse-over/loc (vector-ref prop 0) + (add-mouse-over/loc (find-source-editor (vector-ref prop 0)) (vector-ref prop 1) (vector-ref prop 2) (vector-ref prop 3))]))) diff --git a/pkgs/drracket-pkgs/drracket/scribblings/tools/tools.scrbl b/pkgs/drracket-pkgs/drracket/scribblings/tools/tools.scrbl index 7a34897768..a2b67b08c5 100644 --- a/pkgs/drracket-pkgs/drracket/scribblings/tools/tools.scrbl +++ b/pkgs/drracket-pkgs/drracket/scribblings/tools/tools.scrbl @@ -753,11 +753,12 @@ After putting this code in the DrRacket window, mouse over the words ``big'' and The value of the @racket['mouse-over-tooltips] property is expected to be to be a tree of @racket[cons] pairs (in any configuration) whose leaves are either ignored or are vectors of the shape -@racketblock[(vector/c any/c exact-nonnegative-integer? exact-nonnegative-integer? string?)] +@racketblock[(vector/c syntax? exact-nonnegative-integer? exact-nonnegative-integer? string?)] Each vector's content indicates where to show a tooltip. The first three components are -the @racket[syntax-source] indicating which file the tooltip goes in, the start and end position -in the editor where mouseovers will show the tooltip, and the content of the tooltip. -For example, here's a macro that shows the span of itself in a tooltip on mouseover: +a syntax object whose @racket[syntax-source] field indicates which file the tooltip goes in, +the start and end position in the editor where mouseovers will show the tooltip, +and the content of the tooltip. For example, here's a macro that shows the span of itself +in a tooltip on mouseover: @codeblock{ #lang racket (define-syntax (char-span stx) @@ -767,7 +768,7 @@ For example, here's a macro that shows the span of itself in a tooltip on mouseo #'a 'mouse-over-tooltips (vector - (syntax-source stx) + stx (syntax-position stx) (+ (syntax-position stx) (syntax-span stx)) diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/types/type-table.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/types/type-table.rkt index 02e8e8fdc2..415424c75e 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/types/type-table.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/types/type-table.rkt @@ -71,8 +71,7 @@ (define (type-table->tooltips) (for/fold ([tooltips '()]) ([(stx results) (in-hash table)] - #:when (and (syntax-source stx) - (syntax-position stx) + #:when (and (syntax-position stx) (syntax-span stx)) #:unless (error-at-stx-loc? stx)) ;; `printed-types` is #f if we should skip the type because it's @@ -105,17 +104,17 @@ (let ([fst (car (syntax-e stx))]) (and (identifier? fst) (free-identifier=? fst #'quote)))) - (cons (vector (syntax-source stx) + (cons (vector stx (sub1 (syntax-position stx)) (+ (sub1 (syntax-position stx)) (syntax-span stx)) printed-types) tooltips)] [else - (list* (vector (syntax-source stx) + (list* (vector stx (sub1 (syntax-position stx)) (syntax-position stx) printed-types) - (vector (syntax-source stx) + (vector stx (sub1 (+ (sub1 (syntax-position stx)) (syntax-span stx))) (+ (sub1 (syntax-position stx))