@codingame/monaco-vscode-task-service-override 28.4.1 → 29.0.0

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 (22) hide show
  1. package/package.json +2 -2
  2. package/vscode/src/vs/base/common/parsers.d.ts +32 -0
  3. package/vscode/src/vs/base/common/parsers.js +54 -0
  4. package/vscode/src/vs/workbench/contrib/tasks/browser/abstractTaskService.d.ts +1 -1
  5. package/vscode/src/vs/workbench/contrib/tasks/browser/abstractTaskService.js +114 -114
  6. package/vscode/src/vs/workbench/contrib/tasks/browser/runAutomaticTasks.js +7 -7
  7. package/vscode/src/vs/workbench/contrib/tasks/browser/task.contribution.js +48 -48
  8. package/vscode/src/vs/workbench/contrib/tasks/browser/taskQuickPick.js +19 -19
  9. package/vscode/src/vs/workbench/contrib/tasks/browser/taskService.js +1 -1
  10. package/vscode/src/vs/workbench/contrib/tasks/browser/taskTerminalStatus.js +10 -10
  11. package/vscode/src/vs/workbench/contrib/tasks/browser/tasksQuickAccess.js +2 -2
  12. package/vscode/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.js +17 -17
  13. package/vscode/src/vs/workbench/contrib/tasks/common/jsonSchemaCommon.js +42 -42
  14. package/vscode/src/vs/workbench/contrib/tasks/common/jsonSchema_v1.js +9 -9
  15. package/vscode/src/vs/workbench/contrib/tasks/common/jsonSchema_v2.js +86 -86
  16. package/vscode/src/vs/workbench/contrib/tasks/common/problemCollectors.d.ts +1 -1
  17. package/vscode/src/vs/workbench/contrib/tasks/common/problemCollectors.js +1 -1
  18. package/vscode/src/vs/workbench/contrib/tasks/common/problemMatcher.d.ts +433 -0
  19. package/vscode/src/vs/workbench/contrib/tasks/common/problemMatcher.js +1637 -0
  20. package/vscode/src/vs/workbench/contrib/tasks/common/taskConfiguration.d.ts +514 -0
  21. package/vscode/src/vs/workbench/contrib/tasks/common/taskConfiguration.js +1798 -0
  22. package/vscode/src/vs/workbench/contrib/tasks/common/taskTemplates.js +4 -4
@@ -0,0 +1,1798 @@
1
+
2
+ import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
3
+ import { deepClone } from '@codingame/monaco-vscode-api/vscode/vs/base/common/objects';
4
+ import { Platform } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
5
+ import { isString, isStringArray, isBoolean, isUndefined } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
6
+ import { generateUuid } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uuid';
7
+ import { ProblemMatcherParser, isNamedProblemMatcher, ProblemMatcherRegistry } from './problemMatcher.js';
8
+ import { RunOnOptions as RunOnOptions$1, InstancePolicy as InstancePolicy$1, RevealKind, RevealProblemKind, PanelKind, ExecutionEngine as ExecutionEngine$1, ShellQuoting as ShellQuoting$1, JsonSchemaVersion as JsonSchemaVersion$1, RuntimeType, TaskGroup, USER_TASKS_GROUP_KEY, TaskDefinition, DependsOrder as DependsOrder$1, TaskSourceKind, ConfiguringTask as ConfiguringTask$1, CUSTOMIZED_TASK_TYPE, CustomTask as CustomTask$1, CommandString as CommandString$1 } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/tasks/common/tasks';
9
+ import { TaskDefinitionRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/tasks/common/taskDefinitionRegistry';
10
+ import { ProcessExecutionSupportedContext, ShellExecutionSupportedContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/tasks/common/taskService';
11
+
12
+ var ShellQuoting;
13
+ (function(ShellQuoting) {
14
+ ShellQuoting[ShellQuoting["escape"] = 1] = "escape";
15
+ ShellQuoting[ShellQuoting["strong"] = 2] = "strong";
16
+ ShellQuoting[ShellQuoting["weak"] = 3] = "weak";
17
+ })(ShellQuoting || (ShellQuoting = {}));
18
+ var ITaskIdentifier;
19
+ (function(ITaskIdentifier) {
20
+ function is(value) {
21
+ const candidate = value;
22
+ return candidate !== undefined && isString(value.type);
23
+ }
24
+ ITaskIdentifier.is = is;
25
+ })(ITaskIdentifier || (ITaskIdentifier = {}));
26
+ var CommandString;
27
+ (function(CommandString) {
28
+ function value(value) {
29
+ if (isString(value)) {
30
+ return value;
31
+ } else if (isStringArray(value)) {
32
+ return value.join(" ");
33
+ } else {
34
+ if (isString(value.value)) {
35
+ return value.value;
36
+ } else {
37
+ return value.value.join(" ");
38
+ }
39
+ }
40
+ }
41
+ CommandString.value = value;
42
+ })(CommandString || (CommandString = {}));
43
+ var ProblemMatcherKind;
44
+ (function(ProblemMatcherKind) {
45
+ ProblemMatcherKind[ProblemMatcherKind["Unknown"] = 0] = "Unknown";
46
+ ProblemMatcherKind[ProblemMatcherKind["String"] = 1] = "String";
47
+ ProblemMatcherKind[ProblemMatcherKind["ProblemMatcher"] = 2] = "ProblemMatcher";
48
+ ProblemMatcherKind[ProblemMatcherKind["Array"] = 3] = "Array";
49
+ })(ProblemMatcherKind || (ProblemMatcherKind = {}));
50
+ const EMPTY_ARRAY = [];
51
+ function assignProperty(target, source, key) {
52
+ const sourceAtKey = source[key];
53
+ if (sourceAtKey !== undefined) {
54
+ target[key] = sourceAtKey;
55
+ }
56
+ }
57
+ function fillProperty(target, source, key) {
58
+ const sourceAtKey = source[key];
59
+ if (target[key] === undefined && sourceAtKey !== undefined) {
60
+ target[key] = sourceAtKey;
61
+ }
62
+ }
63
+ function _isEmpty(value, properties, allowEmptyArray = false) {
64
+ if (value === undefined || value === null || properties === undefined) {
65
+ return true;
66
+ }
67
+ for (const meta of properties) {
68
+ const property = value[meta.property];
69
+ if (property !== undefined && property !== null) {
70
+ if (meta.type !== undefined && !meta.type.isEmpty(property)) {
71
+ return false;
72
+ } else if (!Array.isArray(property) || (property.length > 0) || allowEmptyArray) {
73
+ return false;
74
+ }
75
+ }
76
+ }
77
+ return true;
78
+ }
79
+ function _assignProperties(target, source, properties) {
80
+ if (!source || _isEmpty(source, properties)) {
81
+ return target;
82
+ }
83
+ if (!target || _isEmpty(target, properties)) {
84
+ return source;
85
+ }
86
+ for (const meta of properties) {
87
+ const property = meta.property;
88
+ let value;
89
+ if (meta.type !== undefined) {
90
+ value = meta.type.assignProperties(target[property], source[property]);
91
+ } else {
92
+ value = source[property];
93
+ }
94
+ if (value !== undefined && value !== null) {
95
+ target[property] = value;
96
+ }
97
+ }
98
+ return target;
99
+ }
100
+ function _fillProperties(target, source, properties, allowEmptyArray = false) {
101
+ if (!source || _isEmpty(source, properties)) {
102
+ return target;
103
+ }
104
+ if (!target || _isEmpty(target, properties, allowEmptyArray)) {
105
+ return source;
106
+ }
107
+ for (const meta of properties) {
108
+ const property = meta.property;
109
+ let value;
110
+ if (meta.type) {
111
+ value = meta.type.fillProperties(target[property], source[property]);
112
+ } else if (target[property] === undefined) {
113
+ value = source[property];
114
+ }
115
+ if (value !== undefined && value !== null) {
116
+ target[property] = value;
117
+ }
118
+ }
119
+ return target;
120
+ }
121
+ function _fillDefaults(target, defaults, properties, context) {
122
+ if (target && Object.isFrozen(target)) {
123
+ return target;
124
+ }
125
+ if (target === undefined || target === null || defaults === undefined || defaults === null) {
126
+ if (defaults !== undefined && defaults !== null) {
127
+ return deepClone(defaults);
128
+ } else {
129
+ return undefined;
130
+ }
131
+ }
132
+ for (const meta of properties) {
133
+ const property = meta.property;
134
+ if (target[property] !== undefined) {
135
+ continue;
136
+ }
137
+ let value;
138
+ if (meta.type) {
139
+ value = meta.type.fillDefaults(target[property], context);
140
+ } else {
141
+ value = defaults[property];
142
+ }
143
+ if (value !== undefined && value !== null) {
144
+ target[property] = value;
145
+ }
146
+ }
147
+ return target;
148
+ }
149
+ function _freeze(target, properties) {
150
+ if (target === undefined || target === null) {
151
+ return undefined;
152
+ }
153
+ if (Object.isFrozen(target)) {
154
+ return target;
155
+ }
156
+ for (const meta of properties) {
157
+ if (meta.type) {
158
+ const value = target[meta.property];
159
+ if (value) {
160
+ meta.type.freeze(value);
161
+ }
162
+ }
163
+ }
164
+ return target;
165
+ }
166
+ var RunOnOptions;
167
+ (function(RunOnOptions) {
168
+ function fromString(value) {
169
+ if (!value) {
170
+ return RunOnOptions$1.default;
171
+ }
172
+ switch (value.toLowerCase()) {
173
+ case "folderopen":
174
+ return RunOnOptions$1.folderOpen;
175
+ case "worktreecreated":
176
+ return RunOnOptions$1.worktreeCreated;
177
+ case "default":
178
+ default:
179
+ return RunOnOptions$1.default;
180
+ }
181
+ }
182
+ RunOnOptions.fromString = fromString;
183
+ })(RunOnOptions || (RunOnOptions = {}));
184
+ var RunOptions;
185
+ (function(RunOptions) {
186
+ const properties = [{
187
+ property: "reevaluateOnRerun"
188
+ }, {
189
+ property: "runOn"
190
+ }, {
191
+ property: "instanceLimit"
192
+ }, {
193
+ property: "instancePolicy"
194
+ }];
195
+ function fromConfiguration(value) {
196
+ return {
197
+ reevaluateOnRerun: value ? value.reevaluateOnRerun : true,
198
+ runOn: value ? RunOnOptions.fromString(value.runOn) : RunOnOptions$1.default,
199
+ instanceLimit: value?.instanceLimit ? Math.max(value.instanceLimit, 1) : 1,
200
+ instancePolicy: value ? InstancePolicy.fromString(value.instancePolicy) : InstancePolicy$1.prompt
201
+ };
202
+ }
203
+ RunOptions.fromConfiguration = fromConfiguration;
204
+ function assignProperties(target, source) {
205
+ return _assignProperties(target, source, properties);
206
+ }
207
+ RunOptions.assignProperties = assignProperties;
208
+ function fillProperties(target, source) {
209
+ return _fillProperties(target, source, properties);
210
+ }
211
+ RunOptions.fillProperties = fillProperties;
212
+ })(RunOptions || (RunOptions = {}));
213
+ var InstancePolicy;
214
+ (function(InstancePolicy) {
215
+ function fromString(value) {
216
+ if (!value) {
217
+ return InstancePolicy$1.prompt;
218
+ }
219
+ switch (value.toLowerCase()) {
220
+ case "terminatenewest":
221
+ return InstancePolicy$1.terminateNewest;
222
+ case "terminateoldest":
223
+ return InstancePolicy$1.terminateOldest;
224
+ case "warn":
225
+ return InstancePolicy$1.warn;
226
+ case "silent":
227
+ return InstancePolicy$1.silent;
228
+ case "prompt":
229
+ default:
230
+ return InstancePolicy$1.prompt;
231
+ }
232
+ }
233
+ InstancePolicy.fromString = fromString;
234
+ })(InstancePolicy || (InstancePolicy = {}));
235
+ var ShellConfiguration;
236
+ (function(ShellConfiguration) {
237
+ const properties = [{
238
+ property: "executable"
239
+ }, {
240
+ property: "args"
241
+ }, {
242
+ property: "quoting"
243
+ }];
244
+ function is(value) {
245
+ const candidate = value;
246
+ return candidate && (isString(candidate.executable) || isStringArray(candidate.args));
247
+ }
248
+ ShellConfiguration.is = is;
249
+ function from(config, context) {
250
+ if (!is(config)) {
251
+ return undefined;
252
+ }
253
+ const result = {};
254
+ if (config.executable !== undefined) {
255
+ result.executable = config.executable;
256
+ }
257
+ if (config.args !== undefined) {
258
+ result.args = config.args.slice();
259
+ }
260
+ if (config.quoting !== undefined) {
261
+ result.quoting = deepClone(config.quoting);
262
+ }
263
+ return result;
264
+ }
265
+ ShellConfiguration.from = from;
266
+ function isEmpty(value) {
267
+ return _isEmpty(value, properties, true);
268
+ }
269
+ ShellConfiguration.isEmpty = isEmpty;
270
+ function assignProperties(target, source) {
271
+ return _assignProperties(target, source, properties);
272
+ }
273
+ ShellConfiguration.assignProperties = assignProperties;
274
+ function fillProperties(target, source) {
275
+ return _fillProperties(target, source, properties, true);
276
+ }
277
+ ShellConfiguration.fillProperties = fillProperties;
278
+ function fillDefaults(value, context) {
279
+ return value;
280
+ }
281
+ ShellConfiguration.fillDefaults = fillDefaults;
282
+ function freeze(value) {
283
+ if (!value) {
284
+ return undefined;
285
+ }
286
+ return ( Object.freeze(value));
287
+ }
288
+ ShellConfiguration.freeze = freeze;
289
+ })(ShellConfiguration || (ShellConfiguration = {}));
290
+ var CommandOptions;
291
+ (function(CommandOptions) {
292
+ const properties = [{
293
+ property: "cwd"
294
+ }, {
295
+ property: "env"
296
+ }, {
297
+ property: "shell",
298
+ type: ShellConfiguration
299
+ }];
300
+ const defaults = {
301
+ cwd: "${workspaceFolder}"
302
+ };
303
+ function from(options, context) {
304
+ const result = {};
305
+ if (options.cwd !== undefined) {
306
+ if (isString(options.cwd)) {
307
+ result.cwd = options.cwd;
308
+ } else {
309
+ context.taskLoadIssues.push(( localize(
310
+ 13227,
311
+ "Warning: options.cwd must be of type string. Ignoring value {0}\n",
312
+ options.cwd
313
+ )));
314
+ }
315
+ }
316
+ if (options.env !== undefined) {
317
+ result.env = deepClone(options.env);
318
+ }
319
+ result.shell = ShellConfiguration.from(options.shell, context);
320
+ return isEmpty(result) ? undefined : result;
321
+ }
322
+ CommandOptions.from = from;
323
+ function isEmpty(value) {
324
+ return _isEmpty(value, properties);
325
+ }
326
+ CommandOptions.isEmpty = isEmpty;
327
+ function assignProperties(target, source) {
328
+ if ((source === undefined) || isEmpty(source)) {
329
+ return target;
330
+ }
331
+ if ((target === undefined) || isEmpty(target)) {
332
+ return source;
333
+ }
334
+ assignProperty(target, source, "cwd");
335
+ if (target.env === undefined) {
336
+ target.env = source.env;
337
+ } else if (source.env !== undefined) {
338
+ const env = Object.create(null);
339
+ if (target.env !== undefined) {
340
+ ( Object.keys(target.env)).forEach(key => env[key] = target.env[key]);
341
+ }
342
+ if (source.env !== undefined) {
343
+ ( Object.keys(source.env)).forEach(key => env[key] = source.env[key]);
344
+ }
345
+ target.env = env;
346
+ }
347
+ target.shell = ShellConfiguration.assignProperties(target.shell, source.shell);
348
+ return target;
349
+ }
350
+ CommandOptions.assignProperties = assignProperties;
351
+ function fillProperties(target, source) {
352
+ return _fillProperties(target, source, properties);
353
+ }
354
+ CommandOptions.fillProperties = fillProperties;
355
+ function fillDefaults(value, context) {
356
+ return _fillDefaults(value, defaults, properties, context);
357
+ }
358
+ CommandOptions.fillDefaults = fillDefaults;
359
+ function freeze(value) {
360
+ return _freeze(value, properties);
361
+ }
362
+ CommandOptions.freeze = freeze;
363
+ })(CommandOptions || (CommandOptions = {}));
364
+ var CommandConfiguration;
365
+ (function(CommandConfiguration) {
366
+ let PresentationOptions;
367
+ (function(PresentationOptions) {
368
+ const properties = [{
369
+ property: "echo"
370
+ }, {
371
+ property: "reveal"
372
+ }, {
373
+ property: "revealProblems"
374
+ }, {
375
+ property: "focus"
376
+ }, {
377
+ property: "panel"
378
+ }, {
379
+ property: "showReuseMessage"
380
+ }, {
381
+ property: "clear"
382
+ }, {
383
+ property: "group"
384
+ }, {
385
+ property: "close"
386
+ }, {
387
+ property: "preserveTerminalName"
388
+ }];
389
+ function from(config, context) {
390
+ let echo;
391
+ let reveal;
392
+ let revealProblems;
393
+ let focus;
394
+ let panel;
395
+ let showReuseMessage;
396
+ let clear;
397
+ let group;
398
+ let close;
399
+ let preserveTerminalName;
400
+ let hasProps = false;
401
+ if (isBoolean(config.echoCommand)) {
402
+ echo = config.echoCommand;
403
+ hasProps = true;
404
+ }
405
+ if (isString(config.showOutput)) {
406
+ reveal = RevealKind.fromString(config.showOutput);
407
+ hasProps = true;
408
+ }
409
+ const presentation = config.presentation || config.terminal;
410
+ if (presentation) {
411
+ if (isBoolean(presentation.echo)) {
412
+ echo = presentation.echo;
413
+ }
414
+ if (isString(presentation.reveal)) {
415
+ reveal = RevealKind.fromString(presentation.reveal);
416
+ }
417
+ if (isString(presentation.revealProblems)) {
418
+ revealProblems = RevealProblemKind.fromString(presentation.revealProblems);
419
+ }
420
+ if (isBoolean(presentation.focus)) {
421
+ focus = presentation.focus;
422
+ }
423
+ if (isString(presentation.panel)) {
424
+ panel = PanelKind.fromString(presentation.panel);
425
+ }
426
+ if (isBoolean(presentation.showReuseMessage)) {
427
+ showReuseMessage = presentation.showReuseMessage;
428
+ }
429
+ if (isBoolean(presentation.clear)) {
430
+ clear = presentation.clear;
431
+ }
432
+ if (isString(presentation.group)) {
433
+ group = presentation.group;
434
+ }
435
+ if (isBoolean(presentation.close)) {
436
+ close = presentation.close;
437
+ }
438
+ if (isBoolean(presentation.preserveTerminalName)) {
439
+ preserveTerminalName = presentation.preserveTerminalName;
440
+ }
441
+ hasProps = true;
442
+ }
443
+ if (!hasProps) {
444
+ return undefined;
445
+ }
446
+ return {
447
+ echo: echo,
448
+ reveal: reveal,
449
+ revealProblems: revealProblems,
450
+ focus: focus,
451
+ panel: panel,
452
+ showReuseMessage: showReuseMessage,
453
+ clear: clear,
454
+ group,
455
+ close: close,
456
+ preserveTerminalName
457
+ };
458
+ }
459
+ PresentationOptions.from = from;
460
+ function assignProperties(target, source) {
461
+ return _assignProperties(target, source, properties);
462
+ }
463
+ PresentationOptions.assignProperties = assignProperties;
464
+ function fillProperties(target, source) {
465
+ return _fillProperties(target, source, properties);
466
+ }
467
+ PresentationOptions.fillProperties = fillProperties;
468
+ function fillDefaults(value, context) {
469
+ const defaultEcho = context.engine === ExecutionEngine$1.Terminal ? true : false;
470
+ return _fillDefaults(value, {
471
+ echo: defaultEcho,
472
+ reveal: RevealKind.Always,
473
+ revealProblems: RevealProblemKind.Never,
474
+ focus: false,
475
+ panel: PanelKind.Shared,
476
+ showReuseMessage: true,
477
+ clear: false,
478
+ preserveTerminalName: false
479
+ }, properties, context);
480
+ }
481
+ PresentationOptions.fillDefaults = fillDefaults;
482
+ function freeze(value) {
483
+ return _freeze(value, properties);
484
+ }
485
+ PresentationOptions.freeze = freeze;
486
+ function isEmpty(value) {
487
+ return _isEmpty(value, properties);
488
+ }
489
+ PresentationOptions.isEmpty = isEmpty;
490
+ })(
491
+ PresentationOptions = CommandConfiguration.PresentationOptions || (CommandConfiguration.PresentationOptions = {})
492
+ );
493
+ let ShellString;
494
+ (function(ShellString) {
495
+ function from(value) {
496
+ if (value === undefined || value === null) {
497
+ return undefined;
498
+ }
499
+ if (isString(value)) {
500
+ return value;
501
+ } else if (isStringArray(value)) {
502
+ return value.join(" ");
503
+ } else {
504
+ const quoting = ShellQuoting$1.from(value.quoting);
505
+ const result = isString(value.value) ? value.value : isStringArray(value.value) ? value.value.join(" ") : undefined;
506
+ if (result) {
507
+ return {
508
+ value: result,
509
+ quoting: quoting
510
+ };
511
+ } else {
512
+ return undefined;
513
+ }
514
+ }
515
+ }
516
+ ShellString.from = from;
517
+ })(ShellString || (ShellString = {}));
518
+ const properties = [{
519
+ property: "runtime"
520
+ }, {
521
+ property: "name"
522
+ }, {
523
+ property: "options",
524
+ type: CommandOptions
525
+ }, {
526
+ property: "args"
527
+ }, {
528
+ property: "taskSelector"
529
+ }, {
530
+ property: "suppressTaskName"
531
+ }, {
532
+ property: "presentation",
533
+ type: PresentationOptions
534
+ }];
535
+ function from(config, context) {
536
+ let result = fromBase(config, context);
537
+ let osConfig = undefined;
538
+ if (config.windows && context.platform === Platform.Windows) {
539
+ osConfig = fromBase(config.windows, context);
540
+ } else if (config.osx && context.platform === Platform.Mac) {
541
+ osConfig = fromBase(config.osx, context);
542
+ } else if (config.linux && context.platform === Platform.Linux) {
543
+ osConfig = fromBase(config.linux, context);
544
+ }
545
+ if (osConfig) {
546
+ result = assignProperties(result, osConfig, context.schemaVersion === JsonSchemaVersion$1.V2_0_0);
547
+ }
548
+ return isEmpty(result) ? undefined : result;
549
+ }
550
+ CommandConfiguration.from = from;
551
+ function fromBase(config, context) {
552
+ const name = ShellString.from(config.command);
553
+ let runtime;
554
+ if (isString(config.type)) {
555
+ if (config.type === "shell" || config.type === "process") {
556
+ runtime = RuntimeType.fromString(config.type);
557
+ }
558
+ }
559
+ if (isBoolean(config.isShellCommand) || ShellConfiguration.is(config.isShellCommand)) {
560
+ runtime = RuntimeType.Shell;
561
+ } else if (config.isShellCommand !== undefined) {
562
+ runtime = !!config.isShellCommand ? RuntimeType.Shell : RuntimeType.Process;
563
+ }
564
+ const result = {
565
+ name: name,
566
+ runtime: runtime,
567
+ presentation: PresentationOptions.from(config, context)
568
+ };
569
+ if (config.args !== undefined) {
570
+ result.args = [];
571
+ for (const arg of config.args) {
572
+ const converted = ShellString.from(arg);
573
+ if (converted !== undefined) {
574
+ result.args.push(converted);
575
+ } else {
576
+ context.taskLoadIssues.push(( localize(
577
+ 13228,
578
+ "Error: command argument must either be a string or a quoted string. Provided value is:\n{0}",
579
+ arg ? JSON.stringify(arg, undefined, 4) : "undefined"
580
+ )));
581
+ }
582
+ }
583
+ }
584
+ if (config.options !== undefined) {
585
+ result.options = CommandOptions.from(config.options, context);
586
+ if (result.options && result.options.shell === undefined && ShellConfiguration.is(config.isShellCommand)) {
587
+ result.options.shell = ShellConfiguration.from(config.isShellCommand, context);
588
+ if (context.engine !== ExecutionEngine$1.Terminal) {
589
+ context.taskLoadIssues.push(( localize(
590
+ 13229,
591
+ "Warning: shell configuration is only supported when executing tasks in the terminal."
592
+ )));
593
+ }
594
+ }
595
+ }
596
+ if (isString(config.taskSelector)) {
597
+ result.taskSelector = config.taskSelector;
598
+ }
599
+ if (isBoolean(config.suppressTaskName)) {
600
+ result.suppressTaskName = config.suppressTaskName;
601
+ }
602
+ return isEmpty(result) ? undefined : result;
603
+ }
604
+ function hasCommand(value) {
605
+ return value && !!value.name;
606
+ }
607
+ CommandConfiguration.hasCommand = hasCommand;
608
+ function isEmpty(value) {
609
+ return _isEmpty(value, properties);
610
+ }
611
+ CommandConfiguration.isEmpty = isEmpty;
612
+ function assignProperties(target, source, overwriteArgs) {
613
+ if (isEmpty(source)) {
614
+ return target;
615
+ }
616
+ if (isEmpty(target)) {
617
+ return source;
618
+ }
619
+ assignProperty(target, source, "name");
620
+ assignProperty(target, source, "runtime");
621
+ assignProperty(target, source, "taskSelector");
622
+ assignProperty(target, source, "suppressTaskName");
623
+ if (source.args !== undefined) {
624
+ if (target.args === undefined || overwriteArgs) {
625
+ target.args = source.args;
626
+ } else {
627
+ target.args = target.args.concat(source.args);
628
+ }
629
+ }
630
+ target.presentation = PresentationOptions.assignProperties(target.presentation, source.presentation);
631
+ target.options = CommandOptions.assignProperties(target.options, source.options);
632
+ return target;
633
+ }
634
+ CommandConfiguration.assignProperties = assignProperties;
635
+ function fillProperties(target, source) {
636
+ return _fillProperties(target, source, properties);
637
+ }
638
+ CommandConfiguration.fillProperties = fillProperties;
639
+ function fillGlobals(target, source, taskName) {
640
+ if ((source === undefined) || isEmpty(source)) {
641
+ return target;
642
+ }
643
+ target = target || {
644
+ name: undefined,
645
+ runtime: undefined,
646
+ presentation: undefined
647
+ };
648
+ if (target.name === undefined) {
649
+ fillProperty(target, source, "name");
650
+ fillProperty(target, source, "taskSelector");
651
+ fillProperty(target, source, "suppressTaskName");
652
+ let args = source.args ? source.args.slice() : [];
653
+ if (!target.suppressTaskName && taskName) {
654
+ if (target.taskSelector !== undefined) {
655
+ args.push(target.taskSelector + taskName);
656
+ } else {
657
+ args.push(taskName);
658
+ }
659
+ }
660
+ if (target.args) {
661
+ args = args.concat(target.args);
662
+ }
663
+ target.args = args;
664
+ }
665
+ fillProperty(target, source, "runtime");
666
+ target.presentation = PresentationOptions.fillProperties(target.presentation, source.presentation);
667
+ target.options = CommandOptions.fillProperties(target.options, source.options);
668
+ return target;
669
+ }
670
+ CommandConfiguration.fillGlobals = fillGlobals;
671
+ function fillDefaults(value, context) {
672
+ if (!value || Object.isFrozen(value)) {
673
+ return;
674
+ }
675
+ if (value.name !== undefined && value.runtime === undefined) {
676
+ value.runtime = RuntimeType.Process;
677
+ }
678
+ value.presentation = PresentationOptions.fillDefaults(value.presentation, context);
679
+ if (!isEmpty(value)) {
680
+ value.options = CommandOptions.fillDefaults(value.options, context);
681
+ }
682
+ if (value.args === undefined) {
683
+ value.args = EMPTY_ARRAY;
684
+ }
685
+ if (value.suppressTaskName === undefined) {
686
+ value.suppressTaskName = (context.schemaVersion === JsonSchemaVersion$1.V2_0_0);
687
+ }
688
+ }
689
+ CommandConfiguration.fillDefaults = fillDefaults;
690
+ function freeze(value) {
691
+ return _freeze(value, properties);
692
+ }
693
+ CommandConfiguration.freeze = freeze;
694
+ })(CommandConfiguration || (CommandConfiguration = {}));
695
+ var ProblemMatcherConverter;
696
+ (function(ProblemMatcherConverter) {
697
+ function namedFrom(declares, context) {
698
+ const result = Object.create(null);
699
+ if (!Array.isArray(declares)) {
700
+ return result;
701
+ }
702
+ declares.forEach(value => {
703
+ const namedProblemMatcher = ( new ProblemMatcherParser(context.problemReporter)).parse(value);
704
+ if (isNamedProblemMatcher(namedProblemMatcher)) {
705
+ result[namedProblemMatcher.name] = namedProblemMatcher;
706
+ } else {
707
+ context.problemReporter.error(( localize(
708
+ 13230,
709
+ "Error: Problem Matcher in declare scope must have a name:\n{0}\n",
710
+ JSON.stringify(value, undefined, 4)
711
+ )));
712
+ }
713
+ });
714
+ return result;
715
+ }
716
+ ProblemMatcherConverter.namedFrom = namedFrom;
717
+ function fromWithOsConfig(external, context) {
718
+ let result = {};
719
+ const osExternal = external;
720
+ if (osExternal.windows?.problemMatcher && context.platform === Platform.Windows) {
721
+ result = from(osExternal.windows.problemMatcher, context);
722
+ } else if (osExternal.osx?.problemMatcher && context.platform === Platform.Mac) {
723
+ result = from(osExternal.osx.problemMatcher, context);
724
+ } else if (osExternal.linux?.problemMatcher && context.platform === Platform.Linux) {
725
+ result = from(osExternal.linux.problemMatcher, context);
726
+ } else if (external.problemMatcher) {
727
+ result = from(external.problemMatcher, context);
728
+ }
729
+ return result;
730
+ }
731
+ ProblemMatcherConverter.fromWithOsConfig = fromWithOsConfig;
732
+ function from(config, context) {
733
+ const result = [];
734
+ if (config === undefined) {
735
+ return {
736
+ value: result
737
+ };
738
+ }
739
+ const errors = [];
740
+ function addResult(matcher) {
741
+ if (matcher.value) {
742
+ result.push(matcher.value);
743
+ }
744
+ if (matcher.errors) {
745
+ errors.push(...matcher.errors);
746
+ }
747
+ }
748
+ const kind = getProblemMatcherKind(config);
749
+ if (kind === ProblemMatcherKind.Unknown) {
750
+ const error = ( localize(
751
+ 13231,
752
+ "Warning: the defined problem matcher is unknown. Supported types are string | ProblemMatcher | Array<string | ProblemMatcher>.\n{0}\n",
753
+ JSON.stringify(config, null, 4)
754
+ ));
755
+ context.problemReporter.warn(error);
756
+ } else if (kind === ProblemMatcherKind.String || kind === ProblemMatcherKind.ProblemMatcher) {
757
+ addResult(resolveProblemMatcher(config, context));
758
+ } else if (kind === ProblemMatcherKind.Array) {
759
+ const problemMatchers = config;
760
+ problemMatchers.forEach(problemMatcher => {
761
+ addResult(resolveProblemMatcher(problemMatcher, context));
762
+ });
763
+ }
764
+ return {
765
+ value: result,
766
+ errors
767
+ };
768
+ }
769
+ ProblemMatcherConverter.from = from;
770
+ function getProblemMatcherKind(value) {
771
+ if (isString(value)) {
772
+ return ProblemMatcherKind.String;
773
+ } else if (Array.isArray(value)) {
774
+ return ProblemMatcherKind.Array;
775
+ } else if (!isUndefined(value)) {
776
+ return ProblemMatcherKind.ProblemMatcher;
777
+ } else {
778
+ return ProblemMatcherKind.Unknown;
779
+ }
780
+ }
781
+ function resolveProblemMatcher(value, context) {
782
+ if (isString(value)) {
783
+ let variableName = value;
784
+ if (variableName.length > 1 && variableName[0] === "$") {
785
+ variableName = variableName.substring(1);
786
+ const global = ProblemMatcherRegistry.get(variableName);
787
+ if (global) {
788
+ return {
789
+ value: deepClone(global)
790
+ };
791
+ }
792
+ let localProblemMatcher = context.namedProblemMatchers[variableName];
793
+ if (localProblemMatcher) {
794
+ localProblemMatcher = deepClone(localProblemMatcher);
795
+ delete localProblemMatcher.name;
796
+ return {
797
+ value: localProblemMatcher
798
+ };
799
+ }
800
+ }
801
+ return {
802
+ errors: [( localize(13232, "Error: Invalid problemMatcher reference: {0}\n", value))]
803
+ };
804
+ } else {
805
+ const json = value;
806
+ return {
807
+ value: ( new ProblemMatcherParser(context.problemReporter)).parse(json)
808
+ };
809
+ }
810
+ }
811
+ })(ProblemMatcherConverter || (ProblemMatcherConverter = {}));
812
+ var GroupKind;
813
+ (function(GroupKind) {
814
+ function from(external) {
815
+ if (external === undefined) {
816
+ return undefined;
817
+ } else if (isString(external) && TaskGroup.is(external)) {
818
+ return {
819
+ _id: external,
820
+ isDefault: false
821
+ };
822
+ } else if (isString(external.kind) && TaskGroup.is(external.kind)) {
823
+ const group = external.kind;
824
+ const isDefault = isUndefined(external.isDefault) ? false : external.isDefault;
825
+ return {
826
+ _id: group,
827
+ isDefault
828
+ };
829
+ }
830
+ return undefined;
831
+ }
832
+ GroupKind.from = from;
833
+ function to(group) {
834
+ if (isString(group)) {
835
+ return group;
836
+ } else if (!group.isDefault) {
837
+ return group._id;
838
+ }
839
+ return {
840
+ kind: group._id,
841
+ isDefault: group.isDefault
842
+ };
843
+ }
844
+ GroupKind.to = to;
845
+ })(GroupKind || (GroupKind = {}));
846
+ var TaskDependency;
847
+ (function(TaskDependency) {
848
+ function uriFromSource(context, source) {
849
+ switch (source) {
850
+ case TaskConfigSource.User:
851
+ return USER_TASKS_GROUP_KEY;
852
+ case TaskConfigSource.TasksJson:
853
+ return context.workspaceFolder.uri;
854
+ default:
855
+ return context.workspace && context.workspace.configuration ? context.workspace.configuration : context.workspaceFolder.uri;
856
+ }
857
+ }
858
+ function from(external, context, source) {
859
+ if (isString(external)) {
860
+ return {
861
+ uri: uriFromSource(context, source),
862
+ task: external
863
+ };
864
+ } else if (ITaskIdentifier.is(external)) {
865
+ return {
866
+ uri: uriFromSource(context, source),
867
+ task: TaskDefinition.createTaskIdentifier(external, context.problemReporter)
868
+ };
869
+ } else {
870
+ return undefined;
871
+ }
872
+ }
873
+ TaskDependency.from = from;
874
+ })(TaskDependency || (TaskDependency = {}));
875
+ var DependsOrder;
876
+ (function(DependsOrder) {
877
+ function from(order) {
878
+ switch (order) {
879
+ case DependsOrder$1.sequence:
880
+ return DependsOrder$1.sequence;
881
+ case DependsOrder$1.parallel:
882
+ default:
883
+ return DependsOrder$1.parallel;
884
+ }
885
+ }
886
+ DependsOrder.from = from;
887
+ })(DependsOrder || (DependsOrder = {}));
888
+ var ConfigurationProperties;
889
+ (function(ConfigurationProperties) {
890
+ const properties = [{
891
+ property: "name"
892
+ }, {
893
+ property: "identifier"
894
+ }, {
895
+ property: "group"
896
+ }, {
897
+ property: "isBackground"
898
+ }, {
899
+ property: "promptOnClose"
900
+ }, {
901
+ property: "dependsOn"
902
+ }, {
903
+ property: "presentation",
904
+ type: CommandConfiguration.PresentationOptions
905
+ }, {
906
+ property: "problemMatchers"
907
+ }, {
908
+ property: "options"
909
+ }, {
910
+ property: "icon"
911
+ }, {
912
+ property: "hide"
913
+ }, {
914
+ property: "inSessions"
915
+ }];
916
+ function from(external, context, includeCommandOptions, source, properties) {
917
+ if (!external) {
918
+ return {};
919
+ }
920
+ const result = {};
921
+ if (properties) {
922
+ for (const propertyName of ( Object.keys(properties))) {
923
+ if (external[propertyName] !== undefined) {
924
+ result[propertyName] = deepClone(external[propertyName]);
925
+ }
926
+ }
927
+ }
928
+ if (isString(external.taskName)) {
929
+ result.name = external.taskName;
930
+ }
931
+ if (isString(external.label) && context.schemaVersion === JsonSchemaVersion$1.V2_0_0) {
932
+ result.name = external.label;
933
+ }
934
+ if (isString(external.identifier)) {
935
+ result.identifier = external.identifier;
936
+ }
937
+ result.icon = external.icon;
938
+ result.hide = external.hide;
939
+ result.inSessions = external.inSessions;
940
+ if (external.isBackground !== undefined) {
941
+ result.isBackground = !!external.isBackground;
942
+ }
943
+ if (external.promptOnClose !== undefined) {
944
+ result.promptOnClose = !!external.promptOnClose;
945
+ }
946
+ result.group = GroupKind.from(external.group);
947
+ if (external.dependsOn !== undefined) {
948
+ if (Array.isArray(external.dependsOn)) {
949
+ result.dependsOn = external.dependsOn.reduce((dependencies, item) => {
950
+ const dependency = TaskDependency.from(item, context, source);
951
+ if (dependency) {
952
+ dependencies.push(dependency);
953
+ }
954
+ return dependencies;
955
+ }, []);
956
+ } else {
957
+ const dependsOnValue = TaskDependency.from(external.dependsOn, context, source);
958
+ result.dependsOn = dependsOnValue ? [dependsOnValue] : undefined;
959
+ }
960
+ }
961
+ result.dependsOrder = DependsOrder.from(external.dependsOrder);
962
+ if (includeCommandOptions && (external.presentation !== undefined || external.terminal !== undefined)) {
963
+ result.presentation = CommandConfiguration.PresentationOptions.from(external, context);
964
+ }
965
+ if (includeCommandOptions && (external.options !== undefined)) {
966
+ result.options = CommandOptions.from(external.options, context);
967
+ }
968
+ const configProblemMatcher = ProblemMatcherConverter.fromWithOsConfig(external, context);
969
+ if (configProblemMatcher.value !== undefined) {
970
+ result.problemMatchers = configProblemMatcher.value;
971
+ }
972
+ if (external.detail) {
973
+ result.detail = external.detail;
974
+ }
975
+ return isEmpty(result) ? {} : {
976
+ value: result,
977
+ errors: configProblemMatcher.errors
978
+ };
979
+ }
980
+ ConfigurationProperties.from = from;
981
+ function isEmpty(value) {
982
+ return _isEmpty(value, properties);
983
+ }
984
+ ConfigurationProperties.isEmpty = isEmpty;
985
+ })(ConfigurationProperties || (ConfigurationProperties = {}));
986
+ const label = "Workspace";
987
+ var ConfiguringTask;
988
+ (function(ConfiguringTask) {
989
+ const grunt = "grunt.";
990
+ const jake = "jake.";
991
+ const gulp = "gulp.";
992
+ const npm = "vscode.npm.";
993
+ const typescript = "vscode.typescript.";
994
+ function from(external, context, index, source, registry) {
995
+ if (!external) {
996
+ return undefined;
997
+ }
998
+ const type = external.type;
999
+ const customize = external.customize;
1000
+ if (!type && !customize) {
1001
+ context.problemReporter.error(( localize(
1002
+ 13233,
1003
+ "Error: tasks configuration must have a type property. The configuration will be ignored.\n{0}\n",
1004
+ JSON.stringify(external, null, 4)
1005
+ )));
1006
+ return undefined;
1007
+ }
1008
+ const typeDeclaration = type ? registry?.get?.(type) || TaskDefinitionRegistry.get(type) : undefined;
1009
+ if (!typeDeclaration) {
1010
+ const message = ( localize(
1011
+ 13234,
1012
+ "Error: there is no registered task type '{0}'. Did you miss installing an extension that provides a corresponding task provider?",
1013
+ type
1014
+ ));
1015
+ context.problemReporter.error(message);
1016
+ return undefined;
1017
+ }
1018
+ let identifier;
1019
+ if (isString(customize)) {
1020
+ if (customize.indexOf(grunt) === 0) {
1021
+ identifier = {
1022
+ type: "grunt",
1023
+ task: customize.substring(grunt.length)
1024
+ };
1025
+ } else if (customize.indexOf(jake) === 0) {
1026
+ identifier = {
1027
+ type: "jake",
1028
+ task: customize.substring(jake.length)
1029
+ };
1030
+ } else if (customize.indexOf(gulp) === 0) {
1031
+ identifier = {
1032
+ type: "gulp",
1033
+ task: customize.substring(gulp.length)
1034
+ };
1035
+ } else if (customize.indexOf(npm) === 0) {
1036
+ identifier = {
1037
+ type: "npm",
1038
+ script: customize.substring(npm.length + 4)
1039
+ };
1040
+ } else if (customize.indexOf(typescript) === 0) {
1041
+ identifier = {
1042
+ type: "typescript",
1043
+ tsconfig: customize.substring(typescript.length + 6)
1044
+ };
1045
+ }
1046
+ } else {
1047
+ if (isString(external.type)) {
1048
+ identifier = external;
1049
+ }
1050
+ }
1051
+ if (identifier === undefined) {
1052
+ context.problemReporter.error(( localize(
1053
+ 13235,
1054
+ "Error: the task configuration '{0}' is missing the required property 'type'. The task configuration will be ignored.",
1055
+ JSON.stringify(external, undefined, 0)
1056
+ )));
1057
+ return undefined;
1058
+ }
1059
+ const taskIdentifier = TaskDefinition.createTaskIdentifier(identifier, context.problemReporter);
1060
+ if (taskIdentifier === undefined) {
1061
+ context.problemReporter.error(( localize(
1062
+ 13236,
1063
+ "Error: the task configuration '{0}' is using an unknown type. The task configuration will be ignored.",
1064
+ JSON.stringify(external, undefined, 0)
1065
+ )));
1066
+ return undefined;
1067
+ }
1068
+ const configElement = {
1069
+ workspaceFolder: context.workspaceFolder,
1070
+ file: ".vscode/tasks.json",
1071
+ index,
1072
+ element: external
1073
+ };
1074
+ let taskSource;
1075
+ switch (source) {
1076
+ case TaskConfigSource.User:
1077
+ {
1078
+ taskSource = {
1079
+ kind: TaskSourceKind.User,
1080
+ config: configElement,
1081
+ label
1082
+ };
1083
+ break;
1084
+ }
1085
+ case TaskConfigSource.WorkspaceFile:
1086
+ {
1087
+ taskSource = {
1088
+ kind: TaskSourceKind.WorkspaceFile,
1089
+ config: configElement,
1090
+ label
1091
+ };
1092
+ break;
1093
+ }
1094
+ default:
1095
+ {
1096
+ taskSource = {
1097
+ kind: TaskSourceKind.Workspace,
1098
+ config: configElement,
1099
+ label
1100
+ };
1101
+ break;
1102
+ }
1103
+ }
1104
+ const result = new ConfiguringTask$1(
1105
+ `${typeDeclaration.extensionId}.${taskIdentifier._key}`,
1106
+ taskSource,
1107
+ undefined,
1108
+ type,
1109
+ taskIdentifier,
1110
+ RunOptions.fromConfiguration(external.runOptions),
1111
+ {
1112
+ hide: external.hide,
1113
+ inSessions: external.inSessions
1114
+ }
1115
+ );
1116
+ const configuration = ConfigurationProperties.from(external, context, true, source, typeDeclaration.properties);
1117
+ result.addTaskLoadMessages(configuration.errors);
1118
+ if (configuration.value) {
1119
+ result.configurationProperties = Object.assign(result.configurationProperties, configuration.value);
1120
+ if (result.configurationProperties.name) {
1121
+ result._label = result.configurationProperties.name;
1122
+ } else {
1123
+ let label = result.configures.type;
1124
+ if (typeDeclaration.required && typeDeclaration.required.length > 0) {
1125
+ for (const required of typeDeclaration.required) {
1126
+ const value = result.configures[required];
1127
+ if (value) {
1128
+ label = label + ": " + value;
1129
+ break;
1130
+ }
1131
+ }
1132
+ }
1133
+ result._label = label;
1134
+ }
1135
+ if (!result.configurationProperties.identifier) {
1136
+ result.configurationProperties.identifier = taskIdentifier._key;
1137
+ }
1138
+ }
1139
+ return result;
1140
+ }
1141
+ ConfiguringTask.from = from;
1142
+ })(ConfiguringTask || (ConfiguringTask = {}));
1143
+ var CustomTask;
1144
+ (function(CustomTask) {
1145
+ function from(external, context, index, source) {
1146
+ if (!external) {
1147
+ return undefined;
1148
+ }
1149
+ let type = external.type;
1150
+ if (type === undefined || type === null) {
1151
+ type = CUSTOMIZED_TASK_TYPE;
1152
+ }
1153
+ if (type !== CUSTOMIZED_TASK_TYPE && type !== "shell" && type !== "process") {
1154
+ context.problemReporter.error(( localize(
1155
+ 13237,
1156
+ "Error: tasks is not declared as a custom task. The configuration will be ignored.\n{0}\n",
1157
+ JSON.stringify(external, null, 4)
1158
+ )));
1159
+ return undefined;
1160
+ }
1161
+ let taskName = external.taskName;
1162
+ if (isString(external.label) && context.schemaVersion === JsonSchemaVersion$1.V2_0_0) {
1163
+ taskName = external.label;
1164
+ }
1165
+ if (!taskName) {
1166
+ context.problemReporter.error(( localize(
1167
+ 13238,
1168
+ "Error: a task must provide a label property. The task will be ignored.\n{0}\n",
1169
+ JSON.stringify(external, null, 4)
1170
+ )));
1171
+ return undefined;
1172
+ }
1173
+ let taskSource;
1174
+ switch (source) {
1175
+ case TaskConfigSource.User:
1176
+ {
1177
+ taskSource = {
1178
+ kind: TaskSourceKind.User,
1179
+ config: {
1180
+ index,
1181
+ element: external,
1182
+ file: ".vscode/tasks.json",
1183
+ workspaceFolder: context.workspaceFolder
1184
+ },
1185
+ label
1186
+ };
1187
+ break;
1188
+ }
1189
+ case TaskConfigSource.WorkspaceFile:
1190
+ {
1191
+ taskSource = {
1192
+ kind: TaskSourceKind.WorkspaceFile,
1193
+ config: {
1194
+ index,
1195
+ element: external,
1196
+ file: ".vscode/tasks.json",
1197
+ workspaceFolder: context.workspaceFolder,
1198
+ workspace: context.workspace
1199
+ },
1200
+ label
1201
+ };
1202
+ break;
1203
+ }
1204
+ default:
1205
+ {
1206
+ taskSource = {
1207
+ kind: TaskSourceKind.Workspace,
1208
+ config: {
1209
+ index,
1210
+ element: external,
1211
+ file: ".vscode/tasks.json",
1212
+ workspaceFolder: context.workspaceFolder
1213
+ },
1214
+ label
1215
+ };
1216
+ break;
1217
+ }
1218
+ }
1219
+ const result = new CustomTask$1(
1220
+ context.uuidMap.getUUID(taskName),
1221
+ taskSource,
1222
+ taskName,
1223
+ CUSTOMIZED_TASK_TYPE,
1224
+ undefined,
1225
+ false,
1226
+ RunOptions.fromConfiguration(external.runOptions),
1227
+ {
1228
+ name: taskName,
1229
+ identifier: taskName
1230
+ }
1231
+ );
1232
+ const configuration = ConfigurationProperties.from(external, context, false, source);
1233
+ result.addTaskLoadMessages(configuration.errors);
1234
+ if (configuration.value) {
1235
+ result.configurationProperties = Object.assign(result.configurationProperties, configuration.value);
1236
+ }
1237
+ {
1238
+ const legacy = external;
1239
+ if (result.configurationProperties.isBackground === undefined && legacy.isWatching !== undefined) {
1240
+ result.configurationProperties.isBackground = !!legacy.isWatching;
1241
+ }
1242
+ if (result.configurationProperties.group === undefined) {
1243
+ if (legacy.isBuildCommand === true) {
1244
+ result.configurationProperties.group = TaskGroup.Build;
1245
+ } else if (legacy.isTestCommand === true) {
1246
+ result.configurationProperties.group = TaskGroup.Test;
1247
+ }
1248
+ }
1249
+ }
1250
+ const command = CommandConfiguration.from(external, context);
1251
+ if (command) {
1252
+ result.command = command;
1253
+ }
1254
+ if (external.command !== undefined) {
1255
+ command.suppressTaskName = true;
1256
+ }
1257
+ return result;
1258
+ }
1259
+ CustomTask.from = from;
1260
+ function fillGlobals(task, globals) {
1261
+ if (CommandConfiguration.hasCommand(task.command) || task.configurationProperties.dependsOn === undefined) {
1262
+ task.command = CommandConfiguration.fillGlobals(task.command, globals.command, task.configurationProperties.name);
1263
+ }
1264
+ if (task.configurationProperties.problemMatchers === undefined && globals.problemMatcher !== undefined) {
1265
+ task.configurationProperties.problemMatchers = deepClone(globals.problemMatcher);
1266
+ task.hasDefinedMatchers = true;
1267
+ }
1268
+ if (task.configurationProperties.promptOnClose === undefined && task.configurationProperties.isBackground === undefined && globals.promptOnClose !== undefined) {
1269
+ task.configurationProperties.promptOnClose = globals.promptOnClose;
1270
+ }
1271
+ }
1272
+ CustomTask.fillGlobals = fillGlobals;
1273
+ function fillDefaults(task, context) {
1274
+ CommandConfiguration.fillDefaults(task.command, context);
1275
+ if (task.configurationProperties.promptOnClose === undefined) {
1276
+ task.configurationProperties.promptOnClose = task.configurationProperties.isBackground !== undefined ? !task.configurationProperties.isBackground : true;
1277
+ }
1278
+ if (task.configurationProperties.isBackground === undefined) {
1279
+ task.configurationProperties.isBackground = false;
1280
+ }
1281
+ if (task.configurationProperties.problemMatchers === undefined) {
1282
+ task.configurationProperties.problemMatchers = EMPTY_ARRAY;
1283
+ }
1284
+ }
1285
+ CustomTask.fillDefaults = fillDefaults;
1286
+ function createCustomTask(contributedTask, configuredProps) {
1287
+ const result = new CustomTask$1(configuredProps._id, Object.assign({}, configuredProps._source, {
1288
+ customizes: contributedTask.defines
1289
+ }), configuredProps.configurationProperties.name || contributedTask._label, CUSTOMIZED_TASK_TYPE, contributedTask.command, false, contributedTask.runOptions, {
1290
+ name: configuredProps.configurationProperties.name || contributedTask.configurationProperties.name,
1291
+ identifier: configuredProps.configurationProperties.identifier || contributedTask.configurationProperties.identifier,
1292
+ icon: configuredProps.configurationProperties.icon,
1293
+ hide: configuredProps.configurationProperties.hide,
1294
+ inSessions: configuredProps.configurationProperties.inSessions
1295
+ });
1296
+ result.addTaskLoadMessages(configuredProps.taskLoadMessages);
1297
+ const resultConfigProps = result.configurationProperties;
1298
+ assignProperty(resultConfigProps, configuredProps.configurationProperties, "group");
1299
+ assignProperty(resultConfigProps, configuredProps.configurationProperties, "isBackground");
1300
+ assignProperty(resultConfigProps, configuredProps.configurationProperties, "dependsOn");
1301
+ assignProperty(
1302
+ resultConfigProps,
1303
+ configuredProps.configurationProperties,
1304
+ "problemMatchers"
1305
+ );
1306
+ assignProperty(
1307
+ resultConfigProps,
1308
+ configuredProps.configurationProperties,
1309
+ "promptOnClose"
1310
+ );
1311
+ assignProperty(resultConfigProps, configuredProps.configurationProperties, "detail");
1312
+ result.command.presentation = CommandConfiguration.PresentationOptions.assignProperties(
1313
+ result.command.presentation,
1314
+ configuredProps.configurationProperties.presentation
1315
+ );
1316
+ result.command.options = CommandOptions.assignProperties(result.command.options, configuredProps.configurationProperties.options);
1317
+ result.runOptions = RunOptions.assignProperties(result.runOptions, configuredProps.runOptions);
1318
+ const contributedConfigProps = contributedTask.configurationProperties;
1319
+ fillProperty(resultConfigProps, contributedConfigProps, "group");
1320
+ fillProperty(resultConfigProps, contributedConfigProps, "isBackground");
1321
+ fillProperty(resultConfigProps, contributedConfigProps, "dependsOn");
1322
+ fillProperty(resultConfigProps, contributedConfigProps, "problemMatchers");
1323
+ fillProperty(resultConfigProps, contributedConfigProps, "promptOnClose");
1324
+ fillProperty(resultConfigProps, contributedConfigProps, "detail");
1325
+ result.command.presentation = CommandConfiguration.PresentationOptions.fillProperties(result.command.presentation, contributedConfigProps.presentation);
1326
+ result.command.options = CommandOptions.fillProperties(result.command.options, contributedConfigProps.options);
1327
+ result.runOptions = RunOptions.fillProperties(result.runOptions, contributedTask.runOptions);
1328
+ if (contributedTask.hasDefinedMatchers === true) {
1329
+ result.hasDefinedMatchers = true;
1330
+ }
1331
+ return result;
1332
+ }
1333
+ CustomTask.createCustomTask = createCustomTask;
1334
+ })(CustomTask || (CustomTask = {}));
1335
+ var TaskParser;
1336
+ (function(TaskParser) {
1337
+ function isCustomTask(value) {
1338
+ const type = value.type;
1339
+ const customize = value.customize;
1340
+ return customize === undefined && (type === undefined || type === null || type === CUSTOMIZED_TASK_TYPE || type === "shell" || type === "process");
1341
+ }
1342
+ const builtinTypeContextMap = {
1343
+ shell: ShellExecutionSupportedContext,
1344
+ process: ProcessExecutionSupportedContext
1345
+ };
1346
+ function from(externals, globals, context, source, registry) {
1347
+ const result = {
1348
+ custom: [],
1349
+ configured: []
1350
+ };
1351
+ if (!externals) {
1352
+ return result;
1353
+ }
1354
+ const defaultBuildTask = {
1355
+ task: undefined,
1356
+ rank: -1
1357
+ };
1358
+ const defaultTestTask = {
1359
+ task: undefined,
1360
+ rank: -1
1361
+ };
1362
+ const schema2_0_0 = context.schemaVersion === JsonSchemaVersion$1.V2_0_0;
1363
+ const baseLoadIssues = deepClone(context.taskLoadIssues);
1364
+ for (let index = 0; index < externals.length; index++) {
1365
+ const external = externals[index];
1366
+ const definition = external.type ? registry?.get?.(external.type) || TaskDefinitionRegistry.get(external.type) : undefined;
1367
+ let typeNotSupported = false;
1368
+ if (definition && definition.when && !context.contextKeyService.contextMatchesRules(definition.when)) {
1369
+ typeNotSupported = true;
1370
+ } else if (!definition && external.type) {
1371
+ for (const key of ( Object.keys(builtinTypeContextMap))) {
1372
+ if (external.type === key) {
1373
+ typeNotSupported = !ShellExecutionSupportedContext.evaluate(context.contextKeyService.getContext(null));
1374
+ break;
1375
+ }
1376
+ }
1377
+ }
1378
+ if (typeNotSupported) {
1379
+ context.problemReporter.info(( localize(
1380
+ 13239,
1381
+ "Warning: {0} tasks are unavailable in the current environment.\n",
1382
+ external.type
1383
+ )));
1384
+ continue;
1385
+ }
1386
+ if (isCustomTask(external)) {
1387
+ const customTask = CustomTask.from(external, context, index, source);
1388
+ if (customTask) {
1389
+ CustomTask.fillGlobals(customTask, globals);
1390
+ CustomTask.fillDefaults(customTask, context);
1391
+ if (schema2_0_0) {
1392
+ if ((customTask.command === undefined || customTask.command.name === undefined) && (customTask.configurationProperties.dependsOn === undefined || customTask.configurationProperties.dependsOn.length === 0)) {
1393
+ context.problemReporter.error(( localize(
1394
+ 13240,
1395
+ "Error: the task '{0}' neither specifies a command nor a dependsOn property. The task will be ignored. Its definition is:\n{1}",
1396
+ customTask.configurationProperties.name,
1397
+ JSON.stringify(external, undefined, 4)
1398
+ )));
1399
+ continue;
1400
+ }
1401
+ } else {
1402
+ if (customTask.command === undefined || customTask.command.name === undefined) {
1403
+ context.problemReporter.warn(( localize(
1404
+ 13241,
1405
+ "Error: the task '{0}' doesn't define a command. The task will be ignored. Its definition is:\n{1}",
1406
+ customTask.configurationProperties.name,
1407
+ JSON.stringify(external, undefined, 4)
1408
+ )));
1409
+ continue;
1410
+ }
1411
+ }
1412
+ if (customTask.configurationProperties.group === TaskGroup.Build && defaultBuildTask.rank < 2) {
1413
+ defaultBuildTask.task = customTask;
1414
+ defaultBuildTask.rank = 2;
1415
+ } else if (customTask.configurationProperties.group === TaskGroup.Test && defaultTestTask.rank < 2) {
1416
+ defaultTestTask.task = customTask;
1417
+ defaultTestTask.rank = 2;
1418
+ } else if (customTask.configurationProperties.name === "build" && defaultBuildTask.rank < 1) {
1419
+ defaultBuildTask.task = customTask;
1420
+ defaultBuildTask.rank = 1;
1421
+ } else if (customTask.configurationProperties.name === "test" && defaultTestTask.rank < 1) {
1422
+ defaultTestTask.task = customTask;
1423
+ defaultTestTask.rank = 1;
1424
+ }
1425
+ customTask.addTaskLoadMessages(context.taskLoadIssues);
1426
+ result.custom.push(customTask);
1427
+ }
1428
+ } else {
1429
+ const configuredTask = ConfiguringTask.from(external, context, index, source, registry);
1430
+ if (configuredTask) {
1431
+ configuredTask.addTaskLoadMessages(context.taskLoadIssues);
1432
+ result.configured.push(configuredTask);
1433
+ }
1434
+ }
1435
+ context.taskLoadIssues = deepClone(baseLoadIssues);
1436
+ }
1437
+ const defaultBuildGroupName = isString(defaultBuildTask.task?.configurationProperties.group) ? defaultBuildTask.task?.configurationProperties.group : defaultBuildTask.task?.configurationProperties.group?._id;
1438
+ const defaultTestTaskGroupName = isString(defaultTestTask.task?.configurationProperties.group) ? defaultTestTask.task?.configurationProperties.group : defaultTestTask.task?.configurationProperties.group?._id;
1439
+ if ((defaultBuildGroupName !== TaskGroup.Build._id) && (defaultBuildTask.rank > -1) && (defaultBuildTask.rank < 2) && defaultBuildTask.task) {
1440
+ defaultBuildTask.task.configurationProperties.group = TaskGroup.Build;
1441
+ } else if ((defaultTestTaskGroupName !== TaskGroup.Test._id) && (defaultTestTask.rank > -1) && (defaultTestTask.rank < 2) && defaultTestTask.task) {
1442
+ defaultTestTask.task.configurationProperties.group = TaskGroup.Test;
1443
+ }
1444
+ return result;
1445
+ }
1446
+ TaskParser.from = from;
1447
+ function assignTasks(target, source) {
1448
+ if (source === undefined || source.length === 0) {
1449
+ return target;
1450
+ }
1451
+ if (target === undefined || target.length === 0) {
1452
+ return source;
1453
+ }
1454
+ if (source) {
1455
+ const map = Object.create(null);
1456
+ target.forEach(task => {
1457
+ map[task.configurationProperties.name] = task;
1458
+ });
1459
+ source.forEach(task => {
1460
+ map[task.configurationProperties.name] = task;
1461
+ });
1462
+ const newTarget = [];
1463
+ target.forEach(task => {
1464
+ newTarget.push(map[task.configurationProperties.name]);
1465
+ delete map[task.configurationProperties.name];
1466
+ });
1467
+ ( Object.keys(map)).forEach(key => newTarget.push(map[key]));
1468
+ target = newTarget;
1469
+ }
1470
+ return target;
1471
+ }
1472
+ TaskParser.assignTasks = assignTasks;
1473
+ })(TaskParser || (TaskParser = {}));
1474
+ var Globals;
1475
+ (function(Globals) {
1476
+ function from(config, context) {
1477
+ let result = fromBase(config, context);
1478
+ let osGlobals = undefined;
1479
+ if (config.windows && context.platform === Platform.Windows) {
1480
+ osGlobals = fromBase(config.windows, context);
1481
+ } else if (config.osx && context.platform === Platform.Mac) {
1482
+ osGlobals = fromBase(config.osx, context);
1483
+ } else if (config.linux && context.platform === Platform.Linux) {
1484
+ osGlobals = fromBase(config.linux, context);
1485
+ }
1486
+ if (osGlobals) {
1487
+ result = Globals.assignProperties(result, osGlobals);
1488
+ }
1489
+ const command = CommandConfiguration.from(config, context);
1490
+ if (command) {
1491
+ result.command = command;
1492
+ }
1493
+ Globals.fillDefaults(result, context);
1494
+ Globals.freeze(result);
1495
+ return result;
1496
+ }
1497
+ Globals.from = from;
1498
+ function fromBase(config, context) {
1499
+ const result = {};
1500
+ if (config.suppressTaskName !== undefined) {
1501
+ result.suppressTaskName = !!config.suppressTaskName;
1502
+ }
1503
+ if (config.promptOnClose !== undefined) {
1504
+ result.promptOnClose = !!config.promptOnClose;
1505
+ }
1506
+ if (config.problemMatcher) {
1507
+ result.problemMatcher = ProblemMatcherConverter.from(config.problemMatcher, context).value;
1508
+ }
1509
+ return result;
1510
+ }
1511
+ Globals.fromBase = fromBase;
1512
+ function isEmpty(value) {
1513
+ return !value || value.command === undefined && value.promptOnClose === undefined && value.suppressTaskName === undefined;
1514
+ }
1515
+ Globals.isEmpty = isEmpty;
1516
+ function assignProperties(target, source) {
1517
+ if (isEmpty(source)) {
1518
+ return target;
1519
+ }
1520
+ if (isEmpty(target)) {
1521
+ return source;
1522
+ }
1523
+ assignProperty(target, source, "promptOnClose");
1524
+ assignProperty(target, source, "suppressTaskName");
1525
+ return target;
1526
+ }
1527
+ Globals.assignProperties = assignProperties;
1528
+ function fillDefaults(value, context) {
1529
+ if (!value) {
1530
+ return;
1531
+ }
1532
+ CommandConfiguration.fillDefaults(value.command, context);
1533
+ if (value.suppressTaskName === undefined) {
1534
+ value.suppressTaskName = (context.schemaVersion === JsonSchemaVersion$1.V2_0_0);
1535
+ }
1536
+ if (value.promptOnClose === undefined) {
1537
+ value.promptOnClose = true;
1538
+ }
1539
+ }
1540
+ Globals.fillDefaults = fillDefaults;
1541
+ function freeze(value) {
1542
+ if (value.command) {
1543
+ CommandConfiguration.freeze(value.command);
1544
+ }
1545
+ }
1546
+ Globals.freeze = freeze;
1547
+ })(Globals || (Globals = {}));
1548
+ var ExecutionEngine;
1549
+ (function(ExecutionEngine) {
1550
+ function from(config) {
1551
+ const runner = config.runner || config._runner;
1552
+ let result;
1553
+ if (runner) {
1554
+ switch (runner) {
1555
+ case "terminal":
1556
+ result = ExecutionEngine$1.Terminal;
1557
+ break;
1558
+ case "process":
1559
+ result = ExecutionEngine$1.Process;
1560
+ break;
1561
+ }
1562
+ }
1563
+ const schemaVersion = JsonSchemaVersion.from(config);
1564
+ if (schemaVersion === JsonSchemaVersion$1.V0_1_0) {
1565
+ return result || ExecutionEngine$1.Process;
1566
+ } else if (schemaVersion === JsonSchemaVersion$1.V2_0_0) {
1567
+ return ExecutionEngine$1.Terminal;
1568
+ } else {
1569
+ throw ( new Error("Shouldn't happen."));
1570
+ }
1571
+ }
1572
+ ExecutionEngine.from = from;
1573
+ })(ExecutionEngine || (ExecutionEngine = {}));
1574
+ var JsonSchemaVersion;
1575
+ (function(JsonSchemaVersion) {
1576
+ const _default = JsonSchemaVersion$1.V2_0_0;
1577
+ function from(config) {
1578
+ const version = config.version;
1579
+ if (!version) {
1580
+ return _default;
1581
+ }
1582
+ switch (version) {
1583
+ case "0.1.0":
1584
+ return JsonSchemaVersion$1.V0_1_0;
1585
+ case "2.0.0":
1586
+ return JsonSchemaVersion$1.V2_0_0;
1587
+ default:
1588
+ return _default;
1589
+ }
1590
+ }
1591
+ JsonSchemaVersion.from = from;
1592
+ })(JsonSchemaVersion || (JsonSchemaVersion = {}));
1593
+ class UUIDMap {
1594
+ constructor(other) {
1595
+ this.current = Object.create(null);
1596
+ if (other) {
1597
+ for (const key of ( Object.keys(other.current))) {
1598
+ const value = other.current[key];
1599
+ if (Array.isArray(value)) {
1600
+ this.current[key] = value.slice();
1601
+ } else {
1602
+ this.current[key] = value;
1603
+ }
1604
+ }
1605
+ }
1606
+ }
1607
+ start() {
1608
+ this.last = this.current;
1609
+ this.current = Object.create(null);
1610
+ }
1611
+ getUUID(identifier) {
1612
+ const lastValue = this.last ? this.last[identifier] : undefined;
1613
+ let result = undefined;
1614
+ if (lastValue !== undefined) {
1615
+ if (Array.isArray(lastValue)) {
1616
+ result = lastValue.shift();
1617
+ if (lastValue.length === 0) {
1618
+ delete this.last[identifier];
1619
+ }
1620
+ } else {
1621
+ result = lastValue;
1622
+ delete this.last[identifier];
1623
+ }
1624
+ }
1625
+ if (result === undefined) {
1626
+ result = generateUuid();
1627
+ }
1628
+ const currentValue = this.current[identifier];
1629
+ if (currentValue === undefined) {
1630
+ this.current[identifier] = result;
1631
+ } else {
1632
+ if (Array.isArray(currentValue)) {
1633
+ currentValue.push(result);
1634
+ } else {
1635
+ const arrayValue = [currentValue];
1636
+ arrayValue.push(result);
1637
+ this.current[identifier] = arrayValue;
1638
+ }
1639
+ }
1640
+ return result;
1641
+ }
1642
+ finish() {
1643
+ this.last = undefined;
1644
+ }
1645
+ }
1646
+ var TaskConfigSource;
1647
+ (function(TaskConfigSource) {
1648
+ TaskConfigSource[TaskConfigSource["TasksJson"] = 0] = "TasksJson";
1649
+ TaskConfigSource[TaskConfigSource["WorkspaceFile"] = 1] = "WorkspaceFile";
1650
+ TaskConfigSource[TaskConfigSource["User"] = 2] = "User";
1651
+ })(TaskConfigSource || (TaskConfigSource = {}));
1652
+ class ConfigurationParser {
1653
+ constructor(workspaceFolder, workspace, platform, problemReporter, uuidMap) {
1654
+ this.workspaceFolder = workspaceFolder;
1655
+ this.workspace = workspace;
1656
+ this.platform = platform;
1657
+ this.problemReporter = problemReporter;
1658
+ this.uuidMap = uuidMap;
1659
+ }
1660
+ run(fileConfig, source, contextKeyService) {
1661
+ const engine = ExecutionEngine.from(fileConfig);
1662
+ const schemaVersion = JsonSchemaVersion.from(fileConfig);
1663
+ const context = {
1664
+ workspaceFolder: this.workspaceFolder,
1665
+ workspace: this.workspace,
1666
+ problemReporter: this.problemReporter,
1667
+ uuidMap: this.uuidMap,
1668
+ namedProblemMatchers: {},
1669
+ engine,
1670
+ schemaVersion,
1671
+ platform: this.platform,
1672
+ taskLoadIssues: [],
1673
+ contextKeyService
1674
+ };
1675
+ const taskParseResult = this.createTaskRunnerConfiguration(fileConfig, context, source);
1676
+ return {
1677
+ validationStatus: this.problemReporter.status,
1678
+ custom: taskParseResult.custom,
1679
+ configured: taskParseResult.configured,
1680
+ engine
1681
+ };
1682
+ }
1683
+ createTaskRunnerConfiguration(fileConfig, context, source) {
1684
+ const globals = Globals.from(fileConfig, context);
1685
+ if (this.problemReporter.status.isFatal()) {
1686
+ return {
1687
+ custom: [],
1688
+ configured: []
1689
+ };
1690
+ }
1691
+ context.namedProblemMatchers = ProblemMatcherConverter.namedFrom(fileConfig.declares, context);
1692
+ let globalTasks = undefined;
1693
+ let externalGlobalTasks = undefined;
1694
+ if (fileConfig.windows && context.platform === Platform.Windows) {
1695
+ globalTasks = TaskParser.from(fileConfig.windows.tasks, globals, context, source).custom;
1696
+ externalGlobalTasks = fileConfig.windows.tasks;
1697
+ } else if (fileConfig.osx && context.platform === Platform.Mac) {
1698
+ globalTasks = TaskParser.from(fileConfig.osx.tasks, globals, context, source).custom;
1699
+ externalGlobalTasks = fileConfig.osx.tasks;
1700
+ } else if (fileConfig.linux && context.platform === Platform.Linux) {
1701
+ globalTasks = TaskParser.from(fileConfig.linux.tasks, globals, context, source).custom;
1702
+ externalGlobalTasks = fileConfig.linux.tasks;
1703
+ }
1704
+ if (context.schemaVersion === JsonSchemaVersion$1.V2_0_0 && globalTasks && globalTasks.length > 0 && externalGlobalTasks && externalGlobalTasks.length > 0) {
1705
+ const taskContent = [];
1706
+ for (const task of externalGlobalTasks) {
1707
+ taskContent.push(JSON.stringify(task, null, 4));
1708
+ }
1709
+ context.problemReporter.error(( localize(
1710
+ 13242,
1711
+ "Task version 2.0.0 doesn't support global OS specific tasks. Convert them to a task with a OS specific command. Affected tasks are:\n{0}",
1712
+ taskContent.join("\n")
1713
+ )));
1714
+ }
1715
+ let result = {
1716
+ custom: [],
1717
+ configured: []
1718
+ };
1719
+ if (fileConfig.tasks) {
1720
+ result = TaskParser.from(fileConfig.tasks, globals, context, source);
1721
+ }
1722
+ if (globalTasks) {
1723
+ result.custom = TaskParser.assignTasks(result.custom, globalTasks);
1724
+ }
1725
+ if ((!result.custom || result.custom.length === 0) && (globals.command && globals.command.name)) {
1726
+ const matchers = ProblemMatcherConverter.from(fileConfig.problemMatcher, context).value ?? [];
1727
+ const isBackground = fileConfig.isBackground ? !!fileConfig.isBackground : fileConfig.isWatching ? !!fileConfig.isWatching : undefined;
1728
+ const name = CommandString$1.value(globals.command.name);
1729
+ const task = new CustomTask$1(context.uuidMap.getUUID(name), Object.assign({}, source, "workspace", {
1730
+ config: {
1731
+ index: -1,
1732
+ element: fileConfig,
1733
+ workspaceFolder: context.workspaceFolder
1734
+ }
1735
+ }), name, CUSTOMIZED_TASK_TYPE, {
1736
+ name: undefined,
1737
+ runtime: undefined,
1738
+ presentation: undefined,
1739
+ suppressTaskName: true
1740
+ }, false, {
1741
+ reevaluateOnRerun: true
1742
+ }, {
1743
+ name: name,
1744
+ identifier: name,
1745
+ group: TaskGroup.Build,
1746
+ isBackground: isBackground,
1747
+ problemMatchers: matchers
1748
+ });
1749
+ const taskGroupKind = GroupKind.from(fileConfig.group);
1750
+ if (taskGroupKind !== undefined) {
1751
+ task.configurationProperties.group = taskGroupKind;
1752
+ } else if (fileConfig.group === "none") {
1753
+ task.configurationProperties.group = undefined;
1754
+ }
1755
+ CustomTask.fillGlobals(task, globals);
1756
+ CustomTask.fillDefaults(task, context);
1757
+ result.custom = [task];
1758
+ }
1759
+ result.custom = result.custom || [];
1760
+ result.configured = result.configured || [];
1761
+ return result;
1762
+ }
1763
+ }
1764
+ const uuidMaps = ( new Map());
1765
+ const recentUuidMaps = ( new Map());
1766
+ function parse(
1767
+ workspaceFolder,
1768
+ workspace,
1769
+ platform,
1770
+ configuration,
1771
+ logger,
1772
+ source,
1773
+ contextKeyService,
1774
+ isRecents = false
1775
+ ) {
1776
+ const recentOrOtherMaps = isRecents ? recentUuidMaps : uuidMaps;
1777
+ let selectedUuidMaps = recentOrOtherMaps.get(source);
1778
+ if (!selectedUuidMaps) {
1779
+ recentOrOtherMaps.set(source, ( new Map()));
1780
+ selectedUuidMaps = recentOrOtherMaps.get(source);
1781
+ }
1782
+ let uuidMap = selectedUuidMaps.get(( workspaceFolder.uri.toString()));
1783
+ if (!uuidMap) {
1784
+ uuidMap = ( new UUIDMap());
1785
+ selectedUuidMaps.set(( workspaceFolder.uri.toString()), uuidMap);
1786
+ }
1787
+ try {
1788
+ uuidMap.start();
1789
+ return ( new ConfigurationParser(workspaceFolder, workspace, platform, logger, uuidMap)).run(configuration, source, contextKeyService);
1790
+ } finally {
1791
+ uuidMap.finish();
1792
+ }
1793
+ }
1794
+ function createCustomTask(contributedTask, configuredProps) {
1795
+ return CustomTask.createCustomTask(contributedTask, configuredProps);
1796
+ }
1797
+
1798
+ export { CommandString, ExecutionEngine, GroupKind, ITaskIdentifier, InstancePolicy, JsonSchemaVersion, ProblemMatcherConverter, RunOnOptions, RunOptions, ShellQuoting, TaskConfigSource, TaskParser, UUIDMap, createCustomTask, parse };