Skip to content

Test: new task API and contributions #23280

@dbaeumer

Description

@dbaeumer

Tests: #22069 & #22066

Complexity: 4

Write a new extension that contributes problem pattern, problem patterns and a task provider. An example on how to contribute a problem pattern and a matcher can be found here: https://github.com/Microsoft/vscode/blob/master/extensions/typescript/package.json#L386

An example on how to write a task provider can be found here: https://github.com/Microsoft/vscode/blob/master/extensions/gulp/src/main.ts

Please note that we didn't introduce special activation events for tasks. We are currently relying on command activation events. So to participate in Run Task, Run Build Task and Run Test Task you need to list the following activation events:

  "activationEvents": [
    "onCommand:workbench.action.tasks.runTask",
    "onCommand:workbench.action.tasks.build",
    "onCommand:workbench.action.tasks.test"
  ]

See also: https://github.com/Microsoft/vscode/blob/master/extensions/gulp/package.json#L25

In the workspace you test on you need to create a tasks.json and point it to version: "2.0.0". The reason is that task contribution is only allowed with the new terminal runner.

{
   "version": "2.0.0"
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions