-
Notifications
You must be signed in to change notification settings - Fork 12
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
Debouncing file removal #334
Comments
The default debouncing interval is 500ms; try You might try Unfortunately file-watching libraries are very unreliable and full of bugs, even |
BTW it's always helpful to hear about the performance characteristics of ghciwatch so I appreciate this ticket; I'm closing it because I don't think there's too much I can do right now at least. Feel free to comment if you have more information. |
Ok yeah it's exactly as described in notify-rs/notify#247 (comment) . I just hadn't realized that vim's behavior was still unsupported. :P |
Ahhh that's frustrating. FWIW I use |
What happened?
I am watching an individual file:
After making edits in vim, I get this behavior from ghciwatch:
This kills the ghciwatch workflow, naturally. :)
What did you expect to happen?
ghciwatch should see the file change (not get deleted) and reload it.
Hypothesis
Here's what I think is happening. For atomicity, vim does a little dance when writing a file: Write to a temp file, delete the real file, move the temp file to the real file. I assume ghciwatch sees the deletion and stops tracking the file. I've seen this problem with similar tool in the past.
If that is the case (and I haven't looked, sorry), then it might be better to debounce the deletion: Keep tracking the file until the debounce period is over.
Workaround
Watch the directory instead of the file.
ghciwatch --command 'ghci main.hs' --watch . --test-ghci main
Steps to reproduce the issue
(in a separate shell)
The version of ghciwatch with the bug
ghciwatch 1.0.1
The text was updated successfully, but these errors were encountered: