Make plz watch debounce duration configurable
This could be done by adding a flag for waiting a certain time after the last change to that target before building, or just building this in by default.
This would be very helpful for avoid building things that are genuinely broken because I haven't finished typing the line yet 😅
plz watch does have some debouncing, see https://github.com/thought-machine/please/blob/270c0ece7d2465ea20457afeae5056bfea243709/src/watch/watch.go#L67
It seems reasonable to make that configurable though (currently it's a constant 100ms).
This would be very helpful for avoid building things that are genuinely broken because I haven't finished typing the line yet
Curious, it only fires builds when the file actually gets written to disk; is that happening for you because you're saving as you go, or is your editor autosaving as you write?
It might be that he was editing the file during the build, so when the build finishes it just starts the next build. If the target takes a while to link, this might happen but I'm not sure if we can really do anything about this.
plz watch does have some debouncing, see
https://github.com/thought-machine/please/blob/270c0ece7d2465ea20457afeae5056bfea243709/src/watch/watch.go#L67
It seems reasonable to make that configurable though (currently it's a constant 100ms).
This would be very helpful for avoid building things that are genuinely broken because I haven't finished typing the line yet
Curious, it only fires builds when the file actually gets written to disk; is that happening for you because you're saving as you go, or is your editor autosaving as you write?
I'm using vscode with autosave, and its saves every ~ 250ms leading to this behaviour
I'm using vscode with autosave, and its saves every ~ 250ms leading to this behaviour
OK, I'm fine with providing a flag to make this configurable to work around that then. Although I do think that is a little naive of VSCode to just do it on a hard timer - I'd expect it to be debouncing here as well.
This issue has been automatically marked as stale because it has not had any recent activity in the past 90 days. It will be closed if no further activity occurs. If you require additional support, please reply to this message. Thank you for your contributions.