@codingame/monaco-vscode-task-service-override 1.85.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/external/tslib/tslib.es6.js +11 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/override/vs/platform/dialogs/common/dialogs.js +8 -0
- package/package.json +24 -0
- package/task.d.ts +5 -0
- package/task.js +12 -0
- package/vscode/src/vs/base/common/parsers.js +44 -0
- package/vscode/src/vs/workbench/contrib/tasks/browser/abstractTaskService.js +3851 -0
- package/vscode/src/vs/workbench/contrib/tasks/browser/runAutomaticTasks.js +167 -0
- package/vscode/src/vs/workbench/contrib/tasks/browser/task.contribution.js +694 -0
- package/vscode/src/vs/workbench/contrib/tasks/browser/taskQuickPick.js +452 -0
- package/vscode/src/vs/workbench/contrib/tasks/browser/taskService.js +36 -0
- package/vscode/src/vs/workbench/contrib/tasks/browser/taskTerminalStatus.js +191 -0
- package/vscode/src/vs/workbench/contrib/tasks/browser/tasksQuickAccess.js +121 -0
- package/vscode/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.js +1713 -0
- package/vscode/src/vs/workbench/contrib/tasks/common/jsonSchemaCommon.js +440 -0
- package/vscode/src/vs/workbench/contrib/tasks/common/jsonSchema_v1.js +125 -0
- package/vscode/src/vs/workbench/contrib/tasks/common/jsonSchema_v2.js +901 -0
- package/vscode/src/vs/workbench/contrib/tasks/common/problemCollectors.js +464 -0
- package/vscode/src/vs/workbench/contrib/tasks/common/problemMatcher.js +1796 -0
- package/vscode/src/vs/workbench/contrib/tasks/common/taskConfiguration.js +1581 -0
- package/vscode/src/vs/workbench/contrib/tasks/common/taskSystem.js +15 -0
- package/vscode/src/vs/workbench/contrib/tasks/common/taskTemplates.js +145 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalEscapeSequences.js +13 -0
|
@@ -0,0 +1,694 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import * as nls from 'monaco-editor/esm/vs/nls.js';
|
|
3
|
+
import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
4
|
+
import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
|
|
5
|
+
import { registerAction2, MenuRegistry, MenuId } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
|
|
6
|
+
import { ProblemMatcherRegistry } from '../common/problemMatcher.js';
|
|
7
|
+
import { IProgressService } from 'monaco-editor/esm/vs/platform/progress/common/progress.js';
|
|
8
|
+
import * as JSONContributionRegistry from 'monaco-editor/esm/vs/platform/jsonschemas/common/jsonContributionRegistry.js';
|
|
9
|
+
import { IStatusbarService } from 'vscode/vscode/vs/workbench/services/statusbar/browser/statusbar';
|
|
10
|
+
import { Extensions as Extensions$1 } from 'vscode/vscode/vs/workbench/services/output/common/output';
|
|
11
|
+
import { TASKS_CATEGORY, TASK_RUNNING_STATE, TaskGroup } from 'vscode/vscode/vs/workbench/contrib/tasks/common/tasks';
|
|
12
|
+
import { TaskExecutionSupportedContext, TaskCommandsRegistered, ITaskService } from 'vscode/vscode/vs/workbench/contrib/tasks/common/taskService';
|
|
13
|
+
import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
14
|
+
import { RunAutomaticTasks, ManageAutomaticTaskRunning } from './runAutomaticTasks.js';
|
|
15
|
+
import { KeybindingsRegistry } from 'monaco-editor/esm/vs/platform/keybinding/common/keybindingsRegistry.js';
|
|
16
|
+
import schema$1 from '../common/jsonSchema_v1.js';
|
|
17
|
+
import schema$2, { updateProblemMatchers, updateTaskDefinitions } from '../common/jsonSchema_v2.js';
|
|
18
|
+
import { ConfigureTaskAction, AbstractTaskService } from './abstractTaskService.js';
|
|
19
|
+
import { tasksSchemaId } from 'vscode/vscode/vs/workbench/services/configuration/common/configuration';
|
|
20
|
+
import { Extensions as Extensions$3 } from 'monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js';
|
|
21
|
+
import { WorkbenchStateContext } from 'vscode/vscode/vs/workbench/common/contextkeys';
|
|
22
|
+
import { Extensions as Extensions$2 } from 'monaco-editor/esm/vs/platform/quickinput/common/quickAccess.js';
|
|
23
|
+
import { TasksQuickAccessProvider } from './tasksQuickAccess.js';
|
|
24
|
+
import { ContextKeyExpr } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
25
|
+
import { TaskDefinitionRegistry } from 'vscode/vscode/vs/workbench/contrib/tasks/common/taskDefinitionRegistry';
|
|
26
|
+
import { isString } from 'monaco-editor/esm/vs/base/common/types.js';
|
|
27
|
+
|
|
28
|
+
const workbenchRegistry = ( Registry.as(Extensions.Workbench));
|
|
29
|
+
workbenchRegistry.registerWorkbenchContribution(RunAutomaticTasks, 4 );
|
|
30
|
+
registerAction2(ManageAutomaticTaskRunning);
|
|
31
|
+
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
|
|
32
|
+
command: {
|
|
33
|
+
id: ManageAutomaticTaskRunning.ID,
|
|
34
|
+
title: ManageAutomaticTaskRunning.LABEL,
|
|
35
|
+
category: TASKS_CATEGORY
|
|
36
|
+
},
|
|
37
|
+
when: TaskExecutionSupportedContext
|
|
38
|
+
});
|
|
39
|
+
let TaskStatusBarContributions = class TaskStatusBarContributions extends Disposable {
|
|
40
|
+
constructor(_taskService, _statusbarService, _progressService) {
|
|
41
|
+
super();
|
|
42
|
+
this._taskService = _taskService;
|
|
43
|
+
this._statusbarService = _statusbarService;
|
|
44
|
+
this._progressService = _progressService;
|
|
45
|
+
this._activeTasksCount = 0;
|
|
46
|
+
this._registerListeners();
|
|
47
|
+
}
|
|
48
|
+
_registerListeners() {
|
|
49
|
+
let promise = undefined;
|
|
50
|
+
let resolver;
|
|
51
|
+
this._taskService.onDidStateChange(event => {
|
|
52
|
+
if (event.kind === "changed" ) {
|
|
53
|
+
this._updateRunningTasksStatus();
|
|
54
|
+
}
|
|
55
|
+
if (!this._ignoreEventForUpdateRunningTasksCount(event)) {
|
|
56
|
+
switch (event.kind) {
|
|
57
|
+
case "active" :
|
|
58
|
+
this._activeTasksCount++;
|
|
59
|
+
if (this._activeTasksCount === 1) {
|
|
60
|
+
if (!promise) {
|
|
61
|
+
promise = ( new Promise((resolve) => {
|
|
62
|
+
resolver = resolve;
|
|
63
|
+
}));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
break;
|
|
67
|
+
case "inactive" :
|
|
68
|
+
if (this._activeTasksCount > 0) {
|
|
69
|
+
this._activeTasksCount--;
|
|
70
|
+
if (this._activeTasksCount === 0) {
|
|
71
|
+
if (promise && resolver) {
|
|
72
|
+
resolver();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
break;
|
|
77
|
+
case "terminated" :
|
|
78
|
+
if (this._activeTasksCount !== 0) {
|
|
79
|
+
this._activeTasksCount = 0;
|
|
80
|
+
if (promise && resolver) {
|
|
81
|
+
resolver();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (promise && ((event.kind === "active") ) && (this._activeTasksCount === 1)) {
|
|
88
|
+
this._progressService.withProgress({ location: 10 , command: 'workbench.action.tasks.showTasks', type: 'loading' }, progress => {
|
|
89
|
+
progress.report({ message: ( nls.localizeWithPath(
|
|
90
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
91
|
+
'building',
|
|
92
|
+
'Building...'
|
|
93
|
+
)) });
|
|
94
|
+
return promise;
|
|
95
|
+
}).then(() => {
|
|
96
|
+
promise = undefined;
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
async _updateRunningTasksStatus() {
|
|
102
|
+
const tasks = await this._taskService.getActiveTasks();
|
|
103
|
+
if (tasks.length === 0) {
|
|
104
|
+
if (this._runningTasksStatusItem) {
|
|
105
|
+
this._runningTasksStatusItem.dispose();
|
|
106
|
+
this._runningTasksStatusItem = undefined;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
const itemProps = {
|
|
111
|
+
name: ( nls.localizeWithPath(
|
|
112
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
113
|
+
'status.runningTasks',
|
|
114
|
+
"Running Tasks"
|
|
115
|
+
)),
|
|
116
|
+
text: `$(tools) ${tasks.length}`,
|
|
117
|
+
ariaLabel: ( nls.localizeWithPath(
|
|
118
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
119
|
+
'numberOfRunningTasks',
|
|
120
|
+
"{0} running tasks",
|
|
121
|
+
tasks.length
|
|
122
|
+
)),
|
|
123
|
+
tooltip: ( nls.localizeWithPath(
|
|
124
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
125
|
+
'runningTasks',
|
|
126
|
+
"Show Running Tasks"
|
|
127
|
+
)),
|
|
128
|
+
command: 'workbench.action.tasks.showTasks',
|
|
129
|
+
};
|
|
130
|
+
if (!this._runningTasksStatusItem) {
|
|
131
|
+
this._runningTasksStatusItem = this._statusbarService.addEntry(itemProps, 'status.runningTasks', 0 , 49 );
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
this._runningTasksStatusItem.update(itemProps);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
_ignoreEventForUpdateRunningTasksCount(event) {
|
|
139
|
+
if (!this._taskService.inTerminal() || event.kind === "changed" ) {
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
if ((isString(event.group) ? event.group : event.group?._id) !== TaskGroup.Build._id) {
|
|
143
|
+
return true;
|
|
144
|
+
}
|
|
145
|
+
return event.__task.configurationProperties.problemMatchers === undefined || event.__task.configurationProperties.problemMatchers.length === 0;
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
TaskStatusBarContributions = ( __decorate([
|
|
149
|
+
( __param(0, ITaskService)),
|
|
150
|
+
( __param(1, IStatusbarService)),
|
|
151
|
+
( __param(2, IProgressService))
|
|
152
|
+
], TaskStatusBarContributions));
|
|
153
|
+
workbenchRegistry.registerWorkbenchContribution(TaskStatusBarContributions, 3 );
|
|
154
|
+
MenuRegistry.appendMenuItem(MenuId.MenubarTerminalMenu, {
|
|
155
|
+
group: "2_run" ,
|
|
156
|
+
command: {
|
|
157
|
+
id: 'workbench.action.tasks.runTask',
|
|
158
|
+
title: ( nls.localizeWithPath(
|
|
159
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
160
|
+
{ key: 'miRunTask', comment: ['&& denotes a mnemonic'] },
|
|
161
|
+
"&&Run Task..."
|
|
162
|
+
))
|
|
163
|
+
},
|
|
164
|
+
order: 1,
|
|
165
|
+
when: TaskExecutionSupportedContext
|
|
166
|
+
});
|
|
167
|
+
MenuRegistry.appendMenuItem(MenuId.MenubarTerminalMenu, {
|
|
168
|
+
group: "2_run" ,
|
|
169
|
+
command: {
|
|
170
|
+
id: 'workbench.action.tasks.build',
|
|
171
|
+
title: ( nls.localizeWithPath(
|
|
172
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
173
|
+
{ key: 'miBuildTask', comment: ['&& denotes a mnemonic'] },
|
|
174
|
+
"Run &&Build Task..."
|
|
175
|
+
))
|
|
176
|
+
},
|
|
177
|
+
order: 2,
|
|
178
|
+
when: TaskExecutionSupportedContext
|
|
179
|
+
});
|
|
180
|
+
MenuRegistry.appendMenuItem(MenuId.MenubarTerminalMenu, {
|
|
181
|
+
group: "3_manage" ,
|
|
182
|
+
command: {
|
|
183
|
+
precondition: TASK_RUNNING_STATE,
|
|
184
|
+
id: 'workbench.action.tasks.showTasks',
|
|
185
|
+
title: ( nls.localizeWithPath(
|
|
186
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
187
|
+
{ key: 'miRunningTask', comment: ['&& denotes a mnemonic'] },
|
|
188
|
+
"Show Runnin&&g Tasks..."
|
|
189
|
+
))
|
|
190
|
+
},
|
|
191
|
+
order: 1,
|
|
192
|
+
when: TaskExecutionSupportedContext
|
|
193
|
+
});
|
|
194
|
+
MenuRegistry.appendMenuItem(MenuId.MenubarTerminalMenu, {
|
|
195
|
+
group: "3_manage" ,
|
|
196
|
+
command: {
|
|
197
|
+
precondition: TASK_RUNNING_STATE,
|
|
198
|
+
id: 'workbench.action.tasks.restartTask',
|
|
199
|
+
title: ( nls.localizeWithPath(
|
|
200
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
201
|
+
{ key: 'miRestartTask', comment: ['&& denotes a mnemonic'] },
|
|
202
|
+
"R&&estart Running Task..."
|
|
203
|
+
))
|
|
204
|
+
},
|
|
205
|
+
order: 2,
|
|
206
|
+
when: TaskExecutionSupportedContext
|
|
207
|
+
});
|
|
208
|
+
MenuRegistry.appendMenuItem(MenuId.MenubarTerminalMenu, {
|
|
209
|
+
group: "3_manage" ,
|
|
210
|
+
command: {
|
|
211
|
+
precondition: TASK_RUNNING_STATE,
|
|
212
|
+
id: 'workbench.action.tasks.terminate',
|
|
213
|
+
title: ( nls.localizeWithPath(
|
|
214
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
215
|
+
{ key: 'miTerminateTask', comment: ['&& denotes a mnemonic'] },
|
|
216
|
+
"&&Terminate Task..."
|
|
217
|
+
))
|
|
218
|
+
},
|
|
219
|
+
order: 3,
|
|
220
|
+
when: TaskExecutionSupportedContext
|
|
221
|
+
});
|
|
222
|
+
MenuRegistry.appendMenuItem(MenuId.MenubarTerminalMenu, {
|
|
223
|
+
group: "4_configure" ,
|
|
224
|
+
command: {
|
|
225
|
+
id: 'workbench.action.tasks.configureTaskRunner',
|
|
226
|
+
title: ( nls.localizeWithPath(
|
|
227
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
228
|
+
{ key: 'miConfigureTask', comment: ['&& denotes a mnemonic'] },
|
|
229
|
+
"&&Configure Tasks..."
|
|
230
|
+
))
|
|
231
|
+
},
|
|
232
|
+
order: 1,
|
|
233
|
+
when: TaskExecutionSupportedContext
|
|
234
|
+
});
|
|
235
|
+
MenuRegistry.appendMenuItem(MenuId.MenubarTerminalMenu, {
|
|
236
|
+
group: "4_configure" ,
|
|
237
|
+
command: {
|
|
238
|
+
id: 'workbench.action.tasks.configureDefaultBuildTask',
|
|
239
|
+
title: ( nls.localizeWithPath(
|
|
240
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
241
|
+
{ key: 'miConfigureBuildTask', comment: ['&& denotes a mnemonic'] },
|
|
242
|
+
"Configure De&&fault Build Task..."
|
|
243
|
+
))
|
|
244
|
+
},
|
|
245
|
+
order: 2,
|
|
246
|
+
when: TaskExecutionSupportedContext
|
|
247
|
+
});
|
|
248
|
+
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
|
|
249
|
+
command: {
|
|
250
|
+
id: 'workbench.action.tasks.openWorkspaceFileTasks',
|
|
251
|
+
title: { value: ( nls.localizeWithPath(
|
|
252
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
253
|
+
'workbench.action.tasks.openWorkspaceFileTasks',
|
|
254
|
+
"Open Workspace Tasks"
|
|
255
|
+
)), original: 'Open Workspace Tasks' },
|
|
256
|
+
category: TASKS_CATEGORY
|
|
257
|
+
},
|
|
258
|
+
when: ( ContextKeyExpr.and(( WorkbenchStateContext.isEqualTo('workspace')), TaskExecutionSupportedContext))
|
|
259
|
+
});
|
|
260
|
+
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
|
|
261
|
+
command: {
|
|
262
|
+
id: ConfigureTaskAction.ID,
|
|
263
|
+
title: { value: ConfigureTaskAction.TEXT, original: 'Configure Task' },
|
|
264
|
+
category: TASKS_CATEGORY
|
|
265
|
+
},
|
|
266
|
+
when: TaskExecutionSupportedContext
|
|
267
|
+
});
|
|
268
|
+
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
|
|
269
|
+
command: {
|
|
270
|
+
id: 'workbench.action.tasks.showLog',
|
|
271
|
+
title: { value: ( nls.localizeWithPath(
|
|
272
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
273
|
+
'ShowLogAction.label',
|
|
274
|
+
"Show Task Log"
|
|
275
|
+
)), original: 'Show Task Log' },
|
|
276
|
+
category: TASKS_CATEGORY
|
|
277
|
+
},
|
|
278
|
+
when: TaskExecutionSupportedContext
|
|
279
|
+
});
|
|
280
|
+
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
|
|
281
|
+
command: {
|
|
282
|
+
id: 'workbench.action.tasks.runTask',
|
|
283
|
+
title: { value: ( nls.localizeWithPath(
|
|
284
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
285
|
+
'RunTaskAction.label',
|
|
286
|
+
"Run Task"
|
|
287
|
+
)), original: 'Run Task' },
|
|
288
|
+
category: TASKS_CATEGORY
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
|
|
292
|
+
command: {
|
|
293
|
+
id: 'workbench.action.tasks.reRunTask',
|
|
294
|
+
title: { value: ( nls.localizeWithPath(
|
|
295
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
296
|
+
'ReRunTaskAction.label',
|
|
297
|
+
"Rerun Last Task"
|
|
298
|
+
)), original: 'Rerun Last Task' },
|
|
299
|
+
category: TASKS_CATEGORY
|
|
300
|
+
},
|
|
301
|
+
when: TaskExecutionSupportedContext
|
|
302
|
+
});
|
|
303
|
+
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
|
|
304
|
+
command: {
|
|
305
|
+
id: 'workbench.action.tasks.restartTask',
|
|
306
|
+
title: { value: ( nls.localizeWithPath(
|
|
307
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
308
|
+
'RestartTaskAction.label',
|
|
309
|
+
"Restart Running Task"
|
|
310
|
+
)), original: 'Restart Running Task' },
|
|
311
|
+
category: TASKS_CATEGORY
|
|
312
|
+
},
|
|
313
|
+
when: TaskExecutionSupportedContext
|
|
314
|
+
});
|
|
315
|
+
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
|
|
316
|
+
command: {
|
|
317
|
+
id: 'workbench.action.tasks.showTasks',
|
|
318
|
+
title: { value: ( nls.localizeWithPath(
|
|
319
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
320
|
+
'ShowTasksAction.label',
|
|
321
|
+
"Show Running Tasks"
|
|
322
|
+
)), original: 'Show Running Tasks' },
|
|
323
|
+
category: TASKS_CATEGORY
|
|
324
|
+
},
|
|
325
|
+
when: TaskExecutionSupportedContext
|
|
326
|
+
});
|
|
327
|
+
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
|
|
328
|
+
command: {
|
|
329
|
+
id: 'workbench.action.tasks.terminate',
|
|
330
|
+
title: { value: ( nls.localizeWithPath(
|
|
331
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
332
|
+
'TerminateAction.label',
|
|
333
|
+
"Terminate Task"
|
|
334
|
+
)), original: 'Terminate Task' },
|
|
335
|
+
category: TASKS_CATEGORY
|
|
336
|
+
},
|
|
337
|
+
when: TaskExecutionSupportedContext
|
|
338
|
+
});
|
|
339
|
+
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
|
|
340
|
+
command: {
|
|
341
|
+
id: 'workbench.action.tasks.build',
|
|
342
|
+
title: { value: ( nls.localizeWithPath(
|
|
343
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
344
|
+
'BuildAction.label',
|
|
345
|
+
"Run Build Task"
|
|
346
|
+
)), original: 'Run Build Task' },
|
|
347
|
+
category: TASKS_CATEGORY
|
|
348
|
+
},
|
|
349
|
+
when: TaskExecutionSupportedContext
|
|
350
|
+
});
|
|
351
|
+
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
|
|
352
|
+
command: {
|
|
353
|
+
id: 'workbench.action.tasks.test',
|
|
354
|
+
title: { value: ( nls.localizeWithPath(
|
|
355
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
356
|
+
'TestAction.label',
|
|
357
|
+
"Run Test Task"
|
|
358
|
+
)), original: 'Run Test Task' },
|
|
359
|
+
category: TASKS_CATEGORY
|
|
360
|
+
},
|
|
361
|
+
when: TaskExecutionSupportedContext
|
|
362
|
+
});
|
|
363
|
+
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
|
|
364
|
+
command: {
|
|
365
|
+
id: 'workbench.action.tasks.configureDefaultBuildTask',
|
|
366
|
+
title: {
|
|
367
|
+
value: ( nls.localizeWithPath(
|
|
368
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
369
|
+
'ConfigureDefaultBuildTask.label',
|
|
370
|
+
"Configure Default Build Task"
|
|
371
|
+
)),
|
|
372
|
+
original: 'Configure Default Build Task'
|
|
373
|
+
},
|
|
374
|
+
category: TASKS_CATEGORY
|
|
375
|
+
},
|
|
376
|
+
when: TaskExecutionSupportedContext
|
|
377
|
+
});
|
|
378
|
+
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
|
|
379
|
+
command: {
|
|
380
|
+
id: 'workbench.action.tasks.configureDefaultTestTask',
|
|
381
|
+
title: {
|
|
382
|
+
value: ( nls.localizeWithPath(
|
|
383
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
384
|
+
'ConfigureDefaultTestTask.label',
|
|
385
|
+
"Configure Default Test Task"
|
|
386
|
+
)),
|
|
387
|
+
original: 'Configure Default Test Task'
|
|
388
|
+
},
|
|
389
|
+
category: TASKS_CATEGORY
|
|
390
|
+
},
|
|
391
|
+
when: TaskExecutionSupportedContext
|
|
392
|
+
});
|
|
393
|
+
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
|
|
394
|
+
command: {
|
|
395
|
+
id: 'workbench.action.tasks.openUserTasks',
|
|
396
|
+
title: {
|
|
397
|
+
value: ( nls.localizeWithPath(
|
|
398
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
399
|
+
'workbench.action.tasks.openUserTasks',
|
|
400
|
+
"Open User Tasks"
|
|
401
|
+
)),
|
|
402
|
+
original: 'Open User Tasks'
|
|
403
|
+
}, category: TASKS_CATEGORY
|
|
404
|
+
},
|
|
405
|
+
when: TaskExecutionSupportedContext
|
|
406
|
+
});
|
|
407
|
+
class UserTasksGlobalActionContribution extends Disposable {
|
|
408
|
+
constructor() {
|
|
409
|
+
super();
|
|
410
|
+
this.registerActions();
|
|
411
|
+
}
|
|
412
|
+
registerActions() {
|
|
413
|
+
const id = 'workbench.action.tasks.openUserTasks';
|
|
414
|
+
const title = ( nls.localizeWithPath(
|
|
415
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
416
|
+
'userTasks',
|
|
417
|
+
"User Tasks"
|
|
418
|
+
));
|
|
419
|
+
this._register(MenuRegistry.appendMenuItem(MenuId.GlobalActivity, {
|
|
420
|
+
command: {
|
|
421
|
+
id,
|
|
422
|
+
title
|
|
423
|
+
},
|
|
424
|
+
when: TaskExecutionSupportedContext,
|
|
425
|
+
group: '2_configuration',
|
|
426
|
+
order: 6
|
|
427
|
+
}));
|
|
428
|
+
this._register(MenuRegistry.appendMenuItem(MenuId.MenubarPreferencesMenu, {
|
|
429
|
+
command: {
|
|
430
|
+
id,
|
|
431
|
+
title
|
|
432
|
+
},
|
|
433
|
+
when: TaskExecutionSupportedContext,
|
|
434
|
+
group: '2_configuration',
|
|
435
|
+
order: 6
|
|
436
|
+
}));
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
workbenchRegistry.registerWorkbenchContribution(UserTasksGlobalActionContribution, 3 );
|
|
440
|
+
KeybindingsRegistry.registerKeybindingRule({
|
|
441
|
+
id: 'workbench.action.tasks.build',
|
|
442
|
+
weight: 200 ,
|
|
443
|
+
when: TaskCommandsRegistered,
|
|
444
|
+
primary: 2048 | 1024 | 32
|
|
445
|
+
});
|
|
446
|
+
const outputChannelRegistry = ( Registry.as(Extensions$1.OutputChannels));
|
|
447
|
+
outputChannelRegistry.registerChannel({ id: AbstractTaskService.OutputChannelId, label: AbstractTaskService.OutputChannelLabel, log: false });
|
|
448
|
+
const quickAccessRegistry = (( Registry.as(Extensions$2.Quickaccess)));
|
|
449
|
+
const tasksPickerContextKey = 'inTasksPicker';
|
|
450
|
+
quickAccessRegistry.registerQuickAccessProvider({
|
|
451
|
+
ctor: TasksQuickAccessProvider,
|
|
452
|
+
prefix: TasksQuickAccessProvider.PREFIX,
|
|
453
|
+
contextKey: tasksPickerContextKey,
|
|
454
|
+
placeholder: ( nls.localizeWithPath(
|
|
455
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
456
|
+
'tasksQuickAccessPlaceholder',
|
|
457
|
+
"Type the name of a task to run."
|
|
458
|
+
)),
|
|
459
|
+
helpEntries: [{ description: ( nls.localizeWithPath(
|
|
460
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
461
|
+
'tasksQuickAccessHelp',
|
|
462
|
+
"Run Task"
|
|
463
|
+
)), commandCenterOrder: 60 }]
|
|
464
|
+
});
|
|
465
|
+
const schema = {
|
|
466
|
+
id: tasksSchemaId,
|
|
467
|
+
description: 'Task definition file',
|
|
468
|
+
type: 'object',
|
|
469
|
+
allowTrailingCommas: true,
|
|
470
|
+
allowComments: true,
|
|
471
|
+
default: {
|
|
472
|
+
version: '2.0.0',
|
|
473
|
+
tasks: [
|
|
474
|
+
{
|
|
475
|
+
label: 'My Task',
|
|
476
|
+
command: 'echo hello',
|
|
477
|
+
type: 'shell',
|
|
478
|
+
args: [],
|
|
479
|
+
problemMatcher: ['$tsc'],
|
|
480
|
+
presentation: {
|
|
481
|
+
reveal: 'always'
|
|
482
|
+
},
|
|
483
|
+
group: 'build'
|
|
484
|
+
}
|
|
485
|
+
]
|
|
486
|
+
}
|
|
487
|
+
};
|
|
488
|
+
schema.definitions = {
|
|
489
|
+
...schema$1.definitions,
|
|
490
|
+
...schema$2.definitions,
|
|
491
|
+
};
|
|
492
|
+
schema.oneOf = [...(schema$2.oneOf || []), ...(schema$1.oneOf || [])];
|
|
493
|
+
const jsonRegistry = ( Registry.as(JSONContributionRegistry.Extensions.JSONContribution));
|
|
494
|
+
jsonRegistry.registerSchema(tasksSchemaId, schema);
|
|
495
|
+
ProblemMatcherRegistry.onMatcherChanged(() => {
|
|
496
|
+
updateProblemMatchers();
|
|
497
|
+
jsonRegistry.notifySchemaChanged(tasksSchemaId);
|
|
498
|
+
});
|
|
499
|
+
TaskDefinitionRegistry.onDefinitionsChanged(() => {
|
|
500
|
+
updateTaskDefinitions();
|
|
501
|
+
jsonRegistry.notifySchemaChanged(tasksSchemaId);
|
|
502
|
+
});
|
|
503
|
+
const configurationRegistry = ( Registry.as(Extensions$3.Configuration));
|
|
504
|
+
configurationRegistry.registerConfiguration({
|
|
505
|
+
id: 'task',
|
|
506
|
+
order: 100,
|
|
507
|
+
title: ( nls.localizeWithPath(
|
|
508
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
509
|
+
'tasksConfigurationTitle',
|
|
510
|
+
"Tasks"
|
|
511
|
+
)),
|
|
512
|
+
type: 'object',
|
|
513
|
+
properties: {
|
|
514
|
+
["task.problemMatchers.neverPrompt" ]: {
|
|
515
|
+
markdownDescription: ( nls.localizeWithPath(
|
|
516
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
517
|
+
'task.problemMatchers.neverPrompt',
|
|
518
|
+
"Configures whether to show the problem matcher prompt when running a task. Set to `true` to never prompt, or use a dictionary of task types to turn off prompting only for specific task types."
|
|
519
|
+
)),
|
|
520
|
+
'oneOf': [
|
|
521
|
+
{
|
|
522
|
+
type: 'boolean',
|
|
523
|
+
markdownDescription: ( nls.localizeWithPath(
|
|
524
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
525
|
+
'task.problemMatchers.neverPrompt.boolean',
|
|
526
|
+
'Sets problem matcher prompting behavior for all tasks.'
|
|
527
|
+
))
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
type: 'object',
|
|
531
|
+
patternProperties: {
|
|
532
|
+
'.*': {
|
|
533
|
+
type: 'boolean'
|
|
534
|
+
}
|
|
535
|
+
},
|
|
536
|
+
markdownDescription: ( nls.localizeWithPath(
|
|
537
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
538
|
+
'task.problemMatchers.neverPrompt.array',
|
|
539
|
+
'An object containing task type-boolean pairs to never prompt for problem matchers on.'
|
|
540
|
+
)),
|
|
541
|
+
default: {
|
|
542
|
+
'shell': true
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
],
|
|
546
|
+
default: false
|
|
547
|
+
},
|
|
548
|
+
["task.autoDetect" ]: {
|
|
549
|
+
markdownDescription: ( nls.localizeWithPath(
|
|
550
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
551
|
+
'task.autoDetect',
|
|
552
|
+
"Controls enablement of `provideTasks` for all task provider extension. If the Tasks: Run Task command is slow, disabling auto detect for task providers may help. Individual extensions may also provide settings that disable auto detection."
|
|
553
|
+
)),
|
|
554
|
+
type: 'string',
|
|
555
|
+
enum: ['on', 'off'],
|
|
556
|
+
default: 'on'
|
|
557
|
+
},
|
|
558
|
+
["task.slowProviderWarning" ]: {
|
|
559
|
+
markdownDescription: ( nls.localizeWithPath(
|
|
560
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
561
|
+
'task.slowProviderWarning',
|
|
562
|
+
"Configures whether a warning is shown when a provider is slow"
|
|
563
|
+
)),
|
|
564
|
+
'oneOf': [
|
|
565
|
+
{
|
|
566
|
+
type: 'boolean',
|
|
567
|
+
markdownDescription: ( nls.localizeWithPath(
|
|
568
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
569
|
+
'task.slowProviderWarning.boolean',
|
|
570
|
+
'Sets the slow provider warning for all tasks.'
|
|
571
|
+
))
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
type: 'array',
|
|
575
|
+
items: {
|
|
576
|
+
type: 'string',
|
|
577
|
+
markdownDescription: ( nls.localizeWithPath(
|
|
578
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
579
|
+
'task.slowProviderWarning.array',
|
|
580
|
+
'An array of task types to never show the slow provider warning.'
|
|
581
|
+
))
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
],
|
|
585
|
+
default: true
|
|
586
|
+
},
|
|
587
|
+
["task.quickOpen.history" ]: {
|
|
588
|
+
markdownDescription: ( nls.localizeWithPath(
|
|
589
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
590
|
+
'task.quickOpen.history',
|
|
591
|
+
"Controls the number of recent items tracked in task quick open dialog."
|
|
592
|
+
)),
|
|
593
|
+
type: 'number',
|
|
594
|
+
default: 30, minimum: 0, maximum: 30
|
|
595
|
+
},
|
|
596
|
+
["task.quickOpen.detail" ]: {
|
|
597
|
+
markdownDescription: ( nls.localizeWithPath(
|
|
598
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
599
|
+
'task.quickOpen.detail',
|
|
600
|
+
"Controls whether to show the task detail for tasks that have a detail in task quick picks, such as Run Task."
|
|
601
|
+
)),
|
|
602
|
+
type: 'boolean',
|
|
603
|
+
default: true
|
|
604
|
+
},
|
|
605
|
+
["task.quickOpen.skip" ]: {
|
|
606
|
+
type: 'boolean',
|
|
607
|
+
description: ( nls.localizeWithPath(
|
|
608
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
609
|
+
'task.quickOpen.skip',
|
|
610
|
+
"Controls whether the task quick pick is skipped when there is only one task to pick from."
|
|
611
|
+
)),
|
|
612
|
+
default: false
|
|
613
|
+
},
|
|
614
|
+
["task.quickOpen.showAll" ]: {
|
|
615
|
+
type: 'boolean',
|
|
616
|
+
description: ( nls.localizeWithPath(
|
|
617
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
618
|
+
'task.quickOpen.showAll',
|
|
619
|
+
"Causes the Tasks: Run Task command to use the slower \"show all\" behavior instead of the faster two level picker where tasks are grouped by provider."
|
|
620
|
+
)),
|
|
621
|
+
default: false
|
|
622
|
+
},
|
|
623
|
+
["task.allowAutomaticTasks" ]: {
|
|
624
|
+
type: 'string',
|
|
625
|
+
enum: ['on', 'off'],
|
|
626
|
+
enumDescriptions: [
|
|
627
|
+
( nls.localizeWithPath(
|
|
628
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
629
|
+
'task.allowAutomaticTasks.on',
|
|
630
|
+
"Always"
|
|
631
|
+
)),
|
|
632
|
+
( nls.localizeWithPath(
|
|
633
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
634
|
+
'task.allowAutomaticTasks.off',
|
|
635
|
+
"Never"
|
|
636
|
+
)),
|
|
637
|
+
],
|
|
638
|
+
description: ( nls.localizeWithPath(
|
|
639
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
640
|
+
'task.allowAutomaticTasks',
|
|
641
|
+
"Enable automatic tasks - note that tasks won't run in an untrusted workspace."
|
|
642
|
+
)),
|
|
643
|
+
default: 'on',
|
|
644
|
+
restricted: true
|
|
645
|
+
},
|
|
646
|
+
["task.reconnection" ]: {
|
|
647
|
+
type: 'boolean',
|
|
648
|
+
description: ( nls.localizeWithPath(
|
|
649
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
650
|
+
'task.reconnection',
|
|
651
|
+
"On window reload, reconnect to tasks that have problem matchers."
|
|
652
|
+
)),
|
|
653
|
+
default: true
|
|
654
|
+
},
|
|
655
|
+
["task.saveBeforeRun" ]: {
|
|
656
|
+
markdownDescription: ( nls.localizeWithPath(
|
|
657
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
658
|
+
'task.saveBeforeRun',
|
|
659
|
+
'Save all dirty editors before running a task.'
|
|
660
|
+
)),
|
|
661
|
+
type: 'string',
|
|
662
|
+
enum: ['always', 'never', 'prompt'],
|
|
663
|
+
enumDescriptions: [
|
|
664
|
+
( nls.localizeWithPath(
|
|
665
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
666
|
+
'task.saveBeforeRun.always',
|
|
667
|
+
'Always saves all editors before running.'
|
|
668
|
+
)),
|
|
669
|
+
( nls.localizeWithPath(
|
|
670
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
671
|
+
'task.saveBeforeRun.never',
|
|
672
|
+
'Never saves editors before running.'
|
|
673
|
+
)),
|
|
674
|
+
( nls.localizeWithPath(
|
|
675
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
676
|
+
'task.SaveBeforeRun.prompt',
|
|
677
|
+
'Prompts whether to save editors before running.'
|
|
678
|
+
)),
|
|
679
|
+
],
|
|
680
|
+
default: 'always',
|
|
681
|
+
},
|
|
682
|
+
["task.verboseLogging" ]: {
|
|
683
|
+
type: 'boolean',
|
|
684
|
+
description: ( nls.localizeWithPath(
|
|
685
|
+
'vs/workbench/contrib/tasks/browser/task.contribution',
|
|
686
|
+
'task.verboseLogging',
|
|
687
|
+
"Enable verbose logging for tasks."
|
|
688
|
+
)),
|
|
689
|
+
default: false
|
|
690
|
+
},
|
|
691
|
+
}
|
|
692
|
+
});
|
|
693
|
+
|
|
694
|
+
export { TaskStatusBarContributions };
|