triggertaskonsave icon indicating copy to clipboard operation
triggertaskonsave copied to clipboard

File changed

Open llgcode opened this issue 4 years ago • 7 comments

Hi Nigel, Is it possible to trigger a task when a file has been changed, result of a compilation for example. regards

llgcode avatar Jun 14 '21 09:06 llgcode

Not currently via the extension. I had a look at the task docs (https://code.visualstudio.com/Docs/editor/tasks) and it sort of suggests there are ways to trigger tasks - there is a "runOn" option, but it only seems allow "folderOpen".

You could try some experiments and if there is no way to do it, let me know and I can add a file watcher to the extension.

Gruntfuggly avatar Jun 14 '21 10:06 Gruntfuggly

image

llgcode avatar Jun 14 '21 10:06 llgcode

I think "default" just means you have to trigger the task manually.

Gruntfuggly avatar Jun 14 '21 10:06 Gruntfuggly

FWIW the entire reason why I am trying out this extension is because I don't want to run a file watcher (such as Python's watchdog).

nandoflorestan avatar Jul 28 '21 15:07 nandoflorestan

I'm confused - you want to trigger the task when a file has changed, but you don't want a file watcher? How can you do one without the other?

Gruntfuggly avatar Jul 28 '21 15:07 Gruntfuggly

I am a different person from the original poster.

I saw you wrote "I can add a file watcher to the extension". I would be against that. I already have plenty of file watchers I can run. I don't want to run them, I don't want the performance impact. This plugin already does what I want: run a script when I save a file in my editor.

I meant an added file watcher might be a disservice to those like me.

I hope this is clearer...

nandoflorestan avatar Jul 28 '21 16:07 nandoflorestan

Ah OK - sorry, wasn't paying enough attention. If I add one, it would be configurable and off by default anyway.

Gruntfuggly avatar Jul 28 '21 16:07 Gruntfuggly