@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.
Files changed (25) hide show
  1. package/external/tslib/tslib.es6.js +11 -0
  2. package/index.d.ts +1 -0
  3. package/index.js +1 -0
  4. package/override/vs/platform/dialogs/common/dialogs.js +8 -0
  5. package/package.json +24 -0
  6. package/task.d.ts +5 -0
  7. package/task.js +12 -0
  8. package/vscode/src/vs/base/common/parsers.js +44 -0
  9. package/vscode/src/vs/workbench/contrib/tasks/browser/abstractTaskService.js +3851 -0
  10. package/vscode/src/vs/workbench/contrib/tasks/browser/runAutomaticTasks.js +167 -0
  11. package/vscode/src/vs/workbench/contrib/tasks/browser/task.contribution.js +694 -0
  12. package/vscode/src/vs/workbench/contrib/tasks/browser/taskQuickPick.js +452 -0
  13. package/vscode/src/vs/workbench/contrib/tasks/browser/taskService.js +36 -0
  14. package/vscode/src/vs/workbench/contrib/tasks/browser/taskTerminalStatus.js +191 -0
  15. package/vscode/src/vs/workbench/contrib/tasks/browser/tasksQuickAccess.js +121 -0
  16. package/vscode/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.js +1713 -0
  17. package/vscode/src/vs/workbench/contrib/tasks/common/jsonSchemaCommon.js +440 -0
  18. package/vscode/src/vs/workbench/contrib/tasks/common/jsonSchema_v1.js +125 -0
  19. package/vscode/src/vs/workbench/contrib/tasks/common/jsonSchema_v2.js +901 -0
  20. package/vscode/src/vs/workbench/contrib/tasks/common/problemCollectors.js +464 -0
  21. package/vscode/src/vs/workbench/contrib/tasks/common/problemMatcher.js +1796 -0
  22. package/vscode/src/vs/workbench/contrib/tasks/common/taskConfiguration.js +1581 -0
  23. package/vscode/src/vs/workbench/contrib/tasks/common/taskSystem.js +15 -0
  24. package/vscode/src/vs/workbench/contrib/tasks/common/taskTemplates.js +145 -0
  25. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalEscapeSequences.js +13 -0
@@ -0,0 +1,901 @@
1
+ import * as nls from 'monaco-editor/esm/vs/nls.js';
2
+ import * as Objects from 'monaco-editor/esm/vs/base/common/objects.js';
3
+ import commonSchema from './jsonSchemaCommon.js';
4
+ import { ProblemMatcherRegistry } from './problemMatcher.js';
5
+ import { TaskDefinitionRegistry } from 'vscode/vscode/vs/workbench/contrib/tasks/common/taskDefinitionRegistry';
6
+ import { applyDeprecatedVariableMessage } from 'vscode/vscode/vs/workbench/services/configurationResolver/common/configurationResolverUtils';
7
+ import { inputsSchema } from 'vscode/vscode/vs/workbench/services/configurationResolver/common/configurationResolverSchema';
8
+ import { getAllCodicons } from 'monaco-editor/esm/vs/base/common/codicons.js';
9
+
10
+ function fixReferences(literal) {
11
+ if (Array.isArray(literal)) {
12
+ literal.forEach(fixReferences);
13
+ }
14
+ else if (typeof literal === 'object') {
15
+ if (literal['$ref']) {
16
+ literal['$ref'] = literal['$ref'] + '2';
17
+ }
18
+ Object.getOwnPropertyNames(literal).forEach(property => {
19
+ const value = literal[property];
20
+ if (Array.isArray(value) || typeof value === 'object') {
21
+ fixReferences(value);
22
+ }
23
+ });
24
+ }
25
+ }
26
+ const shellCommand = {
27
+ anyOf: [
28
+ {
29
+ type: 'boolean',
30
+ default: true,
31
+ description: ( nls.localizeWithPath(
32
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
33
+ 'JsonSchema.shell',
34
+ 'Specifies whether the command is a shell command or an external program. Defaults to false if omitted.'
35
+ ))
36
+ },
37
+ {
38
+ $ref: '#/definitions/shellConfiguration'
39
+ }
40
+ ],
41
+ deprecationMessage: ( nls.localizeWithPath(
42
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
43
+ 'JsonSchema.tasks.isShellCommand.deprecated',
44
+ 'The property isShellCommand is deprecated. Use the type property of the task and the shell property in the options instead. See also the 1.14 release notes.'
45
+ ))
46
+ };
47
+ const hide = {
48
+ type: 'boolean',
49
+ description: ( nls.localizeWithPath(
50
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
51
+ 'JsonSchema.hide',
52
+ 'Hide this task from the run task quick pick'
53
+ )),
54
+ default: true
55
+ };
56
+ const taskIdentifier = {
57
+ type: 'object',
58
+ additionalProperties: true,
59
+ properties: {
60
+ type: {
61
+ type: 'string',
62
+ description: ( nls.localizeWithPath(
63
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
64
+ 'JsonSchema.tasks.dependsOn.identifier',
65
+ 'The task identifier.'
66
+ ))
67
+ }
68
+ }
69
+ };
70
+ const dependsOn = {
71
+ anyOf: [
72
+ {
73
+ type: 'string',
74
+ description: ( nls.localizeWithPath(
75
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
76
+ 'JsonSchema.tasks.dependsOn.string',
77
+ 'Another task this task depends on.'
78
+ ))
79
+ },
80
+ taskIdentifier,
81
+ {
82
+ type: 'array',
83
+ description: ( nls.localizeWithPath(
84
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
85
+ 'JsonSchema.tasks.dependsOn.array',
86
+ 'The other tasks this task depends on.'
87
+ )),
88
+ items: {
89
+ anyOf: [
90
+ {
91
+ type: 'string',
92
+ },
93
+ taskIdentifier
94
+ ]
95
+ }
96
+ }
97
+ ],
98
+ description: ( nls.localizeWithPath(
99
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
100
+ 'JsonSchema.tasks.dependsOn',
101
+ 'Either a string representing another task or an array of other tasks that this task depends on.'
102
+ ))
103
+ };
104
+ const dependsOrder = {
105
+ type: 'string',
106
+ enum: ['parallel', 'sequence'],
107
+ enumDescriptions: [
108
+ ( nls.localizeWithPath(
109
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
110
+ 'JsonSchema.tasks.dependsOrder.parallel',
111
+ 'Run all dependsOn tasks in parallel.'
112
+ )),
113
+ ( nls.localizeWithPath(
114
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
115
+ 'JsonSchema.tasks.dependsOrder.sequence',
116
+ 'Run all dependsOn tasks in sequence.'
117
+ )),
118
+ ],
119
+ default: 'parallel',
120
+ description: ( nls.localizeWithPath(
121
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
122
+ 'JsonSchema.tasks.dependsOrder',
123
+ 'Determines the order of the dependsOn tasks for this task. Note that this property is not recursive.'
124
+ ))
125
+ };
126
+ const detail = {
127
+ type: 'string',
128
+ description: ( nls.localizeWithPath(
129
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
130
+ 'JsonSchema.tasks.detail',
131
+ 'An optional description of a task that shows in the Run Task quick pick as a detail.'
132
+ ))
133
+ };
134
+ const icon = {
135
+ type: 'object',
136
+ description: ( nls.localizeWithPath(
137
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
138
+ 'JsonSchema.tasks.icon',
139
+ 'An optional icon for the task'
140
+ )),
141
+ properties: {
142
+ id: {
143
+ description: ( nls.localizeWithPath(
144
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
145
+ 'JsonSchema.tasks.icon.id',
146
+ 'An optional codicon ID to use'
147
+ )),
148
+ type: ['string', 'null'],
149
+ enum: Array.from(getAllCodicons(), icon => icon.id),
150
+ markdownEnumDescriptions: Array.from(getAllCodicons(), icon => `$(${icon.id})`),
151
+ },
152
+ color: {
153
+ description: ( nls.localizeWithPath(
154
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
155
+ 'JsonSchema.tasks.icon.color',
156
+ 'An optional color of the icon'
157
+ )),
158
+ type: ['string', 'null'],
159
+ enum: [
160
+ 'terminal.ansiBlack',
161
+ 'terminal.ansiRed',
162
+ 'terminal.ansiGreen',
163
+ 'terminal.ansiYellow',
164
+ 'terminal.ansiBlue',
165
+ 'terminal.ansiMagenta',
166
+ 'terminal.ansiCyan',
167
+ 'terminal.ansiWhite'
168
+ ],
169
+ },
170
+ }
171
+ };
172
+ const presentation = {
173
+ type: 'object',
174
+ default: {
175
+ echo: true,
176
+ reveal: 'always',
177
+ focus: false,
178
+ panel: 'shared',
179
+ showReuseMessage: true,
180
+ clear: false,
181
+ },
182
+ description: ( nls.localizeWithPath(
183
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
184
+ 'JsonSchema.tasks.presentation',
185
+ 'Configures the panel that is used to present the task\'s output and reads its input.'
186
+ )),
187
+ additionalProperties: false,
188
+ properties: {
189
+ echo: {
190
+ type: 'boolean',
191
+ default: true,
192
+ description: ( nls.localizeWithPath(
193
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
194
+ 'JsonSchema.tasks.presentation.echo',
195
+ 'Controls whether the executed command is echoed to the panel. Default is true.'
196
+ ))
197
+ },
198
+ focus: {
199
+ type: 'boolean',
200
+ default: false,
201
+ description: ( nls.localizeWithPath(
202
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
203
+ 'JsonSchema.tasks.presentation.focus',
204
+ 'Controls whether the panel takes focus. Default is false. If set to true the panel is revealed as well.'
205
+ ))
206
+ },
207
+ revealProblems: {
208
+ type: 'string',
209
+ enum: ['always', 'onProblem', 'never'],
210
+ enumDescriptions: [
211
+ ( nls.localizeWithPath(
212
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
213
+ 'JsonSchema.tasks.presentation.revealProblems.always',
214
+ 'Always reveals the problems panel when this task is executed.'
215
+ )),
216
+ ( nls.localizeWithPath(
217
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
218
+ 'JsonSchema.tasks.presentation.revealProblems.onProblem',
219
+ 'Only reveals the problems panel if a problem is found.'
220
+ )),
221
+ ( nls.localizeWithPath(
222
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
223
+ 'JsonSchema.tasks.presentation.revealProblems.never',
224
+ 'Never reveals the problems panel when this task is executed.'
225
+ )),
226
+ ],
227
+ default: 'never',
228
+ description: ( nls.localizeWithPath(
229
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
230
+ 'JsonSchema.tasks.presentation.revealProblems',
231
+ 'Controls whether the problems panel is revealed when running this task or not. Takes precedence over option \"reveal\". Default is \"never\".'
232
+ ))
233
+ },
234
+ reveal: {
235
+ type: 'string',
236
+ enum: ['always', 'silent', 'never'],
237
+ enumDescriptions: [
238
+ ( nls.localizeWithPath(
239
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
240
+ 'JsonSchema.tasks.presentation.reveal.always',
241
+ 'Always reveals the terminal when this task is executed.'
242
+ )),
243
+ ( nls.localizeWithPath(
244
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
245
+ 'JsonSchema.tasks.presentation.reveal.silent',
246
+ 'Only reveals the terminal if the task exits with an error or the problem matcher finds an error.'
247
+ )),
248
+ ( nls.localizeWithPath(
249
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
250
+ 'JsonSchema.tasks.presentation.reveal.never',
251
+ 'Never reveals the terminal when this task is executed.'
252
+ )),
253
+ ],
254
+ default: 'always',
255
+ description: ( nls.localizeWithPath(
256
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
257
+ 'JsonSchema.tasks.presentation.reveal',
258
+ 'Controls whether the terminal running the task is revealed or not. May be overridden by option \"revealProblems\". Default is \"always\".'
259
+ ))
260
+ },
261
+ panel: {
262
+ type: 'string',
263
+ enum: ['shared', 'dedicated', 'new'],
264
+ default: 'shared',
265
+ description: ( nls.localizeWithPath(
266
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
267
+ 'JsonSchema.tasks.presentation.instance',
268
+ 'Controls if the panel is shared between tasks, dedicated to this task or a new one is created on every run.'
269
+ ))
270
+ },
271
+ showReuseMessage: {
272
+ type: 'boolean',
273
+ default: true,
274
+ description: ( nls.localizeWithPath(
275
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
276
+ 'JsonSchema.tasks.presentation.showReuseMessage',
277
+ 'Controls whether to show the `Terminal will be reused by tasks, press any key to close it` message.'
278
+ ))
279
+ },
280
+ clear: {
281
+ type: 'boolean',
282
+ default: false,
283
+ description: ( nls.localizeWithPath(
284
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
285
+ 'JsonSchema.tasks.presentation.clear',
286
+ 'Controls whether the terminal is cleared before executing the task.'
287
+ ))
288
+ },
289
+ group: {
290
+ type: 'string',
291
+ description: ( nls.localizeWithPath(
292
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
293
+ 'JsonSchema.tasks.presentation.group',
294
+ 'Controls whether the task is executed in a specific terminal group using split panes.'
295
+ ))
296
+ },
297
+ close: {
298
+ type: 'boolean',
299
+ description: ( nls.localizeWithPath(
300
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
301
+ 'JsonSchema.tasks.presentation.close',
302
+ 'Controls whether the terminal the task runs in is closed when the task exits.'
303
+ ))
304
+ }
305
+ }
306
+ };
307
+ const terminal = Objects.deepClone(presentation);
308
+ terminal.deprecationMessage = ( nls.localizeWithPath(
309
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
310
+ 'JsonSchema.tasks.terminal',
311
+ 'The terminal property is deprecated. Use presentation instead'
312
+ ));
313
+ const groupStrings = {
314
+ type: 'string',
315
+ enum: [
316
+ 'build',
317
+ 'test',
318
+ 'none'
319
+ ],
320
+ enumDescriptions: [
321
+ ( nls.localizeWithPath(
322
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
323
+ 'JsonSchema.tasks.group.build',
324
+ 'Marks the task as a build task accessible through the \'Run Build Task\' command.'
325
+ )),
326
+ ( nls.localizeWithPath(
327
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
328
+ 'JsonSchema.tasks.group.test',
329
+ 'Marks the task as a test task accessible through the \'Run Test Task\' command.'
330
+ )),
331
+ ( nls.localizeWithPath(
332
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
333
+ 'JsonSchema.tasks.group.none',
334
+ 'Assigns the task to no group'
335
+ ))
336
+ ],
337
+ description: ( nls.localizeWithPath(
338
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
339
+ 'JsonSchema.tasks.group.kind',
340
+ 'The task\'s execution group.'
341
+ ))
342
+ };
343
+ const group = {
344
+ oneOf: [
345
+ groupStrings,
346
+ {
347
+ type: 'object',
348
+ properties: {
349
+ kind: groupStrings,
350
+ isDefault: {
351
+ type: ['boolean', 'string'],
352
+ default: false,
353
+ description: ( nls.localizeWithPath(
354
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
355
+ 'JsonSchema.tasks.group.isDefault',
356
+ 'Defines if this task is the default task in the group, or a glob to match the file which should trigger this task.'
357
+ ))
358
+ }
359
+ }
360
+ },
361
+ ],
362
+ defaultSnippets: [
363
+ {
364
+ body: { kind: 'build', isDefault: true },
365
+ description: ( nls.localizeWithPath(
366
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
367
+ 'JsonSchema.tasks.group.defaultBuild',
368
+ 'Marks the task as the default build task.'
369
+ ))
370
+ },
371
+ {
372
+ body: { kind: 'test', isDefault: true },
373
+ description: ( nls.localizeWithPath(
374
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
375
+ 'JsonSchema.tasks.group.defaultTest',
376
+ 'Marks the task as the default test task.'
377
+ ))
378
+ }
379
+ ],
380
+ description: ( nls.localizeWithPath(
381
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
382
+ 'JsonSchema.tasks.group',
383
+ 'Defines to which execution group this task belongs to. It supports "build" to add it to the build group and "test" to add it to the test group.'
384
+ ))
385
+ };
386
+ const taskType = {
387
+ type: 'string',
388
+ enum: ['shell'],
389
+ default: 'process',
390
+ description: ( nls.localizeWithPath(
391
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
392
+ 'JsonSchema.tasks.type',
393
+ 'Defines whether the task is run as a process or as a command inside a shell.'
394
+ ))
395
+ };
396
+ const command = {
397
+ oneOf: [
398
+ {
399
+ oneOf: [
400
+ {
401
+ type: 'string'
402
+ },
403
+ {
404
+ type: 'array',
405
+ items: {
406
+ type: 'string'
407
+ },
408
+ description: ( nls.localizeWithPath(
409
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
410
+ 'JsonSchema.commandArray',
411
+ 'The shell command to be executed. Array items will be joined using a space character'
412
+ ))
413
+ }
414
+ ]
415
+ },
416
+ {
417
+ type: 'object',
418
+ required: ['value', 'quoting'],
419
+ properties: {
420
+ value: {
421
+ oneOf: [
422
+ {
423
+ type: 'string'
424
+ },
425
+ {
426
+ type: 'array',
427
+ items: {
428
+ type: 'string'
429
+ },
430
+ description: ( nls.localizeWithPath(
431
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
432
+ 'JsonSchema.commandArray',
433
+ 'The shell command to be executed. Array items will be joined using a space character'
434
+ ))
435
+ }
436
+ ],
437
+ description: ( nls.localizeWithPath(
438
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
439
+ 'JsonSchema.command.quotedString.value',
440
+ 'The actual command value'
441
+ ))
442
+ },
443
+ quoting: {
444
+ type: 'string',
445
+ enum: ['escape', 'strong', 'weak'],
446
+ enumDescriptions: [
447
+ ( nls.localizeWithPath(
448
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
449
+ 'JsonSchema.tasks.quoting.escape',
450
+ 'Escapes characters using the shell\'s escape character (e.g. ` under PowerShell and \\ under bash).'
451
+ )),
452
+ ( nls.localizeWithPath(
453
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
454
+ 'JsonSchema.tasks.quoting.strong',
455
+ 'Quotes the argument using the shell\'s strong quote character (e.g. \' under PowerShell and bash).'
456
+ )),
457
+ ( nls.localizeWithPath(
458
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
459
+ 'JsonSchema.tasks.quoting.weak',
460
+ 'Quotes the argument using the shell\'s weak quote character (e.g. " under PowerShell and bash).'
461
+ )),
462
+ ],
463
+ default: 'strong',
464
+ description: ( nls.localizeWithPath(
465
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
466
+ 'JsonSchema.command.quotesString.quote',
467
+ 'How the command value should be quoted.'
468
+ ))
469
+ }
470
+ }
471
+ }
472
+ ],
473
+ description: ( nls.localizeWithPath(
474
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
475
+ 'JsonSchema.command',
476
+ 'The command to be executed. Can be an external program or a shell command.'
477
+ ))
478
+ };
479
+ const args = {
480
+ type: 'array',
481
+ items: {
482
+ oneOf: [
483
+ {
484
+ type: 'string',
485
+ },
486
+ {
487
+ type: 'object',
488
+ required: ['value', 'quoting'],
489
+ properties: {
490
+ value: {
491
+ type: 'string',
492
+ description: ( nls.localizeWithPath(
493
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
494
+ 'JsonSchema.args.quotedString.value',
495
+ 'The actual argument value'
496
+ ))
497
+ },
498
+ quoting: {
499
+ type: 'string',
500
+ enum: ['escape', 'strong', 'weak'],
501
+ enumDescriptions: [
502
+ ( nls.localizeWithPath(
503
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
504
+ 'JsonSchema.tasks.quoting.escape',
505
+ 'Escapes characters using the shell\'s escape character (e.g. ` under PowerShell and \\ under bash).'
506
+ )),
507
+ ( nls.localizeWithPath(
508
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
509
+ 'JsonSchema.tasks.quoting.strong',
510
+ 'Quotes the argument using the shell\'s strong quote character (e.g. \' under PowerShell and bash).'
511
+ )),
512
+ ( nls.localizeWithPath(
513
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
514
+ 'JsonSchema.tasks.quoting.weak',
515
+ 'Quotes the argument using the shell\'s weak quote character (e.g. " under PowerShell and bash).'
516
+ )),
517
+ ],
518
+ default: 'strong',
519
+ description: ( nls.localizeWithPath(
520
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
521
+ 'JsonSchema.args.quotesString.quote',
522
+ 'How the argument value should be quoted.'
523
+ ))
524
+ }
525
+ }
526
+ }
527
+ ]
528
+ },
529
+ description: ( nls.localizeWithPath(
530
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
531
+ 'JsonSchema.tasks.args',
532
+ 'Arguments passed to the command when this task is invoked.'
533
+ ))
534
+ };
535
+ const label = {
536
+ type: 'string',
537
+ description: ( nls.localizeWithPath(
538
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
539
+ 'JsonSchema.tasks.label',
540
+ "The task's user interface label"
541
+ ))
542
+ };
543
+ const version = {
544
+ type: 'string',
545
+ enum: ['2.0.0'],
546
+ description: ( nls.localizeWithPath(
547
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
548
+ 'JsonSchema.version',
549
+ 'The config\'s version number.'
550
+ ))
551
+ };
552
+ const identifier = {
553
+ type: 'string',
554
+ description: ( nls.localizeWithPath(
555
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
556
+ 'JsonSchema.tasks.identifier',
557
+ 'A user defined identifier to reference the task in launch.json or a dependsOn clause.'
558
+ )),
559
+ deprecationMessage: ( nls.localizeWithPath(
560
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
561
+ 'JsonSchema.tasks.identifier.deprecated',
562
+ 'User defined identifiers are deprecated. For custom task use the name as a reference and for tasks provided by extensions use their defined task identifier.'
563
+ ))
564
+ };
565
+ const runOptions = {
566
+ type: 'object',
567
+ additionalProperties: false,
568
+ properties: {
569
+ reevaluateOnRerun: {
570
+ type: 'boolean',
571
+ description: ( nls.localizeWithPath(
572
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
573
+ 'JsonSchema.tasks.reevaluateOnRerun',
574
+ 'Whether to reevaluate task variables on rerun.'
575
+ )),
576
+ default: true
577
+ },
578
+ runOn: {
579
+ type: 'string',
580
+ enum: ['default', 'folderOpen'],
581
+ description: ( nls.localizeWithPath(
582
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
583
+ 'JsonSchema.tasks.runOn',
584
+ 'Configures when the task should be run. If set to folderOpen, then the task will be run automatically when the folder is opened.'
585
+ )),
586
+ default: 'default'
587
+ },
588
+ instanceLimit: {
589
+ type: 'number',
590
+ description: ( nls.localizeWithPath(
591
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
592
+ 'JsonSchema.tasks.instanceLimit',
593
+ 'The number of instances of the task that are allowed to run simultaneously.'
594
+ )),
595
+ default: 1
596
+ },
597
+ },
598
+ description: ( nls.localizeWithPath(
599
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
600
+ 'JsonSchema.tasks.runOptions',
601
+ 'The task\'s run related options'
602
+ ))
603
+ };
604
+ const commonSchemaDefinitions = commonSchema.definitions;
605
+ const options = Objects.deepClone(commonSchemaDefinitions.options);
606
+ const optionsProperties = options.properties;
607
+ optionsProperties.shell = Objects.deepClone(commonSchemaDefinitions.shellConfiguration);
608
+ const taskConfiguration = {
609
+ type: 'object',
610
+ additionalProperties: false,
611
+ properties: {
612
+ label: {
613
+ type: 'string',
614
+ description: ( nls.localizeWithPath(
615
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
616
+ 'JsonSchema.tasks.taskLabel',
617
+ "The task's label"
618
+ ))
619
+ },
620
+ taskName: {
621
+ type: 'string',
622
+ description: ( nls.localizeWithPath(
623
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
624
+ 'JsonSchema.tasks.taskName',
625
+ 'The task\'s name'
626
+ )),
627
+ deprecationMessage: ( nls.localizeWithPath(
628
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
629
+ 'JsonSchema.tasks.taskName.deprecated',
630
+ 'The task\'s name property is deprecated. Use the label property instead.'
631
+ ))
632
+ },
633
+ identifier: Objects.deepClone(identifier),
634
+ group: Objects.deepClone(group),
635
+ isBackground: {
636
+ type: 'boolean',
637
+ description: ( nls.localizeWithPath(
638
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
639
+ 'JsonSchema.tasks.background',
640
+ 'Whether the executed task is kept alive and is running in the background.'
641
+ )),
642
+ default: true
643
+ },
644
+ promptOnClose: {
645
+ type: 'boolean',
646
+ description: ( nls.localizeWithPath(
647
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
648
+ 'JsonSchema.tasks.promptOnClose',
649
+ 'Whether the user is prompted when VS Code closes with a running task.'
650
+ )),
651
+ default: false
652
+ },
653
+ presentation: Objects.deepClone(presentation),
654
+ icon: Objects.deepClone(icon),
655
+ hide: Objects.deepClone(hide),
656
+ options: options,
657
+ problemMatcher: {
658
+ $ref: '#/definitions/problemMatcherType',
659
+ description: ( nls.localizeWithPath(
660
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
661
+ 'JsonSchema.tasks.matchers',
662
+ 'The problem matcher(s) to use. Can either be a string or a problem matcher definition or an array of strings and problem matchers.'
663
+ ))
664
+ },
665
+ runOptions: Objects.deepClone(runOptions),
666
+ dependsOn: Objects.deepClone(dependsOn),
667
+ dependsOrder: Objects.deepClone(dependsOrder),
668
+ detail: Objects.deepClone(detail),
669
+ }
670
+ };
671
+ const taskDefinitions = [];
672
+ TaskDefinitionRegistry.onReady().then(() => {
673
+ updateTaskDefinitions();
674
+ });
675
+ function updateTaskDefinitions() {
676
+ for (const taskType of TaskDefinitionRegistry.all()) {
677
+ if (taskDefinitions.find(schema => {
678
+ return schema.properties?.type?.enum?.find ? schema.properties?.type.enum.find(element => element === taskType.taskType) : undefined;
679
+ })) {
680
+ continue;
681
+ }
682
+ const schema = Objects.deepClone(taskConfiguration);
683
+ const schemaProperties = schema.properties;
684
+ schemaProperties.type = {
685
+ type: 'string',
686
+ description: ( nls.localizeWithPath(
687
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
688
+ 'JsonSchema.customizations.customizes.type',
689
+ 'The task type to customize'
690
+ )),
691
+ enum: [taskType.taskType]
692
+ };
693
+ if (taskType.required) {
694
+ schema.required = taskType.required.slice();
695
+ }
696
+ else {
697
+ schema.required = [];
698
+ }
699
+ schema.required.push('type');
700
+ if (taskType.properties) {
701
+ for (const key of ( Object.keys(taskType.properties))) {
702
+ const property = taskType.properties[key];
703
+ schemaProperties[key] = Objects.deepClone(property);
704
+ }
705
+ }
706
+ fixReferences(schema);
707
+ taskDefinitions.push(schema);
708
+ }
709
+ }
710
+ const customize = Objects.deepClone(taskConfiguration);
711
+ customize.properties.customize = {
712
+ type: 'string',
713
+ deprecationMessage: ( nls.localizeWithPath(
714
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
715
+ 'JsonSchema.tasks.customize.deprecated',
716
+ 'The customize property is deprecated. See the 1.14 release notes on how to migrate to the new task customization approach'
717
+ ))
718
+ };
719
+ if (!customize.required) {
720
+ customize.required = [];
721
+ }
722
+ customize.required.push('customize');
723
+ taskDefinitions.push(customize);
724
+ const definitions = Objects.deepClone(commonSchemaDefinitions);
725
+ const taskDescription = definitions.taskDescription;
726
+ taskDescription.required = ['label'];
727
+ const taskDescriptionProperties = taskDescription.properties;
728
+ taskDescriptionProperties.label = Objects.deepClone(label);
729
+ taskDescriptionProperties.command = Objects.deepClone(command);
730
+ taskDescriptionProperties.args = Objects.deepClone(args);
731
+ taskDescriptionProperties.isShellCommand = Objects.deepClone(shellCommand);
732
+ taskDescriptionProperties.dependsOn = dependsOn;
733
+ taskDescriptionProperties.hide = Objects.deepClone(hide);
734
+ taskDescriptionProperties.dependsOrder = dependsOrder;
735
+ taskDescriptionProperties.identifier = Objects.deepClone(identifier);
736
+ taskDescriptionProperties.type = Objects.deepClone(taskType);
737
+ taskDescriptionProperties.presentation = Objects.deepClone(presentation);
738
+ taskDescriptionProperties.terminal = terminal;
739
+ taskDescriptionProperties.icon = Objects.deepClone(icon);
740
+ taskDescriptionProperties.group = Objects.deepClone(group);
741
+ taskDescriptionProperties.runOptions = Objects.deepClone(runOptions);
742
+ taskDescriptionProperties.detail = detail;
743
+ taskDescriptionProperties.taskName.deprecationMessage = ( nls.localizeWithPath(
744
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
745
+ 'JsonSchema.tasks.taskName.deprecated',
746
+ 'The task\'s name property is deprecated. Use the label property instead.'
747
+ ));
748
+ const processTask = Objects.deepClone(taskDescription);
749
+ taskDescription.default = {
750
+ label: 'My Task',
751
+ type: 'shell',
752
+ command: 'echo Hello',
753
+ problemMatcher: []
754
+ };
755
+ definitions.showOutputType.deprecationMessage = ( nls.localizeWithPath(
756
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
757
+ 'JsonSchema.tasks.showOutput.deprecated',
758
+ 'The property showOutput is deprecated. Use the reveal property inside the presentation property instead. See also the 1.14 release notes.'
759
+ ));
760
+ taskDescriptionProperties.echoCommand.deprecationMessage = ( nls.localizeWithPath(
761
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
762
+ 'JsonSchema.tasks.echoCommand.deprecated',
763
+ 'The property echoCommand is deprecated. Use the echo property inside the presentation property instead. See also the 1.14 release notes.'
764
+ ));
765
+ taskDescriptionProperties.suppressTaskName.deprecationMessage = ( nls.localizeWithPath(
766
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
767
+ 'JsonSchema.tasks.suppressTaskName.deprecated',
768
+ 'The property suppressTaskName is deprecated. Inline the command with its arguments into the task instead. See also the 1.14 release notes.'
769
+ ));
770
+ taskDescriptionProperties.isBuildCommand.deprecationMessage = ( nls.localizeWithPath(
771
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
772
+ 'JsonSchema.tasks.isBuildCommand.deprecated',
773
+ 'The property isBuildCommand is deprecated. Use the group property instead. See also the 1.14 release notes.'
774
+ ));
775
+ taskDescriptionProperties.isTestCommand.deprecationMessage = ( nls.localizeWithPath(
776
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
777
+ 'JsonSchema.tasks.isTestCommand.deprecated',
778
+ 'The property isTestCommand is deprecated. Use the group property instead. See also the 1.14 release notes.'
779
+ ));
780
+ processTask.properties.type = {
781
+ type: 'string',
782
+ enum: ['process'],
783
+ default: 'process',
784
+ description: ( nls.localizeWithPath(
785
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
786
+ 'JsonSchema.tasks.type',
787
+ 'Defines whether the task is run as a process or as a command inside a shell.'
788
+ ))
789
+ };
790
+ processTask.required.push('command');
791
+ processTask.required.push('type');
792
+ taskDefinitions.push(processTask);
793
+ taskDefinitions.push({
794
+ $ref: '#/definitions/taskDescription'
795
+ });
796
+ const definitionsTaskRunnerConfigurationProperties = definitions.taskRunnerConfiguration.properties;
797
+ const tasks = definitionsTaskRunnerConfigurationProperties.tasks;
798
+ tasks.items = {
799
+ oneOf: taskDefinitions
800
+ };
801
+ definitionsTaskRunnerConfigurationProperties.inputs = inputsSchema.definitions.inputs;
802
+ definitions.commandConfiguration.properties.isShellCommand = Objects.deepClone(shellCommand);
803
+ definitions.commandConfiguration.properties.args = Objects.deepClone(args);
804
+ definitions.options.properties.shell = {
805
+ $ref: '#/definitions/shellConfiguration'
806
+ };
807
+ definitionsTaskRunnerConfigurationProperties.isShellCommand = Objects.deepClone(shellCommand);
808
+ definitionsTaskRunnerConfigurationProperties.type = Objects.deepClone(taskType);
809
+ definitionsTaskRunnerConfigurationProperties.group = Objects.deepClone(group);
810
+ definitionsTaskRunnerConfigurationProperties.presentation = Objects.deepClone(presentation);
811
+ definitionsTaskRunnerConfigurationProperties.suppressTaskName.deprecationMessage = ( nls.localizeWithPath(
812
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
813
+ 'JsonSchema.tasks.suppressTaskName.deprecated',
814
+ 'The property suppressTaskName is deprecated. Inline the command with its arguments into the task instead. See also the 1.14 release notes.'
815
+ ));
816
+ definitionsTaskRunnerConfigurationProperties.taskSelector.deprecationMessage = ( nls.localizeWithPath(
817
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
818
+ 'JsonSchema.tasks.taskSelector.deprecated',
819
+ 'The property taskSelector is deprecated. Inline the command with its arguments into the task instead. See also the 1.14 release notes.'
820
+ ));
821
+ const osSpecificTaskRunnerConfiguration = Objects.deepClone(definitions.taskRunnerConfiguration);
822
+ delete osSpecificTaskRunnerConfiguration.properties.tasks;
823
+ osSpecificTaskRunnerConfiguration.additionalProperties = false;
824
+ definitions.osSpecificTaskRunnerConfiguration = osSpecificTaskRunnerConfiguration;
825
+ definitionsTaskRunnerConfigurationProperties.version = Objects.deepClone(version);
826
+ const schema = {
827
+ oneOf: [
828
+ {
829
+ 'allOf': [
830
+ {
831
+ type: 'object',
832
+ required: ['version'],
833
+ properties: {
834
+ version: Objects.deepClone(version),
835
+ windows: {
836
+ '$ref': '#/definitions/osSpecificTaskRunnerConfiguration',
837
+ 'description': ( nls.localizeWithPath(
838
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
839
+ 'JsonSchema.windows',
840
+ 'Windows specific command configuration'
841
+ ))
842
+ },
843
+ osx: {
844
+ '$ref': '#/definitions/osSpecificTaskRunnerConfiguration',
845
+ 'description': ( nls.localizeWithPath(
846
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
847
+ 'JsonSchema.mac',
848
+ 'Mac specific command configuration'
849
+ ))
850
+ },
851
+ linux: {
852
+ '$ref': '#/definitions/osSpecificTaskRunnerConfiguration',
853
+ 'description': ( nls.localizeWithPath(
854
+ 'vs/workbench/contrib/tasks/common/jsonSchema_v2',
855
+ 'JsonSchema.linux',
856
+ 'Linux specific command configuration'
857
+ ))
858
+ }
859
+ }
860
+ },
861
+ {
862
+ $ref: '#/definitions/taskRunnerConfiguration'
863
+ }
864
+ ]
865
+ }
866
+ ]
867
+ };
868
+ schema.definitions = definitions;
869
+ function deprecatedVariableMessage(schemaMap, property) {
870
+ const mapAtProperty = schemaMap[property].properties;
871
+ if (mapAtProperty) {
872
+ ( Object.keys(mapAtProperty)).forEach(name => {
873
+ deprecatedVariableMessage(mapAtProperty, name);
874
+ });
875
+ }
876
+ else {
877
+ applyDeprecatedVariableMessage(schemaMap[property]);
878
+ }
879
+ }
880
+ Object.getOwnPropertyNames(definitions).forEach(key => {
881
+ const newKey = key + '2';
882
+ definitions[newKey] = definitions[key];
883
+ delete definitions[key];
884
+ deprecatedVariableMessage(definitions, newKey);
885
+ });
886
+ fixReferences(schema);
887
+ function updateProblemMatchers() {
888
+ try {
889
+ const matcherIds = ( ( ProblemMatcherRegistry.keys()).map(key => '$' + key));
890
+ definitions.problemMatcherType2.oneOf[0].enum = matcherIds;
891
+ definitions.problemMatcherType2.oneOf[2].items.anyOf[0].enum = matcherIds;
892
+ }
893
+ catch (err) {
894
+ console.log('Installing problem matcher ids failed');
895
+ }
896
+ }
897
+ ProblemMatcherRegistry.onReady().then(() => {
898
+ updateProblemMatchers();
899
+ });
900
+
901
+ export { schema as default, updateProblemMatchers, updateTaskDefinitions };