@codingame/monaco-vscode-task-service-override 26.2.2 → 28.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.
- package/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/tasks/browser/abstractTaskService.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/tasks/browser/abstractTaskService.js +146 -150
- package/vscode/src/vs/workbench/contrib/tasks/browser/runAutomaticTasks.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/tasks/browser/runAutomaticTasks.js +8 -8
- package/vscode/src/vs/workbench/contrib/tasks/browser/task.contribution.js +48 -48
- package/vscode/src/vs/workbench/contrib/tasks/browser/taskQuickPick.js +17 -17
- package/vscode/src/vs/workbench/contrib/tasks/browser/taskService.js +1 -1
- package/vscode/src/vs/workbench/contrib/tasks/browser/taskTerminalStatus.js +11 -11
- package/vscode/src/vs/workbench/contrib/tasks/browser/tasksQuickAccess.js +2 -2
- package/vscode/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.js +53 -37
- package/vscode/src/vs/workbench/contrib/tasks/common/jsonSchemaCommon.js +42 -42
- package/vscode/src/vs/workbench/contrib/tasks/common/jsonSchema_v1.js +14 -10
- package/vscode/src/vs/workbench/contrib/tasks/common/jsonSchema_v2.js +95 -84
- package/vscode/src/vs/workbench/contrib/tasks/common/problemCollectors.d.ts +6 -4
- package/vscode/src/vs/workbench/contrib/tasks/common/problemCollectors.js +34 -13
- package/vscode/src/vs/workbench/contrib/tasks/common/taskSystem.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/tasks/common/taskTemplates.js +4 -4
- package/vscode/src/vs/base/common/parsers.d.ts +0 -32
- package/vscode/src/vs/base/common/parsers.js +0 -54
- package/vscode/src/vs/workbench/contrib/tasks/common/problemMatcher.d.ts +0 -432
- package/vscode/src/vs/workbench/contrib/tasks/common/problemMatcher.js +0 -1627
- package/vscode/src/vs/workbench/contrib/tasks/common/taskConfiguration.d.ts +0 -510
- package/vscode/src/vs/workbench/contrib/tasks/common/taskConfiguration.js +0 -1790
|
@@ -4,10 +4,10 @@ import { Action } from '@codingame/monaco-vscode-api/vscode/vs/base/common/actio
|
|
|
4
4
|
import { Emitter, Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
5
5
|
import { match } from '@codingame/monaco-vscode-api/vscode/vs/base/common/glob';
|
|
6
6
|
import { parse as parse$1 } from '@codingame/monaco-vscode-api/vscode/vs/base/common/json';
|
|
7
|
-
import { Disposable, MutableDisposable,
|
|
7
|
+
import { Disposable, MutableDisposable, toDisposable, dispose } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
8
8
|
import { LRUCache, Touch } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
|
|
9
9
|
import { deepClone } from '@codingame/monaco-vscode-api/vscode/vs/base/common/objects';
|
|
10
|
-
import { ValidationStatus, ValidationState } from '
|
|
10
|
+
import { ValidationStatus, ValidationState } from '@codingame/monaco-vscode-api/vscode/vs/base/common/parsers';
|
|
11
11
|
import { isWeb, Platform, platform } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
12
12
|
import { TerminateResponseCode } from '@codingame/monaco-vscode-api/vscode/vs/base/common/processes';
|
|
13
13
|
import { basename, joinPath, dirname, relativePath } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
@@ -28,7 +28,7 @@ import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode
|
|
|
28
28
|
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
29
29
|
import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
30
30
|
import { IExtensionService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
31
|
-
import { ProblemMatcherRegistry } from '
|
|
31
|
+
import { ProblemMatcherRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/tasks/common/problemMatcher';
|
|
32
32
|
import { IDialogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service';
|
|
33
33
|
import { INotificationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/notification.service';
|
|
34
34
|
import { IOpenerService } from '@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service';
|
|
@@ -47,12 +47,12 @@ import { ChatAgentLocation, ChatModeKind } from '@codingame/monaco-vscode-api/vs
|
|
|
47
47
|
import { TasksAvailableContext, TaskCommandsRegistered, ServerlessWebContext, CustomExecutionSupportedContext, ShellExecutionSupportedContext, ProcessExecutionSupportedContext, TaskExecutionSupportedContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/tasks/common/taskService';
|
|
48
48
|
import { VerifiedTask, Triggers, TaskError, TaskErrors, TaskExecuteKind } from '../common/taskSystem.js';
|
|
49
49
|
import { getTemplates } from '../common/taskTemplates.js';
|
|
50
|
-
import { createCustomTask, TaskConfigSource, GroupKind, parse, ExecutionEngine as ExecutionEngine$1, JsonSchemaVersion as JsonSchemaVersion$1 } from '
|
|
50
|
+
import { createCustomTask, TaskConfigSource, GroupKind, parse, ExecutionEngine as ExecutionEngine$1, JsonSchemaVersion as JsonSchemaVersion$1 } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/tasks/common/taskConfiguration';
|
|
51
51
|
import { TerminalTaskSystem } from './terminalTaskSystem.js';
|
|
52
52
|
import { IQuickInputService } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service';
|
|
53
53
|
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
54
54
|
import { TaskDefinitionRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/tasks/common/taskDefinitionRegistry';
|
|
55
|
-
import { getWindow,
|
|
55
|
+
import { getWindow, getActiveElement } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
56
56
|
import { raceTimeout } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
57
57
|
import { CancellationTokenSource } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
58
58
|
import { isCancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
@@ -93,7 +93,7 @@ const TaskTerminalType = "Task";
|
|
|
93
93
|
var ConfigureTaskAction;
|
|
94
94
|
(function(ConfigureTaskAction) {
|
|
95
95
|
ConfigureTaskAction.ID = "workbench.action.tasks.configureTaskRunner";
|
|
96
|
-
ConfigureTaskAction.TEXT = ( localize2(
|
|
96
|
+
ConfigureTaskAction.TEXT = ( localize2(12576, "Configure Task"));
|
|
97
97
|
})(ConfigureTaskAction || (ConfigureTaskAction = {}));
|
|
98
98
|
class ProblemReporter {
|
|
99
99
|
constructor(_outputChannel) {
|
|
@@ -185,7 +185,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
185
185
|
this.OutputChannelId = "tasks";
|
|
186
186
|
}
|
|
187
187
|
static {
|
|
188
|
-
this.OutputChannelLabel = ( localize(
|
|
188
|
+
this.OutputChannelLabel = ( localize(12577, "Tasks"));
|
|
189
189
|
}
|
|
190
190
|
static {
|
|
191
191
|
this._nextHandle = 0;
|
|
@@ -275,21 +275,21 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
275
275
|
this._hostService = _hostService;
|
|
276
276
|
this._tasksReconnected = false;
|
|
277
277
|
this._taskSystemListeners = [];
|
|
278
|
-
this._onDidRegisterSupportedExecutions = ( new Emitter());
|
|
279
|
-
this._onDidRegisterAllSupportedExecutions = ( new Emitter());
|
|
280
|
-
this._onDidChangeTaskSystemInfo = ( new Emitter());
|
|
278
|
+
this._onDidRegisterSupportedExecutions = this._register(( new Emitter()));
|
|
279
|
+
this._onDidRegisterAllSupportedExecutions = this._register(( new Emitter()));
|
|
280
|
+
this._onDidChangeTaskSystemInfo = this._register(( new Emitter()));
|
|
281
281
|
this._willRestart = false;
|
|
282
282
|
this.onDidChangeTaskSystemInfo = this._onDidChangeTaskSystemInfo.event;
|
|
283
|
-
this._onDidReconnectToTasks = ( new Emitter());
|
|
283
|
+
this._onDidReconnectToTasks = this._register(( new Emitter()));
|
|
284
284
|
this.onDidReconnectToTasks = this._onDidReconnectToTasks.event;
|
|
285
|
-
this._onDidChangeTaskConfig = ( new Emitter());
|
|
285
|
+
this._onDidChangeTaskConfig = this._register(( new Emitter()));
|
|
286
286
|
this.onDidChangeTaskConfig = this._onDidChangeTaskConfig.event;
|
|
287
287
|
this._onDidChangeTaskProviders = this._register(( new Emitter()));
|
|
288
288
|
this.onDidChangeTaskProviders = this._onDidChangeTaskProviders.event;
|
|
289
289
|
this._taskRunStartTimes = ( new Map());
|
|
290
290
|
this._taskRunSources = ( new Map());
|
|
291
291
|
this._activatedTaskProviders = ( new Set());
|
|
292
|
-
this.
|
|
292
|
+
this.toast = this._register(( new MutableDisposable()));
|
|
293
293
|
this._whenTaskSystemReady = Event.toPromise(this.onDidChangeTaskSystemInfo);
|
|
294
294
|
this._workspaceTasksPromise = undefined;
|
|
295
295
|
this._taskSystem = undefined;
|
|
@@ -359,7 +359,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
359
359
|
}
|
|
360
360
|
let entry;
|
|
361
361
|
if (tasks && tasks.length > 0) {
|
|
362
|
-
entry = await this._showQuickPick(tasks, ( localize(
|
|
362
|
+
entry = await this._showQuickPick(tasks, ( localize(12578, "Select the build task (there is no default build task defined)")));
|
|
363
363
|
}
|
|
364
364
|
const task = entry ? entry.task : undefined;
|
|
365
365
|
if (!task) {
|
|
@@ -371,7 +371,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
371
371
|
this._willRestart = e.reason !== ShutdownReason.RELOAD;
|
|
372
372
|
}));
|
|
373
373
|
this._register(this.onDidStateChange(async e => {
|
|
374
|
-
this._log(( localize(
|
|
374
|
+
this._log(( localize(12579, "Task Event kind: {0}", e.kind)), true);
|
|
375
375
|
switch (e.kind) {
|
|
376
376
|
case TaskEventKind.Start:
|
|
377
377
|
this._taskRunStartTimes.set(e.taskId, Date.now());
|
|
@@ -458,7 +458,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
458
458
|
_attemptTaskReconnection() {
|
|
459
459
|
if (!this._lifecycleService.shouldAttemptTaskReconnection) {
|
|
460
460
|
this._log(( localize(
|
|
461
|
-
|
|
461
|
+
12580,
|
|
462
462
|
"Startup kind not window reload, setting connected and removing persistent tasks"
|
|
463
463
|
)), true);
|
|
464
464
|
this._tasksReconnected = true;
|
|
@@ -466,7 +466,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
466
466
|
}
|
|
467
467
|
if (!this._configurationService.getValue(TaskSettingId.Reconnection) || this._tasksReconnected) {
|
|
468
468
|
this._log(( localize(
|
|
469
|
-
|
|
469
|
+
12581,
|
|
470
470
|
"Setting tasks connected configured value {0}, tasks were already reconnected {1}",
|
|
471
471
|
this._configurationService.getValue(TaskSettingId.Reconnection),
|
|
472
472
|
this._tasksReconnected
|
|
@@ -474,10 +474,10 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
474
474
|
this._tasksReconnected = true;
|
|
475
475
|
return;
|
|
476
476
|
}
|
|
477
|
-
this._log(( localize(
|
|
477
|
+
this._log(( localize(12582, "Reconnecting to running tasks...")), true);
|
|
478
478
|
this.getWorkspaceTasks(TaskRunSource.Reconnect).then(async () => {
|
|
479
479
|
this._tasksReconnected = await this._reconnectTasks();
|
|
480
|
-
this._log(( localize(
|
|
480
|
+
this._log(( localize(12583, "Reconnected to running tasks.")), true);
|
|
481
481
|
this._onDidReconnectToTasks.fire();
|
|
482
482
|
});
|
|
483
483
|
}
|
|
@@ -500,24 +500,22 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
500
500
|
return;
|
|
501
501
|
}
|
|
502
502
|
const durationText = this._formatTaskDuration(durationMs);
|
|
503
|
-
const message = taskLabel ? ( localize(
|
|
503
|
+
const message = taskLabel ? ( localize(12584, "Task \"{0}\" finished in {1}.", taskLabel, durationText)) : ( localize(12585, "Task finished in {0}.", durationText));
|
|
504
504
|
this._hostService.focus(targetWindow, {
|
|
505
505
|
mode: FocusMode.Notify
|
|
506
506
|
});
|
|
507
|
-
const
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
}
|
|
520
|
-
}));
|
|
507
|
+
const cts = ( new CancellationTokenSource());
|
|
508
|
+
this.toast.value = toDisposable(() => cts.dispose(true));
|
|
509
|
+
const {
|
|
510
|
+
clicked
|
|
511
|
+
} = await this._hostService.showToast({
|
|
512
|
+
title: message
|
|
513
|
+
}, cts.token);
|
|
514
|
+
this.toast.clear();
|
|
515
|
+
if (clicked) {
|
|
516
|
+
this._hostService.focus(targetWindow, {
|
|
517
|
+
mode: FocusMode.Force
|
|
518
|
+
});
|
|
521
519
|
}
|
|
522
520
|
}
|
|
523
521
|
_formatTaskDuration(durationMs) {
|
|
@@ -525,18 +523,18 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
525
523
|
const minutes = Math.floor(totalSeconds / 60);
|
|
526
524
|
const seconds = totalSeconds % 60;
|
|
527
525
|
if (minutes > 0) {
|
|
528
|
-
return seconds > 0 ? ( localize(
|
|
526
|
+
return seconds > 0 ? ( localize(12586, "{0}m {1}s", minutes, seconds)) : ( localize(12587, "{0}m", minutes));
|
|
529
527
|
}
|
|
530
|
-
return localize(
|
|
528
|
+
return localize(12588, "{0}s", seconds);
|
|
531
529
|
}
|
|
532
530
|
async _reconnectTasks() {
|
|
533
531
|
const tasks = await this.getSavedTasks("persistent");
|
|
534
532
|
if (!tasks.length) {
|
|
535
|
-
this._log(( localize(
|
|
533
|
+
this._log(( localize(12589, "No persistent tasks to reconnect.")), true);
|
|
536
534
|
return true;
|
|
537
535
|
}
|
|
538
536
|
const taskLabels = ( tasks.map(task => task._label)).join(", ");
|
|
539
|
-
this._log(( localize(
|
|
537
|
+
this._log(( localize(12590, "Reconnecting to {0} tasks...", taskLabels)), true);
|
|
540
538
|
for (const task of tasks) {
|
|
541
539
|
if (ConfiguringTask.is(task)) {
|
|
542
540
|
const resolved = await this.tryResolveTask(task);
|
|
@@ -568,21 +566,21 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
568
566
|
args: [{
|
|
569
567
|
name: "args",
|
|
570
568
|
isOptional: true,
|
|
571
|
-
description: ( localize(
|
|
569
|
+
description: ( localize(12591, "Filters the tasks shown in the quickpick")),
|
|
572
570
|
schema: {
|
|
573
571
|
anyOf: [{
|
|
574
572
|
type: "string",
|
|
575
|
-
description: ( localize(
|
|
573
|
+
description: ( localize(12592, "The task's label or a term to filter by"))
|
|
576
574
|
}, {
|
|
577
575
|
type: "object",
|
|
578
576
|
properties: {
|
|
579
577
|
type: {
|
|
580
578
|
type: "string",
|
|
581
|
-
description: ( localize(
|
|
579
|
+
description: ( localize(12593, "The contributed task type"))
|
|
582
580
|
},
|
|
583
581
|
task: {
|
|
584
582
|
type: "string",
|
|
585
|
-
description: ( localize(
|
|
583
|
+
description: ( localize(12594, "The task's label or a term to filter by"))
|
|
586
584
|
}
|
|
587
585
|
}
|
|
588
586
|
}]
|
|
@@ -757,7 +755,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
757
755
|
const defaultAgent = this._chatAgentService.getDefaultAgent(ChatAgentLocation.Chat);
|
|
758
756
|
if (defaultAgent) {
|
|
759
757
|
actions.push({
|
|
760
|
-
label: ( localize(
|
|
758
|
+
label: ( localize(12595, "Fix with AI")),
|
|
761
759
|
run: async () => {
|
|
762
760
|
this._commandService.executeCommand(CHAT_OPEN_ACTION_ID, {
|
|
763
761
|
mode: ChatModeKind.Agent,
|
|
@@ -769,18 +767,18 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
769
767
|
}
|
|
770
768
|
}
|
|
771
769
|
actions.push({
|
|
772
|
-
label: ( localize(
|
|
770
|
+
label: ( localize(12596, "Show Output")),
|
|
773
771
|
run: () => {
|
|
774
772
|
this._outputService.showChannel(this._outputChannel.id, true);
|
|
775
773
|
}
|
|
776
774
|
});
|
|
777
775
|
if (chatEnabled && actions.length > 1) {
|
|
778
776
|
this._notificationService.prompt(Severity.Warning, ( localize(
|
|
779
|
-
|
|
777
|
+
12597,
|
|
780
778
|
"There are task errors. Use chat to fix them or view the output for details."
|
|
781
779
|
)), actions);
|
|
782
780
|
} else {
|
|
783
|
-
this._notificationService.prompt(Severity.Warning, ( localize(
|
|
781
|
+
this._notificationService.prompt(Severity.Warning, ( localize(12598, "There are task errors. See the output for details.")), actions);
|
|
784
782
|
}
|
|
785
783
|
}
|
|
786
784
|
}
|
|
@@ -849,7 +847,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
849
847
|
const tasks = await this.getWorkspaceTasks();
|
|
850
848
|
for (const [, workspaceTasks] of tasks) {
|
|
851
849
|
if (workspaceTasks.configurations) {
|
|
852
|
-
for (const taskName
|
|
850
|
+
for (const taskName of ( Object.keys(workspaceTasks.configurations.byIdentifier))) {
|
|
853
851
|
const task = workspaceTasks.configurations.byIdentifier[taskName];
|
|
854
852
|
if (predicate(task, workspaceTasks.workspaceFolder)) {
|
|
855
853
|
result.push(task);
|
|
@@ -881,7 +879,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
881
879
|
}
|
|
882
880
|
const name = isString(folder) ? folder : isWorkspaceFolder(folder) ? folder.name : folder.configuration ? basename(folder.configuration) : undefined;
|
|
883
881
|
if (( this.ignoredWorkspaceFolders.some(ignored => ignored.name === name))) {
|
|
884
|
-
return Promise.reject(( new Error(( localize(
|
|
882
|
+
return Promise.reject(( new Error(( localize(12599, "The folder {0} is ignored since it uses task version 0.1.0", name)))));
|
|
885
883
|
}
|
|
886
884
|
const key = !isString(identifier) ? TaskDefinition.createTaskIdentifier(identifier, console) : identifier;
|
|
887
885
|
if (key === undefined) {
|
|
@@ -936,7 +934,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
936
934
|
if (!matchingProvider) {
|
|
937
935
|
if (matchingProviderUnavailable) {
|
|
938
936
|
this._log(( localize(
|
|
939
|
-
|
|
937
|
+
12600,
|
|
940
938
|
"Warning: {0} tasks are unavailable in the current environment.",
|
|
941
939
|
configuringTask.configures.type
|
|
942
940
|
)));
|
|
@@ -1074,7 +1072,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
1074
1072
|
}
|
|
1075
1073
|
_getPersistentTasks() {
|
|
1076
1074
|
if (this._persistentTasks) {
|
|
1077
|
-
this._log(( localize(
|
|
1075
|
+
this._log(( localize(12601, "Returning cached tasks {0}", this._persistentTasks.size)), true);
|
|
1078
1076
|
return this._persistentTasks;
|
|
1079
1077
|
}
|
|
1080
1078
|
this._persistentTasks = ( new LRUCache(10));
|
|
@@ -1107,7 +1105,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
1107
1105
|
const workspaceToTaskMap = ( new Map());
|
|
1108
1106
|
const storedTasks = this._getTasksFromStorage(type);
|
|
1109
1107
|
const tasks = [];
|
|
1110
|
-
this._log(( localize(
|
|
1108
|
+
this._log(( localize(12602, "Fetching tasks from task storage.")), true);
|
|
1111
1109
|
function addTaskToMap(map, folder, task) {
|
|
1112
1110
|
if (folder && !( map.has(folder))) {
|
|
1113
1111
|
map.set(folder, []);
|
|
@@ -1122,7 +1120,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
1122
1120
|
const task = JSON.parse(entry[1]);
|
|
1123
1121
|
const folderInfo = this._getFolderFromTaskKey(key);
|
|
1124
1122
|
this._log(( localize(
|
|
1125
|
-
|
|
1123
|
+
12603,
|
|
1126
1124
|
"Reading tasks from task storage, {0}, {1}, {2}",
|
|
1127
1125
|
key,
|
|
1128
1126
|
task,
|
|
@@ -1134,7 +1132,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
1134
1132
|
task
|
|
1135
1133
|
);
|
|
1136
1134
|
} catch (error) {
|
|
1137
|
-
this._log(( localize(
|
|
1135
|
+
this._log(( localize(12604, "Fetching a task from task storage failed: {0}.", error)), true);
|
|
1138
1136
|
}
|
|
1139
1137
|
}
|
|
1140
1138
|
const readTasksMap = ( new Map());
|
|
@@ -1153,7 +1151,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
1153
1151
|
readTasksMap.set(taskKey, task);
|
|
1154
1152
|
}
|
|
1155
1153
|
});
|
|
1156
|
-
for (const configuration
|
|
1154
|
+
for (const configuration of ( Object.keys(customized))) {
|
|
1157
1155
|
const taskKey = customized[configuration].getKey();
|
|
1158
1156
|
if (taskKey) {
|
|
1159
1157
|
readTasksMap.set(taskKey, customized[configuration]);
|
|
@@ -1166,9 +1164,9 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
1166
1164
|
for (const key of ( storedTasks.keys())) {
|
|
1167
1165
|
if (( readTasksMap.has(key))) {
|
|
1168
1166
|
tasks.push(readTasksMap.get(key));
|
|
1169
|
-
this._log(( localize(
|
|
1167
|
+
this._log(( localize(12605, "Resolved task {0}", key)), true);
|
|
1170
1168
|
} else {
|
|
1171
|
-
this._log(( localize(
|
|
1169
|
+
this._log(( localize(12606, "Unable to resolve task {0} ", key)), true);
|
|
1172
1170
|
}
|
|
1173
1171
|
}
|
|
1174
1172
|
return tasks;
|
|
@@ -1179,7 +1177,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
1179
1177
|
}
|
|
1180
1178
|
}
|
|
1181
1179
|
removePersistentTask(key) {
|
|
1182
|
-
this._log(( localize(
|
|
1180
|
+
this._log(( localize(12607, "Removing persistent task {0}", key)), true);
|
|
1183
1181
|
if (this._getTasksFromStorage("persistent").delete(key)) {
|
|
1184
1182
|
this._savePersistentTasks();
|
|
1185
1183
|
}
|
|
@@ -1201,7 +1199,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
1201
1199
|
version: "2.0.0",
|
|
1202
1200
|
tasks: [customizations]
|
|
1203
1201
|
}, TaskRunSource.System, custom, customized, TaskConfigSource.TasksJson, true);
|
|
1204
|
-
for (const configuration
|
|
1202
|
+
for (const configuration of ( Object.keys(customized))) {
|
|
1205
1203
|
key = customized[configuration].getKey();
|
|
1206
1204
|
}
|
|
1207
1205
|
}
|
|
@@ -1246,14 +1244,14 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
1246
1244
|
version: "2.0.0",
|
|
1247
1245
|
tasks: [customizations]
|
|
1248
1246
|
}, TaskRunSource.System, custom, customized, TaskConfigSource.TasksJson, true);
|
|
1249
|
-
for (const configuration
|
|
1247
|
+
for (const configuration of ( Object.keys(customized))) {
|
|
1250
1248
|
key = customized[configuration].getKey();
|
|
1251
1249
|
}
|
|
1252
1250
|
}
|
|
1253
1251
|
if (!task.configurationProperties.isBackground) {
|
|
1254
1252
|
return;
|
|
1255
1253
|
}
|
|
1256
|
-
this._log(( localize(
|
|
1254
|
+
this._log(( localize(12608, "Setting persistent task {0}", key)), true);
|
|
1257
1255
|
this._getTasksFromStorage("persistent").set(key, JSON.stringify(customizations));
|
|
1258
1256
|
this._savePersistentTasks();
|
|
1259
1257
|
}
|
|
@@ -1265,7 +1263,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
1265
1263
|
for (const key of keys) {
|
|
1266
1264
|
keyValues.push([key, this._persistentTasks.get(key, Touch.None)]);
|
|
1267
1265
|
}
|
|
1268
|
-
this._log(( localize(
|
|
1266
|
+
this._log(( localize(12609, "Saving persistent tasks: {0}", keys.join(", "))), true);
|
|
1269
1267
|
this._storageService.store(
|
|
1270
1268
|
AbstractTaskService_1.PersistentTasks_Key,
|
|
1271
1269
|
JSON.stringify(keyValues),
|
|
@@ -1314,24 +1312,24 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
1314
1312
|
if (test) {
|
|
1315
1313
|
if (this.schemaVersion === JsonSchemaVersion.V0_1_0) {
|
|
1316
1314
|
throw ( new TaskError(Severity.Info, ( localize(
|
|
1317
|
-
|
|
1315
|
+
12610,
|
|
1318
1316
|
"No test task defined. Mark a task with 'isTestCommand' in the tasks.json file."
|
|
1319
1317
|
)), TaskErrors.NoTestTask));
|
|
1320
1318
|
} else {
|
|
1321
1319
|
throw ( new TaskError(Severity.Info, ( localize(
|
|
1322
|
-
|
|
1320
|
+
12611,
|
|
1323
1321
|
"No test task defined. Mark a task with as a 'test' group in the tasks.json file."
|
|
1324
1322
|
)), TaskErrors.NoTestTask));
|
|
1325
1323
|
}
|
|
1326
1324
|
} else {
|
|
1327
1325
|
if (this.schemaVersion === JsonSchemaVersion.V0_1_0) {
|
|
1328
1326
|
throw ( new TaskError(Severity.Info, ( localize(
|
|
1329
|
-
|
|
1327
|
+
12612,
|
|
1330
1328
|
"No build task defined. Mark a task with 'isBuildCommand' in the tasks.json file."
|
|
1331
1329
|
)), TaskErrors.NoBuildTask));
|
|
1332
1330
|
} else {
|
|
1333
1331
|
throw ( new TaskError(Severity.Info, ( localize(
|
|
1334
|
-
|
|
1332
|
+
12613,
|
|
1335
1333
|
"No build task defined. Mark a task with as a 'build' group in the tasks.json file."
|
|
1336
1334
|
)), TaskErrors.NoBuildTask));
|
|
1337
1335
|
}
|
|
@@ -1351,7 +1349,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
1351
1349
|
return;
|
|
1352
1350
|
}
|
|
1353
1351
|
if (!task) {
|
|
1354
|
-
throw ( new TaskError(Severity.Info, ( localize(
|
|
1352
|
+
throw ( new TaskError(Severity.Info, ( localize(12614, "Task to execute is undefined")), TaskErrors.TaskNotFound));
|
|
1355
1353
|
}
|
|
1356
1354
|
const resolver = this._createResolver();
|
|
1357
1355
|
let executeTaskResult;
|
|
@@ -1389,7 +1387,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
1389
1387
|
let type;
|
|
1390
1388
|
if (CustomTask.is(task)) {
|
|
1391
1389
|
const configProperties = task._source.config.element;
|
|
1392
|
-
type = configProperties.type;
|
|
1390
|
+
type = configProperties.type ?? "";
|
|
1393
1391
|
} else {
|
|
1394
1392
|
type = task.getDefinition().type;
|
|
1395
1393
|
}
|
|
@@ -1464,34 +1462,34 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
1464
1462
|
});
|
|
1465
1463
|
entries.unshift({
|
|
1466
1464
|
type: "separator",
|
|
1467
|
-
label: ( localize(
|
|
1465
|
+
label: ( localize(12615, "associate"))
|
|
1468
1466
|
});
|
|
1469
1467
|
let taskType;
|
|
1470
1468
|
if (CustomTask.is(task)) {
|
|
1471
1469
|
const configProperties = task._source.config.element;
|
|
1472
|
-
taskType = configProperties.type;
|
|
1470
|
+
taskType = configProperties.type ?? "";
|
|
1473
1471
|
} else {
|
|
1474
1472
|
taskType = task.getDefinition().type;
|
|
1475
1473
|
}
|
|
1476
1474
|
entries.unshift({
|
|
1477
|
-
label: ( localize(
|
|
1475
|
+
label: ( localize(12616, "Continue without scanning the task output")),
|
|
1478
1476
|
matcher: undefined
|
|
1479
1477
|
}, {
|
|
1480
|
-
label: ( localize(
|
|
1478
|
+
label: ( localize(12617, "Never scan the task output for this task")),
|
|
1481
1479
|
matcher: undefined,
|
|
1482
1480
|
never: true
|
|
1483
1481
|
}, {
|
|
1484
|
-
label: ( localize(
|
|
1482
|
+
label: ( localize(12618, "Never scan the task output for {0} tasks", taskType)),
|
|
1485
1483
|
matcher: undefined,
|
|
1486
1484
|
setting: taskType
|
|
1487
1485
|
}, {
|
|
1488
|
-
label: ( localize(
|
|
1486
|
+
label: ( localize(12619, "Learn more about scanning the task output")),
|
|
1489
1487
|
matcher: undefined,
|
|
1490
1488
|
learnMore: true
|
|
1491
1489
|
});
|
|
1492
1490
|
const problemMatcher = await this._quickInputService.pick(entries, {
|
|
1493
1491
|
placeHolder: ( localize(
|
|
1494
|
-
|
|
1492
|
+
12620,
|
|
1495
1493
|
"Select for which kind of errors and warnings to scan the task output"
|
|
1496
1494
|
))
|
|
1497
1495
|
});
|
|
@@ -1681,7 +1679,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
1681
1679
|
const configuration = this._getConfiguration(workspaceFolder, task._source.kind);
|
|
1682
1680
|
if (configuration.hasParseErrors) {
|
|
1683
1681
|
this._notificationService.warn(( localize(
|
|
1684
|
-
|
|
1682
|
+
12621,
|
|
1685
1683
|
"The current task configuration has errors. Please fix the errors first before customizing a task."
|
|
1686
1684
|
)));
|
|
1687
1685
|
return Promise.resolve(undefined);
|
|
@@ -1706,7 +1704,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
1706
1704
|
tasks: [toCustomize]
|
|
1707
1705
|
};
|
|
1708
1706
|
let content = ["{", ( localize(
|
|
1709
|
-
|
|
1707
|
+
12622,
|
|
1710
1708
|
"\t// See https://go.microsoft.com/fwlink/?LinkId=733558 \n\t// for the documentation about the tasks.json format"
|
|
1711
1709
|
))].join("\n") + JSON.stringify(value, null, "\t").substr(1);
|
|
1712
1710
|
const editorConfig = this._configurationService.getValue();
|
|
@@ -1866,7 +1864,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
1866
1864
|
if (workspaceTasks.length > 0) {
|
|
1867
1865
|
if (workspaceTasks.length > 1) {
|
|
1868
1866
|
this._log(( localize(
|
|
1869
|
-
|
|
1867
|
+
12623,
|
|
1870
1868
|
"There are many build tasks defined in the tasks.json. Executing the first one."
|
|
1871
1869
|
)));
|
|
1872
1870
|
}
|
|
@@ -1999,10 +1997,10 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
1999
1997
|
const {
|
|
2000
1998
|
confirmed
|
|
2001
1999
|
} = await this._dialogService.confirm({
|
|
2002
|
-
message: ( localize(
|
|
2003
|
-
detail: ( localize(
|
|
2004
|
-
primaryButton: ( localize(
|
|
2005
|
-
cancelButton: ( localize(
|
|
2000
|
+
message: ( localize(12624, "Save all editors?")),
|
|
2001
|
+
detail: ( localize(12625, "Do you want to save all editors before running the task?")),
|
|
2002
|
+
primaryButton: ( localize(12626, "&&Save")),
|
|
2003
|
+
cancelButton: ( localize(12627, "Do&&n't Save"))
|
|
2006
2004
|
});
|
|
2007
2005
|
if (!confirmed) {
|
|
2008
2006
|
return false;
|
|
@@ -2049,7 +2047,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
2049
2047
|
this._handleInstancePolicy(executeResult.task, executeResult.task.runOptions.instancePolicy);
|
|
2050
2048
|
} else {
|
|
2051
2049
|
throw ( new TaskError(Severity.Warning, ( localize(
|
|
2052
|
-
|
|
2050
|
+
12628,
|
|
2053
2051
|
"There is already a task running. Terminate it first before executing another task."
|
|
2054
2052
|
)), TaskErrors.RunningTask));
|
|
2055
2053
|
}
|
|
@@ -2071,15 +2069,15 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
2071
2069
|
case InstancePolicy.silent:
|
|
2072
2070
|
break;
|
|
2073
2071
|
case InstancePolicy.warn:
|
|
2074
|
-
this._notificationService.warn(( localize(
|
|
2072
|
+
this._notificationService.warn(( localize(12629, "The instance limit for this task has been reached.")));
|
|
2075
2073
|
break;
|
|
2076
2074
|
case InstancePolicy.prompt:
|
|
2077
2075
|
default:
|
|
2078
2076
|
this._showQuickPick(
|
|
2079
2077
|
this._taskSystem.getActiveTasks().filter(t => task._id === t._id),
|
|
2080
|
-
( localize(
|
|
2078
|
+
( localize(12630, "Select an instance to terminate")),
|
|
2081
2079
|
{
|
|
2082
|
-
label: ( localize(
|
|
2080
|
+
label: ( localize(12631, "No instance is currently running")),
|
|
2083
2081
|
task: undefined
|
|
2084
2082
|
},
|
|
2085
2083
|
false,
|
|
@@ -2103,7 +2101,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
2103
2101
|
const response = await this._taskSystem.terminate(task);
|
|
2104
2102
|
if (!response.success) {
|
|
2105
2103
|
this._notificationService.warn(( localize(
|
|
2106
|
-
|
|
2104
|
+
12632,
|
|
2107
2105
|
"Failed to terminate and restart task {0}",
|
|
2108
2106
|
isString(task) ? task : task.configurationProperties.name
|
|
2109
2107
|
)));
|
|
@@ -2118,7 +2116,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
2118
2116
|
const success = await this.run(task);
|
|
2119
2117
|
if (!success || (typeof success.exitCode === "number" && success.exitCode !== 0)) {
|
|
2120
2118
|
this._notificationService.warn(( localize(
|
|
2121
|
-
|
|
2119
|
+
12633,
|
|
2122
2120
|
"Task {0} no longer exists or has been modified. Cannot restart.",
|
|
2123
2121
|
task.configurationProperties.name
|
|
2124
2122
|
)));
|
|
@@ -2258,7 +2256,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
2258
2256
|
if (!isCancellationError(error)) {
|
|
2259
2257
|
if (error && isString(error.message)) {
|
|
2260
2258
|
this._log(`Error: ${error.message}\n`);
|
|
2261
|
-
this._showOutput(error.message);
|
|
2259
|
+
this._showOutput(undefined, undefined, error.message);
|
|
2262
2260
|
} else {
|
|
2263
2261
|
this._log("Unknown error received while collecting tasks from providers.");
|
|
2264
2262
|
this._showOutput();
|
|
@@ -2284,7 +2282,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
2284
2282
|
for (const task of taskSet.tasks) {
|
|
2285
2283
|
if (task.type !== this._providerTypes.get(handle)) {
|
|
2286
2284
|
this._log(( localize(
|
|
2287
|
-
|
|
2285
|
+
12634,
|
|
2288
2286
|
"The task provider for \"{0}\" tasks unexpectedly provided a task of type \"{1}\".\n",
|
|
2289
2287
|
this._providerTypes.get(handle),
|
|
2290
2288
|
task.type
|
|
@@ -2426,13 +2424,13 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
2426
2424
|
}
|
|
2427
2425
|
if (requiredTaskProviderUnavailable) {
|
|
2428
2426
|
this._log(( localize(
|
|
2429
|
-
|
|
2427
|
+
12600,
|
|
2430
2428
|
"Warning: {0} tasks are unavailable in the current environment.",
|
|
2431
2429
|
configuringTask.configures.type
|
|
2432
2430
|
)));
|
|
2433
2431
|
} else if (!waitToActivate) {
|
|
2434
2432
|
this._log(( localize(
|
|
2435
|
-
|
|
2433
|
+
12635,
|
|
2436
2434
|
"Error: The {0} task detection didn't contribute a task for the following configuration:\n{1}\nThe task will be ignored.",
|
|
2437
2435
|
configuringTask.configures.type,
|
|
2438
2436
|
JSON.stringify(configuringTask._source.config.element, undefined, 4)
|
|
@@ -2568,7 +2566,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
2568
2566
|
}
|
|
2569
2567
|
if (problemReporter.status.isFatal()) {
|
|
2570
2568
|
problemReporter.fatal(( localize(
|
|
2571
|
-
|
|
2569
|
+
12636,
|
|
2572
2570
|
"Error: the provided task configuration has validation errors and can't not be used. Please correct the errors first."
|
|
2573
2571
|
)));
|
|
2574
2572
|
return {
|
|
@@ -2617,12 +2615,12 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
2617
2615
|
}
|
|
2618
2616
|
if (isAffected) {
|
|
2619
2617
|
this._log(( localize(
|
|
2620
|
-
|
|
2618
|
+
12637,
|
|
2621
2619
|
"Error: The content of the tasks json in {0} has syntax errors. Please correct them before executing a task.",
|
|
2622
2620
|
location
|
|
2623
2621
|
)));
|
|
2624
2622
|
this._showOutput(undefined, undefined, ( localize(
|
|
2625
|
-
|
|
2623
|
+
12637,
|
|
2626
2624
|
"Error: The content of the tasks json in {0} has syntax errors. Please correct them before executing a task.",
|
|
2627
2625
|
location
|
|
2628
2626
|
)));
|
|
@@ -2647,7 +2645,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
2647
2645
|
return this._emptyWorkspaceTaskResults(workspaceFolder);
|
|
2648
2646
|
}
|
|
2649
2647
|
const workspaceFileConfig = this._getConfiguration(workspaceFolder, TaskSourceKind.WorkspaceFile);
|
|
2650
|
-
const configuration = this._testParseExternalConfig(workspaceFileConfig.config, ( localize(
|
|
2648
|
+
const configuration = this._testParseExternalConfig(workspaceFileConfig.config, ( localize(12638, "workspace file")));
|
|
2651
2649
|
const customizedTasks = {
|
|
2652
2650
|
byIdentifier: Object.create(null)
|
|
2653
2651
|
};
|
|
@@ -2663,7 +2661,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
2663
2661
|
const engine = configuration.config ? ExecutionEngine$1.from(configuration.config) : ExecutionEngine.Terminal;
|
|
2664
2662
|
if (engine === ExecutionEngine.Process) {
|
|
2665
2663
|
this._notificationService.warn(( localize(
|
|
2666
|
-
|
|
2664
|
+
12639,
|
|
2667
2665
|
"Only tasks version 2.0.0 permitted in workspace configuration files."
|
|
2668
2666
|
)));
|
|
2669
2667
|
return this._emptyWorkspaceTaskResults(workspaceFolder);
|
|
@@ -2682,7 +2680,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
2682
2680
|
return this._emptyWorkspaceTaskResults(workspaceFolder);
|
|
2683
2681
|
}
|
|
2684
2682
|
const userTasksConfig = this._getConfiguration(workspaceFolder, TaskSourceKind.User);
|
|
2685
|
-
const configuration = this._testParseExternalConfig(userTasksConfig.config, ( localize(
|
|
2683
|
+
const configuration = this._testParseExternalConfig(userTasksConfig.config, ( localize(12640, "user settings")));
|
|
2686
2684
|
const customizedTasks = {
|
|
2687
2685
|
byIdentifier: Object.create(null)
|
|
2688
2686
|
};
|
|
@@ -2697,7 +2695,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
2697
2695
|
);
|
|
2698
2696
|
const engine = configuration.config ? ExecutionEngine$1.from(configuration.config) : ExecutionEngine.Terminal;
|
|
2699
2697
|
if (engine === ExecutionEngine.Process) {
|
|
2700
|
-
this._notificationService.warn(( localize(
|
|
2698
|
+
this._notificationService.warn(( localize(12641, "Only tasks version 2.0.0 permitted in user settings.")));
|
|
2701
2699
|
return this._emptyWorkspaceTaskResults(workspaceFolder);
|
|
2702
2700
|
}
|
|
2703
2701
|
return {
|
|
@@ -2754,7 +2752,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
2754
2752
|
}
|
|
2755
2753
|
if (problemReporter.status.isFatal()) {
|
|
2756
2754
|
problemReporter.fatal(( localize(
|
|
2757
|
-
|
|
2755
|
+
12636,
|
|
2758
2756
|
"Error: the provided task configuration has validation errors and can't not be used. Please correct the errors first."
|
|
2759
2757
|
)));
|
|
2760
2758
|
return hasErrors;
|
|
@@ -2803,7 +2801,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
2803
2801
|
} else {
|
|
2804
2802
|
ignoredWorkspaceFolders.push(workspaceFolder);
|
|
2805
2803
|
this._log(( localize(
|
|
2806
|
-
|
|
2804
|
+
12642,
|
|
2807
2805
|
"Ignoring task configurations for workspace folder {0}. Multi folder workspace task support requires that all folders use task version 2.0.0",
|
|
2808
2806
|
workspaceFolder.uri.fsPath
|
|
2809
2807
|
)));
|
|
@@ -2883,11 +2881,11 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
2883
2881
|
}
|
|
2884
2882
|
if (isAffected) {
|
|
2885
2883
|
this._log(( localize(
|
|
2886
|
-
|
|
2884
|
+
12643,
|
|
2887
2885
|
"Error: The content of the tasks.json file has syntax errors. Please correct them before executing a task."
|
|
2888
2886
|
)));
|
|
2889
2887
|
this._showOutput(undefined, undefined, ( localize(
|
|
2890
|
-
|
|
2888
|
+
12643,
|
|
2891
2889
|
"Error: The content of the tasks.json file has syntax errors. Please correct them before executing a task."
|
|
2892
2890
|
)));
|
|
2893
2891
|
return {
|
|
@@ -2932,7 +2930,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
2932
2930
|
const needsTerminate = buildError.code === TaskErrors.RunningTask;
|
|
2933
2931
|
if (needsConfig || needsTerminate) {
|
|
2934
2932
|
this._notificationService.prompt(buildError.severity, buildError.message, [{
|
|
2935
|
-
label: needsConfig ? ConfigureTaskAction.TEXT.value : ( localize(
|
|
2933
|
+
label: needsConfig ? ConfigureTaskAction.TEXT.value : ( localize(12644, "Terminate Task")),
|
|
2936
2934
|
run: () => {
|
|
2937
2935
|
if (needsConfig) {
|
|
2938
2936
|
this._runConfigureTasks();
|
|
@@ -2955,12 +2953,12 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
2955
2953
|
this._notificationService.error(err);
|
|
2956
2954
|
} else {
|
|
2957
2955
|
this._notificationService.error(( localize(
|
|
2958
|
-
|
|
2956
|
+
12645,
|
|
2959
2957
|
"An error has occurred while running a task. See task log for details."
|
|
2960
2958
|
)));
|
|
2961
2959
|
}
|
|
2962
2960
|
if (showOutput) {
|
|
2963
|
-
this._showOutput(undefined, undefined, err);
|
|
2961
|
+
this._showOutput(undefined, undefined, isString(err) ? err : undefined);
|
|
2964
2962
|
}
|
|
2965
2963
|
}
|
|
2966
2964
|
_showDetail() {
|
|
@@ -3000,7 +2998,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
3000
2998
|
const entry = TaskQuickPickEntry(task);
|
|
3001
2999
|
entry.buttons = [{
|
|
3002
3000
|
iconClass: ThemeIcon.asClassName(configureTaskIcon),
|
|
3003
|
-
tooltip: ( localize(
|
|
3001
|
+
tooltip: ( localize(12646, "Configure Task"))
|
|
3004
3002
|
}];
|
|
3005
3003
|
if (selectedEntry && (task === selectedEntry.task)) {
|
|
3006
3004
|
entries.unshift(selectedEntry);
|
|
@@ -3049,12 +3047,12 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
3049
3047
|
}
|
|
3050
3048
|
const sorter = this.createSorter();
|
|
3051
3049
|
if (includeRecents) {
|
|
3052
|
-
fillEntries(entries, recent, ( localize(
|
|
3050
|
+
fillEntries(entries, recent, ( localize(12647, "recently used tasks")));
|
|
3053
3051
|
}
|
|
3054
3052
|
configured = configured.sort((a, b) => sorter.compare(a, b));
|
|
3055
|
-
fillEntries(entries, configured, ( localize(
|
|
3053
|
+
fillEntries(entries, configured, ( localize(12648, "configured tasks")));
|
|
3056
3054
|
detected = detected.sort((a, b) => sorter.compare(a, b));
|
|
3057
|
-
fillEntries(entries, detected, ( localize(
|
|
3055
|
+
fillEntries(entries, detected, ( localize(12649, "detected tasks")));
|
|
3058
3056
|
}
|
|
3059
3057
|
} else {
|
|
3060
3058
|
if (sort) {
|
|
@@ -3148,11 +3146,11 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
3148
3146
|
return Promise.resolve(undefined);
|
|
3149
3147
|
}
|
|
3150
3148
|
this._notificationService.prompt(Severity.Info, ( localize(
|
|
3151
|
-
|
|
3149
|
+
12650,
|
|
3152
3150
|
"The following workspace folders are ignored since they use task version 0.1.0: {0}",
|
|
3153
3151
|
( this.ignoredWorkspaceFolders.map(f => f.name)).join(", ")
|
|
3154
3152
|
)), [{
|
|
3155
|
-
label: ( localize(
|
|
3153
|
+
label: ( localize(12651, "Don't Show Again")),
|
|
3156
3154
|
isSecondary: true,
|
|
3157
3155
|
run: () => {
|
|
3158
3156
|
this._storageService.store(
|
|
@@ -3175,7 +3173,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
3175
3173
|
if (!this._workspaceTrustManagementService.isWorkspaceTrusted()) {
|
|
3176
3174
|
return (await this._workspaceTrustRequestService.requestWorkspaceTrust({
|
|
3177
3175
|
message: ( localize(
|
|
3178
|
-
|
|
3176
|
+
12652,
|
|
3179
3177
|
"Listing and running tasks requires that some of the files in this workspace be executed as code."
|
|
3180
3178
|
))
|
|
3181
3179
|
})) === true;
|
|
@@ -3211,9 +3209,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
3211
3209
|
}
|
|
3212
3210
|
}
|
|
3213
3211
|
}
|
|
3214
|
-
const exactMatchTask = !taskName ? undefined : tasks.find(
|
|
3215
|
-
t => t.configurationProperties.identifier === taskName || t.getDefinition(true)?.configurationProperties?.identifier === taskName
|
|
3216
|
-
);
|
|
3212
|
+
const exactMatchTask = !taskName ? undefined : tasks.find(t => t.configurationProperties.identifier === taskName);
|
|
3217
3213
|
if (!exactMatchTask) {
|
|
3218
3214
|
return this._doRunTaskCommand(tasks, type, taskName);
|
|
3219
3215
|
}
|
|
@@ -3276,7 +3272,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
3276
3272
|
}, TaskRunSource.User).then(undefined, reason => {});
|
|
3277
3273
|
}
|
|
3278
3274
|
};
|
|
3279
|
-
const placeholder = ( localize(
|
|
3275
|
+
const placeholder = ( localize(12653, "Select the task to run"));
|
|
3280
3276
|
this._showIgnoredFoldersMessage().then(() => {
|
|
3281
3277
|
if (this._configurationService.getValue(USE_SLOW_PICKER)) {
|
|
3282
3278
|
let taskResult = undefined;
|
|
@@ -3284,14 +3280,14 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
3284
3280
|
taskResult = this._tasksAndGroupedTasks();
|
|
3285
3281
|
}
|
|
3286
3282
|
this._showQuickPick(tasks ? tasks : taskResult.tasks, placeholder, {
|
|
3287
|
-
label: "$(plus) " + ( localize(
|
|
3283
|
+
label: "$(plus) " + ( localize(12654, "Configure a Task")),
|
|
3288
3284
|
task: null
|
|
3289
3285
|
}, true, undefined, undefined, undefined, name).then(entry => {
|
|
3290
3286
|
return pickThen(entry ? entry.task : undefined);
|
|
3291
3287
|
});
|
|
3292
3288
|
} else {
|
|
3293
3289
|
this._showTwoLevelQuickPick(placeholder, {
|
|
3294
|
-
label: "$(plus) " + ( localize(
|
|
3290
|
+
label: "$(plus) " + ( localize(12654, "Configure a Task")),
|
|
3295
3291
|
task: null
|
|
3296
3292
|
}, type, name).then(pickThen);
|
|
3297
3293
|
}
|
|
@@ -3455,16 +3451,16 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
3455
3451
|
return;
|
|
3456
3452
|
}
|
|
3457
3453
|
return this._runTaskGroupCommand(TaskGroup.Build, {
|
|
3458
|
-
fetching: ( localize(
|
|
3459
|
-
select: ( localize(
|
|
3460
|
-
notFoundConfigure: ( localize(
|
|
3454
|
+
fetching: ( localize(12655, "Fetching build tasks...")),
|
|
3455
|
+
select: ( localize(12656, "Select the build task to run")),
|
|
3456
|
+
notFoundConfigure: ( localize(12657, "No build task to run found. Configure Build Task..."))
|
|
3461
3457
|
}, this._runConfigureDefaultBuildTask, this._build);
|
|
3462
3458
|
}
|
|
3463
3459
|
_runTestCommand() {
|
|
3464
3460
|
return this._runTaskGroupCommand(TaskGroup.Test, {
|
|
3465
|
-
fetching: ( localize(
|
|
3466
|
-
select: ( localize(
|
|
3467
|
-
notFoundConfigure: ( localize(
|
|
3461
|
+
fetching: ( localize(12658, "Fetching test tasks...")),
|
|
3462
|
+
select: ( localize(12659, "Select the test task to run")),
|
|
3463
|
+
notFoundConfigure: ( localize(12660, "No test task to run found. Configure Tasks..."))
|
|
3468
3464
|
}, this._runConfigureDefaultTestTask, this._runTest);
|
|
3469
3465
|
}
|
|
3470
3466
|
_runTerminateCommand(arg) {
|
|
@@ -3473,11 +3469,11 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
3473
3469
|
return;
|
|
3474
3470
|
}
|
|
3475
3471
|
const runQuickPick = promise => {
|
|
3476
|
-
this._showQuickPick(promise || this.getActiveTasks(), ( localize(
|
|
3477
|
-
label: ( localize(
|
|
3472
|
+
this._showQuickPick(promise || this.getActiveTasks(), ( localize(12661, "Select a task to terminate")), {
|
|
3473
|
+
label: ( localize(12662, "No task is currently running")),
|
|
3478
3474
|
task: undefined
|
|
3479
3475
|
}, false, true, undefined, [{
|
|
3480
|
-
label: ( localize(
|
|
3476
|
+
label: ( localize(12663, "All Running Tasks")),
|
|
3481
3477
|
id: "terminateAll",
|
|
3482
3478
|
task: undefined
|
|
3483
3479
|
}]).then(entry => {
|
|
@@ -3518,11 +3514,11 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
3518
3514
|
}
|
|
3519
3515
|
if (response.code && response.code === TerminateResponseCode.ProcessNotFound) {
|
|
3520
3516
|
this._notificationService.error(( localize(
|
|
3521
|
-
|
|
3517
|
+
12664,
|
|
3522
3518
|
"The launched process doesn't exist anymore. If the task spawned background tasks exiting VS Code might result in orphaned processes."
|
|
3523
3519
|
)));
|
|
3524
3520
|
} else {
|
|
3525
|
-
this._notificationService.error(( localize(
|
|
3521
|
+
this._notificationService.error(( localize(12665, "Failed to terminate running task")));
|
|
3526
3522
|
}
|
|
3527
3523
|
});
|
|
3528
3524
|
}
|
|
@@ -3545,8 +3541,8 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
3545
3541
|
}
|
|
3546
3542
|
}
|
|
3547
3543
|
}
|
|
3548
|
-
const entry = await this._showQuickPick(activeTasks, ( localize(
|
|
3549
|
-
label: ( localize(
|
|
3544
|
+
const entry = await this._showQuickPick(activeTasks, ( localize(12666, "Select the task to restart")), {
|
|
3545
|
+
label: ( localize(12667, "No task to restart")),
|
|
3550
3546
|
task: null
|
|
3551
3547
|
}, false, true);
|
|
3552
3548
|
if (entry && entry.task) {
|
|
@@ -3561,7 +3557,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
3561
3557
|
async _runRerunAllRunningTasksCommand() {
|
|
3562
3558
|
const activeTasks = await this.getActiveTasks();
|
|
3563
3559
|
if (activeTasks.length === 0) {
|
|
3564
|
-
this._notificationService.info(( localize(
|
|
3560
|
+
this._notificationService.info(( localize(12668, "No running tasks to restart")));
|
|
3565
3561
|
return;
|
|
3566
3562
|
}
|
|
3567
3563
|
const restartPromises = ( activeTasks.map(task => this._restart(task)));
|
|
@@ -3604,7 +3600,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
3604
3600
|
let content;
|
|
3605
3601
|
if (!tasksExistInFile) {
|
|
3606
3602
|
const pickTemplateResult = await this._quickInputService.pick(getTemplates(), {
|
|
3607
|
-
placeHolder: ( localize(
|
|
3603
|
+
placeHolder: ( localize(12669, "Select a Task Template"))
|
|
3608
3604
|
});
|
|
3609
3605
|
if (!pickTemplateResult) {
|
|
3610
3606
|
return Promise.resolve(undefined);
|
|
@@ -3687,7 +3683,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
3687
3683
|
getTaskDescription(task) {
|
|
3688
3684
|
let description;
|
|
3689
3685
|
if (task._source.kind === TaskSourceKind.User) {
|
|
3690
|
-
description = ( localize(
|
|
3686
|
+
description = ( localize(12670, "User"));
|
|
3691
3687
|
} else if (task._source.kind === TaskSourceKind.WorkspaceFile) {
|
|
3692
3688
|
description = task.getWorkspaceFileName();
|
|
3693
3689
|
} else if (this.needsFolderQualification()) {
|
|
@@ -3711,8 +3707,8 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
3711
3707
|
const stats = ( this._contextService.getWorkspace().folders.map(folder => {
|
|
3712
3708
|
return this._fileService.stat(folder.toResource(".vscode/tasks.json")).then(stat => stat, () => undefined);
|
|
3713
3709
|
}));
|
|
3714
|
-
const createLabel = ( localize(
|
|
3715
|
-
const openLabel = ( localize(
|
|
3710
|
+
const createLabel = ( localize(12671, "Create tasks.json file from template"));
|
|
3711
|
+
const openLabel = ( localize(12672, "Open tasks.json file"));
|
|
3716
3712
|
const tokenSource = ( new CancellationTokenSource());
|
|
3717
3713
|
const cancellationToken = tokenSource.token;
|
|
3718
3714
|
const entries = Promise.all(stats).then(stats => {
|
|
@@ -3775,7 +3771,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
3775
3771
|
return resolvedEntries;
|
|
3776
3772
|
});
|
|
3777
3773
|
this._quickInputService.pick(entriesWithSettings, {
|
|
3778
|
-
placeHolder: ( localize(
|
|
3774
|
+
placeHolder: ( localize(12673, "Select a task to configure"))
|
|
3779
3775
|
}, cancellationToken).then(async selection => {
|
|
3780
3776
|
if (cancellationToken.isCancellationRequested) {
|
|
3781
3777
|
const task = (await entries)[0];
|
|
@@ -3818,7 +3814,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
3818
3814
|
for (const task of tasks) {
|
|
3819
3815
|
if (task === defaultBuildTask) {
|
|
3820
3816
|
const label = ( localize(
|
|
3821
|
-
|
|
3817
|
+
12674,
|
|
3822
3818
|
"{0} is already marked as the default build task",
|
|
3823
3819
|
TaskQuickPick.getTaskLabelWithIcon(task, task.getQualifiedLabel())
|
|
3824
3820
|
));
|
|
@@ -3847,7 +3843,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
3847
3843
|
const tokenSource = ( new CancellationTokenSource());
|
|
3848
3844
|
const cancellationToken = tokenSource.token;
|
|
3849
3845
|
this._quickInputService.pick(entries, {
|
|
3850
|
-
placeHolder: ( localize(
|
|
3846
|
+
placeHolder: ( localize(12673, "Select a task to configure"))
|
|
3851
3847
|
}, cancellationToken).then(async entry => {
|
|
3852
3848
|
if (cancellationToken.isCancellationRequested) {
|
|
3853
3849
|
const task = (await entries)[0];
|
|
@@ -3855,7 +3851,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
3855
3851
|
entry = task;
|
|
3856
3852
|
}
|
|
3857
3853
|
}
|
|
3858
|
-
const task = entry && "task"
|
|
3854
|
+
const task = entry && Object.hasOwn(entry, "task") ? entry.task : undefined;
|
|
3859
3855
|
if ((task === undefined) || (task === null)) {
|
|
3860
3856
|
return;
|
|
3861
3857
|
}
|
|
@@ -3878,9 +3874,9 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
3878
3874
|
}
|
|
3879
3875
|
});
|
|
3880
3876
|
this._quickInputService.pick(entries, {
|
|
3881
|
-
placeHolder: ( localize(
|
|
3877
|
+
placeHolder: ( localize(12675, "Select the task to be used as the default build task"))
|
|
3882
3878
|
}).then(entry => {
|
|
3883
|
-
const task = entry && "task"
|
|
3879
|
+
const task = entry && Object.hasOwn(entry, "task") ? entry.task : undefined;
|
|
3884
3880
|
if ((task === undefined) || (task === null)) {
|
|
3885
3881
|
return;
|
|
3886
3882
|
}
|
|
@@ -3927,7 +3923,7 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
3927
3923
|
if (selectedTask) {
|
|
3928
3924
|
selectedEntry = {
|
|
3929
3925
|
label: ( localize(
|
|
3930
|
-
|
|
3926
|
+
12676,
|
|
3931
3927
|
"{0} is already marked as the default test task.",
|
|
3932
3928
|
selectedTask.getQualifiedLabel()
|
|
3933
3929
|
)),
|
|
@@ -3936,8 +3932,8 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
3936
3932
|
};
|
|
3937
3933
|
}
|
|
3938
3934
|
this._showIgnoredFoldersMessage().then(() => {
|
|
3939
|
-
this._showQuickPick(tasks, ( localize(
|
|
3940
|
-
const task = entry ? entry.task : undefined;
|
|
3935
|
+
this._showQuickPick(tasks, ( localize(12677, "Select the task to be used as the default test task")), undefined, true, false, selectedEntry).then(entry => {
|
|
3936
|
+
const task = entry && Object.hasOwn(entry, "task") ? entry.task : undefined;
|
|
3941
3937
|
if (!task) {
|
|
3942
3938
|
return;
|
|
3943
3939
|
}
|
|
@@ -3982,8 +3978,8 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
3982
3978
|
})) {
|
|
3983
3979
|
this._taskSystem.revealTask(activeTasks[0]);
|
|
3984
3980
|
} else {
|
|
3985
|
-
this._showQuickPick(activeTasksPromise, ( localize(
|
|
3986
|
-
label: ( localize(
|
|
3981
|
+
this._showQuickPick(activeTasksPromise, ( localize(12678, "Select the task to show its output")), {
|
|
3982
|
+
label: ( localize(12679, "No task is running")),
|
|
3987
3983
|
task: null
|
|
3988
3984
|
}, false, true).then(entry => {
|
|
3989
3985
|
const task = entry ? entry.task : undefined;
|
|
@@ -4135,13 +4131,13 @@ let AbstractTaskService = class AbstractTaskService extends Disposable {
|
|
|
4135
4131
|
}
|
|
4136
4132
|
this._updateSetup();
|
|
4137
4133
|
this._notificationService.prompt(Severity.Warning, fileDiffs.length === 1 ? ( localize(
|
|
4138
|
-
|
|
4134
|
+
12680,
|
|
4139
4135
|
"The deprecated tasks version 0.1.0 has been removed. Your tasks have been upgraded to version 2.0.0. Open the diff to review the upgrade."
|
|
4140
4136
|
)) : ( localize(
|
|
4141
|
-
|
|
4137
|
+
12681,
|
|
4142
4138
|
"The deprecated tasks version 0.1.0 has been removed. Your tasks have been upgraded to version 2.0.0. Open the diffs to review the upgrade."
|
|
4143
4139
|
)), [{
|
|
4144
|
-
label: fileDiffs.length === 1 ? ( localize(
|
|
4140
|
+
label: fileDiffs.length === 1 ? ( localize(12682, "Open diff")) : ( localize(12683, "Open diffs")),
|
|
4145
4141
|
run: async () => {
|
|
4146
4142
|
for (const upgrade of fileDiffs) {
|
|
4147
4143
|
await this._editorService.openEditor({
|