You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When working with code, we often wish to open the module we are working with in ghci. The way to do this with cabal is "cabal repl ".
If we forget to include the module in exposed-module we get a quite confusing error message from cabal:
$ cabal repl MyModule.hs
Error: [Cabal-7121]
Failed extracting script block: `{- cabal:` start marker not found
Notably if we drop the ".hs" extension in the filename, we get a much better error message:
$ cabal repl MyModule
Error: [Cabal-7076]
Cannot open a repl for the package MyModule, it is not in this project (either directly or indirectly). If you want to add it to the project then edit the cabal.project file.
I feel the good error message should be used in both situations. Why not just omit the .hs in the name? Well, cabal repl is frequently launched from editor keybinds where finding out the current file name is easy, but finding out the canonical module name can be much harder. And the .hs version does work perfectly as long as the module is in exposed-modules.
Describe the bug
When working with code, we often wish to open the module we are working with in ghci. The way to do this with cabal is "cabal repl ".
If we forget to include the module in exposed-module we get a quite confusing error message from cabal:
Notably if we drop the ".hs" extension in the filename, we get a much better error message:
I feel the good error message should be used in both situations. Why not just omit the .hs in the name? Well, cabal repl is frequently launched from editor keybinds where finding out the current file name is easy, but finding out the canonical module name can be much harder. And the .hs version does work perfectly as long as the module is in exposed-modules.
To Reproduce
Steps to reproduce the behavior:
Clone this gist and execute "cabal repl MyModule":
https://gist.github.com/jforberg/bcf4debd9be3f37352827765636dc719
Expected behavior
The second error message should be used in both situations.
System information
Arch linux, GHC 9.10.2, Cabal 3.12.1.0.
Additional context
N/A
The text was updated successfully, but these errors were encountered: