@codingame/monaco-vscode-user-data-profile-service-override 6.0.3 → 7.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.
@@ -24,7 +24,6 @@ import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/
24
24
  import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
25
25
  import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
26
26
  import { ViewPaneContainer } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPaneContainer';
27
- import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
28
27
  import { TreeView, TreeViewPane } from 'vscode/vscode/vs/workbench/browser/parts/views/treeView';
29
28
  import { SettingsResource, SettingsResourceTreeItem } from './settingsResource.js';
30
29
  import { KeybindingsResource, KeybindingsResourceTreeItem } from './keybindingsResource.js';
@@ -65,7 +64,7 @@ import { Action, ActionRunner } from 'vscode/vscode/vs/base/common/actions';
65
64
  import { isWeb } from 'vscode/vscode/vs/base/common/platform';
66
65
  import { registerAction2, Action2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
67
66
  import { getAllCodicons, Codicon } from 'vscode/vscode/vs/base/common/codicons';
68
- import { Barrier } from 'vscode/vscode/vs/base/common/async';
67
+ import { createCancelablePromise, Barrier } from 'vscode/vscode/vs/base/common/async';
69
68
  import { IExtensionManagementService } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagement.service';
70
69
  import { ExtensionType } from 'vscode/vscode/vs/platform/extensions/common/extensions';
71
70
  import { areSameExtensions } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagementUtil';
@@ -81,6 +80,7 @@ import { WorkbenchIconSelectBox } from 'vscode/vscode/vs/workbench/services/user
81
80
  import { StandardKeyboardEvent } from 'vscode/vscode/vs/base/browser/keyboardEvent';
82
81
  import { KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
83
82
  import { IAccessibleViewInformationService } from 'vscode/vscode/vs/workbench/services/accessibility/common/accessibleViewInformationService.service';
83
+ import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
84
84
 
85
85
  var UserDataProfileImportExportService_1;
86
86
  const _moduleId = "vs/workbench/services/userDataProfile/browser/userDataProfileImportExportService";
@@ -162,7 +162,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
162
162
  unregisterProfileContentHandler(id) {
163
163
  this.profileContentHandlers.delete(id);
164
164
  }
165
- async exportProfile() {
165
+ async exportProfile2() {
166
166
  if (this.isProfileExportInProgressContextKey.get()) {
167
167
  this.logService.warn('Profile export already in progress.');
168
168
  return;
@@ -196,7 +196,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
196
196
  await this.previewProfile(profileTemplate, options);
197
197
  }
198
198
  else if (mode === 'apply') {
199
- await this.createAndSwitch(profileTemplate, false, true, options, ( localizeWithPath(_moduleId, 4, "Create Profile")));
199
+ await this.createAndSwitch(profileTemplate, !!options?.transient, true, options, ( localizeWithPath(_moduleId, 4, "Create Profile")));
200
200
  }
201
201
  else if (mode === 'both') {
202
202
  await this.importAndPreviewProfile(uri, profileTemplate, options);
@@ -212,6 +212,121 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
212
212
  editProfile(profile) {
213
213
  return this.saveProfile(profile);
214
214
  }
215
+ async createFromProfile(from, options, token) {
216
+ const disposables = ( (new DisposableStore()));
217
+ let creationPromise;
218
+ disposables.add(token.onCancellationRequested(() => creationPromise.cancel()));
219
+ let profile;
220
+ return this.progressService.withProgress({
221
+ location: ProgressLocation.Notification,
222
+ delay: 500,
223
+ sticky: true,
224
+ cancellable: true,
225
+ }, async (progress) => {
226
+ const reportProgress = (message) => progress.report({ message: ( localizeWithPath(_moduleId, 5, "Create Profile: {0}", message)) });
227
+ creationPromise = createCancelablePromise(async (token) => {
228
+ const userDataProfilesExportState = disposables.add(this.instantiationService.createInstance(UserDataProfileExportState, from, { ...options?.resourceTypeFlags, extensions: false }));
229
+ const profileTemplate = await userDataProfilesExportState.getProfileTemplate(options.name ?? from.name, options?.icon);
230
+ profile = await this.getProfileToImport({ ...profileTemplate, name: options.name ?? profileTemplate.name }, !!options.transient, options);
231
+ if (!profile) {
232
+ return;
233
+ }
234
+ if (token.isCancellationRequested) {
235
+ return;
236
+ }
237
+ await this.applyProfileTemplate(profileTemplate, profile, options, reportProgress, token);
238
+ });
239
+ try {
240
+ await creationPromise;
241
+ if (profile && (options?.resourceTypeFlags?.extensions ?? true)) {
242
+ reportProgress(( localizeWithPath(_moduleId, 6, "Installing Extensions...")));
243
+ await this.instantiationService.createInstance(ExtensionsResource).copy(from, profile, false);
244
+ }
245
+ }
246
+ catch (error) {
247
+ if (profile) {
248
+ await this.userDataProfilesService.removeProfile(profile);
249
+ profile = undefined;
250
+ }
251
+ }
252
+ return profile;
253
+ }, () => creationPromise.cancel()).finally(() => disposables.dispose());
254
+ }
255
+ async createProfileFromTemplate(profileTemplate, options, token) {
256
+ const disposables = ( (new DisposableStore()));
257
+ let creationPromise;
258
+ disposables.add(token.onCancellationRequested(() => creationPromise.cancel()));
259
+ let profile;
260
+ return this.progressService.withProgress({
261
+ location: ProgressLocation.Notification,
262
+ delay: 500,
263
+ sticky: true,
264
+ cancellable: true,
265
+ }, async (progress) => {
266
+ const reportProgress = (message) => progress.report({ message: ( localizeWithPath(_moduleId, 5, "Create Profile: {0}", message)) });
267
+ creationPromise = createCancelablePromise(async (token) => {
268
+ profile = await this.getProfileToImport({ ...profileTemplate, name: options.name ?? profileTemplate.name }, !!options.transient, options);
269
+ if (!profile) {
270
+ return;
271
+ }
272
+ if (token.isCancellationRequested) {
273
+ return;
274
+ }
275
+ await this.applyProfileTemplate(profileTemplate, profile, options, reportProgress, token);
276
+ });
277
+ try {
278
+ await creationPromise;
279
+ }
280
+ catch (error) {
281
+ if (profile) {
282
+ await this.userDataProfilesService.removeProfile(profile);
283
+ profile = undefined;
284
+ }
285
+ }
286
+ return profile;
287
+ }, () => creationPromise.cancel()).finally(() => disposables.dispose());
288
+ }
289
+ async applyProfileTemplate(profileTemplate, profile, options, reportProgress, token) {
290
+ if (profileTemplate.settings && (options.resourceTypeFlags?.settings ?? true) && !profile.useDefaultFlags?.settings) {
291
+ reportProgress(( localizeWithPath(_moduleId, 7, "Creating Settings...")));
292
+ await this.instantiationService.createInstance(SettingsResource).apply(profileTemplate.settings, profile);
293
+ }
294
+ if (token.isCancellationRequested) {
295
+ return;
296
+ }
297
+ if (profileTemplate.keybindings && (options.resourceTypeFlags?.keybindings ?? true) && !profile.useDefaultFlags?.keybindings) {
298
+ reportProgress(( localizeWithPath(_moduleId, 8, "Creating Keyboard Shortcuts...")));
299
+ await this.instantiationService.createInstance(KeybindingsResource).apply(profileTemplate.keybindings, profile);
300
+ }
301
+ if (token.isCancellationRequested) {
302
+ return;
303
+ }
304
+ if (profileTemplate.tasks && (options.resourceTypeFlags?.tasks ?? true) && !profile.useDefaultFlags?.tasks) {
305
+ reportProgress(( localizeWithPath(_moduleId, 9, "Creating Tasks...")));
306
+ await this.instantiationService.createInstance(TasksResource).apply(profileTemplate.tasks, profile);
307
+ }
308
+ if (token.isCancellationRequested) {
309
+ return;
310
+ }
311
+ if (profileTemplate.snippets && (options.resourceTypeFlags?.snippets ?? true) && !profile.useDefaultFlags?.snippets) {
312
+ reportProgress(( localizeWithPath(_moduleId, 10, "Creating Snippets...")));
313
+ await this.instantiationService.createInstance(SnippetsResource).apply(profileTemplate.snippets, profile);
314
+ }
315
+ if (token.isCancellationRequested) {
316
+ return;
317
+ }
318
+ if (profileTemplate.globalState && !profile.useDefaultFlags?.globalState) {
319
+ reportProgress(( localizeWithPath(_moduleId, 11, "Applying UI State...")));
320
+ await this.instantiationService.createInstance(GlobalStateResource).apply(profileTemplate.globalState, profile);
321
+ }
322
+ if (token.isCancellationRequested) {
323
+ return;
324
+ }
325
+ if (profileTemplate.extensions && (options.resourceTypeFlags?.extensions ?? true) && !profile.useDefaultFlags?.extensions) {
326
+ reportProgress(( localizeWithPath(_moduleId, 6, "Installing Extensions...")));
327
+ await this.instantiationService.createInstance(ExtensionsResource).apply(profileTemplate.extensions, profile, reportProgress, token);
328
+ }
329
+ }
215
330
  async saveProfile(profile, source) {
216
331
  const createProfileTelemetryData = { source: source instanceof URI ? 'template' : isUserDataProfile(source) ? 'profile' : source ? 'external' : undefined };
217
332
  if (profile) {
@@ -221,16 +336,16 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
221
336
  this.telemetryService.publicLog2('userDataProfile.startCreate', createProfileTelemetryData);
222
337
  }
223
338
  const disposables = ( (new DisposableStore()));
224
- const title = profile ? ( localizeWithPath(_moduleId, 5, "Edit {0} Profile...", profile.name)) : ( localizeWithPath(_moduleId, 6, "Create New Profile..."));
225
- const settings = { id: ProfileResourceType.Settings, label: ( localizeWithPath(_moduleId, 7, "Settings")), picked: !profile?.useDefaultFlags?.settings };
226
- const keybindings = { id: ProfileResourceType.Keybindings, label: ( localizeWithPath(_moduleId, 8, "Keyboard Shortcuts")), picked: !profile?.useDefaultFlags?.keybindings };
227
- const snippets = { id: ProfileResourceType.Snippets, label: ( localizeWithPath(_moduleId, 9, "User Snippets")), picked: !profile?.useDefaultFlags?.snippets };
228
- const tasks = { id: ProfileResourceType.Tasks, label: ( localizeWithPath(_moduleId, 10, "User Tasks")), picked: !profile?.useDefaultFlags?.tasks };
229
- const extensions = { id: ProfileResourceType.Extensions, label: ( localizeWithPath(_moduleId, 11, "Extensions")), picked: !profile?.useDefaultFlags?.extensions };
339
+ const title = profile ? ( localizeWithPath(_moduleId, 12, "Edit {0} Profile...", profile.name)) : ( localizeWithPath(_moduleId, 13, "Create New Profile..."));
340
+ const settings = { id: ProfileResourceType.Settings, label: ( localizeWithPath(_moduleId, 14, "Settings")), picked: !profile?.useDefaultFlags?.settings };
341
+ const keybindings = { id: ProfileResourceType.Keybindings, label: ( localizeWithPath(_moduleId, 15, "Keyboard Shortcuts")), picked: !profile?.useDefaultFlags?.keybindings };
342
+ const snippets = { id: ProfileResourceType.Snippets, label: ( localizeWithPath(_moduleId, 16, "User Snippets")), picked: !profile?.useDefaultFlags?.snippets };
343
+ const tasks = { id: ProfileResourceType.Tasks, label: ( localizeWithPath(_moduleId, 17, "User Tasks")), picked: !profile?.useDefaultFlags?.tasks };
344
+ const extensions = { id: ProfileResourceType.Extensions, label: ( localizeWithPath(_moduleId, 18, "Extensions")), picked: !profile?.useDefaultFlags?.extensions };
230
345
  const resources = [settings, keybindings, snippets, tasks, extensions];
231
346
  const quickPick = this.quickInputService.createQuickPick();
232
347
  quickPick.title = title;
233
- quickPick.placeholder = ( localizeWithPath(_moduleId, 12, "Profile name"));
348
+ quickPick.placeholder = ( localizeWithPath(_moduleId, 19, "Profile name"));
234
349
  quickPick.value = profile?.name ?? (isUserDataProfileTemplate(source) ? this.generateProfileName(source.name) : '');
235
350
  quickPick.canSelectMany = true;
236
351
  quickPick.matchOnDescription = false;
@@ -242,8 +357,8 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
242
357
  quickPick.customButton = true;
243
358
  quickPick.hideCheckAll = true;
244
359
  quickPick.ignoreFocusOut = true;
245
- quickPick.customLabel = profile ? ( localizeWithPath(_moduleId, 13, "Save")) : ( localizeWithPath(_moduleId, 14, "Create"));
246
- quickPick.description = ( localizeWithPath(_moduleId, 15, "Choose what to configure in your Profile:"));
360
+ quickPick.customLabel = profile ? ( localizeWithPath(_moduleId, 20, "Save")) : ( localizeWithPath(_moduleId, 21, "Create"));
361
+ quickPick.description = ( localizeWithPath(_moduleId, 22, "Choose what to configure in your Profile:"));
247
362
  quickPick.items = [...resources];
248
363
  const update = () => {
249
364
  quickPick.items = resources;
@@ -252,12 +367,12 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
252
367
  update();
253
368
  const validate = () => {
254
369
  if (!profile && ( (this.userDataProfilesService.profiles.some(p => p.name === quickPick.value)))) {
255
- quickPick.validationMessage = ( localizeWithPath(_moduleId, 16, "Profile with name {0} already exists.", quickPick.value));
370
+ quickPick.validationMessage = ( localizeWithPath(_moduleId, 23, "Profile with name {0} already exists.", quickPick.value));
256
371
  quickPick.severity = Severity$1.Warning;
257
372
  return;
258
373
  }
259
374
  if (resources.every(resource => !resource.picked)) {
260
- quickPick.validationMessage = ( localizeWithPath(_moduleId, 17, "The profile should contain at least one configuration."));
375
+ quickPick.validationMessage = ( localizeWithPath(_moduleId, 24, "The profile should contain at least one configuration."));
261
376
  quickPick.severity = Severity$1.Warning;
262
377
  return;
263
378
  }
@@ -268,7 +383,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
268
383
  let needUpdate = false;
269
384
  for (const resource of resources) {
270
385
  resource.picked = items.includes(resource);
271
- const description = resource.picked ? undefined : ( localizeWithPath(_moduleId, 18, "Using Default Profile"));
386
+ const description = resource.picked ? undefined : ( localizeWithPath(_moduleId, 25, "Using Default Profile"));
272
387
  if (resource.description !== description) {
273
388
  resource.description = description;
274
389
  needUpdate = true;
@@ -294,7 +409,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
294
409
  disposables.add(Event.any(quickPick.onDidCustom, quickPick.onDidAccept)(() => {
295
410
  const name = quickPick.value.trim();
296
411
  if (!name) {
297
- quickPick.validationMessage = ( localizeWithPath(_moduleId, 19, "Profile name is required and must be a non-empty value."));
412
+ quickPick.validationMessage = ( localizeWithPath(_moduleId, 26, "Profile name is required and must be a non-empty value."));
298
413
  quickPick.severity = Severity$1.Error;
299
414
  }
300
415
  if (quickPick.validationMessage) {
@@ -307,11 +422,11 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
307
422
  }));
308
423
  const domNode = $('.profile-edit-widget');
309
424
  const profileIconContainer = $('.profile-icon-container');
310
- append(profileIconContainer, $('.profile-icon-label', undefined, ( localizeWithPath(_moduleId, 20, "Icon:"))));
425
+ append(profileIconContainer, $('.profile-icon-label', undefined, ( localizeWithPath(_moduleId, 27, "Icon:"))));
311
426
  const profileIconElement = append(profileIconContainer, $(`.profile-icon${ThemeIcon.asCSSSelector(icon)}`));
312
427
  profileIconElement.tabIndex = 0;
313
428
  profileIconElement.role = 'button';
314
- profileIconElement.ariaLabel = ( localizeWithPath(_moduleId, 21, "Icon: {0}", icon.id));
429
+ profileIconElement.ariaLabel = ( localizeWithPath(_moduleId, 28, "Icon: {0}", icon.id));
315
430
  const iconSelectBox = disposables.add(this.instantiationService.createInstance(WorkbenchIconSelectBox, { icons: ICONS, inputBoxStyles: defaultInputBoxStyles }));
316
431
  const dimension = new Dimension(486, 260);
317
432
  iconSelectBox.layout(dimension);
@@ -319,7 +434,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
319
434
  const updateIcon = (updated) => {
320
435
  icon = updated ?? DEFAULT_ICON;
321
436
  profileIconElement.className = `profile-icon ${ThemeIcon.asClassName(icon)}`;
322
- profileIconElement.ariaLabel = ( localizeWithPath(_moduleId, 21, "Icon: {0}", icon.id));
437
+ profileIconElement.ariaLabel = ( localizeWithPath(_moduleId, 28, "Icon: {0}", icon.id));
323
438
  };
324
439
  disposables.add(iconSelectBox.onDidSelect(selectedIcon => {
325
440
  if (icon.id !== selectedIcon.id) {
@@ -370,18 +485,18 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
370
485
  }));
371
486
  if (!profile && !isUserDataProfileTemplate(source)) {
372
487
  const profileTypeContainer = append(domNode, $('.profile-type-container'));
373
- append(profileTypeContainer, $('.profile-type-create-label', undefined, ( localizeWithPath(_moduleId, 22, "Copy from:"))));
488
+ append(profileTypeContainer, $('.profile-type-create-label', undefined, ( localizeWithPath(_moduleId, 29, "Copy from:"))));
374
489
  const separator = { text: '\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500', isDisabled: true };
375
490
  const profileOptions = [];
376
- profileOptions.push({ text: ( localizeWithPath(_moduleId, 23, "None")) });
491
+ profileOptions.push({ text: ( localizeWithPath(_moduleId, 30, "None")) });
377
492
  const templates = await this.userDataProfileManagementService.getBuiltinProfileTemplates();
378
493
  if (templates.length) {
379
- profileOptions.push({ ...separator, decoratorRight: ( localizeWithPath(_moduleId, 24, "Profile Templates")) });
494
+ profileOptions.push({ ...separator, decoratorRight: ( localizeWithPath(_moduleId, 31, "Profile Templates")) });
380
495
  for (const template of templates) {
381
496
  profileOptions.push({ text: template.name, id: template.url, source: ( (URI.parse(template.url))) });
382
497
  }
383
498
  }
384
- profileOptions.push({ ...separator, decoratorRight: ( localizeWithPath(_moduleId, 25, "Existing Profiles")) });
499
+ profileOptions.push({ ...separator, decoratorRight: ( localizeWithPath(_moduleId, 32, "Existing Profiles")) });
385
500
  for (const profile of this.userDataProfilesService.profiles) {
386
501
  profileOptions.push({ text: profile.name, id: profile.id, source: profile });
387
502
  }
@@ -400,7 +515,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
400
515
  const initialIndex = findOptionIndex();
401
516
  const selectBox = disposables.add(this.instantiationService.createInstance(SelectBox, profileOptions, initialIndex, this.contextViewService, defaultSelectBoxStyles, {
402
517
  useCustomDrawn: true,
403
- ariaLabel: ( localizeWithPath(_moduleId, 26, "Copy profile from")),
518
+ ariaLabel: ( localizeWithPath(_moduleId, 33, "Copy profile from")),
404
519
  }));
405
520
  selectBox.render(append(profileTypeContainer, $('.profile-type-select-container')));
406
521
  if (profileOptions[initialIndex].source) {
@@ -458,7 +573,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
458
573
  }
459
574
  else if (isUserDataProfile(source)) {
460
575
  this.telemetryService.publicLog2('userDataProfile.createFromProfile', createProfileTelemetryData);
461
- await this.createFromProfile(source, result.name, { useDefaultFlags, icon: result.icon ? result.icon : undefined });
576
+ await this._createFromProfile(source, result.name, { useDefaultFlags, icon: result.icon ? result.icon : undefined });
462
577
  }
463
578
  else if (isUserDataProfileTemplate(source)) {
464
579
  source.name = result.name;
@@ -485,7 +600,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
485
600
  try {
486
601
  const userDataProfilesExportState = disposables.add(this.instantiationService.createInstance(UserDataProfileExportState, this.userDataProfileService.currentProfile, undefined));
487
602
  const barrier = ( (new Barrier()));
488
- const exportAction = ( (new BarrierAction(barrier, (new Action('export', ( localizeWithPath(_moduleId, 27, "Export")), undefined, true, async () => {
603
+ const exportAction = ( (new BarrierAction(barrier, (new Action('export', ( localizeWithPath(_moduleId, 34, "Export")), undefined, true, async () => {
489
604
  exportAction.enabled = false;
490
605
  try {
491
606
  await this.doExportProfile(userDataProfilesExportState, EXPORT_PROFILE_PREVIEW_VIEW);
@@ -496,7 +611,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
496
611
  throw error;
497
612
  }
498
613
  })), this.notificationService)));
499
- const closeAction = ( (new BarrierAction(barrier, (new Action('close', ( localizeWithPath(_moduleId, 28, "Close")))), this.notificationService)));
614
+ const closeAction = ( (new BarrierAction(barrier, (new Action('close', ( localizeWithPath(_moduleId, 35, "Close")))), this.notificationService)));
500
615
  await this.showProfilePreviewView(EXPORT_PROFILE_PREVIEW_VIEW, userDataProfilesExportState.profile.name, exportAction, closeAction, true, userDataProfilesExportState);
501
616
  disposables.add(this.userDataProfileService.onDidChangeCurrentProfile(e => barrier.open()));
502
617
  await barrier.wait();
@@ -506,7 +621,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
506
621
  disposables.dispose();
507
622
  }
508
623
  }
509
- async exportProfile2(profile) {
624
+ async exportProfile(profile) {
510
625
  const disposables = ( (new DisposableStore()));
511
626
  try {
512
627
  const userDataProfilesExportState = disposables.add(this.instantiationService.createInstance(UserDataProfileExportState, profile, undefined));
@@ -516,7 +631,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
516
631
  disposables.dispose();
517
632
  }
518
633
  }
519
- async createFromProfile(profile, name, options) {
634
+ async _createFromProfile(profile, name, options) {
520
635
  const userDataProfilesExportState = this.instantiationService.createInstance(UserDataProfileExportState, profile, options?.resourceTypeFlags);
521
636
  try {
522
637
  const profileTemplate = await userDataProfilesExportState.getProfileTemplate(name, options?.icon);
@@ -525,14 +640,14 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
525
640
  delay: 500,
526
641
  sticky: true,
527
642
  }, async (progress) => {
528
- const reportProgress = (message) => progress.report({ message: ( localizeWithPath(_moduleId, 29, "Create Profile: {0}", message)) });
529
- const createdProfile = await this.doCreateProfile(profileTemplate, false, false, { useDefaultFlags: options?.useDefaultFlags, icon: options?.icon }, reportProgress);
643
+ const reportProgress = (message) => progress.report({ message: ( localizeWithPath(_moduleId, 5, "Create Profile: {0}", message)) });
644
+ const createdProfile = await this.doCreateProfile(profileTemplate, false, false, { useDefaultFlags: options?.useDefaultFlags, icon: options?.icon, transient: options?.transient }, reportProgress);
530
645
  if (createdProfile) {
531
646
  if (options?.resourceTypeFlags?.extensions ?? true) {
532
- reportProgress(( localizeWithPath(_moduleId, 30, "Applying Extensions...")));
647
+ reportProgress(( localizeWithPath(_moduleId, 36, "Applying Extensions...")));
533
648
  await this.instantiationService.createInstance(ExtensionsResource).copy(profile, createdProfile, false);
534
649
  }
535
- reportProgress(( localizeWithPath(_moduleId, 31, "Switching Profile...")));
650
+ reportProgress(( localizeWithPath(_moduleId, 37, "Switching Profile...")));
536
651
  await this.userDataProfileManagementService.switchProfile(createdProfile);
537
652
  }
538
653
  });
@@ -544,18 +659,18 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
544
659
  async createTroubleshootProfile() {
545
660
  const userDataProfilesExportState = this.instantiationService.createInstance(UserDataProfileExportState, this.userDataProfileService.currentProfile, undefined);
546
661
  try {
547
- const profileTemplate = await userDataProfilesExportState.getProfileTemplate(( localizeWithPath(_moduleId, 32, "Troubleshoot Issue")), undefined);
662
+ const profileTemplate = await userDataProfilesExportState.getProfileTemplate(( localizeWithPath(_moduleId, 38, "Troubleshoot Issue")), undefined);
548
663
  await this.progressService.withProgress({
549
664
  location: ProgressLocation.Notification,
550
665
  delay: 1000,
551
666
  sticky: true,
552
667
  }, async (progress) => {
553
- const reportProgress = (message) => progress.report({ message: ( localizeWithPath(_moduleId, 33, "Setting up Troubleshoot Profile: {0}", message)) });
668
+ const reportProgress = (message) => progress.report({ message: ( localizeWithPath(_moduleId, 39, "Setting up Troubleshoot Profile: {0}", message)) });
554
669
  const profile = await this.doCreateProfile(profileTemplate, true, false, { useDefaultFlags: this.userDataProfileService.currentProfile.useDefaultFlags }, reportProgress);
555
670
  if (profile) {
556
- reportProgress(( localizeWithPath(_moduleId, 30, "Applying Extensions...")));
671
+ reportProgress(( localizeWithPath(_moduleId, 36, "Applying Extensions...")));
557
672
  await this.instantiationService.createInstance(ExtensionsResource).copy(this.userDataProfileService.currentProfile, profile, true);
558
- reportProgress(( localizeWithPath(_moduleId, 31, "Switching Profile...")));
673
+ reportProgress(( localizeWithPath(_moduleId, 37, "Switching Profile...")));
559
674
  await this.userDataProfileManagementService.switchProfile(profile);
560
675
  }
561
676
  });
@@ -575,7 +690,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
575
690
  try {
576
691
  await this.progressService.withProgress({
577
692
  location,
578
- title: ( localizeWithPath(_moduleId, 34, "{0}: Exporting...", PROFILES_CATEGORY.value)),
693
+ title: ( localizeWithPath(_moduleId, 40, "{0}: Exporting...", PROFILES_CATEGORY.value)),
579
694
  }, async (progress) => {
580
695
  const id = await this.pickProfileContentHandler(profile.name);
581
696
  if (!id) {
@@ -589,17 +704,17 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
589
704
  if (!saveResult) {
590
705
  return;
591
706
  }
592
- const message = ( localizeWithPath(_moduleId, 35, "Profile '{0}' was exported successfully.", profile.name));
707
+ const message = ( localizeWithPath(_moduleId, 41, "Profile '{0}' was exported successfully.", profile.name));
593
708
  if (profileContentHandler.extensionId) {
594
709
  const buttons = [];
595
710
  const link = this.productService.webUrl ? `${this.productService.webUrl}/${PROFILE_URL_AUTHORITY}/${id}/${saveResult.id}` : ( (toUserDataProfileUri(`/${id}/${saveResult.id}`, this.productService).toString()));
596
711
  buttons.push({
597
- label: ( localizeWithPath(_moduleId, 36, "&&Copy Link")),
712
+ label: ( localizeWithPath(_moduleId, 42, "&&Copy Link")),
598
713
  run: () => this.clipboardService.writeText(link)
599
714
  });
600
715
  if (this.productService.webUrl) {
601
716
  buttons.push({
602
- label: ( localizeWithPath(_moduleId, 37, "&&Open Link")),
717
+ label: ( localizeWithPath(_moduleId, 43, "&&Open Link")),
603
718
  run: async () => {
604
719
  await this.openerService.open(link);
605
720
  }
@@ -607,7 +722,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
607
722
  }
608
723
  else {
609
724
  buttons.push({
610
- label: ( localizeWithPath(_moduleId, 38, "&&Open in {0}", profileContentHandler.name)),
725
+ label: ( localizeWithPath(_moduleId, 44, "&&Open in {0}", profileContentHandler.name)),
611
726
  run: async () => {
612
727
  await this.openerService.open(( (saveResult.link.toString())));
613
728
  }
@@ -617,7 +732,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
617
732
  type: Severity$1.Info,
618
733
  message,
619
734
  buttons,
620
- cancelButton: ( localizeWithPath(_moduleId, 28, "Close"))
735
+ cancelButton: ( localizeWithPath(_moduleId, 35, "Close"))
621
736
  });
622
737
  }
623
738
  else {
@@ -676,26 +791,26 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
676
791
  const barrier = ( (new Barrier()));
677
792
  const importAction = this.getCreateAction(barrier, userDataProfileImportState);
678
793
  const primaryAction = isWeb
679
- ? ( (new Action('importInDesktop', ( localizeWithPath(_moduleId, 39, "Create Profile in {0}", this.productService.nameLong)), undefined, true, async () => this.openerService.open(uri, { openExternal: true }))))
794
+ ? ( (new Action('importInDesktop', ( localizeWithPath(_moduleId, 45, "Create Profile in {0}", this.productService.nameLong)), undefined, true, async () => this.openerService.open(uri, { openExternal: true }))))
680
795
  : importAction;
681
796
  const secondaryAction = isWeb
682
797
  ? importAction
683
- : ( (new BarrierAction(barrier, (new Action('close', ( localizeWithPath(_moduleId, 28, "Close")))), this.notificationService)));
798
+ : ( (new BarrierAction(barrier, (new Action('close', ( localizeWithPath(_moduleId, 35, "Close")))), this.notificationService)));
684
799
  const view = await this.showProfilePreviewView(IMPORT_PROFILE_PREVIEW_VIEW, importedProfile.name, primaryAction, secondaryAction, false, userDataProfileImportState);
685
800
  const message = ( (new MarkdownString()));
686
801
  message.appendMarkdown(( localizeWithPath(
687
802
  _moduleId,
688
- 40,
803
+ 46,
689
804
  "By default, extensions aren't installed when previewing a profile on the web. You can still install them manually before importing the profile. "
690
805
  )));
691
- message.appendMarkdown(`[${( localizeWithPath(_moduleId, 41, "Learn more"))}](https://aka.ms/vscode-extension-marketplace#_can-i-trust-extensions-from-the-marketplace).`);
806
+ message.appendMarkdown(`[${( localizeWithPath(_moduleId, 47, "Learn more"))}](https://aka.ms/vscode-extension-marketplace#_can-i-trust-extensions-from-the-marketplace).`);
692
807
  view.setMessage(message);
693
808
  const that = this;
694
809
  const disposable = disposables.add(registerAction2(class extends Action2 {
695
810
  constructor() {
696
811
  super({
697
812
  id: 'previewProfile.installExtensions',
698
- title: ( localizeWithPath(_moduleId, 42, "Install Extensions")),
813
+ title: ( localizeWithPath(_moduleId, 48, "Install Extensions")),
699
814
  icon: Codicon.cloudDownload,
700
815
  menu: {
701
816
  id: MenuId.ViewItemContext,
@@ -746,7 +861,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
746
861
  }
747
862
  else {
748
863
  const barrier = ( (new Barrier()));
749
- const cancelAction = ( (new BarrierAction(barrier, (new Action('cancel', ( localizeWithPath(_moduleId, 43, "Cancel")))), this.notificationService)));
864
+ const cancelAction = ( (new BarrierAction(barrier, (new Action('cancel', ( localizeWithPath(_moduleId, 49, "Cancel")))), this.notificationService)));
750
865
  const importAction = this.getCreateAction(barrier, userDataProfileImportState, cancelAction);
751
866
  await this.showProfilePreviewView(IMPORT_PROFILE_PREVIEW_VIEW, profileTemplate.name, importAction, cancelAction, false, userDataProfileImportState);
752
867
  await barrier.wait();
@@ -758,7 +873,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
758
873
  }
759
874
  }
760
875
  getCreateAction(barrier, userDataProfileImportState, cancelAction) {
761
- const importAction = ( (new BarrierAction(barrier, (new Action('title', ( localizeWithPath(_moduleId, 44, "Create Profile")), undefined, true, async () => {
876
+ const importAction = ( (new BarrierAction(barrier, (new Action('title', ( localizeWithPath(_moduleId, 50, "Create Profile")), undefined, true, async () => {
762
877
  importAction.enabled = false;
763
878
  if (cancelAction) {
764
879
  cancelAction.enabled = false;
@@ -779,7 +894,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
779
894
  const reportProgress = (message) => progress.report({ message: `${title}: ${message}` });
780
895
  const profile = await this.doCreateProfile(profileTemplate, temporaryProfile, extensions, options, reportProgress);
781
896
  if (profile) {
782
- reportProgress(( localizeWithPath(_moduleId, 31, "Switching Profile...")));
897
+ reportProgress(( localizeWithPath(_moduleId, 37, "Switching Profile...")));
783
898
  await this.userDataProfileManagementService.switchProfile(profile);
784
899
  }
785
900
  return profile;
@@ -791,27 +906,27 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
791
906
  return undefined;
792
907
  }
793
908
  if (profileTemplate.settings && !profile.useDefaultFlags?.settings) {
794
- progress(( localizeWithPath(_moduleId, 45, "Applying Settings...")));
909
+ progress(( localizeWithPath(_moduleId, 51, "Applying Settings...")));
795
910
  await this.instantiationService.createInstance(SettingsResource).apply(profileTemplate.settings, profile);
796
911
  }
797
912
  if (profileTemplate.keybindings && !profile.useDefaultFlags?.keybindings) {
798
- progress(( localizeWithPath(_moduleId, 46, "Applying Keyboard Shortcuts...")));
913
+ progress(( localizeWithPath(_moduleId, 52, "Applying Keyboard Shortcuts...")));
799
914
  await this.instantiationService.createInstance(KeybindingsResource).apply(profileTemplate.keybindings, profile);
800
915
  }
801
916
  if (profileTemplate.tasks && !profile.useDefaultFlags?.tasks) {
802
- progress(( localizeWithPath(_moduleId, 47, "Applying Tasks...")));
917
+ progress(( localizeWithPath(_moduleId, 53, "Applying Tasks...")));
803
918
  await this.instantiationService.createInstance(TasksResource).apply(profileTemplate.tasks, profile);
804
919
  }
805
920
  if (profileTemplate.snippets && !profile.useDefaultFlags?.snippets) {
806
- progress(( localizeWithPath(_moduleId, 48, "Applying Snippets...")));
921
+ progress(( localizeWithPath(_moduleId, 54, "Applying Snippets...")));
807
922
  await this.instantiationService.createInstance(SnippetsResource).apply(profileTemplate.snippets, profile);
808
923
  }
809
924
  if (profileTemplate.globalState && !profile.useDefaultFlags?.globalState) {
810
- progress(( localizeWithPath(_moduleId, 49, "Applying State...")));
925
+ progress(( localizeWithPath(_moduleId, 55, "Applying State...")));
811
926
  await this.instantiationService.createInstance(GlobalStateResource).apply(profileTemplate.globalState, profile);
812
927
  }
813
928
  if (profileTemplate.extensions && extensions && !profile.useDefaultFlags?.extensions) {
814
- progress(( localizeWithPath(_moduleId, 30, "Applying Extensions...")));
929
+ progress(( localizeWithPath(_moduleId, 36, "Applying Extensions...")));
815
930
  await this.instantiationService.createInstance(ExtensionsResource).apply(profileTemplate.extensions, profile);
816
931
  }
817
932
  return profile;
@@ -864,7 +979,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
864
979
  options.push({ id, label: profileContentHandler.name, description: profileContentHandler.description });
865
980
  }
866
981
  const result = await this.quickInputService.pick(options.reverse(), {
867
- title: ( localizeWithPath(_moduleId, 50, "Export '{0}' profile as...", name)),
982
+ title: ( localizeWithPath(_moduleId, 56, "Export '{0}' profile as...", name)),
868
983
  hideInput: true
869
984
  });
870
985
  return result?.id;
@@ -886,17 +1001,17 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
886
1001
  type: Severity$1.Info,
887
1002
  message: ( localizeWithPath(
888
1003
  _moduleId,
889
- 51,
1004
+ 57,
890
1005
  "Profile with name '{0}' already exists. Do you want to overwrite it?",
891
1006
  profileName
892
1007
  )),
893
1008
  buttons: [
894
1009
  {
895
- label: ( localizeWithPath(_moduleId, 52, "&&Overwrite")),
1010
+ label: ( localizeWithPath(_moduleId, 58, "&&Overwrite")),
896
1011
  run: () => ImportProfileChoice.Overwrite
897
1012
  },
898
1013
  {
899
- label: ( localizeWithPath(_moduleId, 53, "&&Create New Profile")),
1014
+ label: ( localizeWithPath(_moduleId, 59, "&&Create New Profile")),
900
1015
  run: () => ImportProfileChoice.CreateNew
901
1016
  },
902
1017
  ],
@@ -911,12 +1026,12 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
911
1026
  return undefined;
912
1027
  }
913
1028
  const name = await this.quickInputService.input({
914
- placeHolder: ( localizeWithPath(_moduleId, 54, "Profile name")),
915
- title: ( localizeWithPath(_moduleId, 55, "Create New Profile")),
1029
+ placeHolder: ( localizeWithPath(_moduleId, 60, "Profile name")),
1030
+ title: ( localizeWithPath(_moduleId, 61, "Create New Profile")),
916
1031
  value: `${profileName} ${this.getProfileNameIndex(profileName)}`,
917
1032
  validateInput: async (value) => {
918
1033
  if (( (this.userDataProfilesService.profiles.some(p => p.name === value)))) {
919
- return ( localizeWithPath(_moduleId, 16, "Profile with name {0} already exists.", value));
1034
+ return ( localizeWithPath(_moduleId, 23, "Profile with name {0} already exists.", value));
920
1035
  }
921
1036
  return undefined;
922
1037
  }
@@ -981,23 +1096,6 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
981
1096
  await this.editorService.closeEditors(editorsToColse);
982
1097
  }
983
1098
  }
984
- async setProfile(profile) {
985
- await this.progressService.withProgress({
986
- location: ProgressLocation.Notification,
987
- title: ( localizeWithPath(_moduleId, 56, "{0}: Applying...", PROFILES_CATEGORY.value)),
988
- }, async (progress) => {
989
- if (profile.settings) {
990
- await this.instantiationService.createInstance(SettingsResource).apply(profile.settings, this.userDataProfileService.currentProfile);
991
- }
992
- if (profile.globalState) {
993
- await this.instantiationService.createInstance(GlobalStateResource).apply(profile.globalState, this.userDataProfileService.currentProfile);
994
- }
995
- if (profile.extensions) {
996
- await this.instantiationService.createInstance(ExtensionsResource).apply(profile.extensions, this.userDataProfileService.currentProfile);
997
- }
998
- });
999
- this.notificationService.info(( localizeWithPath(_moduleId, 57, "{0}: Applied successfully.", PROFILES_CATEGORY.value)));
1000
- }
1001
1099
  };
1002
1100
  UserDataProfileImportExportService = UserDataProfileImportExportService_1 = ( (__decorate([
1003
1101
  ( (__param(0, IInstantiationService))),
@@ -1030,12 +1128,12 @@ let FileUserDataProfileContentHandler = class FileUserDataProfileContentHandler
1030
1128
  this.uriIdentityService = uriIdentityService;
1031
1129
  this.fileService = fileService;
1032
1130
  this.textFileService = textFileService;
1033
- this.name = ( localizeWithPath(_moduleId, 58, "Local"));
1034
- this.description = ( localizeWithPath(_moduleId, 59, "file"));
1131
+ this.name = ( localizeWithPath(_moduleId, 62, "Local"));
1132
+ this.description = ( localizeWithPath(_moduleId, 63, "file"));
1035
1133
  }
1036
1134
  async saveProfile(name, content, token) {
1037
1135
  const link = await this.fileDialogService.showSaveDialog({
1038
- title: ( localizeWithPath(_moduleId, 60, "Save Profile")),
1136
+ title: ( localizeWithPath(_moduleId, 64, "Save Profile")),
1039
1137
  filters: PROFILE_FILTER,
1040
1138
  defaultUri: this.uriIdentityService.extUri.joinPath(await this.fileDialogService.defaultFilePath(), `${name}.${PROFILE_EXTENSION}`),
1041
1139
  });
@@ -1062,7 +1160,7 @@ let FileUserDataProfileContentHandler = class FileUserDataProfileContentHandler
1062
1160
  canSelectFiles: true,
1063
1161
  canSelectMany: false,
1064
1162
  filters: PROFILE_FILTER,
1065
- title: ( localizeWithPath(_moduleId, 61, "Select Profile")),
1163
+ title: ( localizeWithPath(_moduleId, 65, "Select Profile")),
1066
1164
  });
1067
1165
  return profileLocation ? profileLocation[0] : null;
1068
1166
  }
@@ -1219,13 +1317,13 @@ let UserDataProfileImportExportState = class UserDataProfileImportExportState ex
1219
1317
  for (const root of this.roots) {
1220
1318
  root.checkbox = {
1221
1319
  isChecked: !root.isFromDefaultProfile(),
1222
- tooltip: ( localizeWithPath(_moduleId, 62, "Select {0}", root.label.label)),
1320
+ tooltip: ( localizeWithPath(_moduleId, 66, "Select {0}", root.label.label)),
1223
1321
  accessibilityInformation: {
1224
- label: ( localizeWithPath(_moduleId, 62, "Select {0}", root.label.label)),
1322
+ label: ( localizeWithPath(_moduleId, 66, "Select {0}", root.label.label)),
1225
1323
  }
1226
1324
  };
1227
1325
  if (root.isFromDefaultProfile()) {
1228
- root.description = ( localizeWithPath(_moduleId, 63, "From Default Profile"));
1326
+ root.description = ( localizeWithPath(_moduleId, 67, "From Default Profile"));
1229
1327
  }
1230
1328
  }
1231
1329
  return this.roots;
@@ -1388,11 +1486,11 @@ let UserDataProfileExportState = class UserDataProfileExportState extends UserDa
1388
1486
  let name = this.profile.name;
1389
1487
  if (this.profile.isDefault) {
1390
1488
  name = await this.quickInputService.input({
1391
- placeHolder: ( localizeWithPath(_moduleId, 64, "Name the profile")),
1392
- title: ( localizeWithPath(_moduleId, 65, "Export Profile")),
1489
+ placeHolder: ( localizeWithPath(_moduleId, 68, "Name the profile")),
1490
+ title: ( localizeWithPath(_moduleId, 69, "Export Profile")),
1393
1491
  async validateInput(input) {
1394
1492
  if (!input.trim()) {
1395
- return ( localizeWithPath(_moduleId, 66, "Profile name must be provided."));
1493
+ return ( localizeWithPath(_moduleId, 70, "Profile name must be provided."));
1396
1494
  }
1397
1495
  return undefined;
1398
1496
  },