Open jhrcek opened 1 month ago
Thanks for the ticket!
The short answer is that the default value is src
. It's pretty unsophisticated. I thought I had a note explaining this somewhere but apparently I do not. Do you have somewhere you think this information should live? (Where did you look for it before you realized it wasn't listed?) I might create a new section in the user manual for it.
If a file argument is given (ghciwatch Foo.hs
), the command executed is ghci Foo.hs
. If neither a file argument nor --command
are given, the command is cabal repl
.
I also have a long-standing TODO to copy some of ghcid
's logic for constructing a default command, which is listed here:
Do you have somewhere you think this information should live?
Good question. Skimming the docs again I see it's actually mentioned in passing in the first example: https://mercurytechnologies.github.io/ghciwatch/cli.html#examples "Load cabal v2-repl and watch for changes in src:"
I would expand that to "watch for changes to *.hs files in src directory or any of its subdirectories (recursively)" (or whatever is actually true)
Originally I was looking for it under --watch flag's documentation https://mercurytechnologies.github.io/ghciwatch/cli.html#--watch maybe because I'm used to optparse-applicative showing the defaults as part of the help message for each flag, e.g. it could be added as last sentence there..
--watch <PATH>
A path to watch for changes.
Directories are watched recursively. Can be given multiple times.
**If not provided, the default behavior is as if `--watch src` was provided.**
Describe the feature you’d like to be implemented
It would be nice to mention (maybe in --help, but definitely in docs) what exactly is being watched when
--watch
flag is not specified.Is cabal file included in the watching by default? It seems to me that there are no reloads on cabal file changes (in which case this is a bug report). Is it all .hs files found in current directory?
List alternatives to the feature and their pros and cons
No response
Additional context
Thank you for opensourcing this great tool, I switched my project to it from ghcid and I'm excited it fixes many issues that I had with ghcid