@codingame/monaco-vscode-task-service-override 3.2.3 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. package/package.json +2 -2
  2. package/task.js +2 -2
  3. package/external/tslib/tslib.es6.js +0 -11
  4. package/override/vs/platform/dialogs/common/dialogs.js +0 -8
  5. package/vscode/src/vs/base/common/parsers.js +0 -44
  6. package/vscode/src/vs/workbench/contrib/tasks/browser/abstractTaskService.js +0 -3855
  7. package/vscode/src/vs/workbench/contrib/tasks/browser/runAutomaticTasks.js +0 -185
  8. package/vscode/src/vs/workbench/contrib/tasks/browser/task.contribution.js +0 -684
  9. package/vscode/src/vs/workbench/contrib/tasks/browser/taskQuickPick.js +0 -452
  10. package/vscode/src/vs/workbench/contrib/tasks/browser/taskService.js +0 -36
  11. package/vscode/src/vs/workbench/contrib/tasks/browser/taskTerminalStatus.js +0 -191
  12. package/vscode/src/vs/workbench/contrib/tasks/browser/tasksQuickAccess.js +0 -121
  13. package/vscode/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.js +0 -1713
  14. package/vscode/src/vs/workbench/contrib/tasks/common/jsonSchemaCommon.js +0 -440
  15. package/vscode/src/vs/workbench/contrib/tasks/common/jsonSchema_v1.js +0 -125
  16. package/vscode/src/vs/workbench/contrib/tasks/common/jsonSchema_v2.js +0 -901
  17. package/vscode/src/vs/workbench/contrib/tasks/common/problemCollectors.js +0 -465
  18. package/vscode/src/vs/workbench/contrib/tasks/common/problemMatcher.js +0 -1796
  19. package/vscode/src/vs/workbench/contrib/tasks/common/taskConfiguration.js +0 -1581
  20. package/vscode/src/vs/workbench/contrib/tasks/common/taskSystem.js +0 -15
  21. package/vscode/src/vs/workbench/contrib/tasks/common/taskTemplates.js +0 -145
  22. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalEscapeSequences.js +0 -13
@@ -1,185 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
- import { localizeWithPath } from 'vscode/vscode/vs/nls';
3
- import { joinPath } from 'vscode/vscode/vs/base/common/resources';
4
- import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
5
- import { ITaskService } from 'vscode/vscode/vs/workbench/contrib/tasks/common/taskService';
6
- import { TASKS_CATEGORY, TaskSourceKind, RunOnOptions } from 'vscode/vscode/vs/workbench/contrib/tasks/common/tasks';
7
- import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput';
8
- import { Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
9
- import { IWorkspaceTrustManagementService } from 'vscode/vscode/vs/platform/workspace/common/workspaceTrust';
10
- import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
11
- import { Event } from 'vscode/vscode/vs/base/common/event';
12
- import { ILogService } from 'vscode/vscode/vs/platform/log/common/log';
13
-
14
- const ALLOW_AUTOMATIC_TASKS = 'task.allowAutomaticTasks';
15
- let RunAutomaticTasks = class RunAutomaticTasks extends Disposable {
16
- constructor(_taskService, _configurationService, _workspaceTrustManagementService, _logService) {
17
- super();
18
- this._taskService = _taskService;
19
- this._configurationService = _configurationService;
20
- this._workspaceTrustManagementService = _workspaceTrustManagementService;
21
- this._logService = _logService;
22
- this._hasRunTasks = false;
23
- if (this._taskService.isReconnected) {
24
- this._tryRunTasks();
25
- }
26
- else {
27
- this._register(Event.once(this._taskService.onDidReconnectToTasks)(async () => await this._tryRunTasks()));
28
- }
29
- this._register(this._workspaceTrustManagementService.onDidChangeTrust(async () => await this._tryRunTasks()));
30
- }
31
- async _tryRunTasks() {
32
- if (!this._workspaceTrustManagementService.isWorkspaceTrusted()) {
33
- return;
34
- }
35
- if (this._hasRunTasks || this._configurationService.getValue(ALLOW_AUTOMATIC_TASKS) === 'off') {
36
- return;
37
- }
38
- this._hasRunTasks = true;
39
- this._logService.trace('RunAutomaticTasks: Trying to run tasks.');
40
- if (!this._taskService.hasTaskSystemInfo) {
41
- this._logService.trace('RunAutomaticTasks: Awaiting task system info.');
42
- await Event.toPromise(Event.once(this._taskService.onDidChangeTaskSystemInfo));
43
- }
44
- let workspaceTasks = await this._taskService.getWorkspaceTasks(2 );
45
- this._logService.trace(`RunAutomaticTasks: Found ${workspaceTasks.size} automatic tasks`);
46
- let autoTasks = this._findAutoTasks(this._taskService, workspaceTasks);
47
- this._logService.trace(`RunAutomaticTasks: taskNames=${JSON.stringify(autoTasks.taskNames)}`);
48
- if (autoTasks.taskNames.length === 0) {
49
- const updatedWithinTimeout = await Promise.race([
50
- ( new Promise((resolve) => {
51
- Event.toPromise(Event.once(this._taskService.onDidChangeTaskConfig)).then(() => resolve(true));
52
- })),
53
- ( new Promise((resolve) => {
54
- const timer = setTimeout(() => { clearTimeout(timer); resolve(false); }, 10000);
55
- }))
56
- ]);
57
- if (!updatedWithinTimeout) {
58
- this._logService.trace(`RunAutomaticTasks: waited some extra time, but no update of tasks configuration`);
59
- return;
60
- }
61
- workspaceTasks = await this._taskService.getWorkspaceTasks(2 );
62
- autoTasks = this._findAutoTasks(this._taskService, workspaceTasks);
63
- this._logService.trace(`RunAutomaticTasks: updated taskNames=${JSON.stringify(autoTasks.taskNames)}`);
64
- }
65
- this._runWithPermission(this._taskService, this._configurationService, autoTasks.tasks, autoTasks.taskNames);
66
- }
67
- _runTasks(taskService, tasks) {
68
- tasks.forEach(task => {
69
- if (task instanceof Promise) {
70
- task.then(promiseResult => {
71
- if (promiseResult) {
72
- taskService.run(promiseResult);
73
- }
74
- });
75
- }
76
- else {
77
- taskService.run(task);
78
- }
79
- });
80
- }
81
- _getTaskSource(source) {
82
- const taskKind = TaskSourceKind.toConfigurationTarget(source.kind);
83
- switch (taskKind) {
84
- case 6 : {
85
- return joinPath(source.config.workspaceFolder.uri, source.config.file);
86
- }
87
- case 5 : {
88
- return source.config.workspace?.configuration ?? undefined;
89
- }
90
- }
91
- return undefined;
92
- }
93
- _findAutoTasks(taskService, workspaceTaskResult) {
94
- const tasks = ( new Array());
95
- const taskNames = ( new Array());
96
- const locations = ( new Map());
97
- if (workspaceTaskResult) {
98
- workspaceTaskResult.forEach(resultElement => {
99
- if (resultElement.set) {
100
- resultElement.set.tasks.forEach(task => {
101
- if (task.runOptions.runOn === RunOnOptions.folderOpen) {
102
- tasks.push(task);
103
- taskNames.push(task._label);
104
- const location = this._getTaskSource(task._source);
105
- if (location) {
106
- locations.set(location.fsPath, location);
107
- }
108
- }
109
- });
110
- }
111
- if (resultElement.configurations) {
112
- for (const configuredTask of ( Object.values(resultElement.configurations.byIdentifier))) {
113
- if (configuredTask.runOptions.runOn === RunOnOptions.folderOpen) {
114
- tasks.push(( new Promise(resolve => {
115
- taskService.getTask(resultElement.workspaceFolder, configuredTask._id, true).then(task => resolve(task));
116
- })));
117
- if (configuredTask._label) {
118
- taskNames.push(configuredTask._label);
119
- }
120
- else {
121
- taskNames.push(configuredTask.configures.task);
122
- }
123
- const location = this._getTaskSource(configuredTask._source);
124
- if (location) {
125
- locations.set(location.fsPath, location);
126
- }
127
- }
128
- }
129
- }
130
- });
131
- }
132
- return { tasks, taskNames, locations };
133
- }
134
- async _runWithPermission(taskService, configurationService, tasks, taskNames) {
135
- if (taskNames.length === 0) {
136
- return;
137
- }
138
- if (configurationService.getValue(ALLOW_AUTOMATIC_TASKS) === 'off') {
139
- return;
140
- }
141
- this._runTasks(taskService, tasks);
142
- }
143
- };
144
- RunAutomaticTasks = ( __decorate([
145
- ( __param(0, ITaskService)),
146
- ( __param(1, IConfigurationService)),
147
- ( __param(2, IWorkspaceTrustManagementService)),
148
- ( __param(3, ILogService))
149
- ], RunAutomaticTasks));
150
- class ManageAutomaticTaskRunning extends Action2 {
151
- static { this.ID = 'workbench.action.tasks.manageAutomaticRunning'; }
152
- static { this.LABEL = ( localizeWithPath(
153
- 'vs/workbench/contrib/tasks/browser/runAutomaticTasks',
154
- 'workbench.action.tasks.manageAutomaticRunning',
155
- "Manage Automatic Tasks"
156
- )); }
157
- constructor() {
158
- super({
159
- id: ManageAutomaticTaskRunning.ID,
160
- title: ManageAutomaticTaskRunning.LABEL,
161
- category: TASKS_CATEGORY
162
- });
163
- }
164
- async run(accessor) {
165
- const quickInputService = accessor.get(IQuickInputService);
166
- const configurationService = accessor.get(IConfigurationService);
167
- const allowItem = { label: ( localizeWithPath(
168
- 'vs/workbench/contrib/tasks/browser/runAutomaticTasks',
169
- 'workbench.action.tasks.allowAutomaticTasks',
170
- "Allow Automatic Tasks"
171
- )) };
172
- const disallowItem = { label: ( localizeWithPath(
173
- 'vs/workbench/contrib/tasks/browser/runAutomaticTasks',
174
- 'workbench.action.tasks.disallowAutomaticTasks',
175
- "Disallow Automatic Tasks"
176
- )) };
177
- const value = await quickInputService.pick([allowItem, disallowItem], { canPickMany: false });
178
- if (!value) {
179
- return;
180
- }
181
- configurationService.updateValue(ALLOW_AUTOMATIC_TASKS, value === allowItem ? 'on' : 'off', 2 );
182
- }
183
- }
184
-
185
- export { ManageAutomaticTaskRunning, RunAutomaticTasks };