diff --git a/collects/stepper/private/xml-snip-helpers.ss b/collects/stepper/private/xml-snip-helpers.ss index 95bea4e7eb..68add61a36 100644 --- a/collects/stepper/private/xml-snip-helpers.ss +++ b/collects/stepper/private/xml-snip-helpers.ss @@ -23,7 +23,7 @@ "read: bad syntax: empty scheme box") txt line col pos 1))) (let ([stx (read-syntax - text + (get-source-name text) (open-input-text-editor text 0 (send text last-position)))]) (when (eof-object? stx) (raise-read-error @@ -33,6 +33,12 @@ text 1 1 1 (send text last-position))) stx))) + (define (get-source-name text) + (cond + [(method-in-interface? 'get-port-name (object-interface text)) + (send text get-port-name)] + [else + (send text get-filename)])) (define (xml-read-special eliminate-whitespace-in-empty-tags? snip file line col pos) (let ([editor (send snip get-editor)]