@codingame/monaco-vscode-task-service-override 4.5.0 → 4.5.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.
@@ -28,6 +28,7 @@ import { VSCodeSequence } from '../../terminal/browser/terminalEscapeSequences.j
28
28
  import { TerminalProcessExtHostProxy } from 'vscode/vscode/vs/workbench/contrib/terminal/browser/terminalProcessExtHostProxy';
29
29
  import { TERMINAL_VIEW_ID } from 'vscode/vscode/vs/workbench/contrib/terminal/common/terminal';
30
30
 
31
+ const _moduleId = "vs/workbench/contrib/tasks/browser/terminalTaskSystem";
31
32
  const ReconnectionType = 'Task';
32
33
  class VariableResolver {
33
34
  static { this._regex = /\$\{(.*?)\}/g; }
@@ -75,7 +76,9 @@ class VerifiedTask {
75
76
  return { task: this.task, resolver: this.resolver, trigger: this.trigger, resolvedVariables: this.resolvedVariables, systemInfo: this.systemInfo, workspaceFolder: this.workspaceFolder, shellLaunchConfig: this.shellLaunchConfig };
76
77
  }
77
78
  else {
78
- throw new Error('VerifiedTask was not checked. verify must be checked before getVerifiedTask.');
79
+ throw ( (new Error(
80
+ 'VerifiedTask was not checked. verify must be checked before getVerifiedTask.'
81
+ )));
79
82
  }
80
83
  }
81
84
  }
@@ -152,9 +155,9 @@ class TerminalTaskSystem extends Disposable {
152
155
  this._activeTasks = Object.create(null);
153
156
  this._busyTasks = Object.create(null);
154
157
  this._terminals = Object.create(null);
155
- this._idleTaskTerminals = ( new LinkedMap());
158
+ this._idleTaskTerminals = ( (new LinkedMap()));
156
159
  this._sameTaskTerminals = Object.create(null);
157
- this._onDidStateChange = ( new Emitter());
160
+ this._onDidStateChange = ( (new Emitter()));
158
161
  this._taskSystemInfoResolver = taskSystemInfoResolver;
159
162
  this._register(this._terminalStatusManager = instantiationService.createInstance(TaskTerminalStatus));
160
163
  }
@@ -176,7 +179,7 @@ class TerminalTaskSystem extends Disposable {
176
179
  const instances = InMemoryTask.is(task) || this._isTaskEmpty(task) ? [] : this._getInstances(task);
177
180
  const validInstance = instances.length < ((task.runOptions && task.runOptions.instanceLimit) ?? 1);
178
181
  const instance = instances[0]?.count?.count ?? 0;
179
- this._currentTask = ( new VerifiedTask(task, resolver, trigger));
182
+ this._currentTask = ( (new VerifiedTask(task, resolver, trigger)));
180
183
  if (instance > 0) {
181
184
  task.instance = instance;
182
185
  }
@@ -186,7 +189,7 @@ class TerminalTaskSystem extends Disposable {
186
189
  return { kind: 2 , task: terminalData.task, active: { same: true, background: task.configurationProperties.isBackground }, promise: terminalData.promise };
187
190
  }
188
191
  try {
189
- const executeResult = { kind: 1 , task, started: {}, promise: this._executeTask(task, resolver, trigger, ( new Set()), ( new Map()), undefined) };
192
+ const executeResult = { kind: 1 , task, started: {}, promise: this._executeTask(task, resolver, trigger, ( (new Set())), ( (new Map())), undefined) };
190
193
  executeResult.promise.then(summary => {
191
194
  this._lastTask = this._currentTask;
192
195
  });
@@ -198,11 +201,15 @@ class TerminalTaskSystem extends Disposable {
198
201
  }
199
202
  else if (error instanceof Error) {
200
203
  this._log(error.message);
201
- throw new TaskError(Severity$1.Error, error.message, 7 );
204
+ throw ( (new TaskError(Severity$1.Error, error.message, 7 )));
202
205
  }
203
206
  else {
204
- this._log(( error.toString()));
205
- throw new TaskError(Severity$1.Error, localizeWithPath('vs/workbench/contrib/tasks/browser/terminalTaskSystem', 'TerminalTaskSystem.unknownError', 'A unknown error has occurred while executing a task. See task output log for details.'), 7 );
207
+ this._log(( (error.toString())));
208
+ throw ( (new TaskError(Severity$1.Error, localizeWithPath(
209
+ _moduleId,
210
+ 0,
211
+ 'A unknown error has occurred while executing a task. See task output log for details.'
212
+ ), 7 )));
206
213
  }
207
214
  }
208
215
  }
@@ -228,8 +235,8 @@ class TerminalTaskSystem extends Disposable {
228
235
  });
229
236
  const openOutput = 'Show Output';
230
237
  this._notificationService.prompt(Severity$1.Warning, ( localizeWithPath(
231
- 'vs/workbench/contrib/tasks/browser/terminalTaskSystem',
232
- 'TerminalTaskSystem.taskLoadReporting',
238
+ _moduleId,
239
+ 1,
233
240
  "There are issues with task \"{0}\". See the output for more details.",
234
241
  task._label
235
242
  )), [{
@@ -284,33 +291,39 @@ class TerminalTaskSystem extends Disposable {
284
291
  return Promise.resolve(this.isActiveSync());
285
292
  }
286
293
  isActiveSync() {
287
- return ( ( Object.values(this._activeTasks)).some(value => !!value.terminal));
294
+ return (
295
+ (( (Object.values(this._activeTasks))).some(value => !!value.terminal))
296
+ );
288
297
  }
289
298
  canAutoTerminate() {
290
- return ( Object.values(this._activeTasks)).every(value => !value.task.configurationProperties.promptOnClose);
299
+ return ( (Object.values(this._activeTasks))).every(value => !value.task.configurationProperties.promptOnClose);
291
300
  }
292
301
  getActiveTasks() {
293
- return ( Object.values(this._activeTasks)).flatMap(value => value.terminal ? value.task : []);
302
+ return ( (Object.values(this._activeTasks))).flatMap(value => value.terminal ? value.task : []);
294
303
  }
295
304
  getLastInstance(task) {
296
305
  const recentKey = task.getKey();
297
- return ( Object.values(this._activeTasks)).reverse().find((value) => recentKey && recentKey === value.task.getKey())?.task;
306
+ return ( (Object.values(this._activeTasks))).reverse().find((value) => recentKey && recentKey === value.task.getKey())?.task;
298
307
  }
299
308
  getBusyTasks() {
300
- return ( ( Object.keys(this._busyTasks)).map(key => this._busyTasks[key]));
309
+ return (
310
+ (( (Object.keys(this._busyTasks))).map(key => this._busyTasks[key]))
311
+ );
301
312
  }
302
313
  customExecutionComplete(task, result) {
303
314
  const activeTerminal = this._activeTasks[task.getMapKey()];
304
315
  if (!activeTerminal?.terminal) {
305
- return Promise.reject(( new Error('Expected to have a terminal for a custom execution task')));
316
+ return Promise.reject(( (new Error('Expected to have a terminal for a custom execution task'))));
306
317
  }
307
- return ( new Promise((resolve) => {
308
- resolve();
309
- }));
318
+ return (
319
+ (new Promise((resolve) => {
320
+ resolve();
321
+ }))
322
+ );
310
323
  }
311
324
  _getInstances(task) {
312
325
  const recentKey = task.getKey();
313
- return ( Object.values(this._activeTasks)).filter((value) => recentKey && recentKey === value.task.getKey());
326
+ return ( (Object.values(this._activeTasks))).filter((value) => recentKey && recentKey === value.task.getKey());
314
327
  }
315
328
  _removeFromActiveTasks(task) {
316
329
  const key = typeof task === 'string' ? task : task.getMapKey();
@@ -335,29 +348,31 @@ class TerminalTaskSystem extends Disposable {
335
348
  if (!terminal) {
336
349
  return Promise.resolve({ success: false, task: undefined });
337
350
  }
338
- return ( new Promise((resolve, reject) => {
339
- terminal.onDisposed(terminal => {
340
- this._fireTaskEvent(TaskEvent.terminated(task, terminal.instanceId, terminal.exitReason));
341
- });
342
- const onExit = terminal.onExit(() => {
343
- const task = activeTerminal.task;
344
- try {
345
- onExit.dispose();
351
+ return (
352
+ (new Promise((resolve, reject) => {
353
+ terminal.onDisposed(terminal => {
346
354
  this._fireTaskEvent(TaskEvent.terminated(task, terminal.instanceId, terminal.exitReason));
347
- }
348
- catch (error) {
349
- }
350
- resolve({ success: true, task: task });
351
- });
352
- terminal.dispose();
353
- }));
355
+ });
356
+ const onExit = terminal.onExit(() => {
357
+ const task = activeTerminal.task;
358
+ try {
359
+ onExit.dispose();
360
+ this._fireTaskEvent(TaskEvent.terminated(task, terminal.instanceId, terminal.exitReason));
361
+ }
362
+ catch (error) {
363
+ }
364
+ resolve({ success: true, task: task });
365
+ });
366
+ terminal.dispose();
367
+ }))
368
+ );
354
369
  }
355
370
  terminateAll() {
356
371
  const promises = [];
357
372
  for (const [key, terminalData] of Object.entries(this._activeTasks)) {
358
373
  const terminal = terminalData.terminal;
359
374
  if (terminal) {
360
- promises.push(( new Promise((resolve, reject) => {
375
+ promises.push(( (new Promise((resolve, reject) => {
361
376
  const onExit = terminal.onExit(() => {
362
377
  const task = terminalData.task;
363
378
  try {
@@ -371,36 +386,31 @@ class TerminalTaskSystem extends Disposable {
371
386
  }
372
387
  resolve({ success: true, task: terminalData.task });
373
388
  });
374
- })));
389
+ }))));
375
390
  terminal.dispose();
376
391
  }
377
392
  }
378
393
  return Promise.all(promises);
379
394
  }
380
395
  _showDependencyCycleMessage(task) {
381
- this._log(( localizeWithPath(
382
- 'vs/workbench/contrib/tasks/browser/terminalTaskSystem',
383
- 'dependencyCycle',
384
- 'There is a dependency cycle. See task "{0}".',
385
- task._label
386
- )));
396
+ this._log(( localizeWithPath(_moduleId, 2, 'There is a dependency cycle. See task "{0}".', task._label)));
387
397
  this._showOutput();
388
398
  }
389
399
  _executeTask(task, resolver, trigger, liveDependencies, encounteredTasks, alreadyResolved) {
390
400
  this._showTaskLoadErrors(task);
391
401
  const mapKey = task.getMapKey();
392
402
  const promise = Promise.resolve().then(async () => {
393
- alreadyResolved = alreadyResolved ?? ( new Map());
403
+ alreadyResolved = alreadyResolved ?? ( (new Map()));
394
404
  const promises = [];
395
405
  if (task.configurationProperties.dependsOn) {
396
- const nextLiveDependencies = ( new Set(liveDependencies)).add(task.getCommonTaskId());
406
+ const nextLiveDependencies = ( (new Set(liveDependencies))).add(task.getCommonTaskId());
397
407
  for (const dependency of task.configurationProperties.dependsOn) {
398
408
  const dependencyTask = await resolver.resolve(dependency.uri, dependency.task);
399
409
  if (dependencyTask) {
400
410
  this._adoptConfigurationForDependencyTask(dependencyTask, task);
401
411
  let taskResult;
402
412
  const commonKey = dependencyTask.getCommonTaskId();
403
- if (( nextLiveDependencies.has(commonKey))) {
413
+ if (( (nextLiveDependencies.has(commonKey)))) {
404
414
  this._showDependencyCycleMessage(dependencyTask);
405
415
  taskResult = Promise.resolve({});
406
416
  }
@@ -426,11 +436,11 @@ class TerminalTaskSystem extends Disposable {
426
436
  }
427
437
  else {
428
438
  this._log(( localizeWithPath(
429
- 'vs/workbench/contrib/tasks/browser/terminalTaskSystem',
430
- 'dependencyFailed',
439
+ _moduleId,
440
+ 3,
431
441
  'Couldn\'t resolve dependent task \'{0}\' in workspace folder \'{1}\'',
432
442
  isString(dependency.task) ? dependency.task : JSON.stringify(dependency.task, undefined, 0),
433
- ( dependency.uri.toString())
443
+ (dependency.uri.toString())
434
444
  )));
435
445
  this._showOutput();
436
446
  }
@@ -465,14 +475,16 @@ class TerminalTaskSystem extends Disposable {
465
475
  return promise;
466
476
  }
467
477
  _createInactiveDependencyPromise(task) {
468
- return ( new Promise(resolve => {
469
- const taskInactiveDisposable = this.onDidStateChange(taskEvent => {
470
- if (((taskEvent.kind === "inactive") ) && (taskEvent.__task === task)) {
471
- taskInactiveDisposable.dispose();
472
- resolve({ exitCode: 0 });
473
- }
474
- });
475
- }));
478
+ return (
479
+ (new Promise(resolve => {
480
+ const taskInactiveDisposable = this.onDidStateChange(taskEvent => {
481
+ if (((taskEvent.kind === "inactive") ) && (taskEvent.__task === task)) {
482
+ taskInactiveDisposable.dispose();
483
+ resolve({ exitCode: 0 });
484
+ }
485
+ });
486
+ }))
487
+ );
476
488
  }
477
489
  _adoptConfigurationForDependencyTask(dependencyTask, task) {
478
490
  if (dependencyTask.configurationProperties.icon) {
@@ -505,7 +517,7 @@ class TerminalTaskSystem extends Disposable {
505
517
  async _resolveAndFindExecutable(systemInfo, workspaceFolder, task, cwd, envPath) {
506
518
  const command = await this._configurationResolverService.resolveAsync(workspaceFolder, CommandString.value(task.command.name));
507
519
  cwd = cwd ? await this._configurationResolverService.resolveAsync(workspaceFolder, cwd) : undefined;
508
- const paths = envPath ? await Promise.all(( envPath.split(delimiter).map(p => this._configurationResolverService.resolveAsync(workspaceFolder, p)))) : undefined;
520
+ const paths = envPath ? await Promise.all(( (envPath.split(delimiter).map(p => this._configurationResolverService.resolveAsync(workspaceFolder, p))))) : undefined;
509
521
  let foundExecutable = await systemInfo?.findExecutable(command, cwd, paths);
510
522
  if (!foundExecutable) {
511
523
  foundExecutable = join(cwd ?? '', command);
@@ -516,9 +528,9 @@ class TerminalTaskSystem extends Disposable {
516
528
  if (alreadyResolved.size === 0) {
517
529
  return variables;
518
530
  }
519
- const unresolved = ( new Set());
531
+ const unresolved = ( (new Set()));
520
532
  for (const variable of variables) {
521
- if (!( alreadyResolved.has(variable.substring(2, variable.length - 1)))) {
533
+ if (!( (alreadyResolved.has(variable.substring(2, variable.length - 1))))) {
522
534
  unresolved.add(variable);
523
535
  }
524
536
  }
@@ -526,7 +538,7 @@ class TerminalTaskSystem extends Disposable {
526
538
  }
527
539
  _mergeMaps(mergeInto, mergeFrom) {
528
540
  for (const entry of mergeFrom) {
529
- if (!( mergeInto.has(entry[0]))) {
541
+ if (!( (mergeInto.has(entry[0])))) {
530
542
  mergeInto.set(entry[0], entry[1]);
531
543
  }
532
544
  }
@@ -542,7 +554,7 @@ class TerminalTaskSystem extends Disposable {
542
554
  const cwd = options ? options.cwd : undefined;
543
555
  let envPath = undefined;
544
556
  if (options && options.env) {
545
- for (const key of ( Object.keys(options.env))) {
557
+ for (const key of ( (Object.keys(options.env)))) {
546
558
  if (key.toLowerCase() === 'path') {
547
559
  if (isString(options.env[key])) {
548
560
  envPath = options.env[key];
@@ -571,7 +583,7 @@ class TerminalTaskSystem extends Disposable {
571
583
  return undefined;
572
584
  }
573
585
  this._mergeMaps(alreadyResolved, resolved.variables);
574
- resolved.variables = ( new Map(alreadyResolved));
586
+ resolved.variables = ( (new Map(alreadyResolved)));
575
587
  if (isProcess) {
576
588
  let process = CommandString.value(task.command.name);
577
589
  if (taskSystemInfo.platform === 3 ) {
@@ -584,35 +596,37 @@ class TerminalTaskSystem extends Disposable {
584
596
  return resolvedVariables;
585
597
  }
586
598
  else {
587
- const variablesArray = ( new Array());
599
+ const variablesArray = ( (new Array()));
588
600
  unresolved.forEach(variable => variablesArray.push(variable));
589
- return ( new Promise((resolve, reject) => {
590
- this._configurationResolverService.resolveWithInteraction(workspaceFolder, variablesArray, 'tasks', undefined, TaskSourceKind.toConfigurationTarget(task._source.kind)).then(async (resolvedVariablesMap) => {
591
- if (resolvedVariablesMap) {
592
- this._mergeMaps(alreadyResolved, resolvedVariablesMap);
593
- resolvedVariablesMap = ( new Map(alreadyResolved));
594
- if (isProcess) {
595
- let processVarValue;
596
- if (isWindows) {
597
- processVarValue = await this._resolveAndFindExecutable(taskSystemInfo, workspaceFolder, task, cwd, envPath);
601
+ return (
602
+ (new Promise((resolve, reject) => {
603
+ this._configurationResolverService.resolveWithInteraction(workspaceFolder, variablesArray, 'tasks', undefined, TaskSourceKind.toConfigurationTarget(task._source.kind)).then(async (resolvedVariablesMap) => {
604
+ if (resolvedVariablesMap) {
605
+ this._mergeMaps(alreadyResolved, resolvedVariablesMap);
606
+ resolvedVariablesMap = ( (new Map(alreadyResolved)));
607
+ if (isProcess) {
608
+ let processVarValue;
609
+ if (isWindows) {
610
+ processVarValue = await this._resolveAndFindExecutable(taskSystemInfo, workspaceFolder, task, cwd, envPath);
611
+ }
612
+ else {
613
+ processVarValue = await this._configurationResolverService.resolveAsync(workspaceFolder, CommandString.value(task.command.name));
614
+ }
615
+ resolvedVariablesMap.set(TerminalTaskSystem.ProcessVarName, processVarValue);
598
616
  }
599
- else {
600
- processVarValue = await this._configurationResolverService.resolveAsync(workspaceFolder, CommandString.value(task.command.name));
601
- }
602
- resolvedVariablesMap.set(TerminalTaskSystem.ProcessVarName, processVarValue);
617
+ const resolvedVariablesResult = {
618
+ variables: resolvedVariablesMap,
619
+ };
620
+ resolve(resolvedVariablesResult);
603
621
  }
604
- const resolvedVariablesResult = {
605
- variables: resolvedVariablesMap,
606
- };
607
- resolve(resolvedVariablesResult);
608
- }
609
- else {
610
- resolve(undefined);
611
- }
612
- }, reason => {
613
- reject(reason);
614
- });
615
- }));
622
+ else {
623
+ resolve(undefined);
624
+ }
625
+ }, reason => {
626
+ reject(reason);
627
+ });
628
+ }))
629
+ );
616
630
  }
617
631
  }
618
632
  _executeCommand(task, trigger, alreadyResolved) {
@@ -626,18 +640,18 @@ class TerminalTaskSystem extends Disposable {
626
640
  workspaceFolder = folders.length > 0 ? folders[0] : undefined;
627
641
  }
628
642
  const systemInfo = this._currentTask.systemInfo = this._taskSystemInfoResolver(workspaceFolder);
629
- const variables = ( new Set());
643
+ const variables = ( (new Set()));
630
644
  this._collectTaskVariables(variables, task);
631
645
  const resolvedVariables = this._acquireInput(systemInfo, workspaceFolder, task, variables, alreadyResolved);
632
646
  return resolvedVariables.then((resolvedVariables) => {
633
647
  if (resolvedVariables && !this._isTaskEmpty(task)) {
634
648
  this._currentTask.resolvedVariables = resolvedVariables;
635
- return this._executeInTerminal(task, trigger, ( new VariableResolver(
649
+ return this._executeInTerminal(task, trigger, ( (new VariableResolver(
636
650
  workspaceFolder,
637
651
  systemInfo,
638
652
  resolvedVariables.variables,
639
653
  this._configurationResolverService
640
- )), workspaceFolder);
654
+ ))), workspaceFolder);
641
655
  }
642
656
  else {
643
657
  this._fireTaskEvent(TaskEvent.general("end" , task));
@@ -654,10 +668,10 @@ class TerminalTaskSystem extends Disposable {
654
668
  _reexecuteCommand(task, trigger, alreadyResolved) {
655
669
  const lastTask = this._lastTask;
656
670
  if (!lastTask) {
657
- return Promise.reject(( new Error('No task previously run')));
671
+ return Promise.reject(( (new Error('No task previously run'))));
658
672
  }
659
673
  const workspaceFolder = this._currentTask.workspaceFolder = lastTask.workspaceFolder;
660
- const variables = ( new Set());
674
+ const variables = ( (new Set()));
661
675
  this._collectTaskVariables(variables, task);
662
676
  let hasAllVariables = true;
663
677
  variables.forEach(value => {
@@ -672,24 +686,24 @@ class TerminalTaskSystem extends Disposable {
672
686
  return { exitCode: 0 };
673
687
  }
674
688
  this._currentTask.resolvedVariables = resolvedVariables;
675
- return this._executeInTerminal(task, trigger, ( new VariableResolver(
689
+ return this._executeInTerminal(task, trigger, ( (new VariableResolver(
676
690
  lastTask.getVerifiedTask().workspaceFolder,
677
691
  lastTask.getVerifiedTask().systemInfo,
678
692
  resolvedVariables.variables,
679
693
  this._configurationResolverService
680
- )), workspaceFolder);
694
+ ))), workspaceFolder);
681
695
  }, reason => {
682
696
  return Promise.reject(reason);
683
697
  });
684
698
  }
685
699
  else {
686
700
  this._currentTask.resolvedVariables = lastTask.getVerifiedTask().resolvedVariables;
687
- return this._executeInTerminal(task, trigger, ( new VariableResolver(
701
+ return this._executeInTerminal(task, trigger, ( (new VariableResolver(
688
702
  lastTask.getVerifiedTask().workspaceFolder,
689
703
  lastTask.getVerifiedTask().systemInfo,
690
704
  lastTask.getVerifiedTask().resolvedVariables.variables,
691
705
  this._configurationResolverService
692
- )), workspaceFolder);
706
+ ))), workspaceFolder);
693
707
  }
694
708
  }
695
709
  async _executeInTerminal(task, trigger, resolver, workspaceFolder) {
@@ -698,22 +712,22 @@ class TerminalTaskSystem extends Disposable {
698
712
  let promise = undefined;
699
713
  if (task.configurationProperties.isBackground) {
700
714
  const problemMatchers = await this._resolveMatchers(resolver, task.configurationProperties.problemMatchers);
701
- const watchingProblemMatcher = ( new WatchingProblemCollector(
715
+ const watchingProblemMatcher = ( (new WatchingProblemCollector(
702
716
  problemMatchers,
703
717
  this._markerService,
704
718
  this._modelService,
705
719
  this._fileService
706
- ));
720
+ )));
707
721
  if ((problemMatchers.length > 0) && !watchingProblemMatcher.isWatching()) {
708
722
  this._appendOutput(( localizeWithPath(
709
- 'vs/workbench/contrib/tasks/browser/terminalTaskSystem',
710
- 'TerminalTaskSystem.nonWatchingMatcher',
723
+ _moduleId,
724
+ 4,
711
725
  'Task {0} is a background task but uses a problem matcher without a background pattern',
712
726
  task._label
713
727
  )));
714
728
  this._showOutput();
715
729
  }
716
- const toDispose = ( new DisposableStore());
730
+ const toDispose = ( (new DisposableStore()));
717
731
  let eventCounter = 0;
718
732
  const mapKey = task.getMapKey();
719
733
  toDispose.add(watchingProblemMatcher.onDidStateChange((event) => {
@@ -748,10 +762,10 @@ class TerminalTaskSystem extends Disposable {
748
762
  let delayer = undefined;
749
763
  [terminal, error] = await this._createTerminal(task, resolver, workspaceFolder);
750
764
  if (error) {
751
- return Promise.reject(( new Error(error.message)));
765
+ return Promise.reject(( (new Error(error.message))));
752
766
  }
753
767
  if (!terminal) {
754
- return Promise.reject(( new Error(`Failed to create terminal for task ${task._label}`)));
768
+ return Promise.reject(( (new Error(`Failed to create terminal for task ${task._label}`))));
755
769
  }
756
770
  this._terminalStatusManager.addTerminal(task, terminal, watchingProblemMatcher);
757
771
  let processStartedSignaled = false;
@@ -777,7 +791,7 @@ class TerminalTaskSystem extends Disposable {
777
791
  });
778
792
  });
779
793
  }
780
- promise = ( new Promise((resolve, reject) => {
794
+ promise = ( (new Promise((resolve, reject) => {
781
795
  const onExit = terminal.onExit((terminalLaunchResult) => {
782
796
  const exitCode = typeof terminalLaunchResult === 'number' ? terminalLaunchResult : terminalLaunchResult?.code;
783
797
  onData?.dispose();
@@ -791,10 +805,10 @@ class TerminalTaskSystem extends Disposable {
791
805
  if (terminalLaunchResult !== undefined) {
792
806
  switch (task.command.presentation.panel) {
793
807
  case PanelKind.Dedicated:
794
- this._sameTaskTerminals[key] = ( terminal.instanceId.toString());
808
+ this._sameTaskTerminals[key] = ( (terminal.instanceId.toString()));
795
809
  break;
796
810
  case PanelKind.Shared:
797
- this._idleTaskTerminals.set(key, ( terminal.instanceId.toString()), 1 );
811
+ this._idleTaskTerminals.set(key, ( (terminal.instanceId.toString())), 1 );
798
812
  break;
799
813
  }
800
814
  }
@@ -823,11 +837,13 @@ class TerminalTaskSystem extends Disposable {
823
837
  toDispose.dispose();
824
838
  resolve({ exitCode: exitCode ?? undefined });
825
839
  });
826
- }));
840
+ })));
827
841
  if (trigger === Triggers.reconnect && !!terminal.xterm) {
828
842
  const bufferLines = [];
829
843
  const bufferReverseIterator = terminal.xterm.getBufferReverseIterator();
830
- const startRegex = ( new RegExp(( watchingProblemMatcher.beginPatterns.map(pattern => pattern.source)).join('|')));
844
+ const startRegex = ( (new RegExp(
845
+ ( (watchingProblemMatcher.beginPatterns.map(pattern => pattern.source))).join('|')
846
+ )));
831
847
  for (const nextLine of bufferReverseIterator) {
832
848
  bufferLines.push(nextLine);
833
849
  if (startRegex.test(nextLine)) {
@@ -850,23 +866,23 @@ class TerminalTaskSystem extends Disposable {
850
866
  else {
851
867
  [terminal, error] = await this._createTerminal(task, resolver, workspaceFolder);
852
868
  if (error) {
853
- return Promise.reject(( new Error(error.message)));
869
+ return Promise.reject(( (new Error(error.message))));
854
870
  }
855
871
  if (!terminal) {
856
- return Promise.reject(( new Error(`Failed to create terminal for task ${task._label}`)));
872
+ return Promise.reject(( (new Error(`Failed to create terminal for task ${task._label}`))));
857
873
  }
858
874
  this._fireTaskEvent(TaskEvent.start(task, terminal.instanceId, resolver.values));
859
875
  const mapKey = task.getMapKey();
860
876
  this._busyTasks[mapKey] = task;
861
877
  this._fireTaskEvent(TaskEvent.general("active" , task, terminal.instanceId));
862
878
  const problemMatchers = await this._resolveMatchers(resolver, task.configurationProperties.problemMatchers);
863
- const startStopProblemMatcher = ( new StartStopProblemCollector(
879
+ const startStopProblemMatcher = ( (new StartStopProblemCollector(
864
880
  problemMatchers,
865
881
  this._markerService,
866
882
  this._modelService,
867
883
  0 ,
868
884
  this._fileService
869
- ));
885
+ )));
870
886
  this._terminalStatusManager.addTerminal(task, terminal, startStopProblemMatcher);
871
887
  let processStartedSignaled = false;
872
888
  terminal.processReady.then(() => {
@@ -879,7 +895,7 @@ class TerminalTaskSystem extends Disposable {
879
895
  const onData = terminal.onLineData((line) => {
880
896
  startStopProblemMatcher.processLine(line);
881
897
  });
882
- promise = ( new Promise((resolve, reject) => {
898
+ promise = ( (new Promise((resolve, reject) => {
883
899
  const onExit = terminal.onExit((terminalLaunchResult) => {
884
900
  const exitCode = typeof terminalLaunchResult === 'number' ? terminalLaunchResult : terminalLaunchResult?.code;
885
901
  onExit.dispose();
@@ -889,10 +905,10 @@ class TerminalTaskSystem extends Disposable {
889
905
  if (terminalLaunchResult !== undefined) {
890
906
  switch (task.command.presentation.panel) {
891
907
  case PanelKind.Dedicated:
892
- this._sameTaskTerminals[key] = ( terminal.instanceId.toString());
908
+ this._sameTaskTerminals[key] = ( (terminal.instanceId.toString()));
893
909
  break;
894
910
  case PanelKind.Shared:
895
- this._idleTaskTerminals.set(key, ( terminal.instanceId.toString()), 1 );
911
+ this._idleTaskTerminals.set(key, ( (terminal.instanceId.toString())), 1 );
896
912
  break;
897
913
  }
898
914
  }
@@ -928,7 +944,7 @@ class TerminalTaskSystem extends Disposable {
928
944
  this._fireTaskEvent(TaskEvent.general("end" , task, terminal?.instanceId));
929
945
  resolve({ exitCode: exitCode ?? undefined });
930
946
  });
931
- }));
947
+ })));
932
948
  }
933
949
  const showProblemPanel = task.command.presentation && (task.command.presentation.revealProblems === RevealProblemKind.Always);
934
950
  if (showProblemPanel) {
@@ -964,7 +980,7 @@ class TerminalTaskSystem extends Disposable {
964
980
  cwd = join(workspaceFolder.uri.fsPath, cwd);
965
981
  }
966
982
  }
967
- cwd = isUNC(cwd) ? cwd : toLocalResource(( URI.from({ scheme: Schemas.file, path: cwd })), this._environmentService.remoteAuthority, this._pathService.defaultUriScheme);
983
+ cwd = isUNC(cwd) ? cwd : toLocalResource(( (URI.from({ scheme: Schemas.file, path: cwd }))), this._environmentService.remoteAuthority, this._pathService.defaultUriScheme);
968
984
  }
969
985
  if (isShellCommand) {
970
986
  let os;
@@ -1065,16 +1081,10 @@ class TerminalTaskSystem extends Disposable {
1065
1081
  if (task.command.presentation && task.command.presentation.echo) {
1066
1082
  if (needsFolderQualification && workspaceFolder) {
1067
1083
  const folder = cwd && typeof cwd === 'object' && 'path' in cwd ? basename(cwd.path) : workspaceFolder.name;
1068
- shellLaunchConfig.initialText = this.taskShellIntegrationStartSequence(cwd) + formatMessageForTerminal(( localizeWithPath('vs/workbench/contrib/tasks/browser/terminalTaskSystem', {
1069
- key: 'task.executingInFolder',
1070
- comment: ['The workspace folder the task is running in', 'The task command line or label']
1071
- }, 'Executing task in folder {0}: {1}', folder, commandLine)), { excludeLeadingNewLine: true }) + this.taskShellIntegrationOutputSequence;
1084
+ shellLaunchConfig.initialText = this.taskShellIntegrationStartSequence(cwd) + formatMessageForTerminal(( localizeWithPath(_moduleId, 5, 'Executing task in folder {0}: {1}', folder, commandLine)), { excludeLeadingNewLine: true }) + this.taskShellIntegrationOutputSequence;
1072
1085
  }
1073
1086
  else {
1074
- shellLaunchConfig.initialText = this.taskShellIntegrationStartSequence(cwd) + formatMessageForTerminal(( localizeWithPath('vs/workbench/contrib/tasks/browser/terminalTaskSystem', {
1075
- key: 'task.executing.shellIntegration',
1076
- comment: ['The task command line or label']
1077
- }, 'Executing task: {0}', commandLine)), { excludeLeadingNewLine: true }) + this.taskShellIntegrationOutputSequence;
1087
+ shellLaunchConfig.initialText = this.taskShellIntegrationStartSequence(cwd) + formatMessageForTerminal(( localizeWithPath(_moduleId, 6, 'Executing task: {0}', commandLine)), { excludeLeadingNewLine: true }) + this.taskShellIntegrationOutputSequence;
1078
1088
  }
1079
1089
  }
1080
1090
  else {
@@ -1095,7 +1105,7 @@ class TerminalTaskSystem extends Disposable {
1095
1105
  icon: task.configurationProperties.icon?.id ? ThemeIcon.fromId(task.configurationProperties.icon.id) : undefined,
1096
1106
  color: task.configurationProperties.icon?.color || undefined,
1097
1107
  executable: executable,
1098
- args: ( args.map(a => isString(a) ? a : a.value)),
1108
+ args: ( (args.map(a => isString(a) ? a : a.value))),
1099
1109
  waitOnExit
1100
1110
  };
1101
1111
  if (task.command.presentation && task.command.presentation.echo) {
@@ -1109,16 +1119,21 @@ class TerminalTaskSystem extends Disposable {
1109
1119
  return args.join(' ');
1110
1120
  };
1111
1121
  if (needsFolderQualification && workspaceFolder) {
1112
- shellLaunchConfig.initialText = this.taskShellIntegrationStartSequence(cwd) + formatMessageForTerminal(( localizeWithPath('vs/workbench/contrib/tasks/browser/terminalTaskSystem', {
1113
- key: 'task.executingInFolder',
1114
- comment: ['The workspace folder the task is running in', 'The task command line or label']
1115
- }, 'Executing task in folder {0}: {1}', workspaceFolder.name, `${shellLaunchConfig.executable} ${getArgsToEcho(shellLaunchConfig.args)}`)), { excludeLeadingNewLine: true }) + this.taskShellIntegrationOutputSequence;
1122
+ shellLaunchConfig.initialText = this.taskShellIntegrationStartSequence(cwd) + formatMessageForTerminal(( localizeWithPath(
1123
+ _moduleId,
1124
+ 5,
1125
+ 'Executing task in folder {0}: {1}',
1126
+ workspaceFolder.name,
1127
+ `${shellLaunchConfig.executable} ${getArgsToEcho(shellLaunchConfig.args)}`
1128
+ )), { excludeLeadingNewLine: true }) + this.taskShellIntegrationOutputSequence;
1116
1129
  }
1117
1130
  else {
1118
- shellLaunchConfig.initialText = this.taskShellIntegrationStartSequence(cwd) + formatMessageForTerminal(( localizeWithPath('vs/workbench/contrib/tasks/browser/terminalTaskSystem', {
1119
- key: 'task.executing.shell-integration',
1120
- comment: ['The task command line or label']
1121
- }, 'Executing task: {0}', `${shellLaunchConfig.executable} ${getArgsToEcho(shellLaunchConfig.args)}`)), { excludeLeadingNewLine: true }) + this.taskShellIntegrationOutputSequence;
1131
+ shellLaunchConfig.initialText = this.taskShellIntegrationStartSequence(cwd) + formatMessageForTerminal(( localizeWithPath(
1132
+ _moduleId,
1133
+ 7,
1134
+ 'Executing task: {0}',
1135
+ `${shellLaunchConfig.executable} ${getArgsToEcho(shellLaunchConfig.args)}`
1136
+ )), { excludeLeadingNewLine: true }) + this.taskShellIntegrationOutputSequence;
1122
1137
  }
1123
1138
  }
1124
1139
  else {
@@ -1185,7 +1200,7 @@ class TerminalTaskSystem extends Disposable {
1185
1200
  return reconnectedTerminal;
1186
1201
  }
1187
1202
  if (group) {
1188
- for (const terminal of ( Object.values(this._terminals))) {
1203
+ for (const terminal of ( (Object.values(this._terminals)))) {
1189
1204
  if (terminal.group === group) {
1190
1205
  this._logService.trace(`Found terminal to split for group ${group}`);
1191
1206
  const originalInstance = terminal.terminal;
@@ -1239,7 +1254,7 @@ class TerminalTaskSystem extends Disposable {
1239
1254
  const options = await this._resolveOptions(resolver, task.command.options);
1240
1255
  const presentationOptions = task.command.presentation;
1241
1256
  if (!presentationOptions) {
1242
- throw new Error('Task presentation options should not be undefined here.');
1257
+ throw ( (new Error('Task presentation options should not be undefined here.')));
1243
1258
  }
1244
1259
  const waitOnExit = getWaitOnExitValue(presentationOptions, task.configurationProperties);
1245
1260
  let command;
@@ -1247,13 +1262,10 @@ class TerminalTaskSystem extends Disposable {
1247
1262
  let launchConfigs;
1248
1263
  if (task.command.runtime === RuntimeType.CustomExecution) {
1249
1264
  this._currentTask.shellLaunchConfig = launchConfigs = {
1250
- customPtyImplementation: (id, cols, rows) => ( new TerminalProcessExtHostProxy(id, cols, rows, this._terminalService)),
1265
+ customPtyImplementation: (id, cols, rows) => ( (new TerminalProcessExtHostProxy(id, cols, rows, this._terminalService))),
1251
1266
  waitOnExit,
1252
1267
  name: this._createTerminalName(task),
1253
- initialText: task.command.presentation && task.command.presentation.echo ? formatMessageForTerminal(( localizeWithPath('vs/workbench/contrib/tasks/browser/terminalTaskSystem', {
1254
- key: 'task.executing',
1255
- comment: ['The task command line or label']
1256
- }, 'Executing task: {0}', task._label)), { excludeLeadingNewLine: true }) : undefined,
1268
+ initialText: task.command.presentation && task.command.presentation.echo ? formatMessageForTerminal(( localizeWithPath(_moduleId, 8, 'Executing task: {0}', task._label)), { excludeLeadingNewLine: true }) : undefined,
1257
1269
  isFeatureTerminal: true,
1258
1270
  icon: task.configurationProperties.icon?.id ? ThemeIcon.fromId(task.configurationProperties.icon.id) : undefined,
1259
1271
  color: task.configurationProperties.icon?.color || undefined
@@ -1265,11 +1277,11 @@ class TerminalTaskSystem extends Disposable {
1265
1277
  args = resolvedResult.args;
1266
1278
  this._currentTask.shellLaunchConfig = launchConfigs = await this._createShellLaunchConfig(task, workspaceFolder, resolver, platform$1, options, command, args, waitOnExit);
1267
1279
  if (launchConfigs === undefined) {
1268
- return [undefined, ( new TaskError(Severity$1.Error, ( localizeWithPath(
1269
- 'vs/workbench/contrib/tasks/browser/terminalTaskSystem',
1270
- 'TerminalTaskSystem',
1280
+ return [undefined, ( (new TaskError(Severity$1.Error, ( localizeWithPath(
1281
+ _moduleId,
1282
+ 9,
1271
1283
  'Can\'t execute a shell command on an UNC drive using cmd.exe.'
1272
- )), 7 ))];
1284
+ )), 7 )))];
1273
1285
  }
1274
1286
  }
1275
1287
  const prefersSameTerminal = presentationOptions.panel === PanelKind.Dedicated;
@@ -1287,7 +1299,7 @@ class TerminalTaskSystem extends Disposable {
1287
1299
  else if (allowsSharedTerminal) {
1288
1300
  let terminalId = this._idleTaskTerminals.remove(taskKey);
1289
1301
  if (!terminalId) {
1290
- for (const taskId of ( this._idleTaskTerminals.keys())) {
1302
+ for (const taskId of ( (this._idleTaskTerminals.keys()))) {
1291
1303
  const idleTerminalId = this._idleTaskTerminals.get(taskId);
1292
1304
  if (idleTerminalId && this._terminals[idleTerminalId] && this._terminals[idleTerminalId].group === group) {
1293
1305
  terminalId = this._idleTaskTerminals.remove(taskId);
@@ -1301,7 +1313,7 @@ class TerminalTaskSystem extends Disposable {
1301
1313
  }
1302
1314
  if (terminalToReuse) {
1303
1315
  if (!launchConfigs) {
1304
- throw new Error('Task shell launch configuration should not be undefined here.');
1316
+ throw ( (new Error('Task shell launch configuration should not be undefined here.')));
1305
1317
  }
1306
1318
  terminalToReuse.terminal.scrollToBottom();
1307
1319
  if (task.configurationProperties.isBackground) {
@@ -1311,7 +1323,7 @@ class TerminalTaskSystem extends Disposable {
1311
1323
  if (task.command.presentation && task.command.presentation.clear) {
1312
1324
  terminalToReuse.terminal.clearBuffer();
1313
1325
  }
1314
- this._terminals[( terminalToReuse.terminal.instanceId.toString())].lastTask = taskKey;
1326
+ this._terminals[( (terminalToReuse.terminal.instanceId.toString()))].lastTask = taskKey;
1315
1327
  return [terminalToReuse.terminal, undefined];
1316
1328
  }
1317
1329
  this._terminalCreationQueue = this._terminalCreationQueue.then(() => this._doCreateTerminal(task, group, launchConfigs));
@@ -1319,7 +1331,7 @@ class TerminalTaskSystem extends Disposable {
1319
1331
  if (task.configurationProperties.isBackground) {
1320
1332
  terminal.shellLaunchConfig.reconnectionProperties = { ownerId: ReconnectionType, data: { lastTask: task.getCommonTaskId(), group, label: task._label, id: task._id } };
1321
1333
  }
1322
- const terminalKey = ( terminal.instanceId.toString());
1334
+ const terminalKey = ( (terminal.instanceId.toString()));
1323
1335
  const terminalData = { terminal: terminal, lastTask: taskKey, group };
1324
1336
  terminal.onDisposed(() => this._deleteTaskAndTerminal(terminal, terminalData));
1325
1337
  this._terminals[terminalKey] = terminalData;
@@ -1372,7 +1384,7 @@ class TerminalTaskSystem extends Disposable {
1372
1384
  for (const ch of shellQuoteOptions.escape.charsToEscape) {
1373
1385
  buffer.push(`\\${ch}`);
1374
1386
  }
1375
- const regexp = ( new RegExp('[' + buffer.join(',') + ']', 'g'));
1387
+ const regexp = ( (new RegExp('[' + buffer.join(',') + ']', 'g')));
1376
1388
  const escapeChar = shellQuoteOptions.escape.escapeChar;
1377
1389
  return [value.replace(regexp, (match) => escapeChar + match), true];
1378
1390
  }
@@ -1461,7 +1473,7 @@ class TerminalTaskSystem extends Disposable {
1461
1473
  return;
1462
1474
  }
1463
1475
  if (command.name === undefined) {
1464
- throw new Error('Command name should never be undefined here.');
1476
+ throw ( (new Error('Command name should never be undefined here.')));
1465
1477
  }
1466
1478
  this._collectVariables(variables, command.name);
1467
1479
  command.args?.forEach(arg => this._collectVariables(variables, arg));
@@ -1476,7 +1488,7 @@ class TerminalTaskSystem extends Disposable {
1476
1488
  }
1477
1489
  const optionsEnv = options.env;
1478
1490
  if (optionsEnv) {
1479
- ( Object.keys(optionsEnv)).forEach((key) => {
1491
+ ( (Object.keys(optionsEnv))).forEach((key) => {
1480
1492
  const value = optionsEnv[key];
1481
1493
  if (isString(value)) {
1482
1494
  this._collectVariables(variables, value);
@@ -1538,7 +1550,7 @@ class TerminalTaskSystem extends Disposable {
1538
1550
  return { command, args };
1539
1551
  }
1540
1552
  async _resolveVariables(resolver, value) {
1541
- return Promise.all(( value.map(s => this._resolveVariable(resolver, s))));
1553
+ return Promise.all(( (value.map(s => this._resolveVariable(resolver, s)))));
1542
1554
  }
1543
1555
  async _resolveMatchers(resolver, values) {
1544
1556
  if (values === undefined || values === null || values.length === 0) {
@@ -1560,8 +1572,8 @@ class TerminalTaskSystem extends Disposable {
1560
1572
  }
1561
1573
  if (!matcher) {
1562
1574
  this._appendOutput(( localizeWithPath(
1563
- 'vs/workbench/contrib/tasks/browser/terminalTaskSystem',
1564
- 'unknownProblemMatcher',
1575
+ _moduleId,
1576
+ 10,
1565
1577
  'Problem matcher {0} can\'t be resolved. The matcher will be ignored'
1566
1578
  )));
1567
1579
  continue;
@@ -1585,12 +1597,12 @@ class TerminalTaskSystem extends Disposable {
1585
1597
  else if (filePrefix !== undefined) {
1586
1598
  if (filePrefix.include) {
1587
1599
  filePrefix.include = Array.isArray(filePrefix.include)
1588
- ? await Promise.all(( filePrefix.include.map(x => this._resolveVariable(resolver, x))))
1600
+ ? await Promise.all(( (filePrefix.include.map(x => this._resolveVariable(resolver, x)))))
1589
1601
  : await this._resolveVariable(resolver, filePrefix.include);
1590
1602
  }
1591
1603
  if (filePrefix.exclude) {
1592
1604
  filePrefix.exclude = Array.isArray(filePrefix.exclude)
1593
- ? await Promise.all(( filePrefix.exclude.map(x => this._resolveVariable(resolver, x))))
1605
+ ? await Promise.all(( (filePrefix.exclude.map(x => this._resolveVariable(resolver, x)))))
1594
1606
  : await this._resolveVariable(resolver, filePrefix.exclude);
1595
1607
  }
1596
1608
  }
@@ -1611,7 +1623,7 @@ class TerminalTaskSystem extends Disposable {
1611
1623
  };
1612
1624
  }
1613
1625
  else {
1614
- throw new Error('Should never try to resolve undefined.');
1626
+ throw ( (new Error('Should never try to resolve undefined.')));
1615
1627
  }
1616
1628
  }
1617
1629
  async _resolveOptions(resolver, options) {
@@ -1629,13 +1641,13 @@ class TerminalTaskSystem extends Disposable {
1629
1641
  : { cwd: await this._resolveVariable(resolver, '${workspaceFolder}') };
1630
1642
  if (options.env) {
1631
1643
  result.env = Object.create(null);
1632
- for (const key of ( Object.keys(options.env))) {
1644
+ for (const key of ( (Object.keys(options.env)))) {
1633
1645
  const value = options.env[key];
1634
1646
  if (isString(value)) {
1635
1647
  result.env[key] = await this._resolveVariable(resolver, value);
1636
1648
  }
1637
1649
  else {
1638
- result.env[key] = ( value.toString());
1650
+ result.env[key] = ( (value.toString()));
1639
1651
  }
1640
1652
  }
1641
1653
  }
@@ -1681,16 +1693,12 @@ function getWaitOnExitValue(presentationOptions, configurationProperties) {
1681
1693
  if ((presentationOptions.close === undefined) || (presentationOptions.close === false)) {
1682
1694
  if ((presentationOptions.reveal !== RevealKind.Never) || !configurationProperties.isBackground || (presentationOptions.close === false)) {
1683
1695
  if (presentationOptions.panel === PanelKind.New) {
1684
- return taskShellIntegrationWaitOnExitSequence(( localizeWithPath(
1685
- 'vs/workbench/contrib/tasks/browser/terminalTaskSystem',
1686
- 'closeTerminal',
1687
- 'Press any key to close the terminal.'
1688
- )));
1696
+ return taskShellIntegrationWaitOnExitSequence(( localizeWithPath(_moduleId, 11, 'Press any key to close the terminal.')));
1689
1697
  }
1690
1698
  else if (presentationOptions.showReuseMessage) {
1691
1699
  return taskShellIntegrationWaitOnExitSequence(( localizeWithPath(
1692
- 'vs/workbench/contrib/tasks/browser/terminalTaskSystem',
1693
- 'reuseTerminal',
1700
+ _moduleId,
1701
+ 12,
1694
1702
  'Terminal will be reused by tasks, press any key to close it.'
1695
1703
  )));
1696
1704
  }
@@ -1703,7 +1711,7 @@ function getWaitOnExitValue(presentationOptions, configurationProperties) {
1703
1711
  }
1704
1712
  function taskShellIntegrationWaitOnExitSequence(message) {
1705
1713
  return (exitCode) => {
1706
- return `${VSCodeSequence("D" , ( exitCode.toString()))}${message}`;
1714
+ return `${VSCodeSequence("D" , ( (exitCode.toString())))}${message}`;
1707
1715
  };
1708
1716
  }
1709
1717
  function getReconnectionData(terminal) {