@codingame/monaco-vscode-api 1.85.1 → 1.85.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/README.md +14 -5
  2. package/missing-services.js +305 -63
  3. package/monaco-editor-treemending.patch +946 -946
  4. package/package.json +8 -7
  5. package/service-override/tools/editor.js +1 -1
  6. package/services.js +10 -6
  7. package/vscode/src/vs/base/browser/ui/tree/treeDefaults.js +14 -0
  8. package/vscode/src/vs/platform/extensionManagement/common/extensionEnablementService.js +140 -0
  9. package/vscode/src/vs/platform/extensions/common/extensions.d.ts +1062 -93
  10. package/vscode/src/vs/platform/files/common/inMemoryFilesystemProvider.js +220 -0
  11. package/vscode/src/vs/platform/quickinput/browser/quickPickPin.js +102 -0
  12. package/vscode/src/vs/platform/userDataSync/common/content.js +9 -0
  13. package/vscode/src/vs/platform/userDataSync/common/settingsMerge.js +514 -0
  14. package/vscode/src/vs/platform/userDataSync/common/userDataSync.js +154 -2
  15. package/vscode/src/vs/platform/userDataSync/common/userDataSyncAccount.js +43 -1
  16. package/vscode/src/vs/platform/userDataSync/common/userDataSyncMachines.js +177 -0
  17. package/vscode/src/vs/workbench/api/common/extHostApiCommands.js +1 -1
  18. package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +1 -1
  19. package/vscode/src/vs/workbench/api/common/extHostWebview.js +2 -2
  20. package/vscode/src/vs/workbench/browser/parts/views/checkbox.js +105 -0
  21. package/vscode/src/vs/workbench/browser/parts/views/media/views.css.js +4 -0
  22. package/vscode/src/vs/workbench/browser/parts/views/treeView.js +1614 -0
  23. package/vscode/src/vs/workbench/contrib/codeEditor/browser/languageConfigurationExtensionPoint.js +7 -7
  24. package/vscode/src/vs/workbench/contrib/files/browser/explorerViewlet.js +73 -2
  25. package/vscode/src/vs/workbench/contrib/tasks/common/taskDefinitionRegistry.js +6 -6
  26. package/vscode/src/vs/workbench/contrib/tasks/common/taskService.js +12 -2
  27. package/vscode/src/vs/workbench/contrib/tasks/common/tasks.js +712 -0
  28. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessExtHostProxy.js +130 -0
  29. package/vscode/src/vs/workbench/services/authentication/browser/authenticationService.js +20 -1
  30. package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverSchema.js +205 -0
  31. package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverUtils.js +11 -0
  32. package/vscode/src/vs/workbench/services/configurationResolver/common/variableResolver.js +9 -9
  33. package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionBisect.js +1 -1
  34. package/vscode/src/vs/workbench/services/keybinding/common/keybindingEditing.js +2 -2
  35. package/vscode/src/vs/workbench/services/languageStatus/common/languageStatusService.js +24 -1
  36. package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorInput.js +41 -0
  37. package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorModel.js +588 -0
  38. package/vscode/src/vs/workbench/services/preferences/common/preferencesEditorInput.js +43 -0
  39. package/vscode/src/vs/workbench/services/search/common/search.js +3 -3
  40. package/vscode/src/vs/workbench/services/terminal/common/embedderTerminalService.js +75 -1
  41. package/vscode/src/vs/workbench/services/timer/browser/timerService.js +240 -1
  42. package/vscode/src/vs/workbench/services/userData/browser/userDataInit.js +31 -1
  43. package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfile.js +25 -1
  44. package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfileIcons.js +75 -1
  45. package/vscode/src/vs/workbench/services/userDataSync/common/userDataSync.js +74 -4
  46. package/vscode/src/vs/base/parts/request/browser/request.js +0 -60
  47. package/vscode/src/vs/platform/request/browser/requestService.js +0 -28
  48. package/vscode/src/vs/platform/request/common/requestIpc.js +0 -17
  49. package/vscode/src/vs/platform/url/common/urlService.js +0 -17
  50. package/vscode/src/vs/workbench/services/configuration/common/jsonEditingService.js +0 -120
  51. package/vscode/src/vs/workbench/services/decorations/browser/decorationsService.js +0 -319
  52. package/vscode/src/vs/workbench/services/files/browser/elevatedFileService.js +0 -9
  53. package/vscode/src/vs/workbench/services/host/browser/browserHostService.js +0 -408
  54. package/vscode/src/vs/workbench/services/request/browser/requestService.js +0 -48
  55. package/vscode/src/vs/workbench/services/textfile/browser/browserTextFileService.js +0 -56
  56. package/vscode/src/vs/workbench/services/textfile/browser/textFileService.js +0 -639
  57. package/vscode/src/vs/workbench/services/textfile/common/textFileEditorModelManager.js +0 -402
  58. package/vscode/src/vs/workbench/services/textfile/common/textFileSaveParticipant.js +0 -62
  59. package/vscode/src/vs/workbench/services/themes/browser/browserHostColorSchemeService.js +0 -38
  60. package/vscode/src/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.js +0 -295
  61. package/vscode/src/vs/workbench/services/url/browser/urlService.js +0 -47
  62. package/vscode/src/vs/workbench/services/views/common/treeViewsService.js +0 -20
  63. package/vscode/src/vs/workbench/services/workspaces/common/canonicalUriService.js +0 -19
@@ -0,0 +1,712 @@
1
+ import * as nls from 'monaco-editor/esm/vs/nls.js';
2
+ import * as Types from 'monaco-editor/esm/vs/base/common/types.js';
3
+ import * as resources from 'monaco-editor/esm/vs/base/common/resources.js';
4
+ import * as Objects from 'monaco-editor/esm/vs/base/common/objects.js';
5
+ import { RawContextKey } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
6
+ import { TaskDefinitionRegistry } from './taskDefinitionRegistry.js';
7
+ const USER_TASKS_GROUP_KEY = 'settings';
8
+ const TASK_RUNNING_STATE = ( new RawContextKey('taskRunning', false, ( nls.localizeWithPath(
9
+ 'vs/workbench/contrib/tasks/common/tasks',
10
+ 'tasks.taskRunningContext',
11
+ "Whether a task is currently running."
12
+ ))));
13
+ const TASKS_CATEGORY = { value: ( nls.localizeWithPath('vs/workbench/contrib/tasks/common/tasks', 'tasksCategory', "Tasks")), original: 'Tasks' };
14
+ var ShellQuoting;
15
+ ( (function(ShellQuoting) {
16
+ ShellQuoting[ShellQuoting["Escape"] = 1] = "Escape";
17
+ ShellQuoting[ShellQuoting["Strong"] = 2] = "Strong";
18
+ ShellQuoting[ShellQuoting["Weak"] = 3] = "Weak";
19
+ })(ShellQuoting || (ShellQuoting = {})));
20
+ const CUSTOMIZED_TASK_TYPE = '$customized';
21
+ ( (function(ShellQuoting) {
22
+ function from(value) {
23
+ if (!value) {
24
+ return ShellQuoting.Strong;
25
+ }
26
+ switch (value.toLowerCase()) {
27
+ case 'escape':
28
+ return ShellQuoting.Escape;
29
+ case 'strong':
30
+ return ShellQuoting.Strong;
31
+ case 'weak':
32
+ return ShellQuoting.Weak;
33
+ default:
34
+ return ShellQuoting.Strong;
35
+ }
36
+ }
37
+ ShellQuoting.from = from;
38
+ })(ShellQuoting || (ShellQuoting = {})));
39
+ var CommandOptions;
40
+ ( (function(CommandOptions) {
41
+ CommandOptions.defaults = { cwd: '${workspaceFolder}' };
42
+ })(CommandOptions || (CommandOptions = {})));
43
+ var RevealKind;
44
+ ( (function(RevealKind) {
45
+ RevealKind[RevealKind["Always"] = 1] = "Always";
46
+ RevealKind[RevealKind["Silent"] = 2] = "Silent";
47
+ RevealKind[RevealKind["Never"] = 3] = "Never";
48
+ })(RevealKind || (RevealKind = {})));
49
+ ( (function(RevealKind) {
50
+ function fromString(value) {
51
+ switch (value.toLowerCase()) {
52
+ case 'always':
53
+ return RevealKind.Always;
54
+ case 'silent':
55
+ return RevealKind.Silent;
56
+ case 'never':
57
+ return RevealKind.Never;
58
+ default:
59
+ return RevealKind.Always;
60
+ }
61
+ }
62
+ RevealKind.fromString = fromString;
63
+ })(RevealKind || (RevealKind = {})));
64
+ var RevealProblemKind;
65
+ ( (function(RevealProblemKind) {
66
+ RevealProblemKind[RevealProblemKind["Never"] = 1] = "Never";
67
+ RevealProblemKind[RevealProblemKind["OnProblem"] = 2] = "OnProblem";
68
+ RevealProblemKind[RevealProblemKind["Always"] = 3] = "Always";
69
+ })(RevealProblemKind || (RevealProblemKind = {})));
70
+ ( (function(RevealProblemKind) {
71
+ function fromString(value) {
72
+ switch (value.toLowerCase()) {
73
+ case 'always':
74
+ return RevealProblemKind.Always;
75
+ case 'never':
76
+ return RevealProblemKind.Never;
77
+ case 'onproblem':
78
+ return RevealProblemKind.OnProblem;
79
+ default:
80
+ return RevealProblemKind.OnProblem;
81
+ }
82
+ }
83
+ RevealProblemKind.fromString = fromString;
84
+ })(RevealProblemKind || (RevealProblemKind = {})));
85
+ var PanelKind;
86
+ ( (function(PanelKind) {
87
+ PanelKind[PanelKind["Shared"] = 1] = "Shared";
88
+ PanelKind[PanelKind["Dedicated"] = 2] = "Dedicated";
89
+ PanelKind[PanelKind["New"] = 3] = "New";
90
+ })(PanelKind || (PanelKind = {})));
91
+ ( (function(PanelKind) {
92
+ function fromString(value) {
93
+ switch (value.toLowerCase()) {
94
+ case 'shared':
95
+ return PanelKind.Shared;
96
+ case 'dedicated':
97
+ return PanelKind.Dedicated;
98
+ case 'new':
99
+ return PanelKind.New;
100
+ default:
101
+ return PanelKind.Shared;
102
+ }
103
+ }
104
+ PanelKind.fromString = fromString;
105
+ })(PanelKind || (PanelKind = {})));
106
+ var PresentationOptions;
107
+ ( (function(PresentationOptions) {
108
+ PresentationOptions.defaults = {
109
+ echo: true, reveal: RevealKind.Always, revealProblems: RevealProblemKind.Never, focus: false, panel: PanelKind.Shared, showReuseMessage: true, clear: false
110
+ };
111
+ })(PresentationOptions || (PresentationOptions = {})));
112
+ var RuntimeType;
113
+ ( (function(RuntimeType) {
114
+ RuntimeType[RuntimeType["Shell"] = 1] = "Shell";
115
+ RuntimeType[RuntimeType["Process"] = 2] = "Process";
116
+ RuntimeType[RuntimeType["CustomExecution"] = 3] = "CustomExecution";
117
+ })(RuntimeType || (RuntimeType = {})));
118
+ ( (function(RuntimeType) {
119
+ function fromString(value) {
120
+ switch (value.toLowerCase()) {
121
+ case 'shell':
122
+ return RuntimeType.Shell;
123
+ case 'process':
124
+ return RuntimeType.Process;
125
+ case 'customExecution':
126
+ return RuntimeType.CustomExecution;
127
+ default:
128
+ return RuntimeType.Process;
129
+ }
130
+ }
131
+ RuntimeType.fromString = fromString;
132
+ function toString(value) {
133
+ switch (value) {
134
+ case RuntimeType.Shell: return 'shell';
135
+ case RuntimeType.Process: return 'process';
136
+ case RuntimeType.CustomExecution: return 'customExecution';
137
+ default: return 'process';
138
+ }
139
+ }
140
+ RuntimeType.toString = toString;
141
+ })(RuntimeType || (RuntimeType = {})));
142
+ var CommandString;
143
+ ( (function(CommandString) {
144
+ function value(value) {
145
+ if (Types.isString(value)) {
146
+ return value;
147
+ }
148
+ else {
149
+ return value.value;
150
+ }
151
+ }
152
+ CommandString.value = value;
153
+ })(CommandString || (CommandString = {})));
154
+ var TaskGroup;
155
+ ( (function(TaskGroup) {
156
+ TaskGroup.Clean = { _id: 'clean', isDefault: false };
157
+ TaskGroup.Build = { _id: 'build', isDefault: false };
158
+ TaskGroup.Rebuild = { _id: 'rebuild', isDefault: false };
159
+ TaskGroup.Test = { _id: 'test', isDefault: false };
160
+ function is(value) {
161
+ return value === TaskGroup.Clean._id || value === TaskGroup.Build._id || value === TaskGroup.Rebuild._id || value === TaskGroup.Test._id;
162
+ }
163
+ TaskGroup.is = is;
164
+ function from(value) {
165
+ if (value === undefined) {
166
+ return undefined;
167
+ }
168
+ else if (Types.isString(value)) {
169
+ if (is(value)) {
170
+ return { _id: value, isDefault: false };
171
+ }
172
+ return undefined;
173
+ }
174
+ else {
175
+ return value;
176
+ }
177
+ }
178
+ TaskGroup.from = from;
179
+ })(TaskGroup || (TaskGroup = {})));
180
+ var TaskSourceKind;
181
+ ( (function(TaskSourceKind) {
182
+ TaskSourceKind.Workspace = 'workspace';
183
+ TaskSourceKind.Extension = 'extension';
184
+ TaskSourceKind.InMemory = 'inMemory';
185
+ TaskSourceKind.WorkspaceFile = 'workspaceFile';
186
+ TaskSourceKind.User = 'user';
187
+ function toConfigurationTarget(kind) {
188
+ switch (kind) {
189
+ case TaskSourceKind.User: return 2 ;
190
+ case TaskSourceKind.WorkspaceFile: return 5 ;
191
+ default: return 6 ;
192
+ }
193
+ }
194
+ TaskSourceKind.toConfigurationTarget = toConfigurationTarget;
195
+ })(TaskSourceKind || (TaskSourceKind = {})));
196
+ var RunOnOptions;
197
+ ( (function(RunOnOptions) {
198
+ RunOnOptions[RunOnOptions["default"] = 1] = "default";
199
+ RunOnOptions[RunOnOptions["folderOpen"] = 2] = "folderOpen";
200
+ })(RunOnOptions || (RunOnOptions = {})));
201
+ var RunOptions;
202
+ ( (function(RunOptions) {
203
+ RunOptions.defaults = { reevaluateOnRerun: true, runOn: RunOnOptions.default, instanceLimit: 1 };
204
+ })(RunOptions || (RunOptions = {})));
205
+ class CommonTask {
206
+ constructor(id, label, type, runOptions, configurationProperties, source) {
207
+ this._label = '';
208
+ this._id = id;
209
+ if (label) {
210
+ this._label = label;
211
+ }
212
+ if (type) {
213
+ this.type = type;
214
+ }
215
+ this.runOptions = runOptions;
216
+ this.configurationProperties = configurationProperties;
217
+ this._source = source;
218
+ }
219
+ getDefinition(useSource) {
220
+ return undefined;
221
+ }
222
+ getMapKey() {
223
+ return this._id;
224
+ }
225
+ getKey() {
226
+ return undefined;
227
+ }
228
+ getCommonTaskId() {
229
+ const key = { folder: this.getFolderId(), id: this._id };
230
+ return JSON.stringify(key);
231
+ }
232
+ clone() {
233
+ return this.fromObject(Object.assign({}, this));
234
+ }
235
+ getWorkspaceFolder() {
236
+ return undefined;
237
+ }
238
+ getWorkspaceFileName() {
239
+ return undefined;
240
+ }
241
+ getTelemetryKind() {
242
+ return 'unknown';
243
+ }
244
+ matches(key, compareId = false) {
245
+ if (key === undefined) {
246
+ return false;
247
+ }
248
+ if (Types.isString(key)) {
249
+ return key === this._label || key === this.configurationProperties.identifier || (compareId && key === this._id);
250
+ }
251
+ const identifier = this.getDefinition(true);
252
+ return identifier !== undefined && identifier._key === key._key;
253
+ }
254
+ getQualifiedLabel() {
255
+ const workspaceFolder = this.getWorkspaceFolder();
256
+ if (workspaceFolder) {
257
+ return `${this._label} (${workspaceFolder.name})`;
258
+ }
259
+ else {
260
+ return this._label;
261
+ }
262
+ }
263
+ getTaskExecution() {
264
+ const result = {
265
+ id: this._id,
266
+ task: this
267
+ };
268
+ return result;
269
+ }
270
+ addTaskLoadMessages(messages) {
271
+ if (this._taskLoadMessages === undefined) {
272
+ this._taskLoadMessages = [];
273
+ }
274
+ if (messages) {
275
+ this._taskLoadMessages = this._taskLoadMessages.concat(messages);
276
+ }
277
+ }
278
+ get taskLoadMessages() {
279
+ return this._taskLoadMessages;
280
+ }
281
+ }
282
+ class CustomTask extends CommonTask {
283
+ constructor(id, source, label, type, command, hasDefinedMatchers, runOptions, configurationProperties) {
284
+ super(id, label, undefined, runOptions, configurationProperties, source);
285
+ this.command = {};
286
+ this._source = source;
287
+ this.hasDefinedMatchers = hasDefinedMatchers;
288
+ if (command) {
289
+ this.command = command;
290
+ }
291
+ }
292
+ clone() {
293
+ return ( new CustomTask(
294
+ this._id,
295
+ this._source,
296
+ this._label,
297
+ this.type,
298
+ this.command,
299
+ this.hasDefinedMatchers,
300
+ this.runOptions,
301
+ this.configurationProperties
302
+ ));
303
+ }
304
+ customizes() {
305
+ if (this._source && this._source.customizes) {
306
+ return this._source.customizes;
307
+ }
308
+ return undefined;
309
+ }
310
+ getDefinition(useSource = false) {
311
+ if (useSource && this._source.customizes !== undefined) {
312
+ return this._source.customizes;
313
+ }
314
+ else {
315
+ let type;
316
+ const commandRuntime = this.command ? this.command.runtime : undefined;
317
+ switch (commandRuntime) {
318
+ case RuntimeType.Shell:
319
+ type = 'shell';
320
+ break;
321
+ case RuntimeType.Process:
322
+ type = 'process';
323
+ break;
324
+ case RuntimeType.CustomExecution:
325
+ type = 'customExecution';
326
+ break;
327
+ case undefined:
328
+ type = '$composite';
329
+ break;
330
+ default:
331
+ throw new Error('Unexpected task runtime');
332
+ }
333
+ const result = {
334
+ type,
335
+ _key: this._id,
336
+ id: this._id
337
+ };
338
+ return result;
339
+ }
340
+ }
341
+ static is(value) {
342
+ return value instanceof CustomTask;
343
+ }
344
+ getMapKey() {
345
+ const workspaceFolder = this._source.config.workspaceFolder;
346
+ return workspaceFolder ? `${( workspaceFolder.uri.toString())}|${this._id}|${this.instance}` : `${this._id}|${this.instance}`;
347
+ }
348
+ getFolderId() {
349
+ return this._source.kind === TaskSourceKind.User ? USER_TASKS_GROUP_KEY : this._source.config.workspaceFolder?.uri.toString();
350
+ }
351
+ getCommonTaskId() {
352
+ return this._source.customizes ? super.getCommonTaskId() : (this.getKey() ?? super.getCommonTaskId());
353
+ }
354
+ getKey() {
355
+ const workspaceFolder = this.getFolderId();
356
+ if (!workspaceFolder) {
357
+ return undefined;
358
+ }
359
+ let id = this.configurationProperties.identifier;
360
+ if (this._source.kind !== TaskSourceKind.Workspace) {
361
+ id += this._source.kind;
362
+ }
363
+ const key = { type: CUSTOMIZED_TASK_TYPE, folder: workspaceFolder, id };
364
+ return JSON.stringify(key);
365
+ }
366
+ getWorkspaceFolder() {
367
+ return this._source.config.workspaceFolder;
368
+ }
369
+ getWorkspaceFileName() {
370
+ return (this._source.config.workspace && this._source.config.workspace.configuration) ? resources.basename(this._source.config.workspace.configuration) : undefined;
371
+ }
372
+ getTelemetryKind() {
373
+ if (this._source.customizes) {
374
+ return 'workspace>extension';
375
+ }
376
+ else {
377
+ return 'workspace';
378
+ }
379
+ }
380
+ fromObject(object) {
381
+ return ( new CustomTask(
382
+ object._id,
383
+ object._source,
384
+ object._label,
385
+ object.type,
386
+ object.command,
387
+ object.hasDefinedMatchers,
388
+ object.runOptions,
389
+ object.configurationProperties
390
+ ));
391
+ }
392
+ }
393
+ class ConfiguringTask extends CommonTask {
394
+ constructor(id, source, label, type, configures, runOptions, configurationProperties) {
395
+ super(id, label, type, runOptions, configurationProperties, source);
396
+ this._source = source;
397
+ this.configures = configures;
398
+ }
399
+ static is(value) {
400
+ return value instanceof ConfiguringTask;
401
+ }
402
+ fromObject(object) {
403
+ return object;
404
+ }
405
+ getDefinition() {
406
+ return this.configures;
407
+ }
408
+ getWorkspaceFileName() {
409
+ return (this._source.config.workspace && this._source.config.workspace.configuration) ? resources.basename(this._source.config.workspace.configuration) : undefined;
410
+ }
411
+ getWorkspaceFolder() {
412
+ return this._source.config.workspaceFolder;
413
+ }
414
+ getFolderId() {
415
+ return this._source.kind === TaskSourceKind.User ? USER_TASKS_GROUP_KEY : this._source.config.workspaceFolder?.uri.toString();
416
+ }
417
+ getKey() {
418
+ const workspaceFolder = this.getFolderId();
419
+ if (!workspaceFolder) {
420
+ return undefined;
421
+ }
422
+ let id = this.configurationProperties.identifier;
423
+ if (this._source.kind !== TaskSourceKind.Workspace) {
424
+ id += this._source.kind;
425
+ }
426
+ const key = { type: CUSTOMIZED_TASK_TYPE, folder: workspaceFolder, id };
427
+ return JSON.stringify(key);
428
+ }
429
+ }
430
+ class ContributedTask extends CommonTask {
431
+ constructor(id, source, label, type, defines, command, hasDefinedMatchers, runOptions, configurationProperties) {
432
+ super(id, label, type, runOptions, configurationProperties, source);
433
+ this.defines = defines;
434
+ this.hasDefinedMatchers = hasDefinedMatchers;
435
+ this.command = command;
436
+ this.icon = configurationProperties.icon;
437
+ this.hide = configurationProperties.hide;
438
+ }
439
+ clone() {
440
+ return ( new ContributedTask(
441
+ this._id,
442
+ this._source,
443
+ this._label,
444
+ this.type,
445
+ this.defines,
446
+ this.command,
447
+ this.hasDefinedMatchers,
448
+ this.runOptions,
449
+ this.configurationProperties
450
+ ));
451
+ }
452
+ getDefinition() {
453
+ return this.defines;
454
+ }
455
+ static is(value) {
456
+ return value instanceof ContributedTask;
457
+ }
458
+ getMapKey() {
459
+ const workspaceFolder = this._source.workspaceFolder;
460
+ return workspaceFolder
461
+ ? `${( this._source.scope.toString())}|${( workspaceFolder.uri.toString())}|${this._id}|${this.instance}`
462
+ : `${( this._source.scope.toString())}|${this._id}|${this.instance}`;
463
+ }
464
+ getFolderId() {
465
+ if (this._source.scope === 3 && this._source.workspaceFolder) {
466
+ return ( this._source.workspaceFolder.uri.toString());
467
+ }
468
+ return undefined;
469
+ }
470
+ getKey() {
471
+ const key = { type: 'contributed', scope: this._source.scope, id: this._id };
472
+ key.folder = this.getFolderId();
473
+ return JSON.stringify(key);
474
+ }
475
+ getWorkspaceFolder() {
476
+ return this._source.workspaceFolder;
477
+ }
478
+ getTelemetryKind() {
479
+ return 'extension';
480
+ }
481
+ fromObject(object) {
482
+ return ( new ContributedTask(
483
+ object._id,
484
+ object._source,
485
+ object._label,
486
+ object.type,
487
+ object.defines,
488
+ object.command,
489
+ object.hasDefinedMatchers,
490
+ object.runOptions,
491
+ object.configurationProperties
492
+ ));
493
+ }
494
+ }
495
+ class InMemoryTask extends CommonTask {
496
+ constructor(id, source, label, type, runOptions, configurationProperties) {
497
+ super(id, label, type, runOptions, configurationProperties, source);
498
+ this._source = source;
499
+ }
500
+ clone() {
501
+ return ( new InMemoryTask(
502
+ this._id,
503
+ this._source,
504
+ this._label,
505
+ this.type,
506
+ this.runOptions,
507
+ this.configurationProperties
508
+ ));
509
+ }
510
+ static is(value) {
511
+ return value instanceof InMemoryTask;
512
+ }
513
+ getTelemetryKind() {
514
+ return 'composite';
515
+ }
516
+ getMapKey() {
517
+ return `${this._id}|${this.instance}`;
518
+ }
519
+ getFolderId() {
520
+ return undefined;
521
+ }
522
+ fromObject(object) {
523
+ return ( new InMemoryTask(
524
+ object._id,
525
+ object._source,
526
+ object._label,
527
+ object.type,
528
+ object.runOptions,
529
+ object.configurationProperties
530
+ ));
531
+ }
532
+ }
533
+ var ExecutionEngine;
534
+ ( (function(ExecutionEngine) {
535
+ ExecutionEngine[ExecutionEngine["Process"] = 1] = "Process";
536
+ ExecutionEngine[ExecutionEngine["Terminal"] = 2] = "Terminal";
537
+ })(ExecutionEngine || (ExecutionEngine = {})));
538
+ ( (function(ExecutionEngine) {
539
+ ExecutionEngine._default = ExecutionEngine.Terminal;
540
+ })(ExecutionEngine || (ExecutionEngine = {})));
541
+ class TaskSorter {
542
+ constructor(workspaceFolders) {
543
+ this._order = ( new Map());
544
+ for (let i = 0; i < workspaceFolders.length; i++) {
545
+ this._order.set(( workspaceFolders[i].uri.toString()), i);
546
+ }
547
+ }
548
+ compare(a, b) {
549
+ const aw = a.getWorkspaceFolder();
550
+ const bw = b.getWorkspaceFolder();
551
+ if (aw && bw) {
552
+ let ai = this._order.get(( aw.uri.toString()));
553
+ ai = ai === undefined ? 0 : ai + 1;
554
+ let bi = this._order.get(( bw.uri.toString()));
555
+ bi = bi === undefined ? 0 : bi + 1;
556
+ if (ai === bi) {
557
+ return a._label.localeCompare(b._label);
558
+ }
559
+ else {
560
+ return ai - bi;
561
+ }
562
+ }
563
+ else if (!aw && bw) {
564
+ return -1;
565
+ }
566
+ else if (aw && !bw) {
567
+ return +1;
568
+ }
569
+ else {
570
+ return 0;
571
+ }
572
+ }
573
+ }
574
+ var TaskEvent;
575
+ ( (function(TaskEvent) {
576
+ function common(task) {
577
+ return {
578
+ taskId: task._id,
579
+ taskName: task.configurationProperties.name,
580
+ runType: task.configurationProperties.isBackground ? "background" : "singleRun" ,
581
+ group: task.configurationProperties.group,
582
+ __task: task,
583
+ };
584
+ }
585
+ function start(task, terminalId, resolvedVariables) {
586
+ return {
587
+ ...common(task),
588
+ kind: "start" ,
589
+ terminalId,
590
+ resolvedVariables,
591
+ };
592
+ }
593
+ TaskEvent.start = start;
594
+ function processStarted(task, terminalId, processId) {
595
+ return {
596
+ ...common(task),
597
+ kind: "processStarted" ,
598
+ terminalId,
599
+ processId,
600
+ };
601
+ }
602
+ TaskEvent.processStarted = processStarted;
603
+ function processEnded(task, terminalId, exitCode) {
604
+ return {
605
+ ...common(task),
606
+ kind: "processEnded" ,
607
+ terminalId,
608
+ exitCode,
609
+ };
610
+ }
611
+ TaskEvent.processEnded = processEnded;
612
+ function terminated(task, terminalId, exitReason) {
613
+ return {
614
+ ...common(task),
615
+ kind: "terminated" ,
616
+ exitReason,
617
+ terminalId,
618
+ };
619
+ }
620
+ TaskEvent.terminated = terminated;
621
+ function general(kind, task, terminalId) {
622
+ return {
623
+ ...common(task),
624
+ kind,
625
+ terminalId,
626
+ };
627
+ }
628
+ TaskEvent.general = general;
629
+ function changed() {
630
+ return { kind: "changed" };
631
+ }
632
+ TaskEvent.changed = changed;
633
+ })(TaskEvent || (TaskEvent = {})));
634
+ var KeyedTaskIdentifier;
635
+ ( (function(KeyedTaskIdentifier) {
636
+ function sortedStringify(literal) {
637
+ const keys = ( Object.keys(literal)).sort();
638
+ let result = '';
639
+ for (const key of keys) {
640
+ let stringified = literal[key];
641
+ if (stringified instanceof Object) {
642
+ stringified = sortedStringify(stringified);
643
+ }
644
+ else if (typeof stringified === 'string') {
645
+ stringified = stringified.replace(/,/g, ',,');
646
+ }
647
+ result += key + ',' + stringified + ',';
648
+ }
649
+ return result;
650
+ }
651
+ function create(value) {
652
+ const resultKey = sortedStringify(value);
653
+ const result = { _key: resultKey, type: value.taskType };
654
+ Object.assign(result, value);
655
+ return result;
656
+ }
657
+ KeyedTaskIdentifier.create = create;
658
+ })(KeyedTaskIdentifier || (KeyedTaskIdentifier = {})));
659
+ var TaskDefinition;
660
+ ( (function(TaskDefinition) {
661
+ function createTaskIdentifier(external, reporter) {
662
+ const definition = TaskDefinitionRegistry.get(external.type);
663
+ if (definition === undefined) {
664
+ const copy = Objects.deepClone(external);
665
+ delete copy._key;
666
+ return KeyedTaskIdentifier.create(copy);
667
+ }
668
+ const literal = Object.create(null);
669
+ literal.type = definition.taskType;
670
+ const required = ( new Set());
671
+ definition.required.forEach(element => required.add(element));
672
+ const properties = definition.properties;
673
+ for (const property of ( Object.keys(properties))) {
674
+ const value = external[property];
675
+ if (value !== undefined && value !== null) {
676
+ literal[property] = value;
677
+ }
678
+ else if (( required.has(property))) {
679
+ const schema = properties[property];
680
+ if (schema.default !== undefined) {
681
+ literal[property] = Objects.deepClone(schema.default);
682
+ }
683
+ else {
684
+ switch (schema.type) {
685
+ case 'boolean':
686
+ literal[property] = false;
687
+ break;
688
+ case 'number':
689
+ case 'integer':
690
+ literal[property] = 0;
691
+ break;
692
+ case 'string':
693
+ literal[property] = '';
694
+ break;
695
+ default:
696
+ reporter.error(( nls.localizeWithPath(
697
+ 'vs/workbench/contrib/tasks/common/tasks',
698
+ 'TaskDefinition.missingRequiredProperty',
699
+ 'Error: the task identifier \'{0}\' is missing the required property \'{1}\'. The task identifier will be ignored.',
700
+ JSON.stringify(external, undefined, 0),
701
+ property
702
+ )));
703
+ return undefined;
704
+ }
705
+ }
706
+ }
707
+ }
708
+ return KeyedTaskIdentifier.create(literal);
709
+ }
710
+ TaskDefinition.createTaskIdentifier = createTaskIdentifier;
711
+ })(TaskDefinition || (TaskDefinition = {})));
712
+ export { CUSTOMIZED_TASK_TYPE, CommandOptions, CommandString, CommonTask, ConfiguringTask, ContributedTask, CustomTask, ExecutionEngine, InMemoryTask, KeyedTaskIdentifier, PanelKind, PresentationOptions, RevealKind, RevealProblemKind, RunOnOptions, RunOptions, RuntimeType, ShellQuoting, TASKS_CATEGORY, TASK_RUNNING_STATE, TaskDefinition, TaskEvent, TaskGroup, TaskSorter, TaskSourceKind, USER_TASKS_GROUP_KEY };