-
Notifications
You must be signed in to change notification settings - Fork 113
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
Allow --test expression to declare file dependencies #353
Comments
I think having test figure out new dependencies would be possible, but I wonder if the ability to do so dynamically is worth the hassle? Are the things being read hard to figure out in advance (or at least an approximation thereof) and put in |
I agree, it would be unusual to have use cases that can't be addressed with That said, unless this would be useful to others, I think I can also just start a thread and watch these files myself and |
The thread touching a file seems like a reasonable way to go for now, until we find other people with similar use cases. |
Would it make sense to allow the Haskell expression passed in with the
--test
option to somehow declare what non-Haskell files it ended up depending on, so that they can be added to the watch list.This would allow a tighter integration with any workflow that involves external files. Application configurations, test inputs/outputs or, in my case, DB migrations would be useful to watch this way.
I guess one can also organize the project file structure so that all interesting files live under predetermined folders so one can pass those folders to
--reload
, but being able to declare these dynamically might allow richer workflows.Another alternative could be to use a
--test
expression that keeps running after doing what it's supposed to do and then it starts watching the files itself and repeats what it does when any of them change. This avoids the need for any cooperation fromghcid
, but I think this is a clunkier solution.As for how this ticket might work; Would it be possible to let the
--test
expression to produce a result of some special type thatghcid
interprets specially. Maybe a record that contains a fieldexternalDependencies :: [FilePath]
. Or maybeghcid
justshow
s the output of the expression as usual and just interprets the string looking for some special forms, similar to how--allow-eval
looks for-- $>
comments to evaluate.The text was updated successfully, but these errors were encountered: