MercuryTechnologies / ghciwatch

Load a GHCi session for a Haskell project and reload it when source files change
https://mercurytechnologies.github.io/ghciwatch/
MIT License
111 stars 10 forks source link

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

Closed 9999years closed 4 months ago

9999years commented 4 months ago

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.

linear[bot] commented 4 months ago

DUX-2339 Add tests for `NormalPath`

github-actions[bot] commented 4 months ago

A PR to release these changes has been created, bumping the version from 1.0.0 to 1.0.1.