feedback icon indicating copy to clipboard operation
feedback copied to clipboard

Is there a way to add a timeout option to feedback so it waits if lots of files are changing at the same time?

Open erlandsona opened this issue 2 years ago • 6 comments

erlandsona avatar Aug 24 '23 13:08 erlandsona

@erlandsona You're probably looking to configure this FS.defaultConfig: https://github.com/NorfairKing/feedback/blob/9b2b037be77805507928238ec3c34abec9133631/feedback/src/Feedback/Loop.hs#L75

PR welcome!

NorfairKing avatar Aug 24 '23 15:08 NorfairKing

Ah wait no that doesn't make sense because feedback will still run the first time anything happens. I'm not sure how you'd like this to work then. Can you elaborate?

NorfairKing avatar Aug 24 '23 15:08 NorfairKing

Of course. Sorry we've got a make format task that runs stylish-haskell -i **/*.hs which touches every file in the project and if I forgot to kill feedback dev it'll trigger new build processes for every file being "changed" in the project.

Obviously the current workaround is to just kill the watcher before I run the formatter, but for LSP formatting it still can run away from me because I'll write the file then the formatter will write the file which can trigger 2 recompiles.

Of course the assumption here is that feedback is reliably killing the build whenever files change but sometimes the processes go rougue and I've got a free flyin' background stack build goin' until it finishes and no amount of ctrl-c can fix it.

erlandsona avatar Aug 24 '23 20:08 erlandsona

@erlandsona So if I understand it well, you want a configurable threadDelay that happens after a change event and before the loop is rerun? Yeah PR welcome!

NorfairKing avatar Aug 24 '23 20:08 NorfairKing

I guess? Or just denouncing on the file changed events? Not sure I can get to it any time soon but sounds good! Where should I look first to get started?

erlandsona avatar Aug 24 '23 20:08 erlandsona

Option parsing goes here: https://github.com/NorfairKing/feedback/blob/master/feedback/src/Feedback/Common/OptParse.hs

Delay goes here: https://github.com/NorfairKing/feedback/blob/9b2b037be77805507928238ec3c34abec9133631/feedback/src/Feedback/Loop.hs#L172

NorfairKing avatar Aug 24 '23 23:08 NorfairKing