src/vs/workbench/contrib/tasks/common/taskService.ts

119 LOC · 119 covered · 0 uncovered · 1 ranges · 131 concepts · 1 introducers · 59 tests

File neighbourhood

The centred file is linked to every concept that introduces one of its ranges, every test that runs code from the file, and the gray connector concepts standing between those tests and the file's own introducer concepts. Undirected links join concepts to every file where they introduce source and concepts to the tests they introduce; arrows show specialization between the displayed concepts and bridge only concepts omitted from this view. Concept colors match the source ranges below; connector concepts have no source color and are shown in gray.

Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the file

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the related-file, concept, and source links on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the related-file, concept, and source links on this page while the interactive map is unavailable.

1 > /*--------------------------------------------------------------------------------------------- taskConfiguration.ts ×80
2 > * Copyright (c) Microsoft Corporation. All rights reserved.
3 > * Licensed under the MIT License. See License.txt in the project root for license information.
4 > *--------------------------------------------------------------------------------------------*/
5 >
6 > import * as nls from '../../../../nls.js';
7 > import { Action } from '../../../../base/common/actions.js';
8 > import { Event } from '../../../../base/common/event.js';
9 > import { createDecorator } from '../../../../platform/instantiation/common/instantiation.js';
10 > import { IDisposable } from '../../../../base/common/lifecycle.js';
11 > import { IWorkspaceFolder, IWorkspace } from '../../../../platform/workspace/common/workspace.js';
12 > import { Task, ContributedTask, CustomTask, ITaskSet, TaskSorter, ITaskEvent, ITaskIdentifier, ConfiguringTask, TaskRunSource } from './tasks.js';
13 > import { ITaskSummary, ITaskTerminateResponse, ITaskSystemInfo } from './taskSystem.js';
14 > import { IStringDictionary } from '../../../../base/common/collections.js';
15 > import { RawContextKey, ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js';
16 > import { URI } from '../../../../base/common/uri.js';
17 > import { IMarkerData } from '../../../../platform/markers/common/markers.js';
18 > import type { SingleOrMany } from '../../../../base/common/types.js';
19 > export type { ITaskSummary, Task, ITaskTerminateResponse as TaskTerminateResponse };
20 > export const CustomExecutionSupportedContext = new RawContextKey<boolean>('customExecutionSupported', false, nls.localize('tasks.customExecutionSupported', "Whether CustomExecution tasks are supported. Consider using in the when clause of a \'taskDefinition\' contribution."));
21 > export const ShellExecutionSupportedContext = new RawContextKey<boolean>('shellExecutionSupported', false, nls.localize('tasks.shellExecutionSupported', "Whether ShellExecution tasks are supported. Consider using in the when clause of a \'taskDefinition\' contribution."));
22 > export const TaskCommandsRegistered = new RawContextKey<boolean>('taskCommandsRegistered', false, nls.localize('tasks.taskCommandsRegistered', "Whether the task commands have been registered yet"));
23 > export const ProcessExecutionSupportedContext = new RawContextKey<boolean>('processExecutionSupported', false, nls.localize('tasks.processExecutionSupported', "Whether ProcessExecution tasks are supported. Consider using in the when clause of a \'taskDefinition\' contribution."));
24 > export const ServerlessWebContext = new RawContextKey<boolean>('serverlessWebContext', false, nls.localize('tasks.serverlessWebContext', "True when in the web with no remote authority."));
25 > export const TasksAvailableContext = new RawContextKey<boolean>('tasksAvailable', false, nls.localize('tasks.tasksAvailable', "Whether any tasks are available in the workspace."));
26 > export const TaskExecutionSupportedContext = ContextKeyExpr.or(ContextKeyExpr.and(ShellExecutionSupportedContext, ProcessExecutionSupportedContext), CustomExecutionSupportedContext);
27 >
28 > export const ITaskService = createDecorator<ITaskService>('taskService');
29 >
30 > export interface ITaskProvider {
31 > provideTasks(validTypes: IStringDictionary<boolean>): Promise<ITaskSet>;
32 > resolveTask(task: ConfiguringTask): Promise<ContributedTask | undefined>;
33 > }
34 >
35 > export interface IProblemMatcherRunOptions {
36 > attachProblemMatcher?: boolean;
37 > }
38 >
39 > export interface ICustomizationProperties {
40 > group?: string | { kind?: string; isDefault?: boolean };
41 > problemMatcher?: SingleOrMany<string>;
42 > isBackground?: boolean;
43 > color?: string;
44 > icon?: string;
45 > inAgents?: boolean;
46 > }
47 >
48 > export interface ITaskFilter {
49 > version?: string;
50 > type?: string;
51 > task?: string;
52 > }
53 >
54 > interface IWorkspaceTaskResult {
55 > set: ITaskSet | undefined;
56 > configurations: {
57 > byIdentifier: IStringDictionary<ConfiguringTask>;
58 > } | undefined;
59 > hasErrors: boolean;
60 > }
61 >
62 > export interface IWorkspaceFolderTaskResult extends IWorkspaceTaskResult {
63 > workspaceFolder: IWorkspaceFolder;
64 > }
65 >
66 > export interface ITaskService {
67 > readonly _serviceBrand: undefined;
68 > readonly onDidStateChange: Event<ITaskEvent>;
69 > /** Fired when task providers are registered or unregistered */
70 > readonly onDidChangeTaskProviders: Event<void>;
71 > isReconnected: boolean;
72 > readonly onDidReconnectToTasks: Event<void>;
73 > supportsMultipleTaskExecutions: boolean;
74 >
75 > configureAction(): Action;
76 > run(task: Task | undefined, options?: IProblemMatcherRunOptions, runSource?: TaskRunSource): Promise<ITaskSummary | undefined>;
77 > inTerminal(): boolean;
78 > getActiveTasks(): Promise<Task[]>;
79 > getBusyTasks(): Promise<Task[]>;
80 > terminate(task: Task): Promise<ITaskTerminateResponse>;
81 > tasks(filter?: ITaskFilter): Promise<Task[]>;
82 > rerun(terminalInstanceId: number): void;
83 > /**
84 > * Gets tasks currently known to the task system. Unlike {@link tasks},
85 > * this does not activate extensions or prompt for workspace trust.
86 > */
87 > getKnownTasks(filter?: ITaskFilter): Promise<Task[]>;
88 > taskTypes(): string[];
89 > getWorkspaceTasks(runSource?: TaskRunSource): Promise<Map<string, IWorkspaceFolderTaskResult>>;
90 > getSavedTasks(type: 'persistent' | 'historical'): Promise<(Task | ConfiguringTask)[]>;
91 > removeRecentlyUsedTask(taskRecentlyUsedKey: string): void;
92 > getTerminalsForTasks(tasks: SingleOrMany<Task>): URI[] | undefined;
93 > getTaskProblems(instanceId: number): Map<string, { resources: URI[]; markers: IMarkerData[] }> | undefined;
94 > /**
95 > * @param alias The task's name, label or defined identifier.
96 > */
97 > getTask(workspaceFolder: IWorkspace | IWorkspaceFolder | string, alias: string | ITaskIdentifier, compareId?: boolean): Promise<Task | undefined>;
98 > tryResolveTask(configuringTask: ConfiguringTask): Promise<Task | undefined>;
99 > createSorter(): TaskSorter;
100 >
101 > getTaskDescription(task: Task | ConfiguringTask): string | undefined;
102 > customize(task: ContributedTask | CustomTask | ConfiguringTask, properties?: {}, openConfig?: boolean): Promise<void>;
103 > openConfig(task: CustomTask | ConfiguringTask | undefined): Promise<boolean>;
104 >
105 > registerTaskProvider(taskProvider: ITaskProvider, type: string): IDisposable;
106 >
107 > registerTaskSystem(scheme: string, taskSystemInfo: ITaskSystemInfo): void;
108 > readonly onDidChangeTaskSystemInfo: Event<void>;
109 > readonly onDidChangeTaskConfig: Event<void>;
110 > readonly hasTaskSystemInfo: boolean;
111 > registerSupportedExecutions(custom?: boolean, shell?: boolean, process?: boolean): void;
112 >
113 > extensionCallbackTaskComplete(task: Task, result: number | undefined): Promise<void>;
114 > }
115 >
116 > export interface ITaskTerminalStatus {
117 > terminalId: number;
118 > status: string;
119 > }