A task to execute

Constructor

new(taskDefinition:TaskDefinition, target:EitherType<WorkspaceFolder, TaskScope>, name:String, source:String, ?execution:EitherType<ProcessExecution, EitherType<ShellExecution, CustomExecution>>, ?problemMatchers:EitherType<String, Array<String>>)

new(taskDefinition:TaskDefinition, name:String, source:String, ?execution:EitherType<ProcessExecution, ShellExecution>, ?problemMatchers:EitherType<String, Array<String>>)

Creates a new task.

Parameters:

definition

The task definition as defined in the taskDefinitions extension point.

scope

Specifies the task's scope. It is either a global or a workspace task or a task for a specific workspace folder. Global tasks are currently not supported.

name

The task's name. Is presented in the user interface.

source

The task's source (e.g. 'gulp', 'npm', ...). Is presented in the user interface.

execution

The process or shell execution.

problemMatchers

the names of problem matchers to use, like '$tsc' or '$eslint'. Problem matchers can be contributed by an extension using the problemMatchers extension point.

Variables

definition:TaskDefinition

The task's definition.

detail:Null<String>

A human-readable string which is rendered less prominently on a separate line in places where the task's name is displayed. Supports rendering of {@link ThemeIcon theme icons} via the $(<name>)-syntax.

execution:Null<EitherType<ProcessExecution, EitherType<ShellExecution, CustomExecution>>>

The task's execution engine

group:Null<TaskGroup>

The task group this tasks belongs to. See TaskGroup for a predefined set of available groups. Defaults to undefined meaning that the task doesn't belong to any special group.

isBackground:Bool

Whether the task is a background task or not.

name:String

The task's name

presentationOptions:TaskPresentationOptions

The presentation options. Defaults to an empty literal.

problemMatchers:Array<String>

The problem matchers attached to the task. Defaults to an empty array.

runOptions:RunOptions

Run options for the task

read onlyscope:Null<EitherType<TaskScope, WorkspaceFolder>>

The task's scope.

source:String

A human-readable string describing the source of this shell task, e.g. 'gulp' or 'npm'. Supports rendering of {@link ThemeIcon theme icons} via the $(<name>)-syntax.