@codingame/monaco-vscode-user-data-profile-service-override 7.1.0 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/vscode/src/vs/base/browser/ui/radio/radio.css.js +6 -0
- package/vscode/src/vs/base/browser/ui/radio/radio.js +69 -0
- package/vscode/src/vs/platform/userDataSync/common/keybindingsSync.js +5 -8
- package/vscode/src/vs/platform/userDataSync/common/settingsSync.js +28 -11
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/media/userDataProfilesEditor.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.js +96 -60
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfileActions.js +13 -15
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditor.js +744 -349
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditorModel.js +114 -70
- package/vscode/src/vs/workbench/services/userDataProfile/browser/extensionsResource.js +7 -9
- package/vscode/src/vs/workbench/services/userDataProfile/browser/globalStateResource.js +2 -3
- package/vscode/src/vs/workbench/services/userDataProfile/browser/keybindingsResource.js +2 -3
- package/vscode/src/vs/workbench/services/userDataProfile/browser/settingsResource.js +2 -3
- package/vscode/src/vs/workbench/services/userDataProfile/browser/snippetsResource.js +4 -6
- package/vscode/src/vs/workbench/services/userDataProfile/browser/tasksResource.js +2 -3
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileImportExportService.js +93 -130
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.js +12 -16
- package/vscode/src/vs/workbench/services/userDataSync/common/userDataSyncUtil.js +2 -2
package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditorModel.js
CHANGED
|
@@ -2,7 +2,7 @@ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
|
2
2
|
import { Action, Separator } from 'vscode/vscode/vs/base/common/actions';
|
|
3
3
|
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
4
4
|
import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
|
|
5
|
-
import {
|
|
5
|
+
import { localize } from 'vscode/vscode/vs/nls';
|
|
6
6
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
7
7
|
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
8
8
|
import { ProfileResourceType, isUserDataProfile, toUserDataProfile } from 'vscode/vscode/vs/platform/userDataProfile/common/userDataProfile';
|
|
@@ -30,9 +30,10 @@ import { SIDE_GROUP } from 'vscode/vscode/vs/workbench/services/editor/common/ed
|
|
|
30
30
|
import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands.service';
|
|
31
31
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
32
32
|
import { CONFIG_NEW_WINDOW_PROFILE } from 'vscode/vscode/vs/workbench/common/configuration';
|
|
33
|
+
import { ResourceMap } from 'vscode/vscode/vs/base/common/map';
|
|
34
|
+
import { getErrorMessage } from 'vscode/vscode/vs/base/common/errors';
|
|
33
35
|
|
|
34
36
|
var UserDataProfilesEditorModel_1;
|
|
35
|
-
const _moduleId = "vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditorModel";
|
|
36
37
|
function isProfileResourceTypeElement(element) {
|
|
37
38
|
return element.resourceType !== undefined;
|
|
38
39
|
}
|
|
@@ -121,15 +122,15 @@ let AbstractUserDataProfileElement = class AbstractUserDataProfileElement extend
|
|
|
121
122
|
}
|
|
122
123
|
validate() {
|
|
123
124
|
if (!this.name) {
|
|
124
|
-
this.message = (
|
|
125
|
+
this.message = ( localize(11407, "Profile name is required and must be a non-empty value."));
|
|
125
126
|
return;
|
|
126
127
|
}
|
|
127
|
-
if (this.name !== this.getInitialName() && ( (this.userDataProfilesService.profiles.some(p => p.name === this.name)))) {
|
|
128
|
-
this.message = (
|
|
128
|
+
if (this.shouldValidateName() && this.name !== this.getInitialName() && ( (this.userDataProfilesService.profiles.some(p => p.name === this.name)))) {
|
|
129
|
+
this.message = ( localize(11408, "Profile with name {0} already exists.", this.name));
|
|
129
130
|
return;
|
|
130
131
|
}
|
|
131
132
|
if (this.flags && this.flags.settings && this.flags.keybindings && this.flags.tasks && this.flags.snippets && this.flags.extensions) {
|
|
132
|
-
this.message = (
|
|
133
|
+
this.message = ( localize(11409, "The profile should contain at least one configuration."));
|
|
133
134
|
return;
|
|
134
135
|
}
|
|
135
136
|
this.message = undefined;
|
|
@@ -152,7 +153,7 @@ let AbstractUserDataProfileElement = class AbstractUserDataProfileElement extend
|
|
|
152
153
|
checkbox: undefined,
|
|
153
154
|
resourceType: r,
|
|
154
155
|
action: children.length
|
|
155
|
-
? ( (new Action('_open', (
|
|
156
|
+
? ( (new Action('_open', ( localize(11410, "Open to the Side")), ThemeIcon.asClassName(Codicon.goToFile), true, () => children[0]?.action?.run())))
|
|
156
157
|
: undefined
|
|
157
158
|
};
|
|
158
159
|
}))));
|
|
@@ -193,7 +194,7 @@ let AbstractUserDataProfileElement = class AbstractUserDataProfileElement extend
|
|
|
193
194
|
label: child.label?.label ?? '',
|
|
194
195
|
resource: URI.revive(child.resourceUri),
|
|
195
196
|
icon: child.themeIcon,
|
|
196
|
-
action: ( (new Action('_openChild', (
|
|
197
|
+
action: ( (new Action('_openChild', ( localize(11410, "Open to the Side")), ThemeIcon.asClassName(Codicon.goToFile), true, async () => {
|
|
197
198
|
if (child.parent.type === ProfileResourceType.Extensions) {
|
|
198
199
|
await this.commandService.executeCommand('extension.open', child.handle, undefined, true, undefined, true);
|
|
199
200
|
}
|
|
@@ -206,6 +207,9 @@ let AbstractUserDataProfileElement = class AbstractUserDataProfileElement extend
|
|
|
206
207
|
getInitialName() {
|
|
207
208
|
return '';
|
|
208
209
|
}
|
|
210
|
+
shouldValidateName() {
|
|
211
|
+
return true;
|
|
212
|
+
}
|
|
209
213
|
save() {
|
|
210
214
|
this.saveScheduler.schedule();
|
|
211
215
|
}
|
|
@@ -247,11 +251,10 @@ AbstractUserDataProfileElement = ( (__decorate([
|
|
|
247
251
|
], AbstractUserDataProfileElement)));
|
|
248
252
|
let UserDataProfileElement = class UserDataProfileElement extends AbstractUserDataProfileElement {
|
|
249
253
|
get profile() { return this._profile; }
|
|
250
|
-
constructor(_profile, titleButtons,
|
|
254
|
+
constructor(_profile, titleButtons, actions, userDataProfileService, configurationService, userDataProfileManagementService, userDataProfilesService, commandService, instantiationService) {
|
|
251
255
|
super(_profile.name, _profile.icon, _profile.useDefaultFlags, userDataProfileService.currentProfile.id === _profile.id, userDataProfileManagementService, userDataProfilesService, commandService, instantiationService);
|
|
252
256
|
this._profile = _profile;
|
|
253
257
|
this.titleButtons = titleButtons;
|
|
254
|
-
this.titleActions = titleActions;
|
|
255
258
|
this.actions = actions;
|
|
256
259
|
this.userDataProfileService = userDataProfileService;
|
|
257
260
|
this.configurationService = configurationService;
|
|
@@ -299,23 +302,25 @@ let UserDataProfileElement = class UserDataProfileElement extends AbstractUserDa
|
|
|
299
302
|
}
|
|
300
303
|
};
|
|
301
304
|
UserDataProfileElement = ( (__decorate([
|
|
302
|
-
( (__param(
|
|
303
|
-
( (__param(
|
|
304
|
-
( (__param(
|
|
305
|
-
( (__param(
|
|
306
|
-
( (__param(
|
|
307
|
-
( (__param(
|
|
305
|
+
( (__param(3, IUserDataProfileService))),
|
|
306
|
+
( (__param(4, IConfigurationService))),
|
|
307
|
+
( (__param(5, IUserDataProfileManagementService))),
|
|
308
|
+
( (__param(6, IUserDataProfilesService))),
|
|
309
|
+
( (__param(7, ICommandService))),
|
|
310
|
+
( (__param(8, IInstantiationService)))
|
|
308
311
|
], UserDataProfileElement)));
|
|
309
312
|
const USER_DATA_PROFILE_TEMPLATE_PREVIEW_SCHEME = 'userdataprofiletemplatepreview';
|
|
310
313
|
let NewProfileElement = class NewProfileElement extends AbstractUserDataProfileElement {
|
|
311
|
-
|
|
314
|
+
get copyFromTemplates() { return this._copyFromTemplates; }
|
|
315
|
+
constructor(name, copyFrom, titleButtons, actions, fileService, userDataProfileImportExportService, userDataProfileManagementService, userDataProfilesService, commandService, instantiationService) {
|
|
312
316
|
super(name, undefined, undefined, false, userDataProfileManagementService, userDataProfilesService, commandService, instantiationService);
|
|
313
317
|
this.titleButtons = titleButtons;
|
|
314
|
-
this.titleActions = titleActions;
|
|
315
318
|
this.actions = actions;
|
|
316
319
|
this.fileService = fileService;
|
|
317
320
|
this.userDataProfileImportExportService = userDataProfileImportExportService;
|
|
321
|
+
this._copyFromTemplates = ( (new ResourceMap()));
|
|
318
322
|
this.template = null;
|
|
323
|
+
this.defaultName = name;
|
|
319
324
|
this._copyFrom = copyFrom;
|
|
320
325
|
this._copyFlags = this.getCopyFlagsFrom(copyFrom);
|
|
321
326
|
this.initialize();
|
|
@@ -364,33 +369,49 @@ let NewProfileElement = class NewProfileElement extends AbstractUserDataProfileE
|
|
|
364
369
|
if (this.copyFrom instanceof URI) {
|
|
365
370
|
await this.resolveTemplate(this.copyFrom);
|
|
366
371
|
if (this.template) {
|
|
367
|
-
this.
|
|
368
|
-
this.
|
|
372
|
+
this.copyFromTemplates.set(this.copyFrom, this.template.name);
|
|
373
|
+
if (this.defaultName === this.name) {
|
|
374
|
+
this.name = this.defaultName = this.template.name ?? '';
|
|
375
|
+
}
|
|
376
|
+
if (this.defaultIcon === this.icon) {
|
|
377
|
+
this.icon = this.defaultIcon = this.template.icon;
|
|
378
|
+
}
|
|
369
379
|
this.setCopyFlag(ProfileResourceType.Settings, !!this.template.settings);
|
|
370
380
|
this.setCopyFlag(ProfileResourceType.Keybindings, !!this.template.keybindings);
|
|
371
381
|
this.setCopyFlag(ProfileResourceType.Tasks, !!this.template.tasks);
|
|
372
382
|
this.setCopyFlag(ProfileResourceType.Snippets, !!this.template.snippets);
|
|
373
383
|
this.setCopyFlag(ProfileResourceType.Extensions, !!this.template.extensions);
|
|
384
|
+
this._onDidChange.fire({ copyFromInfo: true });
|
|
374
385
|
}
|
|
375
386
|
return;
|
|
376
387
|
}
|
|
377
388
|
if (isUserDataProfile(this.copyFrom)) {
|
|
378
|
-
this.
|
|
379
|
-
|
|
389
|
+
if (this.defaultName === this.name) {
|
|
390
|
+
this.name = this.defaultName = ( localize(11411, "{0} (Copy)", this.copyFrom.name));
|
|
391
|
+
}
|
|
392
|
+
if (this.defaultIcon === this.icon) {
|
|
393
|
+
this.icon = this.defaultIcon = this.copyFrom.icon;
|
|
394
|
+
}
|
|
380
395
|
this.setCopyFlag(ProfileResourceType.Settings, true);
|
|
381
396
|
this.setCopyFlag(ProfileResourceType.Keybindings, true);
|
|
382
397
|
this.setCopyFlag(ProfileResourceType.Tasks, true);
|
|
383
398
|
this.setCopyFlag(ProfileResourceType.Snippets, true);
|
|
384
399
|
this.setCopyFlag(ProfileResourceType.Extensions, true);
|
|
400
|
+
this._onDidChange.fire({ copyFromInfo: true });
|
|
385
401
|
return;
|
|
386
402
|
}
|
|
387
|
-
this.
|
|
388
|
-
|
|
403
|
+
if (this.defaultName === this.name) {
|
|
404
|
+
this.name = this.defaultName = ( localize(11412, "Untitled"));
|
|
405
|
+
}
|
|
406
|
+
if (this.defaultIcon === this.icon) {
|
|
407
|
+
this.icon = this.defaultIcon = undefined;
|
|
408
|
+
}
|
|
389
409
|
this.setCopyFlag(ProfileResourceType.Settings, false);
|
|
390
410
|
this.setCopyFlag(ProfileResourceType.Keybindings, false);
|
|
391
411
|
this.setCopyFlag(ProfileResourceType.Tasks, false);
|
|
392
412
|
this.setCopyFlag(ProfileResourceType.Snippets, false);
|
|
393
413
|
this.setCopyFlag(ProfileResourceType.Extensions, false);
|
|
414
|
+
this._onDidChange.fire({ copyFromInfo: true });
|
|
394
415
|
}
|
|
395
416
|
finally {
|
|
396
417
|
this.disabled = false;
|
|
@@ -437,8 +458,8 @@ let NewProfileElement = class NewProfileElement extends AbstractUserDataProfileE
|
|
|
437
458
|
if (isUserDataProfile(this.copyFrom)) {
|
|
438
459
|
return this.copyFrom.name;
|
|
439
460
|
}
|
|
440
|
-
if (this.
|
|
441
|
-
return this.
|
|
461
|
+
if (this.copyFrom instanceof URI) {
|
|
462
|
+
return this.copyFromTemplates.get(this.copyFrom);
|
|
442
463
|
}
|
|
443
464
|
return undefined;
|
|
444
465
|
}
|
|
@@ -499,6 +520,9 @@ let NewProfileElement = class NewProfileElement extends AbstractUserDataProfileE
|
|
|
499
520
|
}
|
|
500
521
|
return [];
|
|
501
522
|
}
|
|
523
|
+
shouldValidateName() {
|
|
524
|
+
return !this.copyFrom;
|
|
525
|
+
}
|
|
502
526
|
getInitialName() {
|
|
503
527
|
return this.previewProfile?.name ?? '';
|
|
504
528
|
}
|
|
@@ -512,12 +536,12 @@ let NewProfileElement = class NewProfileElement extends AbstractUserDataProfileE
|
|
|
512
536
|
}
|
|
513
537
|
};
|
|
514
538
|
NewProfileElement = ( (__decorate([
|
|
515
|
-
( (__param(
|
|
516
|
-
( (__param(
|
|
517
|
-
( (__param(
|
|
518
|
-
( (__param(
|
|
519
|
-
( (__param(
|
|
520
|
-
( (__param(
|
|
539
|
+
( (__param(4, IFileService))),
|
|
540
|
+
( (__param(5, IUserDataProfileImportExportService))),
|
|
541
|
+
( (__param(6, IUserDataProfileManagementService))),
|
|
542
|
+
( (__param(7, IUserDataProfilesService))),
|
|
543
|
+
( (__param(8, ICommandService))),
|
|
544
|
+
( (__param(9, IInstantiationService)))
|
|
521
545
|
], NewProfileElement)));
|
|
522
546
|
let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends EditorModel {
|
|
523
547
|
static { UserDataProfilesEditorModel_1 = this; }
|
|
@@ -546,6 +570,7 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
|
|
|
546
570
|
return a.name.localeCompare(b.name);
|
|
547
571
|
});
|
|
548
572
|
}
|
|
573
|
+
get templates() { return this._templates ?? []; }
|
|
549
574
|
constructor(userDataProfileService, userDataProfilesService, userDataProfileManagementService, userDataProfileImportExportService, dialogService, telemetryService, hostService, instantiationService) {
|
|
550
575
|
super();
|
|
551
576
|
this.userDataProfileService = userDataProfileService;
|
|
@@ -588,36 +613,30 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
|
|
|
588
613
|
this._onDidChange.fire(undefined);
|
|
589
614
|
}
|
|
590
615
|
}
|
|
616
|
+
async resolve() {
|
|
617
|
+
await super.resolve();
|
|
618
|
+
this._templates = await this.userDataProfileManagementService.getBuiltinProfileTemplates();
|
|
619
|
+
}
|
|
591
620
|
createProfileElement(profile) {
|
|
592
621
|
const disposables = ( (new DisposableStore()));
|
|
593
|
-
const activateAction = disposables.add(( (new Action('userDataProfile.activate', (
|
|
594
|
-
const copyFromProfileAction = disposables.add(( (new Action('userDataProfile.copyFromProfile', (
|
|
595
|
-
const exportAction = disposables.add(( (new Action('userDataProfile.export', (
|
|
596
|
-
const deleteAction = disposables.add(( (new Action('userDataProfile.delete', (
|
|
597
|
-
const newWindowAction = disposables.add(( (new Action('userDataProfile.newWindow', (
|
|
598
|
-
const useAsNewWindowProfileAction = disposables.add(( (new Action('userDataProfile.useAsNewWindowProfile', (
|
|
599
|
-
const titlePrimaryActions = [];
|
|
600
|
-
titlePrimaryActions.push(newWindowAction);
|
|
601
|
-
const titleSecondaryActions = [];
|
|
602
|
-
titleSecondaryActions.push(copyFromProfileAction);
|
|
603
|
-
titleSecondaryActions.push(exportAction);
|
|
604
|
-
if (!profile.isDefault) {
|
|
605
|
-
titleSecondaryActions.push(( (new Separator())));
|
|
606
|
-
titleSecondaryActions.push(deleteAction);
|
|
607
|
-
}
|
|
622
|
+
const activateAction = disposables.add(( (new Action('userDataProfile.activate', ( localize(11413, "Use for Current Window")), ThemeIcon.asClassName(Codicon.check), true, () => this.userDataProfileManagementService.switchProfile(profileElement.profile)))));
|
|
623
|
+
const copyFromProfileAction = disposables.add(( (new Action('userDataProfile.copyFromProfile', ( localize(11414, "Duplicate...")), ThemeIcon.asClassName(Codicon.copy), true, () => this.createNewProfile(profileElement.profile)))));
|
|
624
|
+
const exportAction = disposables.add(( (new Action('userDataProfile.export', ( localize(11415, "Export...")), ThemeIcon.asClassName(Codicon.export), true, () => this.exportProfile(profileElement.profile)))));
|
|
625
|
+
const deleteAction = disposables.add(( (new Action('userDataProfile.delete', ( localize(11416, "Delete")), ThemeIcon.asClassName(Codicon.trash), true, () => this.removeProfile(profileElement.profile)))));
|
|
626
|
+
const newWindowAction = disposables.add(( (new Action('userDataProfile.newWindow', ( localize(11417, "Open New Window with this Profile")), ThemeIcon.asClassName(Codicon.emptyWindow), true, () => this.openWindow(profileElement.profile)))));
|
|
627
|
+
const useAsNewWindowProfileAction = disposables.add(( (new Action('userDataProfile.useAsNewWindowProfile', ( localize(11418, "Use for New Windows")), undefined, true, () => profileElement.toggleNewWindowProfile()))));
|
|
608
628
|
const primaryActions = [];
|
|
609
629
|
primaryActions.push(newWindowAction);
|
|
630
|
+
if (!profile.isDefault) {
|
|
631
|
+
primaryActions.push(deleteAction);
|
|
632
|
+
}
|
|
610
633
|
const secondaryActions = [];
|
|
611
634
|
secondaryActions.push(activateAction);
|
|
612
635
|
secondaryActions.push(useAsNewWindowProfileAction);
|
|
613
636
|
secondaryActions.push(( (new Separator())));
|
|
614
637
|
secondaryActions.push(copyFromProfileAction);
|
|
615
638
|
secondaryActions.push(exportAction);
|
|
616
|
-
|
|
617
|
-
secondaryActions.push(( (new Separator())));
|
|
618
|
-
secondaryActions.push(deleteAction);
|
|
619
|
-
}
|
|
620
|
-
const profileElement = disposables.add(this.instantiationService.createInstance(UserDataProfileElement, profile, [[], []], [titlePrimaryActions, titleSecondaryActions], [primaryActions, secondaryActions]));
|
|
639
|
+
const profileElement = disposables.add(this.instantiationService.createInstance(UserDataProfileElement, profile, [[], []], [primaryActions, secondaryActions]));
|
|
621
640
|
activateAction.checked = this.userDataProfileService.currentProfile.id === profileElement.profile.id;
|
|
622
641
|
disposables.add(this.userDataProfileService.onDidChangeCurrentProfile(() => activateAction.checked = this.userDataProfileService.currentProfile.id === profileElement.profile.id));
|
|
623
642
|
useAsNewWindowProfileAction.checked = profileElement.isNewWindowProfile;
|
|
@@ -632,27 +651,44 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
|
|
|
632
651
|
if (this.newProfileElement) {
|
|
633
652
|
const result = await this.dialogService.confirm({
|
|
634
653
|
type: 'info',
|
|
635
|
-
message: (
|
|
636
|
-
|
|
637
|
-
11,
|
|
654
|
+
message: ( localize(
|
|
655
|
+
11419,
|
|
638
656
|
"A new profile is already being created. Do you want to discard it and create a new one?"
|
|
639
657
|
)),
|
|
640
|
-
primaryButton: (
|
|
641
|
-
cancelButton: (
|
|
658
|
+
primaryButton: ( localize(11420, "Discard & Create")),
|
|
659
|
+
cancelButton: ( localize(11421, "Cancel"))
|
|
642
660
|
});
|
|
643
661
|
if (!result.confirmed) {
|
|
644
662
|
return;
|
|
645
663
|
}
|
|
646
664
|
this.revert();
|
|
647
665
|
}
|
|
666
|
+
if (copyFrom instanceof URI) {
|
|
667
|
+
try {
|
|
668
|
+
await this.userDataProfileImportExportService.resolveProfileTemplate(copyFrom);
|
|
669
|
+
}
|
|
670
|
+
catch (error) {
|
|
671
|
+
this.dialogService.error(getErrorMessage(error));
|
|
672
|
+
return;
|
|
673
|
+
}
|
|
674
|
+
}
|
|
648
675
|
if (!this.newProfileElement) {
|
|
649
676
|
const disposables = ( (new DisposableStore()));
|
|
650
677
|
const cancellationTokenSource = ( (new CancellationTokenSource()));
|
|
651
678
|
disposables.add(toDisposable(() => cancellationTokenSource.dispose(true)));
|
|
652
|
-
const createAction = disposables.add(( (new Action('userDataProfile.create', (
|
|
653
|
-
const cancelAction = disposables.add(( (new Action('userDataProfile.cancel', (
|
|
654
|
-
const previewProfileAction = disposables.add(( (new Action('userDataProfile.preview', (
|
|
655
|
-
this.newProfileElement = disposables.add(this.instantiationService.createInstance(NewProfileElement, copyFrom ? '' : (
|
|
679
|
+
const createAction = disposables.add(( (new Action('userDataProfile.create', ( localize(11422, "Create")), undefined, true, () => this.saveNewProfile(false, cancellationTokenSource.token)))));
|
|
680
|
+
const cancelAction = disposables.add(( (new Action('userDataProfile.cancel', ( localize(11422, "Cancel")), ThemeIcon.asClassName(Codicon.trash), true, () => this.discardNewProfile()))));
|
|
681
|
+
const previewProfileAction = disposables.add(( (new Action('userDataProfile.preview', ( localize(11423, "Preview")), ThemeIcon.asClassName(Codicon.openPreview), true, () => this.previewNewProfile(cancellationTokenSource.token)))));
|
|
682
|
+
this.newProfileElement = disposables.add(this.instantiationService.createInstance(NewProfileElement, copyFrom ? '' : ( localize(11423, "Untitled")), copyFrom, [[createAction], [cancelAction, previewProfileAction]], [[cancelAction], []]));
|
|
683
|
+
const updateCreateActionLabel = () => {
|
|
684
|
+
if (this.newProfileElement?.copyFrom && ( (this.userDataProfilesService.profiles.some(p => p.name === this.newProfileElement?.name)))) {
|
|
685
|
+
createAction.label = ( localize(11424, "Replace"));
|
|
686
|
+
}
|
|
687
|
+
else {
|
|
688
|
+
createAction.label = ( localize(11424, "Create"));
|
|
689
|
+
}
|
|
690
|
+
};
|
|
691
|
+
updateCreateActionLabel();
|
|
656
692
|
disposables.add(this.newProfileElement.onDidChange(e => {
|
|
657
693
|
if (e.preview) {
|
|
658
694
|
previewProfileAction.checked = !!this.newProfileElement?.previewProfile;
|
|
@@ -660,6 +696,13 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
|
|
|
660
696
|
if (e.disabled || e.message) {
|
|
661
697
|
previewProfileAction.enabled = createAction.enabled = !this.newProfileElement?.disabled && !this.newProfileElement?.message;
|
|
662
698
|
}
|
|
699
|
+
if (e.name || e.copyFrom) {
|
|
700
|
+
updateCreateActionLabel();
|
|
701
|
+
}
|
|
702
|
+
}));
|
|
703
|
+
disposables.add(this.userDataProfilesService.onDidChangeProfiles((e) => {
|
|
704
|
+
updateCreateActionLabel();
|
|
705
|
+
this.newProfileElement?.validate();
|
|
663
706
|
}));
|
|
664
707
|
this._profiles.push([this.newProfileElement, disposables]);
|
|
665
708
|
this._onDidChange.fire(this.newProfileElement);
|
|
@@ -757,7 +800,13 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
|
|
|
757
800
|
}
|
|
758
801
|
if (profile && !profile.isTransient && this.newProfileElement) {
|
|
759
802
|
this.removeNewProfile();
|
|
760
|
-
this.
|
|
803
|
+
const existing = this._profiles.find(([p]) => p.name === profile.name);
|
|
804
|
+
if (existing) {
|
|
805
|
+
this._onDidChange.fire(existing[0]);
|
|
806
|
+
}
|
|
807
|
+
else {
|
|
808
|
+
this.onDidChangeProfiles({ added: [profile], removed: [], updated: [], all: this.userDataProfilesService.profiles });
|
|
809
|
+
}
|
|
761
810
|
}
|
|
762
811
|
return profile;
|
|
763
812
|
}
|
|
@@ -774,14 +823,9 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
|
|
|
774
823
|
async removeProfile(profile) {
|
|
775
824
|
const result = await this.dialogService.confirm({
|
|
776
825
|
type: 'info',
|
|
777
|
-
message: (
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
"Are you sure you want to delete the profile '{0}'?",
|
|
781
|
-
profile.name
|
|
782
|
-
)),
|
|
783
|
-
primaryButton: ( localizeWithPath(_moduleId, 8, "Delete")),
|
|
784
|
-
cancelButton: ( localizeWithPath(_moduleId, 13, "Cancel"))
|
|
826
|
+
message: ( localize(11425, "Are you sure you want to delete the profile '{0}'?", profile.name)),
|
|
827
|
+
primaryButton: ( localize(11425, "Delete")),
|
|
828
|
+
cancelButton: ( localize(11425, "Cancel"))
|
|
785
829
|
});
|
|
786
830
|
if (result.confirmed) {
|
|
787
831
|
await this.userDataProfileManagementService.removeProfile(profile);
|
|
@@ -2,7 +2,7 @@ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
|
2
2
|
import { CancellationToken } from 'vscode/vscode/vs/base/common/cancellation';
|
|
3
3
|
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
4
4
|
import { DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
5
|
-
import {
|
|
5
|
+
import { localize } from 'vscode/vscode/vs/nls';
|
|
6
6
|
import { GlobalExtensionEnablementService } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionEnablementService';
|
|
7
7
|
import { EXTENSION_INSTALL_SKIP_WALKTHROUGH_CONTEXT } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagement';
|
|
8
8
|
import { IExtensionManagementService, IExtensionGalleryService, IGlobalExtensionEnablementService } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagement.service';
|
|
@@ -17,7 +17,6 @@ import { IUserDataProfileStorageService } from 'vscode/vscode/vs/platform/userDa
|
|
|
17
17
|
import { TreeItemCollapsibleState } from 'vscode/vscode/vs/workbench/common/views';
|
|
18
18
|
import { IUserDataProfileService } from 'vscode/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.service';
|
|
19
19
|
|
|
20
|
-
const _moduleId = "vs/workbench/services/userDataProfile/browser/extensionsResource";
|
|
21
20
|
let ExtensionsResourceInitializer = class ExtensionsResourceInitializer {
|
|
22
21
|
constructor(userDataProfileService, extensionManagementService, extensionGalleryService, extensionEnablementService, logService) {
|
|
23
22
|
this.userDataProfileService = userDataProfileService;
|
|
@@ -170,9 +169,8 @@ let ExtensionsResource = class ExtensionsResource {
|
|
|
170
169
|
if (token.isCancellationRequested) {
|
|
171
170
|
return;
|
|
172
171
|
}
|
|
173
|
-
progress?.((
|
|
174
|
-
|
|
175
|
-
0,
|
|
172
|
+
progress?.(( localize(
|
|
173
|
+
8764,
|
|
176
174
|
"Installing extension {0}...",
|
|
177
175
|
installExtensionInfo.extension.displayName ?? installExtensionInfo.extension.identifier.id
|
|
178
176
|
)));
|
|
@@ -264,7 +262,7 @@ class ExtensionsResourceTreeItem {
|
|
|
264
262
|
constructor() {
|
|
265
263
|
this.type = ProfileResourceType.Extensions;
|
|
266
264
|
this.handle = ProfileResourceType.Extensions;
|
|
267
|
-
this.label = { label: (
|
|
265
|
+
this.label = { label: ( localize(8765, "Extensions")) };
|
|
268
266
|
this.collapsibleState = TreeItemCollapsibleState.Expanded;
|
|
269
267
|
this.contextValue = ProfileResourceType.Extensions;
|
|
270
268
|
this.excludedExtensions = ( (new Set()));
|
|
@@ -277,7 +275,7 @@ class ExtensionsResourceTreeItem {
|
|
|
277
275
|
handle: e.identifier.id.toLowerCase(),
|
|
278
276
|
parent: this,
|
|
279
277
|
label: { label: e.displayName || e.identifier.id },
|
|
280
|
-
description: e.disabled ? (
|
|
278
|
+
description: e.disabled ? ( localize(8766, "Disabled")) : undefined,
|
|
281
279
|
collapsibleState: TreeItemCollapsibleState.None,
|
|
282
280
|
checkbox: that.checkbox ? {
|
|
283
281
|
get isChecked() { return !( (that.excludedExtensions.has(e.identifier.id.toLowerCase()))); },
|
|
@@ -289,9 +287,9 @@ class ExtensionsResourceTreeItem {
|
|
|
289
287
|
that.excludedExtensions.add(e.identifier.id.toLowerCase());
|
|
290
288
|
}
|
|
291
289
|
},
|
|
292
|
-
tooltip: (
|
|
290
|
+
tooltip: ( localize(8767, "Select {0} Extension", e.displayName || e.identifier.id)),
|
|
293
291
|
accessibilityInformation: {
|
|
294
|
-
label: (
|
|
292
|
+
label: ( localize(8767, "Select {0} Extension", e.displayName || e.identifier.id)),
|
|
295
293
|
}
|
|
296
294
|
} : undefined,
|
|
297
295
|
themeIcon: Codicon.extensions,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
|
-
import {
|
|
2
|
+
import { localize } from 'vscode/vscode/vs/nls';
|
|
3
3
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
4
4
|
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
|
|
5
5
|
import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
@@ -10,7 +10,6 @@ import { IUserDataProfileStorageService } from 'vscode/vscode/vs/platform/userDa
|
|
|
10
10
|
import { API_OPEN_EDITOR_COMMAND_ID } from 'vscode/vscode/vs/workbench/browser/parts/editor/editorCommands';
|
|
11
11
|
import { TreeItemCollapsibleState } from 'vscode/vscode/vs/workbench/common/views';
|
|
12
12
|
|
|
13
|
-
const _moduleId = "vs/workbench/services/userDataProfile/browser/globalStateResource";
|
|
14
13
|
let GlobalStateResourceInitializer = class GlobalStateResourceInitializer {
|
|
15
14
|
constructor(storageService) {
|
|
16
15
|
this.storageService = storageService;
|
|
@@ -86,7 +85,7 @@ class GlobalStateResourceTreeItem {
|
|
|
86
85
|
this.uriIdentityService = uriIdentityService;
|
|
87
86
|
this.type = ProfileResourceType.GlobalState;
|
|
88
87
|
this.handle = ProfileResourceType.GlobalState;
|
|
89
|
-
this.label = { label: (
|
|
88
|
+
this.label = { label: ( localize(8759, "UI State")) };
|
|
90
89
|
this.collapsibleState = TreeItemCollapsibleState.Collapsed;
|
|
91
90
|
}
|
|
92
91
|
async getChildren() {
|
|
@@ -9,10 +9,9 @@ import { TreeItemCollapsibleState } from 'vscode/vscode/vs/workbench/common/view
|
|
|
9
9
|
import { ProfileResourceType } from 'vscode/vscode/vs/platform/userDataProfile/common/userDataProfile';
|
|
10
10
|
import { API_OPEN_EDITOR_COMMAND_ID } from 'vscode/vscode/vs/workbench/browser/parts/editor/editorCommands';
|
|
11
11
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
12
|
-
import {
|
|
12
|
+
import { localize } from 'vscode/vscode/vs/nls';
|
|
13
13
|
import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
14
14
|
|
|
15
|
-
const _moduleId = "vs/workbench/services/userDataProfile/browser/keybindingsResource";
|
|
16
15
|
let KeybindingsResourceInitializer = class KeybindingsResourceInitializer {
|
|
17
16
|
constructor(userDataProfileService, fileService, logService) {
|
|
18
17
|
this.userDataProfileService = userDataProfileService;
|
|
@@ -82,7 +81,7 @@ let KeybindingsResourceTreeItem = class KeybindingsResourceTreeItem {
|
|
|
82
81
|
this.instantiationService = instantiationService;
|
|
83
82
|
this.type = ProfileResourceType.Keybindings;
|
|
84
83
|
this.handle = ProfileResourceType.Keybindings;
|
|
85
|
-
this.label = { label: (
|
|
84
|
+
this.label = { label: ( localize(8760, "Keyboard Shortcuts")) };
|
|
86
85
|
this.collapsibleState = TreeItemCollapsibleState.Expanded;
|
|
87
86
|
}
|
|
88
87
|
isFromDefaultProfile() {
|
|
@@ -12,10 +12,9 @@ import { TreeItemCollapsibleState } from 'vscode/vscode/vs/workbench/common/view
|
|
|
12
12
|
import { ProfileResourceType } from 'vscode/vscode/vs/platform/userDataProfile/common/userDataProfile';
|
|
13
13
|
import { API_OPEN_EDITOR_COMMAND_ID } from 'vscode/vscode/vs/workbench/browser/parts/editor/editorCommands';
|
|
14
14
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
15
|
-
import {
|
|
15
|
+
import { localize } from 'vscode/vscode/vs/nls';
|
|
16
16
|
import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
17
17
|
|
|
18
|
-
const _moduleId = "vs/workbench/services/userDataProfile/browser/settingsResource";
|
|
19
18
|
let SettingsResourceInitializer = class SettingsResourceInitializer {
|
|
20
19
|
constructor(userDataProfileService, fileService, logService) {
|
|
21
20
|
this.userDataProfileService = userDataProfileService;
|
|
@@ -103,7 +102,7 @@ let SettingsResourceTreeItem = class SettingsResourceTreeItem {
|
|
|
103
102
|
this.instantiationService = instantiationService;
|
|
104
103
|
this.type = ProfileResourceType.Settings;
|
|
105
104
|
this.handle = ProfileResourceType.Settings;
|
|
106
|
-
this.label = { label: (
|
|
105
|
+
this.label = { label: ( localize(8758, "Settings")) };
|
|
107
106
|
this.collapsibleState = TreeItemCollapsibleState.Expanded;
|
|
108
107
|
}
|
|
109
108
|
async getChildren() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
2
|
import { VSBuffer } from 'vscode/vscode/vs/base/common/buffer';
|
|
3
3
|
import { ResourceSet } from 'vscode/vscode/vs/base/common/map';
|
|
4
|
-
import {
|
|
4
|
+
import { localize } from 'vscode/vscode/vs/nls';
|
|
5
5
|
import { FileOperationError, FileOperationResult } from 'vscode/vscode/vs/platform/files/common/files';
|
|
6
6
|
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
|
|
7
7
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
@@ -11,7 +11,6 @@ import { API_OPEN_EDITOR_COMMAND_ID } from 'vscode/vscode/vs/workbench/browser/p
|
|
|
11
11
|
import { TreeItemCollapsibleState } from 'vscode/vscode/vs/workbench/common/views';
|
|
12
12
|
import { IUserDataProfileService } from 'vscode/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.service';
|
|
13
13
|
|
|
14
|
-
const _moduleId = "vs/workbench/services/userDataProfile/browser/snippetsResource";
|
|
15
14
|
let SnippetsResourceInitializer = class SnippetsResourceInitializer {
|
|
16
15
|
constructor(userDataProfileService, fileService, uriIdentityService) {
|
|
17
16
|
this.userDataProfileService = userDataProfileService;
|
|
@@ -94,7 +93,7 @@ let SnippetsResourceTreeItem = class SnippetsResourceTreeItem {
|
|
|
94
93
|
this.uriIdentityService = uriIdentityService;
|
|
95
94
|
this.type = ProfileResourceType.Snippets;
|
|
96
95
|
this.handle = ( (this.profile.snippetsHome.toString()));
|
|
97
|
-
this.label = { label: (
|
|
96
|
+
this.label = { label: ( localize(8762, "Snippets")) };
|
|
98
97
|
this.collapsibleState = TreeItemCollapsibleState.Collapsed;
|
|
99
98
|
this.excludedSnippets = ( (new ResourceSet()));
|
|
100
99
|
}
|
|
@@ -121,9 +120,8 @@ let SnippetsResourceTreeItem = class SnippetsResourceTreeItem {
|
|
|
121
120
|
}
|
|
122
121
|
},
|
|
123
122
|
accessibilityInformation: {
|
|
124
|
-
label: (
|
|
125
|
-
|
|
126
|
-
1,
|
|
123
|
+
label: ( localize(
|
|
124
|
+
8763,
|
|
127
125
|
"Select Snippet {0}",
|
|
128
126
|
this.uriIdentityService.extUri.basename(resource)
|
|
129
127
|
)),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
2
|
import { VSBuffer } from 'vscode/vscode/vs/base/common/buffer';
|
|
3
|
-
import {
|
|
3
|
+
import { localize } from 'vscode/vscode/vs/nls';
|
|
4
4
|
import { FileOperationError, FileOperationResult } from 'vscode/vscode/vs/platform/files/common/files';
|
|
5
5
|
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
|
|
6
6
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
@@ -11,7 +11,6 @@ import { API_OPEN_EDITOR_COMMAND_ID } from 'vscode/vscode/vs/workbench/browser/p
|
|
|
11
11
|
import { TreeItemCollapsibleState } from 'vscode/vscode/vs/workbench/common/views';
|
|
12
12
|
import { IUserDataProfileService } from 'vscode/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.service';
|
|
13
13
|
|
|
14
|
-
const _moduleId = "vs/workbench/services/userDataProfile/browser/tasksResource";
|
|
15
14
|
let TasksResourceInitializer = class TasksResourceInitializer {
|
|
16
15
|
constructor(userDataProfileService, fileService, logService) {
|
|
17
16
|
this.userDataProfileService = userDataProfileService;
|
|
@@ -81,7 +80,7 @@ let TasksResourceTreeItem = class TasksResourceTreeItem {
|
|
|
81
80
|
this.instantiationService = instantiationService;
|
|
82
81
|
this.type = ProfileResourceType.Tasks;
|
|
83
82
|
this.handle = ProfileResourceType.Tasks;
|
|
84
|
-
this.label = { label: (
|
|
83
|
+
this.label = { label: ( localize(8761, "Tasks")) };
|
|
85
84
|
this.collapsibleState = TreeItemCollapsibleState.Expanded;
|
|
86
85
|
}
|
|
87
86
|
async getChildren() {
|