Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TaskService

Hierarchy

  • TaskService

Implements

Index

Constructors

constructor

Properties

Protected Readonly app

app: FrontendApplication

Protected cachedRecentTasks

cachedRecentTasks: TaskConfiguration[] = []

Protected Readonly commands

commands: CommandService

Protected Readonly editorManager

editorManager: EditorManager

Protected Readonly labelProvider

labelProvider: LabelProvider

Protected lastTask

lastTask: undefined | { scope: TaskConfigurationScope; source: string; taskLabel: string } = ...

The last executed task.

Protected Readonly logger

logger: ILogger

Protected Readonly messageService

messageService: MessageService

Protected monacoWorkspace

monacoWorkspace: MonacoWorkspace

Protected Readonly openerService

openerService: OpenerService

Protected Readonly problemManager

problemManager: ProblemManager

Protected Readonly problemMatcherRegistry

problemMatcherRegistry: ProblemMatcherRegistry

Protected Readonly providedTaskConfigurations

providedTaskConfigurations: ProvidedTaskConfigurations

Protected Readonly quickPickService

quickPickService: QuickPickService

Protected runningTasks

runningTasks: Map<number, { exitCode: Deferred<undefined | number>; isBackgroundTaskEnded: Deferred<undefined | boolean>; terminateSignal: Deferred<undefined | string> }> = ...

Protected Readonly shell

shell: ApplicationShell

Protected Readonly shellTerminalServer

shellTerminalServer: JsonRpcProxy<IShellTerminalServer>

Protected Readonly taskConfigurationManager

taskConfigurationManager: TaskConfigurationManager

Protected Readonly taskConfigurations

taskConfigurations: TaskConfigurations

Protected Readonly taskDefinitionRegistry

taskDefinitionRegistry: TaskDefinitionRegistry

Protected Readonly taskNameResolver

taskNameResolver: TaskNameResolver

Protected Readonly taskResolverRegistry

taskResolverRegistry: TaskResolverRegistry

Protected Readonly taskSchemaUpdater

taskSchemaUpdater: TaskSchemaUpdater

Protected Readonly taskServer

taskServer: TaskServer

Protected Readonly taskSourceResolver

taskSourceResolver: TaskSourceResolver

Protected taskStartingLock

taskStartingLock: Mutex = ...

Protected Readonly taskTerminalWidgetManager

taskTerminalWidgetManager: TaskTerminalWidgetManager

Protected Readonly taskWatcher

taskWatcher: TaskWatcher

Protected Readonly terminalService

terminalService: TerminalService

Protected Readonly variableResolverService

variableResolverService: VariableResolverService

Protected Readonly widgetManager

widgetManager: WidgetManager

Protected Readonly workspaceService

workspaceService: WorkspaceService

Accessors

recentTasks

Methods

addRecentTasks

attach

  • attach(terminalId: number, taskInfo: TaskInfo): Promise<number | void>

clearRecentTasks

  • clearRecentTasks(): void

configure

createChildTaskNode

customExecutionComplete

  • customExecutionComplete(id: number, exitCode: undefined | number): Promise<void>

detectDirectedAcyclicGraph

Protected doRunTask

getConfiguredTasks

Protected getContext

  • getContext(): undefined | string

Protected getCustomizeProblemMatcherItems

getDependentTask

  • Gets task configuration by task label or by a JSON object which represents a task identifier

    Parameters

    • taskIdentifier: string | TaskIdentifier

      The task label (string) or a JSON object which represents a TaskIdentifier (e.g. {"type":"npm", "script":"script1"})

    • tasks: TaskConfiguration[]

      an array of the task configurations

    Returns TaskConfiguration

    the correct TaskConfiguration object which matches the taskIdentifier

getExitCode

  • getExitCode(id: number): Promise<undefined | number>

getLastTask

getProvidedTask

  • Returns a task configuration provided by an extension by task source, scope and label. If there are no task configuration, returns undefined.

    Parameters

    • token: number

      The cache token for the user interaction in progress

    • source: string

      The source for configured tasks

    • label: string

      The label of the task to find

    • scope: TaskConfigurationScope

      The task scope to look in

    Returns Promise<undefined | TaskConfiguration>

getProvidedTasks

getRegisteredTaskTypes

  • getRegisteredTaskTypes(): Promise<string[]>

getRunningTasks

  • getRunningTasks(): Promise<TaskInfo[]>

getTaskByTaskIdentifier

  • Gets the matched task from an array of task configurations by TaskIdentifier. In case that more than one task configuration matches, we returns the first one.

    Parameters

    • taskIdentifier: TaskIdentifier

      The task label (string) or a JSON object which represents a TaskIdentifier (e.g. {"type":"npm", "script":"script1"})

    • tasks: TaskConfiguration[]

      An array of task configurations.

    Returns TaskConfiguration

    The correct TaskConfiguration object which matches the taskIdentifier.

Protected getTaskCustomization

Protected getTaskIdentifier

getTasks

Protected getTerminalWidgetId

  • getTerminalWidgetId(terminalId: number): undefined | string

getTerminateSignal

  • getTerminateSignal(id: number): Promise<undefined | string>

Protected getWorkspaceTasks

Protected init

  • init(): void

isBackgroundTaskEnded

  • isBackgroundTaskEnded(id: number): Promise<undefined | boolean>

Protected isEventForThisClient

  • isEventForThisClient(context: undefined | string): boolean

kill

  • kill(id: number): Promise<void>

openUserTasks

  • openUserTasks(): Promise<void>

Protected removeProblemMarkers

Protected resolveProblemMatchers

restartTask

run

  • Runs a task, by the source and label of the task configuration. It looks for configured and detected tasks.

    Parameters

    • token: number

      The cache token for the user interaction in progress

    • source: string

      The source for configured tasks

    • taskLabel: string

      The label to look for

    • scope: TaskConfigurationScope

      The scope where to look for tasks

    Returns Promise<undefined | TaskInfo>

runCompoundTask

runConfiguredTask

  • Runs a task, by task configuration label. Note, it looks for a task configured in tasks.json only.

    Parameters

    • token: number

      The cache token for the user interaction in progress

    • scope: TaskConfigurationScope

      The scope where to look for tasks

    • taskLabel: string

      the label to look for

    Returns Promise<void>

runLastTask

  • runLastTask(token: number): Promise<undefined | TaskInfo>

Protected runResolvedTask

runSelectedText

  • runSelectedText(): Promise<void>

runTask

runTaskByLabel

  • runTaskByLabel(token: number, taskLabel: string): Promise<undefined | TaskInfo>
  • Runs the first task with the given label.

    Parameters

    • token: number

      The cache token for the user interaction in progress

    • taskLabel: string

      The label of the task to be executed

    Returns Promise<undefined | TaskInfo>

runTasksGraph

runWorkspaceTask

  • runWorkspaceTask(token: number, workspaceFolderUri: undefined | string, taskIdentifier: string | TaskIdentifier): Promise<undefined | TaskInfo>
  • Runs a task identified by the given identifier, but only if found in the given workspace folder

    Parameters

    • token: number

      The cache token for the user interaction in progress

    • workspaceFolderUri: undefined | string

      The folder to restrict the search to

    • taskIdentifier: string | TaskIdentifier

      The identifier to look for

    Returns Promise<undefined | TaskInfo>

startUserAction

  • startUserAction(): number
  • Client should call this method to indicate that a new user-level action related to tasks has been started, like invoking "Run Task..." This method returns a token that can be used with various methods in this service. As long as a client uses the same token, task providers will only asked once to contribute tasks and the set of tasks will be cached. Each time the a new token is used, the cache of contributed tasks is cleared.

    Returns number

    a token to be used for task-related actions

taskConfigurationChanged

  • taskConfigurationChanged(event: string[]): void
  • The task configuration file has changed, so a client might want to refresh its configurations

    Parameters

    • event: string[]

    Returns void

terminateTask

  • terminateTask(activeTaskInfo: TaskInfo): Promise<void>

updateTaskConfiguration

  • updateTaskConfiguration(token: number, task: TaskConfiguration, update: {}): Promise<void>
  • Updates the task configuration in the tasks.json. The task config, together with updates, will be written into the tasks.json if it is not found in the file.

    Parameters

    • token: number

      The cache token for the user interaction in progress

    • task: TaskConfiguration

      task that the updates will be applied to

    • update: {}

      the updates to be applied

      • [name: string]: any

    Returns Promise<void>