@codingame/monaco-vscode-user-data-profile-service-override 11.1.2 → 12.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/index.d.ts +2 -1
  2. package/index.js +126 -1
  3. package/package.json +31 -8
  4. package/vscode/src/vs/base/browser/ui/radio/radio.css.js +1 -1
  5. package/vscode/src/vs/base/browser/ui/radio/radio.d.ts +37 -0
  6. package/vscode/src/vs/base/browser/ui/radio/radio.js +1 -0
  7. package/vscode/src/vs/platform/userDataProfile/browser/userDataProfile.d.ts +16 -0
  8. package/vscode/src/vs/platform/userDataProfile/browser/userDataProfile.js +3 -2
  9. package/vscode/src/vs/platform/userDataProfile/common/userDataProfileStorageService.d.ts +42 -0
  10. package/vscode/src/vs/platform/userDataProfile/common/userDataProfileStorageService.js +10 -11
  11. package/vscode/src/vs/workbench/contrib/userDataProfile/browser/media/userDataProfilesEditor.css.js +1 -1
  12. package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.contribution.d.ts +1 -0
  13. package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.contribution.js +3 -2
  14. package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.d.ts +53 -0
  15. package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.js +65 -63
  16. package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfileActions.d.ts +1 -0
  17. package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfileActions.js +5 -4
  18. package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditor.d.ts +73 -0
  19. package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditor.js +298 -307
  20. package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditorModel.d.ts +236 -0
  21. package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditorModel.js +168 -166
  22. package/vscode/src/vs/workbench/contrib/userDataProfile/common/userDataProfile.d.ts +7 -0
  23. package/vscode/src/vs/workbench/services/userData/browser/userDataInit.d.ts +19 -0
  24. package/vscode/src/vs/workbench/services/userData/browser/userDataInit.js +4 -2
  25. package/vscode/src/vs/workbench/services/userDataProfile/browser/extensionsResource.d.ts +77 -0
  26. package/vscode/src/vs/workbench/services/userDataProfile/browser/extensionsResource.js +83 -82
  27. package/vscode/src/vs/workbench/services/userDataProfile/browser/globalStateResource.d.ts +58 -0
  28. package/vscode/src/vs/workbench/services/userDataProfile/browser/globalStateResource.js +31 -28
  29. package/vscode/src/vs/workbench/services/userDataProfile/browser/keybindingsResource.d.ts +47 -0
  30. package/vscode/src/vs/workbench/services/userDataProfile/browser/keybindingsResource.js +24 -24
  31. package/vscode/src/vs/workbench/services/userDataProfile/browser/media/userDataProfileView.css.js +1 -1
  32. package/vscode/src/vs/workbench/services/userDataProfile/browser/settingsResource.d.ts +48 -0
  33. package/vscode/src/vs/workbench/services/userDataProfile/browser/settingsResource.js +29 -29
  34. package/vscode/src/vs/workbench/services/userDataProfile/browser/snippetsResource.d.ts +43 -0
  35. package/vscode/src/vs/workbench/services/userDataProfile/browser/snippetsResource.js +54 -54
  36. package/vscode/src/vs/workbench/services/userDataProfile/browser/tasksResource.d.ts +45 -0
  37. package/vscode/src/vs/workbench/services/userDataProfile/browser/tasksResource.js +24 -24
  38. package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileImportExportService.d.ts +63 -0
  39. package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileImportExportService.js +106 -111
  40. package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileInit.d.ts +32 -0
  41. package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileInit.js +11 -8
  42. package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.d.ts +58 -0
  43. package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.js +35 -33
  44. package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileStorageService.d.ts +18 -0
  45. package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileStorageService.js +7 -5
  46. package/vscode/src/vs/workbench/services/userDataSync/browser/userDataSyncInit.d.ts +45 -0
  47. package/vscode/src/vs/workbench/services/userDataSync/browser/userDataSyncInit.js +25 -22
  48. package/vscode/src/vs/workbench/services/userDataSync/common/userDataSyncUtil.d.ts +18 -0
  49. package/vscode/src/vs/workbench/services/userDataSync/common/userDataSyncUtil.js +3 -1
  50. package/userDataProfile.js +0 -125
@@ -1,19 +1,20 @@
1
- import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
1
+
2
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
2
3
  import { Action, Separator } from 'vscode/vscode/vs/base/common/actions';
3
4
  import { Emitter } from 'vscode/vscode/vs/base/common/event';
4
5
  import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
5
6
  import { localize } from 'vscode/vscode/vs/nls';
6
7
  import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
7
8
  import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
8
- import { isUserDataProfile, toUserDataProfile } from 'vscode/vscode/vs/platform/userDataProfile/common/userDataProfile';
9
+ import { ProfileResourceType, isUserDataProfile, toUserDataProfile } from 'vscode/vscode/vs/platform/userDataProfile/common/userDataProfile';
9
10
  import { IUserDataProfilesService } from 'vscode/vscode/vs/platform/userDataProfile/common/userDataProfile.service';
10
- import { isProfileURL } from 'vscode/vscode/vs/workbench/services/userDataProfile/common/userDataProfile';
11
+ import { isProfileURL } from '@codingame/monaco-vscode-e72c94ca-257a-5b75-8b68-5a5fa3c18255-common/vscode/vs/workbench/services/userDataProfile/common/userDataProfile';
11
12
  import { IUserDataProfileManagementService, IUserDataProfileService, IUserDataProfileImportExportService } from 'vscode/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.service';
12
13
  import { Disposable, DisposableStore, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
13
14
  import { URI } from 'vscode/vscode/vs/base/common/uri';
14
15
  import { equals } from 'vscode/vscode/vs/base/common/arrays';
15
16
  import { equals as equals$1 } from 'vscode/vscode/vs/base/common/objects';
16
- import { EditorModel } from 'vscode/vscode/vs/workbench/common/editor/editorModel';
17
+ import { EditorModel } from '@codingame/monaco-vscode-e571cbbb-526b-5d8b-92c5-a0437d2dabb3-common/vscode/vs/workbench/common/editor/editorModel';
17
18
  import { ExtensionsResourceExportTreeItem, ExtensionsResourceImportTreeItem } from '../../../services/userDataProfile/browser/extensionsResource.js';
18
19
  import { SettingsResourceTreeItem, SettingsResource } from '../../../services/userDataProfile/browser/settingsResource.js';
19
20
  import { KeybindingsResourceTreeItem, KeybindingsResource } from '../../../services/userDataProfile/browser/keybindingsResource.js';
@@ -21,13 +22,13 @@ import { TasksResourceTreeItem, TasksResource } from '../../../services/userData
21
22
  import { SnippetsResourceTreeItem, SnippetsResource } from '../../../services/userDataProfile/browser/snippetsResource.js';
22
23
  import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
23
24
  import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs.service';
24
- import { InMemoryFileSystemProvider } from 'vscode/vscode/vs/platform/files/common/inMemoryFilesystemProvider';
25
+ import { InMemoryFileSystemProvider } from '@codingame/monaco-vscode-2f06fe84-148e-5e6b-a7ca-c7989c5f128a-common/vscode/vs/platform/files/common/inMemoryFilesystemProvider';
25
26
  import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
26
27
  import { generateUuid } from 'vscode/vscode/vs/base/common/uuid';
27
28
  import { RunOnceScheduler, createCancelablePromise } from 'vscode/vscode/vs/base/common/async';
28
29
  import { IHostService } from 'vscode/vscode/vs/workbench/services/host/browser/host.service';
29
30
  import { CancellationTokenSource, CancellationToken } from 'vscode/vscode/vs/base/common/cancellation';
30
- import { API_OPEN_EDITOR_COMMAND_ID } from 'vscode/vscode/vs/workbench/browser/parts/editor/editorCommands';
31
+ import { API_OPEN_EDITOR_COMMAND_ID } from '@codingame/monaco-vscode-f48982c4-9e82-55e2-b800-20e6d1e6096f-common/vscode/vs/workbench/browser/parts/editor/editorCommands';
31
32
  import { SIDE_GROUP } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
32
33
  import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands.service';
33
34
  import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
@@ -63,9 +64,9 @@ let AbstractUserDataProfileElement = class AbstractUserDataProfileElement extend
63
64
  this.fileService = fileService;
64
65
  this.extensionManagementService = extensionManagementService;
65
66
  this.instantiationService = instantiationService;
66
- this._onDidChange = this._register(( (new Emitter())));
67
+ this._onDidChange = this._register(( new Emitter()));
67
68
  this.onDidChange = this._onDidChange.event;
68
- this.saveScheduler = this._register(( (new RunOnceScheduler(() => this.doSave(), 500))));
69
+ this.saveScheduler = this._register(( new RunOnceScheduler(() => this.doSave(), 500)));
69
70
  this._name = '';
70
71
  this._active = false;
71
72
  this._disabled = false;
@@ -82,9 +83,9 @@ let AbstractUserDataProfileElement = class AbstractUserDataProfileElement extend
82
83
  }));
83
84
  this._register(this.extensionManagementService.onProfileAwareDidInstallExtensions(results => {
84
85
  const profile = this.getProfileToWatch();
85
- if (profile && ( (results.some(
86
+ if (profile && ( results.some(
86
87
  r => !r.error && (r.applicationScoped || this.uriIdentityService.extUri.isEqual(r.profileLocation, profile.extensionsResource))
87
- )))) {
88
+ ))) {
88
89
  this._onDidChange.fire({ extensions: true });
89
90
  }
90
91
  }));
@@ -118,7 +119,7 @@ let AbstractUserDataProfileElement = class AbstractUserDataProfileElement extend
118
119
  }
119
120
  get workspaces() { return this._workspaces; }
120
121
  set workspaces(workspaces) {
121
- if (!equals(this._workspaces, workspaces, (a, b) => ( (a.toString())) === ( (b.toString())))) {
122
+ if (!equals(this._workspaces, workspaces, (a, b) => ( a.toString()) === ( b.toString()))) {
122
123
  this._workspaces = workspaces;
123
124
  this._onDidChange.fire({ workspaces: true });
124
125
  }
@@ -166,15 +167,15 @@ let AbstractUserDataProfileElement = class AbstractUserDataProfileElement extend
166
167
  }
167
168
  validate() {
168
169
  if (!this.name) {
169
- this.message = ( localize(11755, "Profile name is required and must be a non-empty value."));
170
+ this.message = ( localize(10573, "Profile name is required and must be a non-empty value."));
170
171
  return;
171
172
  }
172
- if (this.shouldValidateName() && this.name !== this.getInitialName() && ( (this.userDataProfilesService.profiles.some(p => p.name === this.name)))) {
173
- this.message = ( localize(11756, "Profile with name {0} already exists.", this.name));
173
+ if (this.shouldValidateName() && this.name !== this.getInitialName() && ( this.userDataProfilesService.profiles.some(p => p.name === this.name))) {
174
+ this.message = ( localize(10574, "Profile with name {0} already exists.", this.name));
174
175
  return;
175
176
  }
176
177
  if (this.flags && this.flags.settings && this.flags.keybindings && this.flags.tasks && this.flags.snippets && this.flags.extensions) {
177
- this.message = ( localize(11757, "The profile should contain at least one configuration."));
178
+ this.message = ( localize(10575, "The profile should contain at least one configuration."));
178
179
  return;
179
180
  }
180
181
  this.message = undefined;
@@ -182,24 +183,25 @@ let AbstractUserDataProfileElement = class AbstractUserDataProfileElement extend
182
183
  async getChildren(resourceType) {
183
184
  if (resourceType === undefined) {
184
185
  const resourceTypes = [
185
- "settings" ,
186
- "keybindings" ,
187
- "tasks" ,
188
- "snippets" ,
189
- "extensions"
186
+ ProfileResourceType.Settings,
187
+ ProfileResourceType.Keybindings,
188
+ ProfileResourceType.Tasks,
189
+ ProfileResourceType.Snippets,
190
+ ProfileResourceType.Extensions
190
191
  ];
191
- return Promise.all(( (resourceTypes.map(async (r) => {
192
- const children = ((r === "settings"
193
- || r === "keybindings" || r === "tasks") ) ? await this.getChildrenForResourceType(r) : [];
192
+ return Promise.all(( resourceTypes.map(async (r) => {
193
+ const children = (r === ProfileResourceType.Settings
194
+ || r === ProfileResourceType.Keybindings
195
+ || r === ProfileResourceType.Tasks) ? await this.getChildrenForResourceType(r) : [];
194
196
  return {
195
197
  handle: r,
196
198
  checkbox: undefined,
197
199
  resourceType: r,
198
200
  openAction: children.length
199
- ? ( (new Action('_open', ( localize(11758, "Open to the Side")), ThemeIcon.asClassName(Codicon.goToFile), true, () => children[0]?.openAction?.run())))
201
+ ? ( new Action('_open', ( localize(10576, "Open to the Side")), ThemeIcon.asClassName(Codicon.goToFile), true, () => children[0]?.openAction?.run()))
200
202
  : undefined
201
203
  };
202
- }))));
204
+ })));
203
205
  }
204
206
  return this.getChildrenForResourceType(resourceType);
205
207
  }
@@ -210,25 +212,23 @@ let AbstractUserDataProfileElement = class AbstractUserDataProfileElement extend
210
212
  profile = this.getFlag(resourceType) ? this.userDataProfilesService.defaultProfile : profile;
211
213
  let children = [];
212
214
  switch (resourceType) {
213
- case "settings" :
215
+ case ProfileResourceType.Settings:
214
216
  children = await this.instantiationService.createInstance(SettingsResourceTreeItem, profile).getChildren();
215
217
  break;
216
- case "keybindings" :
218
+ case ProfileResourceType.Keybindings:
217
219
  children = await this.instantiationService.createInstance(KeybindingsResourceTreeItem, profile).getChildren();
218
220
  break;
219
- case "snippets" :
221
+ case ProfileResourceType.Snippets:
220
222
  children = (await this.instantiationService.createInstance(SnippetsResourceTreeItem, profile).getChildren()) ?? [];
221
223
  break;
222
- case "tasks" :
224
+ case ProfileResourceType.Tasks:
223
225
  children = await this.instantiationService.createInstance(TasksResourceTreeItem, profile).getChildren();
224
226
  break;
225
- case "extensions" :
227
+ case ProfileResourceType.Extensions:
226
228
  children = await this.instantiationService.createInstance(ExtensionsResourceExportTreeItem, profile).getChildren();
227
229
  break;
228
230
  }
229
- return (
230
- (children.map(child => this.toUserDataProfileResourceChildElement(child)))
231
- );
231
+ return ( children.map(child => this.toUserDataProfileResourceChildElement(child)));
232
232
  }
233
233
  toUserDataProfileResourceChildElement(child, primaryActions, contextMenuActions) {
234
234
  return {
@@ -238,14 +238,14 @@ let AbstractUserDataProfileElement = class AbstractUserDataProfileElement extend
238
238
  description: isString(child.description) ? child.description : undefined,
239
239
  resource: URI.revive(child.resourceUri),
240
240
  icon: child.themeIcon,
241
- openAction: ( (new Action('_openChild', ( localize(11758, "Open to the Side")), ThemeIcon.asClassName(Codicon.goToFile), true, async () => {
242
- if (child.parent.type === "extensions" ) {
241
+ openAction: ( new Action('_openChild', ( localize(10576, "Open to the Side")), ThemeIcon.asClassName(Codicon.goToFile), true, async () => {
242
+ if (child.parent.type === ProfileResourceType.Extensions) {
243
243
  await this.commandService.executeCommand('extension.open', child.handle, undefined, true, undefined, true);
244
244
  }
245
245
  else if (child.resourceUri) {
246
246
  await this.commandService.executeCommand(API_OPEN_EDITOR_COMMAND_ID, child.resourceUri, [SIDE_GROUP], undefined);
247
247
  }
248
- }))),
248
+ })),
249
249
  actions: {
250
250
  primary: primaryActions,
251
251
  contextMenu: contextMenuActions,
@@ -283,7 +283,7 @@ let AbstractUserDataProfileElement = class AbstractUserDataProfileElement extend
283
283
  if (!equals$1(this.flags ?? {}, profile.useDefaultFlags ?? {})) {
284
284
  return true;
285
285
  }
286
- if (!equals(this.workspaces ?? [], profile.workspaces ?? [], (a, b) => ( (a.toString())) === ( (b.toString())))) {
286
+ if (!equals(this.workspaces ?? [], profile.workspaces ?? [], (a, b) => ( a.toString()) === ( b.toString()))) {
287
287
  return true;
288
288
  }
289
289
  return false;
@@ -307,17 +307,17 @@ let AbstractUserDataProfileElement = class AbstractUserDataProfileElement extend
307
307
  });
308
308
  }
309
309
  };
310
- AbstractUserDataProfileElement = ( (__decorate([
311
- ( (__param(5, IUserDataProfileManagementService))),
312
- ( (__param(6, IUserDataProfilesService))),
313
- ( (__param(7, ICommandService))),
314
- ( (__param(8, IWorkspaceContextService))),
315
- ( (__param(9, IHostService))),
316
- ( (__param(10, IUriIdentityService))),
317
- ( (__param(11, IFileService))),
318
- ( (__param(12, IWorkbenchExtensionManagementService))),
319
- ( (__param(13, IInstantiationService)))
320
- ], AbstractUserDataProfileElement)));
310
+ AbstractUserDataProfileElement = ( __decorate([
311
+ ( __param(5, IUserDataProfileManagementService)),
312
+ ( __param(6, IUserDataProfilesService)),
313
+ ( __param(7, ICommandService)),
314
+ ( __param(8, IWorkspaceContextService)),
315
+ ( __param(9, IHostService)),
316
+ ( __param(10, IUriIdentityService)),
317
+ ( __param(11, IFileService)),
318
+ ( __param(12, IWorkbenchExtensionManagementService)),
319
+ ( __param(13, IInstantiationService))
320
+ ], AbstractUserDataProfileElement));
321
321
  let UserDataProfileElement = class UserDataProfileElement extends AbstractUserDataProfileElement {
322
322
  get profile() { return this._profile; }
323
323
  constructor(_profile, titleButtons, actions, userDataProfileService, configurationService, userDataProfileManagementService, userDataProfilesService, commandService, workspaceContextService, hostService, uriIdentityService, fileService, extensionManagementService, instantiationService) {
@@ -360,14 +360,14 @@ let UserDataProfileElement = class UserDataProfileElement extends AbstractUserDa
360
360
  this.workspaces = this._profile.workspaces;
361
361
  }
362
362
  updateWorkspaces(toAdd, toRemove) {
363
- const workspaces = ( (new ResourceSet(this.workspaces ?? [])));
363
+ const workspaces = ( new ResourceSet(this.workspaces ?? []));
364
364
  for (const workspace of toAdd) {
365
365
  workspaces.add(workspace);
366
366
  }
367
367
  for (const workspace of toRemove) {
368
368
  workspaces.delete(workspace);
369
369
  }
370
- this.workspaces = [...( (workspaces.values()))];
370
+ this.workspaces = [...( workspaces.values())];
371
371
  }
372
372
  async toggleNewWindowProfile() {
373
373
  if (this._isNewWindowProfile) {
@@ -396,25 +396,23 @@ let UserDataProfileElement = class UserDataProfileElement extends AbstractUserDa
396
396
  await this.saveProfile(this.profile);
397
397
  }
398
398
  async getChildrenForResourceType(resourceType) {
399
- if (resourceType === "extensions" ) {
399
+ if (resourceType === ProfileResourceType.Extensions) {
400
400
  const children = await this.instantiationService.createInstance(ExtensionsResourceExportTreeItem, this.profile).getChildren();
401
- return (
402
- (children.map(child => this.toUserDataProfileResourceChildElement(child, undefined, [{
403
- id: 'applyToAllProfiles',
404
- label: ( localize(11759, "Apply Extension to all Profiles")),
405
- checked: child.applicationScoped,
406
- enabled: true,
407
- class: '',
408
- tooltip: '',
409
- run: async () => {
410
- const extensions = await this.extensionManagementService.getInstalled(undefined, this.profile.extensionsResource);
411
- const extension = extensions.find(e => areSameExtensions(e.identifier, child.identifier));
412
- if (extension) {
413
- await this.extensionManagementService.toggleAppliationScope(extension, this.profile.extensionsResource);
414
- }
401
+ return (children.map(child => this.toUserDataProfileResourceChildElement(child, undefined, [{
402
+ id: 'applyToAllProfiles',
403
+ label: ( localize(10577, "Apply Extension to all Profiles")),
404
+ checked: child.applicationScoped,
405
+ enabled: true,
406
+ class: '',
407
+ tooltip: '',
408
+ run: async () => {
409
+ const extensions = await this.extensionManagementService.getInstalled(undefined, this.profile.extensionsResource);
410
+ const extension = extensions.find(e => areSameExtensions(e.identifier, child.identifier));
411
+ if (extension) {
412
+ await this.extensionManagementService.toggleAppliationScope(extension, this.profile.extensionsResource);
415
413
  }
416
- }])))
417
- );
414
+ }
415
+ }])));
418
416
  }
419
417
  return this.getChildrenFromProfile(this.profile, resourceType);
420
418
  }
@@ -422,19 +420,19 @@ let UserDataProfileElement = class UserDataProfileElement extends AbstractUserDa
422
420
  return this.profile.name;
423
421
  }
424
422
  };
425
- UserDataProfileElement = ( (__decorate([
426
- ( (__param(3, IUserDataProfileService))),
427
- ( (__param(4, IConfigurationService))),
428
- ( (__param(5, IUserDataProfileManagementService))),
429
- ( (__param(6, IUserDataProfilesService))),
430
- ( (__param(7, ICommandService))),
431
- ( (__param(8, IWorkspaceContextService))),
432
- ( (__param(9, IHostService))),
433
- ( (__param(10, IUriIdentityService))),
434
- ( (__param(11, IFileService))),
435
- ( (__param(12, IWorkbenchExtensionManagementService))),
436
- ( (__param(13, IInstantiationService)))
437
- ], UserDataProfileElement)));
423
+ UserDataProfileElement = ( __decorate([
424
+ ( __param(3, IUserDataProfileService)),
425
+ ( __param(4, IConfigurationService)),
426
+ ( __param(5, IUserDataProfileManagementService)),
427
+ ( __param(6, IUserDataProfilesService)),
428
+ ( __param(7, ICommandService)),
429
+ ( __param(8, IWorkspaceContextService)),
430
+ ( __param(9, IHostService)),
431
+ ( __param(10, IUriIdentityService)),
432
+ ( __param(11, IFileService)),
433
+ ( __param(12, IWorkbenchExtensionManagementService)),
434
+ ( __param(13, IInstantiationService))
435
+ ], UserDataProfileElement));
438
436
  const USER_DATA_PROFILE_TEMPLATE_PREVIEW_SCHEME = 'userdataprofiletemplatepreview';
439
437
  let NewProfileElement = class NewProfileElement extends AbstractUserDataProfileElement {
440
438
  get copyFromTemplates() { return this._copyFromTemplates; }
@@ -443,14 +441,14 @@ let NewProfileElement = class NewProfileElement extends AbstractUserDataProfileE
443
441
  this.titleButtons = titleButtons;
444
442
  this.actions = actions;
445
443
  this.userDataProfileImportExportService = userDataProfileImportExportService;
446
- this._copyFromTemplates = ( (new ResourceMap()));
444
+ this._copyFromTemplates = ( new ResourceMap());
447
445
  this.template = null;
448
- this.previewProfileWatchDisposables = this._register(( (new DisposableStore())));
446
+ this.previewProfileWatchDisposables = this._register(( new DisposableStore()));
449
447
  this.defaultName = name;
450
448
  this._copyFrom = copyFrom;
451
449
  this._copyFlags = this.getCopyFlagsFrom(copyFrom);
452
450
  this.initialize();
453
- this._register(this.fileService.registerProvider(USER_DATA_PROFILE_TEMPLATE_PREVIEW_SCHEME, this._register(( (new InMemoryFileSystemProvider())))));
451
+ this._register(this.fileService.registerProvider(USER_DATA_PROFILE_TEMPLATE_PREVIEW_SCHEME, this._register(( new InMemoryFileSystemProvider()))));
454
452
  this._register(toDisposable(() => {
455
453
  if (this.previewProfile) {
456
454
  this.userDataProfilesService.removeProfile(this.previewProfile);
@@ -522,41 +520,41 @@ let NewProfileElement = class NewProfileElement extends AbstractUserDataProfileE
522
520
  if (this.defaultIcon === this.icon) {
523
521
  this.icon = this.defaultIcon = this.template.icon;
524
522
  }
525
- this.setCopyFlag("settings" , !!this.template.settings);
526
- this.setCopyFlag("keybindings" , !!this.template.keybindings);
527
- this.setCopyFlag("tasks" , !!this.template.tasks);
528
- this.setCopyFlag("snippets" , !!this.template.snippets);
529
- this.setCopyFlag("extensions" , !!this.template.extensions);
523
+ this.setCopyFlag(ProfileResourceType.Settings, !!this.template.settings);
524
+ this.setCopyFlag(ProfileResourceType.Keybindings, !!this.template.keybindings);
525
+ this.setCopyFlag(ProfileResourceType.Tasks, !!this.template.tasks);
526
+ this.setCopyFlag(ProfileResourceType.Snippets, !!this.template.snippets);
527
+ this.setCopyFlag(ProfileResourceType.Extensions, !!this.template.extensions);
530
528
  this._onDidChange.fire({ copyFromInfo: true });
531
529
  }
532
530
  return;
533
531
  }
534
532
  if (isUserDataProfile(this.copyFrom)) {
535
533
  if (this.defaultName === this.name) {
536
- this.name = this.defaultName = ( localize(11760, "{0} (Copy)", this.copyFrom.name));
534
+ this.name = this.defaultName = ( localize(10578, "{0} (Copy)", this.copyFrom.name));
537
535
  }
538
536
  if (this.defaultIcon === this.icon) {
539
537
  this.icon = this.defaultIcon = this.copyFrom.icon;
540
538
  }
541
- this.setCopyFlag("settings" , true);
542
- this.setCopyFlag("keybindings" , true);
543
- this.setCopyFlag("tasks" , true);
544
- this.setCopyFlag("snippets" , true);
545
- this.setCopyFlag("extensions" , true);
539
+ this.setCopyFlag(ProfileResourceType.Settings, true);
540
+ this.setCopyFlag(ProfileResourceType.Keybindings, true);
541
+ this.setCopyFlag(ProfileResourceType.Tasks, true);
542
+ this.setCopyFlag(ProfileResourceType.Snippets, true);
543
+ this.setCopyFlag(ProfileResourceType.Extensions, true);
546
544
  this._onDidChange.fire({ copyFromInfo: true });
547
545
  return;
548
546
  }
549
547
  if (this.defaultName === this.name) {
550
- this.name = this.defaultName = ( localize(11761, "Untitled"));
548
+ this.name = this.defaultName = ( localize(10579, "Untitled"));
551
549
  }
552
550
  if (this.defaultIcon === this.icon) {
553
551
  this.icon = this.defaultIcon = undefined;
554
552
  }
555
- this.setCopyFlag("settings" , false);
556
- this.setCopyFlag("keybindings" , false);
557
- this.setCopyFlag("tasks" , false);
558
- this.setCopyFlag("snippets" , false);
559
- this.setCopyFlag("extensions" , false);
553
+ this.setCopyFlag(ProfileResourceType.Settings, false);
554
+ this.setCopyFlag(ProfileResourceType.Keybindings, false);
555
+ this.setCopyFlag(ProfileResourceType.Tasks, false);
556
+ this.setCopyFlag(ProfileResourceType.Snippets, false);
557
+ this.setCopyFlag(ProfileResourceType.Extensions, false);
560
558
  this._onDidChange.fire({ copyFromInfo: true });
561
559
  }
562
560
  finally {
@@ -578,15 +576,15 @@ let NewProfileElement = class NewProfileElement extends AbstractUserDataProfileE
578
576
  hasResource(resourceType) {
579
577
  if (this.template) {
580
578
  switch (resourceType) {
581
- case "settings" :
579
+ case ProfileResourceType.Settings:
582
580
  return !!this.template.settings;
583
- case "keybindings" :
581
+ case ProfileResourceType.Keybindings:
584
582
  return !!this.template.keybindings;
585
- case "snippets" :
583
+ case ProfileResourceType.Snippets:
586
584
  return !!this.template.snippets;
587
- case "tasks" :
585
+ case ProfileResourceType.Tasks:
588
586
  return !!this.template.tasks;
589
- case "extensions" :
587
+ case ProfileResourceType.Extensions:
590
588
  return !!this.template.extensions;
591
589
  }
592
590
  }
@@ -632,38 +630,42 @@ let NewProfileElement = class NewProfileElement extends AbstractUserDataProfileE
632
630
  return [];
633
631
  }
634
632
  async getChildrenFromProfileTemplate(profileTemplate, resourceType) {
635
- const profile = toUserDataProfile(generateUuid(), this.name, URI.file('/root').with({ scheme: USER_DATA_PROFILE_TEMPLATE_PREVIEW_SCHEME }), URI.file('/cache').with({ scheme: USER_DATA_PROFILE_TEMPLATE_PREVIEW_SCHEME }));
633
+ const location = ( URI.from(
634
+ { scheme: USER_DATA_PROFILE_TEMPLATE_PREVIEW_SCHEME, path: `/root/profiles/${profileTemplate.name}` }
635
+ ));
636
+ const cacheLocation = ( URI.from(
637
+ { scheme: USER_DATA_PROFILE_TEMPLATE_PREVIEW_SCHEME, path: `/root/cache/${profileTemplate.name}` }
638
+ ));
639
+ const profile = toUserDataProfile(generateUuid(), this.name, location, cacheLocation);
636
640
  switch (resourceType) {
637
- case "settings" :
641
+ case ProfileResourceType.Settings:
638
642
  if (profileTemplate.settings) {
639
643
  await this.instantiationService.createInstance(SettingsResource).apply(profileTemplate.settings, profile);
640
644
  return this.getChildrenFromProfile(profile, resourceType);
641
645
  }
642
646
  return [];
643
- case "keybindings" :
647
+ case ProfileResourceType.Keybindings:
644
648
  if (profileTemplate.keybindings) {
645
649
  await this.instantiationService.createInstance(KeybindingsResource).apply(profileTemplate.keybindings, profile);
646
650
  return this.getChildrenFromProfile(profile, resourceType);
647
651
  }
648
652
  return [];
649
- case "snippets" :
653
+ case ProfileResourceType.Snippets:
650
654
  if (profileTemplate.snippets) {
651
655
  await this.instantiationService.createInstance(SnippetsResource).apply(profileTemplate.snippets, profile);
652
656
  return this.getChildrenFromProfile(profile, resourceType);
653
657
  }
654
658
  return [];
655
- case "tasks" :
659
+ case ProfileResourceType.Tasks:
656
660
  if (profileTemplate.tasks) {
657
661
  await this.instantiationService.createInstance(TasksResource).apply(profileTemplate.tasks, profile);
658
662
  return this.getChildrenFromProfile(profile, resourceType);
659
663
  }
660
664
  return [];
661
- case "extensions" :
665
+ case ProfileResourceType.Extensions:
662
666
  if (profileTemplate.extensions) {
663
667
  const children = await this.instantiationService.createInstance(ExtensionsResourceImportTreeItem, profileTemplate.extensions).getChildren();
664
- return (
665
- (children.map(child => this.toUserDataProfileResourceChildElement(child)))
666
- );
668
+ return ( children.map(child => this.toUserDataProfileResourceChildElement(child)));
667
669
  }
668
670
  return [];
669
671
  }
@@ -684,18 +686,18 @@ let NewProfileElement = class NewProfileElement extends AbstractUserDataProfileE
684
686
  }
685
687
  }
686
688
  };
687
- NewProfileElement = ( (__decorate([
688
- ( (__param(4, IUserDataProfileImportExportService))),
689
- ( (__param(5, IUserDataProfileManagementService))),
690
- ( (__param(6, IUserDataProfilesService))),
691
- ( (__param(7, ICommandService))),
692
- ( (__param(8, IWorkspaceContextService))),
693
- ( (__param(9, IHostService))),
694
- ( (__param(10, IUriIdentityService))),
695
- ( (__param(11, IFileService))),
696
- ( (__param(12, IWorkbenchExtensionManagementService))),
697
- ( (__param(13, IInstantiationService)))
698
- ], NewProfileElement)));
689
+ NewProfileElement = ( __decorate([
690
+ ( __param(4, IUserDataProfileImportExportService)),
691
+ ( __param(5, IUserDataProfileManagementService)),
692
+ ( __param(6, IUserDataProfilesService)),
693
+ ( __param(7, ICommandService)),
694
+ ( __param(8, IWorkspaceContextService)),
695
+ ( __param(9, IHostService)),
696
+ ( __param(10, IUriIdentityService)),
697
+ ( __param(11, IFileService)),
698
+ ( __param(12, IWorkbenchExtensionManagementService)),
699
+ ( __param(13, IInstantiationService))
700
+ ], NewProfileElement));
699
701
  let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends EditorModel {
700
702
  static { UserDataProfilesEditorModel_1 = this; }
701
703
  static getInstance(instantiationService) {
@@ -705,8 +707,8 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
705
707
  return UserDataProfilesEditorModel_1.INSTANCE;
706
708
  }
707
709
  get profiles() {
708
- return ( (this._profiles
709
- .map(([profile]) => profile)))
710
+ return ( this._profiles
711
+ .map(([profile]) => profile))
710
712
  .sort((a, b) => {
711
713
  if (a instanceof NewProfileElement) {
712
714
  return 1;
@@ -736,14 +738,14 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
736
738
  this.openerService = openerService;
737
739
  this.instantiationService = instantiationService;
738
740
  this._profiles = [];
739
- this._onDidChange = this._register(( (new Emitter())));
741
+ this._onDidChange = this._register(( new Emitter()));
740
742
  this.onDidChange = this._onDidChange.event;
741
743
  for (const profile of userDataProfilesService.profiles) {
742
744
  if (!profile.isTransient) {
743
745
  this._profiles.push(this.createProfileElement(profile));
744
746
  }
745
747
  }
746
- this._register(toDisposable(() => ( (this._profiles.splice(0, this._profiles.length).map(([, disposables]) => disposables.dispose())))));
748
+ this._register(toDisposable(() => ( this._profiles.splice(0, this._profiles.length).map(([, disposables]) => disposables.dispose()))));
747
749
  this._register(userDataProfilesService.onDidChangeProfiles(e => this.onDidChangeProfiles(e)));
748
750
  }
749
751
  onDidChangeProfiles(e) {
@@ -774,12 +776,12 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
774
776
  return this.templates;
775
777
  }
776
778
  createProfileElement(profile) {
777
- const disposables = ( (new DisposableStore()));
778
- const activateAction = disposables.add(( (new Action('userDataProfile.activate', ( localize(11762, "Use this Profile for Current Window")), ThemeIcon.asClassName(Codicon.check), true, () => this.userDataProfileManagementService.switchProfile(profileElement.profile)))));
779
- const copyFromProfileAction = disposables.add(( (new Action('userDataProfile.copyFromProfile', ( localize(11763, "Duplicate...")), ThemeIcon.asClassName(Codicon.copy), true, () => this.createNewProfile(profileElement.profile)))));
780
- const exportAction = disposables.add(( (new Action('userDataProfile.export', ( localize(11764, "Export...")), ThemeIcon.asClassName(Codicon.export), true, () => this.userDataProfileImportExportService.exportProfile(profile)))));
781
- const deleteAction = disposables.add(( (new Action('userDataProfile.delete', ( localize(11765, "Delete")), ThemeIcon.asClassName(Codicon.trash), true, () => this.removeProfile(profileElement.profile)))));
782
- const newWindowAction = disposables.add(( (new Action('userDataProfile.newWindow', ( localize(11766, "Open New Window with this Profile")), ThemeIcon.asClassName(Codicon.emptyWindow), true, () => this.openWindow(profileElement.profile)))));
779
+ const disposables = ( new DisposableStore());
780
+ const activateAction = disposables.add(( new Action('userDataProfile.activate', ( localize(10580, "Use this Profile for Current Window")), ThemeIcon.asClassName(Codicon.check), true, () => this.userDataProfileManagementService.switchProfile(profileElement.profile))));
781
+ const copyFromProfileAction = disposables.add(( new Action('userDataProfile.copyFromProfile', ( localize(10581, "Duplicate...")), ThemeIcon.asClassName(Codicon.copy), true, () => this.createNewProfile(profileElement.profile))));
782
+ const exportAction = disposables.add(( new Action('userDataProfile.export', ( localize(10582, "Export...")), ThemeIcon.asClassName(Codicon.export), true, () => this.userDataProfileImportExportService.exportProfile(profile))));
783
+ const deleteAction = disposables.add(( new Action('userDataProfile.delete', ( localize(10583, "Delete")), ThemeIcon.asClassName(Codicon.trash), true, () => this.removeProfile(profileElement.profile))));
784
+ const newWindowAction = disposables.add(( new Action('userDataProfile.newWindow', ( localize(10584, "Open New Window with this Profile")), ThemeIcon.asClassName(Codicon.emptyWindow), true, () => this.openWindow(profileElement.profile))));
783
785
  const primaryActions = [];
784
786
  primaryActions.push(activateAction);
785
787
  primaryActions.push(newWindowAction);
@@ -787,7 +789,7 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
787
789
  secondaryActions.push(copyFromProfileAction);
788
790
  secondaryActions.push(exportAction);
789
791
  if (!profile.isDefault) {
790
- secondaryActions.push(( (new Separator())));
792
+ secondaryActions.push(( new Separator()));
791
793
  secondaryActions.push(deleteAction);
792
794
  }
793
795
  const profileElement = disposables.add(this.instantiationService.createInstance(UserDataProfileElement, profile, [[], []], [primaryActions, secondaryActions]));
@@ -800,11 +802,11 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
800
802
  const result = await this.dialogService.confirm({
801
803
  type: 'info',
802
804
  message: ( localize(
803
- 11767,
805
+ 10585,
804
806
  "A new profile is already being created. Do you want to discard it and create a new one?"
805
807
  )),
806
- primaryButton: ( localize(11768, "Discard & Create")),
807
- cancelButton: ( localize(11769, "Cancel"))
808
+ primaryButton: ( localize(10586, "Discard & Create")),
809
+ cancelButton: ( localize(10587, "Cancel"))
808
810
  });
809
811
  if (!result.confirmed) {
810
812
  return;
@@ -821,29 +823,29 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
821
823
  }
822
824
  }
823
825
  if (!this.newProfileElement) {
824
- const disposables = ( (new DisposableStore()));
825
- const cancellationTokenSource = ( (new CancellationTokenSource()));
826
+ const disposables = ( new DisposableStore());
827
+ const cancellationTokenSource = ( new CancellationTokenSource());
826
828
  disposables.add(toDisposable(() => cancellationTokenSource.dispose(true)));
827
829
  const primaryActions = [];
828
830
  const secondaryActions = [];
829
- const createAction = disposables.add(( (new Action('userDataProfile.create', ( localize(11770, "Create")), undefined, true, () => this.saveNewProfile(false, cancellationTokenSource.token)))));
831
+ const createAction = disposables.add(( new Action('userDataProfile.create', ( localize(10588, "Create")), undefined, true, () => this.saveNewProfile(false, cancellationTokenSource.token))));
830
832
  primaryActions.push(createAction);
831
833
  if (isWeb && copyFrom instanceof URI && isProfileURL(copyFrom)) {
832
- primaryActions.push(( (new Action('userDataProfile.createInDesktop', ( localize(11771, "Create in {0}", this.productService.nameLong)), undefined, true, () => this.openerService.open(copyFrom, { openExternal: true })))));
834
+ primaryActions.push(( new Action('userDataProfile.createInDesktop', ( localize(10589, "Create in {0}", this.productService.nameLong)), undefined, true, () => this.openerService.open(copyFrom, { openExternal: true }))));
833
835
  }
834
- const cancelAction = disposables.add(( (new Action('userDataProfile.cancel', ( localize(11769, "Cancel")), ThemeIcon.asClassName(Codicon.trash), true, () => this.discardNewProfile()))));
836
+ const cancelAction = disposables.add(( new Action('userDataProfile.cancel', ( localize(10587, "Cancel")), ThemeIcon.asClassName(Codicon.trash), true, () => this.discardNewProfile())));
835
837
  secondaryActions.push(cancelAction);
836
- const previewProfileAction = disposables.add(( (new Action('userDataProfile.preview', ( localize(11772, "Preview")), ThemeIcon.asClassName(Codicon.openPreview), true, () => this.previewNewProfile(cancellationTokenSource.token)))));
838
+ const previewProfileAction = disposables.add(( new Action('userDataProfile.preview', ( localize(10590, "Preview")), ThemeIcon.asClassName(Codicon.openPreview), true, () => this.previewNewProfile(cancellationTokenSource.token))));
837
839
  secondaryActions.push(previewProfileAction);
838
- const exportAction = disposables.add(( (new Action('userDataProfile.export', ( localize(11764, "Export...")), ThemeIcon.asClassName(Codicon.export), isUserDataProfile(copyFrom), () => this.exportNewProfile(cancellationTokenSource.token)))));
839
- this.newProfileElement = disposables.add(this.instantiationService.createInstance(NewProfileElement, copyFrom ? '' : ( localize(11761, "Untitled")), copyFrom, [primaryActions, secondaryActions], [[cancelAction], [exportAction]]));
840
+ const exportAction = disposables.add(( new Action('userDataProfile.export', ( localize(10582, "Export...")), ThemeIcon.asClassName(Codicon.export), isUserDataProfile(copyFrom), () => this.exportNewProfile(cancellationTokenSource.token))));
841
+ this.newProfileElement = disposables.add(this.instantiationService.createInstance(NewProfileElement, copyFrom ? '' : ( localize(10579, "Untitled")), copyFrom, [primaryActions, secondaryActions], [[cancelAction], [exportAction]]));
840
842
  const updateCreateActionLabel = () => {
841
843
  if (createAction.enabled) {
842
- if (this.newProfileElement?.copyFrom && ( (this.userDataProfilesService.profiles.some(p => !p.isTransient && p.name === this.newProfileElement?.name)))) {
843
- createAction.label = ( localize(11773, "Replace"));
844
+ if (this.newProfileElement?.copyFrom && ( this.userDataProfilesService.profiles.some(p => !p.isTransient && p.name === this.newProfileElement?.name))) {
845
+ createAction.label = ( localize(10591, "Replace"));
844
846
  }
845
847
  else {
846
- createAction.label = ( localize(11770, "Create"));
848
+ createAction.label = ( localize(10588, "Create"));
847
849
  }
848
850
  }
849
851
  };
@@ -1000,9 +1002,9 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
1000
1002
  async removeProfile(profile) {
1001
1003
  const result = await this.dialogService.confirm({
1002
1004
  type: 'info',
1003
- message: ( localize(11774, "Are you sure you want to delete the profile '{0}'?", profile.name)),
1004
- primaryButton: ( localize(11765, "Delete")),
1005
- cancelButton: ( localize(11769, "Cancel"))
1005
+ message: ( localize(10592, "Are you sure you want to delete the profile '{0}'?", profile.name)),
1006
+ primaryButton: ( localize(10583, "Delete")),
1007
+ cancelButton: ( localize(10587, "Cancel"))
1006
1008
  });
1007
1009
  if (result.confirmed) {
1008
1010
  await this.userDataProfileManagementService.removeProfile(profile);
@@ -1012,17 +1014,17 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
1012
1014
  await this.hostService.openWindow({ forceProfile: profile.name });
1013
1015
  }
1014
1016
  };
1015
- UserDataProfilesEditorModel = UserDataProfilesEditorModel_1 = ( (__decorate([
1016
- ( (__param(0, IUserDataProfileService))),
1017
- ( (__param(1, IUserDataProfilesService))),
1018
- ( (__param(2, IUserDataProfileManagementService))),
1019
- ( (__param(3, IUserDataProfileImportExportService))),
1020
- ( (__param(4, IDialogService))),
1021
- ( (__param(5, ITelemetryService))),
1022
- ( (__param(6, IHostService))),
1023
- ( (__param(7, IProductService))),
1024
- ( (__param(8, IOpenerService))),
1025
- ( (__param(9, IInstantiationService)))
1026
- ], UserDataProfilesEditorModel)));
1017
+ UserDataProfilesEditorModel = UserDataProfilesEditorModel_1 = ( __decorate([
1018
+ ( __param(0, IUserDataProfileService)),
1019
+ ( __param(1, IUserDataProfilesService)),
1020
+ ( __param(2, IUserDataProfileManagementService)),
1021
+ ( __param(3, IUserDataProfileImportExportService)),
1022
+ ( __param(4, IDialogService)),
1023
+ ( __param(5, ITelemetryService)),
1024
+ ( __param(6, IHostService)),
1025
+ ( __param(7, IProductService)),
1026
+ ( __param(8, IOpenerService)),
1027
+ ( __param(9, IInstantiationService))
1028
+ ], UserDataProfilesEditorModel));
1027
1029
 
1028
1030
  export { AbstractUserDataProfileElement, NewProfileElement, UserDataProfileElement, UserDataProfilesEditorModel, isProfileResourceChildElement, isProfileResourceTypeElement };