Can extensions contribute a custom task in VS Code?

Viewed 466

I'm writing a VS Code extension. I want to contribute a Task to the user's workspace, without the user having to configure it (ideally conditionally, depending on the contents of the workspace), and I probably also need a custom problemMatcher.

Does VS Code expose an API to do so? Or should I be writing my own command instead of a task?

1 Answers

Yes, an API for contributing tasks was introduced in VSCode 1.14 (June 2017). The entry point for it is the registerTaskProvider() method found in the vscode.tasks namespace. For a usage example, check out the task-provider-sample found in vscode-extension-samples.

Related