Task2 is kept for compatibility reasons.

Hierarchy (view full)

Constructors

  • Creates a new task.

    Parameters

    • taskDefinition: TaskDefinition
    • scope: WorkspaceFolder | Global | Workspace

      Specifies the task's scope.

    • name: string

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

    • Optional source: string

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

    • Optional execution: ShellExecution | ProcessExecution | CustomExecution

      The process, shell or custom execution.

    • Optional problemMatchers: string | string[]

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

    Returns Task2

  • Creates a new task.

    Parameters

    • taskDefinition: TaskDefinition
    • name: string

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

    • source: string

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

    • Optional execution: ShellExecution | ProcessExecution | CustomExecution

      The process, shell or custom execution.

    • Optional problemMatchers: string | string[]

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

    Returns Task2

    Deprecated

    Use the new constructors that allow specifying a scope for the task.

Properties

definition: TaskDefinition

The task's definition.

detail?: 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 theme icons via the $(<name>)-syntax.

The task's execution engine

group?: 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?: boolean

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?: string[]

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

runOptions: RunOptions

Run options for the task

The task's scope.

source?: string

A human-readable string describing the source of this shell task, e.g. 'gulp' or 'npm'.