-
Notifications
You must be signed in to change notification settings - Fork 291
add watch / unwatch commands
#6063
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
Conversation
|
@mitchellwrosen Could you check if I broke |
|
@aryairani Couple things –
|
Thanks yeah, these were both accidental delirium-related outcomes. For 1. I think I ended up there because of something to do with wanting to to unwatch paths even before application exit. Would it be better to have both an explicit and an implicit cleanup? Do you know if this can actually leave threads running in the background? In any case, it was an accident to leave a Ki scope that isn't used. For 2. Yeah not ideal; is it that the race would happen if watch path set changes are come from some other thread? but I don't think we want that anyway. i.e. right now the idea is that they're disabled in non-interactive contexts, and there shouldn't be a race in an interactive context, I don't think? |
|
For 1, I would say it'd only be theoretically better to ensure all file-watching threads get cleaned up. I think we could just abandon For 2, agree there shouldn't be a race in practice, just wanted to call out the non-atomicity in the implementation. I think we could just delete |
|
Okay I'll do that then. We can always revisit too, thanks for taking a look. |
though we could revisit later
doesn't appear in transcripts because the file watcher is disabled in transcripts
…nison into arya/watch-other-file.claude
Overview
These commands let you watch multiple directories or multiple individual files. Initially we watch the start-up directory like usual, but you can remove it and/or add other paths.
Closes #4850.
Implementation approach and notes
How does it accomplish it, in broad strokes? i.e. How does it change the Haskell codebase?
Interesting/controversial decisions
Hopefully I didn't mess up any Ki / finalizer stuff. (I did?)
unwatchaccepts multiple args, butwatchonly accepts one arg. I guess there's no harm in havingwatchaccept multiple args, but I wasn't sure it was worth the effort.Test coverage
Also a transcript showing that the three new commands are disabled (along with file watching in general) during transcripts.
I would like better test coverage, but it would require coordinating two processes to use CLI on one side and trigger file events on the other side, and I acknowledge we don't have any tests like that yet and it might be a pain to set up.
Both as shown above.
Loose ends
n/a
Final checklist
.cabalfiles, make sure thepackage.yamlfiles are up-to-date instead.