I am trying to get the new registerTaskProvider
method in the VSCode Task API working within my extension, and I have been unable to make this work so far.
I have used the npm extension as a basis. Here are the steps that I have followed:
- Used yo to create a new extension
- Updated package.json to include a new activationEvent
onCommand:workbench.action.tasks.runTask
- Updated package.json to include
configuration
andtaskDefinitions
sections in thecontributes
section - Added the following code to the extension.ts file
NOTE: I realise that the linked code won't actually provide any additional tasks, I am just using this code as a basis for testing.
Now, when I try to debug the extension, the provideTasks
method is never invoked. What am I missing?
Also, the only way to have the activate method called is when I invoke the Hello World
command. However, I might not have a command associated with the extension. How can I force the activation of the extension?
Is there any additional documentation on how to get started with the registerTaskProvider
API?
I have added a sample repository that has the current work to date.