Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix :show targets / :show paths parsing logic #294

Merged
merged 1 commit into from
Jun 21, 2024

Commits on Jun 13, 2024

  1. Fix :show targets / :show paths parsing logic

    Previously, if `:show targets` displayed a path, we would attempt to
    join that path to each of the module search paths and to GHCi's working
    directory to find the file.
    
    In reality, GHCi only checks such paths relative to its working
    directory. (Indeed, if you change the working directory with `:cd`, GHCi
    will unload all modules. [1])
    
    Also, the logic for checking these paths was broken, considering that
    the search paths can be relative to the working directory, but we
    weren't properly joining these paths.
    
    In the future, I'll write some tests that do `--after-startup-ghci
    ":cd ../"` and see how much of ghciwatch explodes.
    
    [1]: https://gitlab.haskell.org/ghc/ghc/-/blob/077cb2e11fa81076e8c9c5f8dd3bdfa99c8aaf8d/compiler/GHC.hs#L1073-L1083
    9999years committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    bec1747 View commit details
    Browse the repository at this point in the history