How to find source file loaded by/relevant for (require <some-package>)?

20 views
Skip to first unread message

Marc Kaufmann

unread,
Mar 27, 2020, 4:56:00 AM3/27/20
to Racket Users
Hi,

I am trying to set up vim such that it jumps to the correct source file when I see a `(require some-module)`. With packages that I have installed myself, I have managed to do so (80% solution), since they get installed in $HOME/.racket/<version>/pkgs. However, I can't quite figure out where all the things are. Some are in /usr/share/racket/pkgs/<module>-lib/<submodules-and-sub-submodules>, but others like racket/match seem to be in /usr/share/racket/collects/... . Are there any other places for the core modules?

Rather than me trying to do something error-prone, is there a Racket function that I can call on <some-module> that returns the right path on my machine? That way I don't write stupid error-prone regexes.

Cheers,
Marc

Alexis King

unread,
Mar 27, 2020, 5:08:22 AM3/27/20
to Marc Kaufmann, Racket Users
I recommend Ryan Culpepper’s whereis package: https://docs.racket-lang.org/whereis/index.html It provides both a programmatic interface and a raco command.

Alexis

Marc Kaufmann

unread,
Mar 30, 2020, 1:09:00 AM3/30/20
to Alexis King, Racket Users
Awesome, that looks like the right thing.

Thanks,
Marc
Reply all
Reply to author
Forward
0 new messages