appulate / vscode-file-watcher

Extension for Visual Studio Code allows configuring commands that get run whenever a file is saved or folder is changed in vscode.
MIT License
39 stars 22 forks source link

Is there a way to stop previous cmd execution once new cmd is triggered? #4

Closed ThePlenkov closed 2 years ago

ThePlenkov commented 4 years ago

Hi!

I created some file watcher task which takes around 30 seconds to build the project.

The problem - with activated autosave - it triggers this command almost every time I press a key.

It would be great that along with sync/async - we will also provide some flag saying that only 1 runner can run and the rest must be killed.

Thank you!

VovanNet commented 4 years ago

File watching handlers not good for long time buildings. Its better to use manual running of vscode task or npm commands for these purposes. But we try to implement timeout setting to kill very long running

ThePlenkov commented 4 years ago

This is mostly not even about long lasting task but rather about multiple concurrent tasks. Let’s say typing a text with activated auto save feature triggers file change every key press. The extensions triggers up every time a new process. The idea to limit number of async processes is mostly to prevent this extension to overload PC.

Currently I solved my issue by setting up auto save delay.