Skip to content

Commit

Permalink
better pie error highlighting in DrRacket
Browse files Browse the repository at this point in the history
exn:fail:pie exceptions now work a little harder to
convert srcloc info into a format DrRacket is better
about highlighting in the definitions window.
  • Loading branch information
Andrew Kent authored and david-christiansen committed Jan 31, 2018
1 parent 9ee6fe1 commit 77c97a6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pie-err.rkt
Expand Up @@ -10,7 +10,15 @@
#:property prop:exn:srclocs
(lambda (e)
(match (exn:fail:pie-where e)
[(list src line col pos span)
[(list raw-src line col pos span)
;; DrRacket highlights more consistently if we
;; return an actual path for the source when
;; the source string corresponds to a valid
;; file on the user's machine.
(define src (if (and (string? raw-src)
(file-exists? raw-src))
(string->path raw-src)
raw-src))
(list (srcloc src line col pos span))]))
#:transparent)

Expand Down

0 comments on commit 77c97a6

Please sign in to comment.