racket / drracket

DrRacket, IDE for Racket
http://www.racket-lang.org/
Other
454 stars 93 forks source link

add relative path support to make-traversals #418

Closed sorawee closed 3 years ago

sorawee commented 4 years ago

The current requirement of path in make-traversal is that it is either #f or a path-string? However, because we parameterize current-load-relative-directory to be this path, providing any non complete-path? will result in a contract error. This PR thus strengthens the requirement so that the provided path must be complete-path?

The PR also fixes the show-content procedure so that it satisfies the contract. Note that we need additional parameterization of current-load-relative-directory so that macro expansion can work correctly on relative path source like:

;; main.rkt
(require drracket/check-syntax)
(show-content "test/a.rkt")

;; test/a.rkt
(require "b.rkt")

;; test/b.rkt
1

Also cleanup description about add-id-set, since the method is no longer called.

rfindler commented 4 years ago

Probably better if we do (build-path (current-directory) ...) when complete-path? returns #f for the input (and document that) instead of strengthening the contract.

sorawee commented 4 years ago

Ping, any thoughts on this? It's been a month.