@codingame/monaco-vscode-user-data-profile-service-override 10.1.4 → 11.0.1
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 +3 -2
- package/vscode/src/vs/platform/userDataProfile/browser/userDataProfile.js +1 -8
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.js +84 -27
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfileActions.js +4 -7
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditor.js +101 -85
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditorModel.js +27 -27
- package/vscode/src/vs/workbench/services/userDataProfile/browser/extensionsResource.js +5 -5
- package/vscode/src/vs/workbench/services/userDataProfile/browser/globalStateResource.js +1 -1
- package/vscode/src/vs/workbench/services/userDataProfile/browser/keybindingsResource.js +1 -1
- package/vscode/src/vs/workbench/services/userDataProfile/browser/settingsResource.js +1 -1
- package/vscode/src/vs/workbench/services/userDataProfile/browser/snippetsResource.js +2 -2
- package/vscode/src/vs/workbench/services/userDataProfile/browser/tasksResource.js +1 -1
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileImportExportService.js +40 -41
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.js +8 -8
- package/vscode/src/vs/workbench/services/userDataSync/browser/userDataSyncInit.js +6 -6
- package/_virtual/semver.js +0 -5
- package/vscode/src/vs/platform/userDataSync/common/extensionsMerge.js +0 -331
- package/vscode/src/vs/platform/userDataSync/common/extensionsSync.js +0 -546
- package/vscode/src/vs/platform/userDataSync/common/globalStateMerge.js +0 -102
- package/vscode/src/vs/platform/userDataSync/common/globalStateSync.js +0 -431
- package/vscode/src/vs/platform/userDataSync/common/keybindingsMerge.js +0 -277
- package/vscode/src/vs/platform/userDataSync/common/keybindingsSync.js +0 -325
- package/vscode/src/vs/platform/userDataSync/common/settingsSync.js +0 -338
- package/vscode/src/vs/platform/userDataSync/common/snippetsMerge.js +0 -126
- package/vscode/src/vs/platform/userDataSync/common/snippetsSync.js +0 -478
- package/vscode/src/vs/platform/userDataSync/common/tasksSync.js +0 -245
package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditorModel.js
CHANGED
|
@@ -166,15 +166,15 @@ let AbstractUserDataProfileElement = class AbstractUserDataProfileElement extend
|
|
|
166
166
|
}
|
|
167
167
|
validate() {
|
|
168
168
|
if (!this.name) {
|
|
169
|
-
this.message = ( localize(
|
|
169
|
+
this.message = ( localize(11755, "Profile name is required and must be a non-empty value."));
|
|
170
170
|
return;
|
|
171
171
|
}
|
|
172
172
|
if (this.shouldValidateName() && this.name !== this.getInitialName() && ( (this.userDataProfilesService.profiles.some(p => p.name === this.name)))) {
|
|
173
|
-
this.message = ( localize(
|
|
173
|
+
this.message = ( localize(11756, "Profile with name {0} already exists.", this.name));
|
|
174
174
|
return;
|
|
175
175
|
}
|
|
176
176
|
if (this.flags && this.flags.settings && this.flags.keybindings && this.flags.tasks && this.flags.snippets && this.flags.extensions) {
|
|
177
|
-
this.message = ( localize(
|
|
177
|
+
this.message = ( localize(11757, "The profile should contain at least one configuration."));
|
|
178
178
|
return;
|
|
179
179
|
}
|
|
180
180
|
this.message = undefined;
|
|
@@ -196,7 +196,7 @@ let AbstractUserDataProfileElement = class AbstractUserDataProfileElement extend
|
|
|
196
196
|
checkbox: undefined,
|
|
197
197
|
resourceType: r,
|
|
198
198
|
openAction: children.length
|
|
199
|
-
? ( (new Action('_open', ( localize(
|
|
199
|
+
? ( (new Action('_open', ( localize(11758, "Open to the Side")), ThemeIcon.asClassName(Codicon.goToFile), true, () => children[0]?.openAction?.run())))
|
|
200
200
|
: undefined
|
|
201
201
|
};
|
|
202
202
|
}))));
|
|
@@ -238,7 +238,7 @@ 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(
|
|
241
|
+
openAction: ( (new Action('_openChild', ( localize(11758, "Open to the Side")), ThemeIcon.asClassName(Codicon.goToFile), true, async () => {
|
|
242
242
|
if (child.parent.type === "extensions" ) {
|
|
243
243
|
await this.commandService.executeCommand('extension.open', child.handle, undefined, true, undefined, true);
|
|
244
244
|
}
|
|
@@ -401,7 +401,7 @@ let UserDataProfileElement = class UserDataProfileElement extends AbstractUserDa
|
|
|
401
401
|
return (
|
|
402
402
|
(children.map(child => this.toUserDataProfileResourceChildElement(child, undefined, [{
|
|
403
403
|
id: 'applyToAllProfiles',
|
|
404
|
-
label: ( localize(
|
|
404
|
+
label: ( localize(11759, "Apply Extension to all Profiles")),
|
|
405
405
|
checked: child.applicationScoped,
|
|
406
406
|
enabled: true,
|
|
407
407
|
class: '',
|
|
@@ -533,7 +533,7 @@ let NewProfileElement = class NewProfileElement extends AbstractUserDataProfileE
|
|
|
533
533
|
}
|
|
534
534
|
if (isUserDataProfile(this.copyFrom)) {
|
|
535
535
|
if (this.defaultName === this.name) {
|
|
536
|
-
this.name = this.defaultName = ( localize(
|
|
536
|
+
this.name = this.defaultName = ( localize(11760, "{0} (Copy)", this.copyFrom.name));
|
|
537
537
|
}
|
|
538
538
|
if (this.defaultIcon === this.icon) {
|
|
539
539
|
this.icon = this.defaultIcon = this.copyFrom.icon;
|
|
@@ -547,7 +547,7 @@ let NewProfileElement = class NewProfileElement extends AbstractUserDataProfileE
|
|
|
547
547
|
return;
|
|
548
548
|
}
|
|
549
549
|
if (this.defaultName === this.name) {
|
|
550
|
-
this.name = this.defaultName = ( localize(
|
|
550
|
+
this.name = this.defaultName = ( localize(11761, "Untitled"));
|
|
551
551
|
}
|
|
552
552
|
if (this.defaultIcon === this.icon) {
|
|
553
553
|
this.icon = this.defaultIcon = undefined;
|
|
@@ -775,11 +775,11 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
|
|
|
775
775
|
}
|
|
776
776
|
createProfileElement(profile) {
|
|
777
777
|
const disposables = ( (new DisposableStore()));
|
|
778
|
-
const activateAction = disposables.add(( (new Action('userDataProfile.activate', ( localize(
|
|
779
|
-
const copyFromProfileAction = disposables.add(( (new Action('userDataProfile.copyFromProfile', ( localize(
|
|
780
|
-
const exportAction = disposables.add(( (new Action('userDataProfile.export', ( localize(
|
|
781
|
-
const deleteAction = disposables.add(( (new Action('userDataProfile.delete', ( localize(
|
|
782
|
-
const newWindowAction = disposables.add(( (new Action('userDataProfile.newWindow', ( localize(
|
|
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)))));
|
|
783
783
|
const primaryActions = [];
|
|
784
784
|
primaryActions.push(activateAction);
|
|
785
785
|
primaryActions.push(newWindowAction);
|
|
@@ -800,11 +800,11 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
|
|
|
800
800
|
const result = await this.dialogService.confirm({
|
|
801
801
|
type: 'info',
|
|
802
802
|
message: ( localize(
|
|
803
|
-
|
|
803
|
+
11767,
|
|
804
804
|
"A new profile is already being created. Do you want to discard it and create a new one?"
|
|
805
805
|
)),
|
|
806
|
-
primaryButton: ( localize(
|
|
807
|
-
cancelButton: ( localize(
|
|
806
|
+
primaryButton: ( localize(11768, "Discard & Create")),
|
|
807
|
+
cancelButton: ( localize(11769, "Cancel"))
|
|
808
808
|
});
|
|
809
809
|
if (!result.confirmed) {
|
|
810
810
|
return;
|
|
@@ -826,24 +826,24 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
|
|
|
826
826
|
disposables.add(toDisposable(() => cancellationTokenSource.dispose(true)));
|
|
827
827
|
const primaryActions = [];
|
|
828
828
|
const secondaryActions = [];
|
|
829
|
-
const createAction = disposables.add(( (new Action('userDataProfile.create', ( localize(
|
|
829
|
+
const createAction = disposables.add(( (new Action('userDataProfile.create', ( localize(11770, "Create")), undefined, true, () => this.saveNewProfile(false, cancellationTokenSource.token)))));
|
|
830
830
|
primaryActions.push(createAction);
|
|
831
831
|
if (isWeb && copyFrom instanceof URI && isProfileURL(copyFrom)) {
|
|
832
|
-
primaryActions.push(( (new Action('userDataProfile.createInDesktop', ( localize(
|
|
832
|
+
primaryActions.push(( (new Action('userDataProfile.createInDesktop', ( localize(11771, "Create in {0}", this.productService.nameLong)), undefined, true, () => this.openerService.open(copyFrom, { openExternal: true })))));
|
|
833
833
|
}
|
|
834
|
-
const cancelAction = disposables.add(( (new Action('userDataProfile.cancel', ( localize(
|
|
834
|
+
const cancelAction = disposables.add(( (new Action('userDataProfile.cancel', ( localize(11769, "Cancel")), ThemeIcon.asClassName(Codicon.trash), true, () => this.discardNewProfile()))));
|
|
835
835
|
secondaryActions.push(cancelAction);
|
|
836
|
-
const previewProfileAction = disposables.add(( (new Action('userDataProfile.preview', ( localize(
|
|
836
|
+
const previewProfileAction = disposables.add(( (new Action('userDataProfile.preview', ( localize(11772, "Preview")), ThemeIcon.asClassName(Codicon.openPreview), true, () => this.previewNewProfile(cancellationTokenSource.token)))));
|
|
837
837
|
secondaryActions.push(previewProfileAction);
|
|
838
|
-
const exportAction = disposables.add(( (new Action('userDataProfile.export', ( localize(
|
|
839
|
-
this.newProfileElement = disposables.add(this.instantiationService.createInstance(NewProfileElement, copyFrom ? '' : ( localize(
|
|
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
840
|
const updateCreateActionLabel = () => {
|
|
841
841
|
if (createAction.enabled) {
|
|
842
842
|
if (this.newProfileElement?.copyFrom && ( (this.userDataProfilesService.profiles.some(p => !p.isTransient && p.name === this.newProfileElement?.name)))) {
|
|
843
|
-
createAction.label = ( localize(
|
|
843
|
+
createAction.label = ( localize(11773, "Replace"));
|
|
844
844
|
}
|
|
845
845
|
else {
|
|
846
|
-
createAction.label = ( localize(
|
|
846
|
+
createAction.label = ( localize(11770, "Create"));
|
|
847
847
|
}
|
|
848
848
|
}
|
|
849
849
|
};
|
|
@@ -1000,9 +1000,9 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
|
|
|
1000
1000
|
async removeProfile(profile) {
|
|
1001
1001
|
const result = await this.dialogService.confirm({
|
|
1002
1002
|
type: 'info',
|
|
1003
|
-
message: ( localize(
|
|
1004
|
-
primaryButton: ( localize(
|
|
1005
|
-
cancelButton: ( localize(
|
|
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"))
|
|
1006
1006
|
});
|
|
1007
1007
|
if (result.confirmed) {
|
|
1008
1008
|
await this.userDataProfileManagementService.removeProfile(profile);
|
|
@@ -168,7 +168,7 @@ let ExtensionsResource = class ExtensionsResource {
|
|
|
168
168
|
return;
|
|
169
169
|
}
|
|
170
170
|
progress?.(( localize(
|
|
171
|
-
|
|
171
|
+
9002,
|
|
172
172
|
"Installing extension {0}...",
|
|
173
173
|
installExtensionInfo.extension.displayName ?? installExtensionInfo.extension.identifier.id
|
|
174
174
|
)));
|
|
@@ -261,7 +261,7 @@ class ExtensionsResourceTreeItem {
|
|
|
261
261
|
constructor() {
|
|
262
262
|
this.type = "extensions" ;
|
|
263
263
|
this.handle = "extensions" ;
|
|
264
|
-
this.label = { label: ( localize(
|
|
264
|
+
this.label = { label: ( localize(9003, "Extensions")) };
|
|
265
265
|
this.collapsibleState = TreeItemCollapsibleState.Expanded;
|
|
266
266
|
this.contextValue = "extensions" ;
|
|
267
267
|
this.excludedExtensions = ( (new Set()));
|
|
@@ -275,7 +275,7 @@ class ExtensionsResourceTreeItem {
|
|
|
275
275
|
handle: e.identifier.id.toLowerCase(),
|
|
276
276
|
parent: this,
|
|
277
277
|
label: { label: e.displayName || e.identifier.id },
|
|
278
|
-
description: e.applicationScoped ? ( localize(
|
|
278
|
+
description: e.applicationScoped ? ( localize(9004, "All Profiles")) : undefined,
|
|
279
279
|
collapsibleState: TreeItemCollapsibleState.None,
|
|
280
280
|
checkbox: that.checkbox ? {
|
|
281
281
|
get isChecked() { return !( (that.excludedExtensions.has(e.identifier.id.toLowerCase()))); },
|
|
@@ -287,9 +287,9 @@ class ExtensionsResourceTreeItem {
|
|
|
287
287
|
that.excludedExtensions.add(e.identifier.id.toLowerCase());
|
|
288
288
|
}
|
|
289
289
|
},
|
|
290
|
-
tooltip: ( localize(
|
|
290
|
+
tooltip: ( localize(9005, "Select {0} Extension", e.displayName || e.identifier.id)),
|
|
291
291
|
accessibilityInformation: {
|
|
292
|
-
label: ( localize(
|
|
292
|
+
label: ( localize(9005, "Select {0} Extension", e.displayName || e.identifier.id)),
|
|
293
293
|
}
|
|
294
294
|
} : undefined,
|
|
295
295
|
themeIcon: Codicon.extensions,
|
|
@@ -83,7 +83,7 @@ class GlobalStateResourceTreeItem {
|
|
|
83
83
|
this.uriIdentityService = uriIdentityService;
|
|
84
84
|
this.type = "globalState" ;
|
|
85
85
|
this.handle = "globalState" ;
|
|
86
|
-
this.label = { label: ( localize(
|
|
86
|
+
this.label = { label: ( localize(8997, "UI State")) };
|
|
87
87
|
this.collapsibleState = TreeItemCollapsibleState.Collapsed;
|
|
88
88
|
}
|
|
89
89
|
async getChildren() {
|
|
@@ -80,7 +80,7 @@ let KeybindingsResourceTreeItem = class KeybindingsResourceTreeItem {
|
|
|
80
80
|
this.instantiationService = instantiationService;
|
|
81
81
|
this.type = "keybindings" ;
|
|
82
82
|
this.handle = "keybindings" ;
|
|
83
|
-
this.label = { label: ( localize(
|
|
83
|
+
this.label = { label: ( localize(8998, "Keyboard Shortcuts")) };
|
|
84
84
|
this.collapsibleState = TreeItemCollapsibleState.Expanded;
|
|
85
85
|
}
|
|
86
86
|
isFromDefaultProfile() {
|
|
@@ -101,7 +101,7 @@ let SettingsResourceTreeItem = class SettingsResourceTreeItem {
|
|
|
101
101
|
this.instantiationService = instantiationService;
|
|
102
102
|
this.type = "settings" ;
|
|
103
103
|
this.handle = "settings" ;
|
|
104
|
-
this.label = { label: ( localize(
|
|
104
|
+
this.label = { label: ( localize(8996, "Settings")) };
|
|
105
105
|
this.collapsibleState = TreeItemCollapsibleState.Expanded;
|
|
106
106
|
}
|
|
107
107
|
async getChildren() {
|
|
@@ -92,7 +92,7 @@ let SnippetsResourceTreeItem = class SnippetsResourceTreeItem {
|
|
|
92
92
|
this.uriIdentityService = uriIdentityService;
|
|
93
93
|
this.type = "snippets" ;
|
|
94
94
|
this.handle = ( (this.profile.snippetsHome.toString()));
|
|
95
|
-
this.label = { label: ( localize(
|
|
95
|
+
this.label = { label: ( localize(9000, "Snippets")) };
|
|
96
96
|
this.collapsibleState = TreeItemCollapsibleState.Collapsed;
|
|
97
97
|
this.excludedSnippets = ( (new ResourceSet()));
|
|
98
98
|
}
|
|
@@ -120,7 +120,7 @@ let SnippetsResourceTreeItem = class SnippetsResourceTreeItem {
|
|
|
120
120
|
},
|
|
121
121
|
accessibilityInformation: {
|
|
122
122
|
label: ( localize(
|
|
123
|
-
|
|
123
|
+
9001,
|
|
124
124
|
"Select Snippet {0}",
|
|
125
125
|
this.uriIdentityService.extUri.basename(resource)
|
|
126
126
|
)),
|
|
@@ -79,7 +79,7 @@ let TasksResourceTreeItem = class TasksResourceTreeItem {
|
|
|
79
79
|
this.instantiationService = instantiationService;
|
|
80
80
|
this.type = "tasks" ;
|
|
81
81
|
this.handle = "tasks" ;
|
|
82
|
-
this.label = { label: ( localize(
|
|
82
|
+
this.label = { label: ( localize(8999, "Tasks")) };
|
|
83
83
|
this.collapsibleState = TreeItemCollapsibleState.Expanded;
|
|
84
84
|
}
|
|
85
85
|
async getChildren() {
|
|
@@ -85,7 +85,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
85
85
|
sticky: true,
|
|
86
86
|
cancellable: true,
|
|
87
87
|
}, async (progress) => {
|
|
88
|
-
const reportProgress = (message) => progress.report({ message: ( localize(
|
|
88
|
+
const reportProgress = (message) => progress.report({ message: ( localize(3685, "Create Profile: {0}", message)) });
|
|
89
89
|
creationPromise = createCancelablePromise(async (token) => {
|
|
90
90
|
const userDataProfilesExportState = disposables.add(this.instantiationService.createInstance(UserDataProfileExportState, from, { ...options?.resourceTypeFlags, extensions: false }));
|
|
91
91
|
const profileTemplate = await userDataProfilesExportState.getProfileTemplate(options.name ?? from.name, options?.icon);
|
|
@@ -101,7 +101,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
101
101
|
try {
|
|
102
102
|
await creationPromise;
|
|
103
103
|
if (profile && (options?.resourceTypeFlags?.extensions ?? true)) {
|
|
104
|
-
reportProgress(( localize(
|
|
104
|
+
reportProgress(( localize(3686, "Installing Extensions...")));
|
|
105
105
|
await this.instantiationService.createInstance(ExtensionsResource).copy(from, profile, false);
|
|
106
106
|
}
|
|
107
107
|
}
|
|
@@ -125,7 +125,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
125
125
|
sticky: true,
|
|
126
126
|
cancellable: true,
|
|
127
127
|
}, async (progress) => {
|
|
128
|
-
const reportProgress = (message) => progress.report({ message: ( localize(
|
|
128
|
+
const reportProgress = (message) => progress.report({ message: ( localize(3685, "Create Profile: {0}", message)) });
|
|
129
129
|
creationPromise = createCancelablePromise(async (token) => {
|
|
130
130
|
profile = await this.getProfileToImport({ ...profileTemplate, name: options.name ?? profileTemplate.name }, !!options.transient, options);
|
|
131
131
|
if (!profile) {
|
|
@@ -150,42 +150,42 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
150
150
|
}
|
|
151
151
|
async applyProfileTemplate(profileTemplate, profile, options, reportProgress, token) {
|
|
152
152
|
if (profileTemplate.settings && (options.resourceTypeFlags?.settings ?? true) && !profile.useDefaultFlags?.settings) {
|
|
153
|
-
reportProgress(( localize(
|
|
153
|
+
reportProgress(( localize(3687, "Creating Settings...")));
|
|
154
154
|
await this.instantiationService.createInstance(SettingsResource).apply(profileTemplate.settings, profile);
|
|
155
155
|
}
|
|
156
156
|
if (token.isCancellationRequested) {
|
|
157
157
|
return;
|
|
158
158
|
}
|
|
159
159
|
if (profileTemplate.keybindings && (options.resourceTypeFlags?.keybindings ?? true) && !profile.useDefaultFlags?.keybindings) {
|
|
160
|
-
reportProgress(( localize(
|
|
160
|
+
reportProgress(( localize(3688, "Creating Keyboard Shortcuts...")));
|
|
161
161
|
await this.instantiationService.createInstance(KeybindingsResource).apply(profileTemplate.keybindings, profile);
|
|
162
162
|
}
|
|
163
163
|
if (token.isCancellationRequested) {
|
|
164
164
|
return;
|
|
165
165
|
}
|
|
166
166
|
if (profileTemplate.tasks && (options.resourceTypeFlags?.tasks ?? true) && !profile.useDefaultFlags?.tasks) {
|
|
167
|
-
reportProgress(( localize(
|
|
167
|
+
reportProgress(( localize(3689, "Creating Tasks...")));
|
|
168
168
|
await this.instantiationService.createInstance(TasksResource).apply(profileTemplate.tasks, profile);
|
|
169
169
|
}
|
|
170
170
|
if (token.isCancellationRequested) {
|
|
171
171
|
return;
|
|
172
172
|
}
|
|
173
173
|
if (profileTemplate.snippets && (options.resourceTypeFlags?.snippets ?? true) && !profile.useDefaultFlags?.snippets) {
|
|
174
|
-
reportProgress(( localize(
|
|
174
|
+
reportProgress(( localize(3690, "Creating Snippets...")));
|
|
175
175
|
await this.instantiationService.createInstance(SnippetsResource).apply(profileTemplate.snippets, profile);
|
|
176
176
|
}
|
|
177
177
|
if (token.isCancellationRequested) {
|
|
178
178
|
return;
|
|
179
179
|
}
|
|
180
180
|
if (profileTemplate.globalState && !profile.useDefaultFlags?.globalState) {
|
|
181
|
-
reportProgress(( localize(
|
|
181
|
+
reportProgress(( localize(3691, "Applying UI State...")));
|
|
182
182
|
await this.instantiationService.createInstance(GlobalStateResource).apply(profileTemplate.globalState, profile);
|
|
183
183
|
}
|
|
184
184
|
if (token.isCancellationRequested) {
|
|
185
185
|
return;
|
|
186
186
|
}
|
|
187
187
|
if (profileTemplate.extensions && (options.resourceTypeFlags?.extensions ?? true) && !profile.useDefaultFlags?.extensions) {
|
|
188
|
-
reportProgress(( localize(
|
|
188
|
+
reportProgress(( localize(3686, "Installing Extensions...")));
|
|
189
189
|
await this.instantiationService.createInstance(ExtensionsResource).apply(profileTemplate.extensions, profile, reportProgress, token);
|
|
190
190
|
}
|
|
191
191
|
}
|
|
@@ -202,18 +202,18 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
202
202
|
async createTroubleshootProfile() {
|
|
203
203
|
const userDataProfilesExportState = this.instantiationService.createInstance(UserDataProfileExportState, this.userDataProfileService.currentProfile, undefined);
|
|
204
204
|
try {
|
|
205
|
-
const profileTemplate = await userDataProfilesExportState.getProfileTemplate(( localize(
|
|
205
|
+
const profileTemplate = await userDataProfilesExportState.getProfileTemplate(( localize(3692, "Troubleshoot Issue")), undefined);
|
|
206
206
|
await this.progressService.withProgress({
|
|
207
207
|
location: 15 ,
|
|
208
208
|
delay: 1000,
|
|
209
209
|
sticky: true,
|
|
210
210
|
}, async (progress) => {
|
|
211
|
-
const reportProgress = (message) => progress.report({ message: ( localize(
|
|
211
|
+
const reportProgress = (message) => progress.report({ message: ( localize(3693, "Setting up Troubleshoot Profile: {0}", message)) });
|
|
212
212
|
const profile = await this.doCreateProfile(profileTemplate, true, false, { useDefaultFlags: this.userDataProfileService.currentProfile.useDefaultFlags }, reportProgress);
|
|
213
213
|
if (profile) {
|
|
214
|
-
reportProgress(( localize(
|
|
214
|
+
reportProgress(( localize(3694, "Applying Extensions...")));
|
|
215
215
|
await this.instantiationService.createInstance(ExtensionsResource).copy(this.userDataProfileService.currentProfile, profile, true);
|
|
216
|
-
reportProgress(( localize(
|
|
216
|
+
reportProgress(( localize(3695, "Switching Profile...")));
|
|
217
217
|
await this.userDataProfileManagementService.switchProfile(profile);
|
|
218
218
|
}
|
|
219
219
|
});
|
|
@@ -231,7 +231,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
231
231
|
try {
|
|
232
232
|
await this.progressService.withProgress({
|
|
233
233
|
location,
|
|
234
|
-
title: ( localize(
|
|
234
|
+
title: ( localize(3696, "{0}: Exporting...", PROFILES_CATEGORY.value)),
|
|
235
235
|
}, async (progress) => {
|
|
236
236
|
const id = await this.pickProfileContentHandler(profile.name);
|
|
237
237
|
if (!id) {
|
|
@@ -245,17 +245,17 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
245
245
|
if (!saveResult) {
|
|
246
246
|
return;
|
|
247
247
|
}
|
|
248
|
-
const message = ( localize(
|
|
248
|
+
const message = ( localize(3697, "Profile '{0}' was exported successfully.", profile.name));
|
|
249
249
|
if (profileContentHandler.extensionId) {
|
|
250
250
|
const buttons = [];
|
|
251
251
|
const link = this.productService.webUrl ? `${this.productService.webUrl}/${PROFILE_URL_AUTHORITY}/${id}/${saveResult.id}` : ( (toUserDataProfileUri(`/${id}/${saveResult.id}`, this.productService).toString()));
|
|
252
252
|
buttons.push({
|
|
253
|
-
label: ( localize(
|
|
253
|
+
label: ( localize(3698, "&&Copy Link")),
|
|
254
254
|
run: () => this.clipboardService.writeText(link)
|
|
255
255
|
});
|
|
256
256
|
if (this.productService.webUrl) {
|
|
257
257
|
buttons.push({
|
|
258
|
-
label: ( localize(
|
|
258
|
+
label: ( localize(3699, "&&Open Link")),
|
|
259
259
|
run: async () => {
|
|
260
260
|
await this.openerService.open(link);
|
|
261
261
|
}
|
|
@@ -263,7 +263,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
263
263
|
}
|
|
264
264
|
else {
|
|
265
265
|
buttons.push({
|
|
266
|
-
label: ( localize(
|
|
266
|
+
label: ( localize(3700, "&&Open in {0}", profileContentHandler.name)),
|
|
267
267
|
run: async () => {
|
|
268
268
|
await this.openerService.open(( (saveResult.link.toString())));
|
|
269
269
|
}
|
|
@@ -273,7 +273,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
273
273
|
type: Severity$1.Info,
|
|
274
274
|
message,
|
|
275
275
|
buttons,
|
|
276
|
-
cancelButton: ( localize(
|
|
276
|
+
cancelButton: ( localize(3701, "Close"))
|
|
277
277
|
});
|
|
278
278
|
}
|
|
279
279
|
else {
|
|
@@ -295,10 +295,10 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
295
295
|
profileTemplate = JSON.parse(profileContent);
|
|
296
296
|
}
|
|
297
297
|
catch (error) {
|
|
298
|
-
throw ( (new Error(localize(
|
|
298
|
+
throw ( (new Error(localize(3702, "This profile is not valid."))));
|
|
299
299
|
}
|
|
300
300
|
if (!isUserDataProfileTemplate(profileTemplate)) {
|
|
301
|
-
throw ( (new Error(localize(
|
|
301
|
+
throw ( (new Error(localize(3702, "This profile is not valid."))));
|
|
302
302
|
}
|
|
303
303
|
if (options?.name) {
|
|
304
304
|
profileTemplate.name = options.name;
|
|
@@ -332,27 +332,27 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
332
332
|
return undefined;
|
|
333
333
|
}
|
|
334
334
|
if (profileTemplate.settings && !profile.useDefaultFlags?.settings) {
|
|
335
|
-
progress(( localize(
|
|
335
|
+
progress(( localize(3703, "Applying Settings...")));
|
|
336
336
|
await this.instantiationService.createInstance(SettingsResource).apply(profileTemplate.settings, profile);
|
|
337
337
|
}
|
|
338
338
|
if (profileTemplate.keybindings && !profile.useDefaultFlags?.keybindings) {
|
|
339
|
-
progress(( localize(
|
|
339
|
+
progress(( localize(3704, "Applying Keyboard Shortcuts...")));
|
|
340
340
|
await this.instantiationService.createInstance(KeybindingsResource).apply(profileTemplate.keybindings, profile);
|
|
341
341
|
}
|
|
342
342
|
if (profileTemplate.tasks && !profile.useDefaultFlags?.tasks) {
|
|
343
|
-
progress(( localize(
|
|
343
|
+
progress(( localize(3705, "Applying Tasks...")));
|
|
344
344
|
await this.instantiationService.createInstance(TasksResource).apply(profileTemplate.tasks, profile);
|
|
345
345
|
}
|
|
346
346
|
if (profileTemplate.snippets && !profile.useDefaultFlags?.snippets) {
|
|
347
|
-
progress(( localize(
|
|
347
|
+
progress(( localize(3706, "Applying Snippets...")));
|
|
348
348
|
await this.instantiationService.createInstance(SnippetsResource).apply(profileTemplate.snippets, profile);
|
|
349
349
|
}
|
|
350
350
|
if (profileTemplate.globalState && !profile.useDefaultFlags?.globalState) {
|
|
351
|
-
progress(( localize(
|
|
351
|
+
progress(( localize(3707, "Applying State...")));
|
|
352
352
|
await this.instantiationService.createInstance(GlobalStateResource).apply(profileTemplate.globalState, profile);
|
|
353
353
|
}
|
|
354
354
|
if (profileTemplate.extensions && extensions && !profile.useDefaultFlags?.extensions) {
|
|
355
|
-
progress(( localize(
|
|
355
|
+
progress(( localize(3694, "Applying Extensions...")));
|
|
356
356
|
await this.instantiationService.createInstance(ExtensionsResource).apply(profileTemplate.extensions, profile);
|
|
357
357
|
}
|
|
358
358
|
return profile;
|
|
@@ -405,7 +405,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
405
405
|
options.push({ id, label: profileContentHandler.name, description: profileContentHandler.description });
|
|
406
406
|
}
|
|
407
407
|
const result = await this.quickInputService.pick(options.reverse(), {
|
|
408
|
-
title: ( localize(
|
|
408
|
+
title: ( localize(3708, "Export '{0}' profile as...", name)),
|
|
409
409
|
hideInput: true
|
|
410
410
|
});
|
|
411
411
|
return result?.id;
|
|
@@ -420,11 +420,11 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
420
420
|
const { confirmed } = await this.dialogService.confirm({
|
|
421
421
|
type: Severity$1.Info,
|
|
422
422
|
message: ( localize(
|
|
423
|
-
|
|
423
|
+
3709,
|
|
424
424
|
"Profile with name '{0}' already exists. Do you want to replace its contents?",
|
|
425
425
|
profileName
|
|
426
426
|
)),
|
|
427
|
-
primaryButton: ( localize(
|
|
427
|
+
primaryButton: ( localize(3710, "&&Replace"))
|
|
428
428
|
});
|
|
429
429
|
if (!confirmed) {
|
|
430
430
|
return undefined;
|
|
@@ -468,12 +468,12 @@ let FileUserDataProfileContentHandler = class FileUserDataProfileContentHandler
|
|
|
468
468
|
this.fileService = fileService;
|
|
469
469
|
this.productService = productService;
|
|
470
470
|
this.textFileService = textFileService;
|
|
471
|
-
this.name = ( localize(
|
|
472
|
-
this.description = ( localize(
|
|
471
|
+
this.name = ( localize(3711, "Local"));
|
|
472
|
+
this.description = ( localize(3712, "file"));
|
|
473
473
|
}
|
|
474
474
|
async saveProfile(name, content, token) {
|
|
475
475
|
const link = await this.fileDialogService.showSaveDialog({
|
|
476
|
-
title: ( localize(
|
|
476
|
+
title: ( localize(3713, "Save Profile")),
|
|
477
477
|
filters: PROFILE_FILTER,
|
|
478
478
|
defaultUri: this.uriIdentityService.extUri.joinPath(await this.fileDialogService.defaultFilePath(), `${name}.${PROFILE_EXTENSION}`),
|
|
479
479
|
});
|
|
@@ -500,7 +500,7 @@ let FileUserDataProfileContentHandler = class FileUserDataProfileContentHandler
|
|
|
500
500
|
canSelectFiles: true,
|
|
501
501
|
canSelectMany: false,
|
|
502
502
|
filters: PROFILE_FILTER,
|
|
503
|
-
title: ( localize(
|
|
503
|
+
title: ( localize(3714, "Select Profile")),
|
|
504
504
|
});
|
|
505
505
|
return profileLocation ? profileLocation[0] : null;
|
|
506
506
|
}
|
|
@@ -547,13 +547,13 @@ let UserDataProfileImportExportState = class UserDataProfileImportExportState ex
|
|
|
547
547
|
for (const root of this.roots) {
|
|
548
548
|
root.checkbox = {
|
|
549
549
|
isChecked: !root.isFromDefaultProfile(),
|
|
550
|
-
tooltip: ( localize(
|
|
550
|
+
tooltip: ( localize(3715, "Select {0}", root.label.label)),
|
|
551
551
|
accessibilityInformation: {
|
|
552
|
-
label: ( localize(
|
|
552
|
+
label: ( localize(3715, "Select {0}", root.label.label)),
|
|
553
553
|
}
|
|
554
554
|
};
|
|
555
555
|
if (root.isFromDefaultProfile()) {
|
|
556
|
-
root.description = ( localize(
|
|
556
|
+
root.description = ( localize(3716, "From Default Profile"));
|
|
557
557
|
}
|
|
558
558
|
}
|
|
559
559
|
return this.roots;
|
|
@@ -699,7 +699,6 @@ let UserDataProfileExportState = class UserDataProfileExportState extends UserDa
|
|
|
699
699
|
name: profile.name,
|
|
700
700
|
location: profile.location,
|
|
701
701
|
isDefault: profile.isDefault,
|
|
702
|
-
shortName: profile.shortName,
|
|
703
702
|
icon: profile.icon,
|
|
704
703
|
globalStorageHome: profile.globalStorageHome,
|
|
705
704
|
settingsResource: profile.settingsResource.with({ scheme: USER_DATA_PROFILE_EXPORT_SCHEME }),
|
|
@@ -716,11 +715,11 @@ let UserDataProfileExportState = class UserDataProfileExportState extends UserDa
|
|
|
716
715
|
let name = this.profile.name;
|
|
717
716
|
if (this.profile.isDefault) {
|
|
718
717
|
name = await this.quickInputService.input({
|
|
719
|
-
placeHolder: ( localize(
|
|
720
|
-
title: ( localize(
|
|
718
|
+
placeHolder: ( localize(3717, "Name the profile")),
|
|
719
|
+
title: ( localize(3718, "Export Profile")),
|
|
721
720
|
async validateInput(input) {
|
|
722
721
|
if (!input.trim()) {
|
|
723
|
-
return ( localize(
|
|
722
|
+
return ( localize(3719, "Profile name must be provided."));
|
|
724
723
|
}
|
|
725
724
|
return undefined;
|
|
726
725
|
},
|
package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.js
CHANGED
|
@@ -43,7 +43,7 @@ let UserDataProfileManagementService = class UserDataProfileManagementService ex
|
|
|
43
43
|
const profileToUse = this.getProfileToUseForCurrentWorkspace();
|
|
44
44
|
this.switchProfile(profileToUse);
|
|
45
45
|
this.changeCurrentProfile(profileToUse, ( localize(
|
|
46
|
-
|
|
46
|
+
3720,
|
|
47
47
|
"The current profile has been removed. Please reload to switch back to default profile"
|
|
48
48
|
)));
|
|
49
49
|
return;
|
|
@@ -54,13 +54,13 @@ let UserDataProfileManagementService = class UserDataProfileManagementService ex
|
|
|
54
54
|
if (profileToUse?.id !== updatedCurrentProfile.id) {
|
|
55
55
|
this.switchProfile(profileToUse);
|
|
56
56
|
this.changeCurrentProfile(profileToUse, ( localize(
|
|
57
|
-
|
|
57
|
+
3721,
|
|
58
58
|
"The current workspace has been removed from the current profile. Please reload to switch back to the updated profile"
|
|
59
59
|
)));
|
|
60
60
|
}
|
|
61
61
|
else {
|
|
62
62
|
this.changeCurrentProfile(updatedCurrentProfile, ( localize(
|
|
63
|
-
|
|
63
|
+
3722,
|
|
64
64
|
"The current profile has been updated. Please reload to switch back to the updated profile"
|
|
65
65
|
)));
|
|
66
66
|
}
|
|
@@ -122,7 +122,7 @@ let UserDataProfileManagementService = class UserDataProfileManagementService ex
|
|
|
122
122
|
throw ( (new Error(`Profile ${profile.name} does not exist`)));
|
|
123
123
|
}
|
|
124
124
|
if (profile.isDefault) {
|
|
125
|
-
throw ( (new Error(localize(
|
|
125
|
+
throw ( (new Error(localize(3723, "Cannot rename the default profile"))));
|
|
126
126
|
}
|
|
127
127
|
const updatedProfile = await this.userDataProfilesService.updateProfile(profile, updateOptions);
|
|
128
128
|
this.telemetryService.publicLog2('profileManagementActionExecuted', { id: 'updateProfile' });
|
|
@@ -133,7 +133,7 @@ let UserDataProfileManagementService = class UserDataProfileManagementService ex
|
|
|
133
133
|
throw ( (new Error(`Profile ${profile.name} does not exist`)));
|
|
134
134
|
}
|
|
135
135
|
if (profile.isDefault) {
|
|
136
|
-
throw ( (new Error(localize(
|
|
136
|
+
throw ( (new Error(localize(3724, "Cannot delete the default profile"))));
|
|
137
137
|
}
|
|
138
138
|
await this.userDataProfilesService.removeProfile(profile);
|
|
139
139
|
this.telemetryService.publicLog2('profileManagementActionExecuted', { id: 'removeProfile' });
|
|
@@ -178,7 +178,7 @@ let UserDataProfileManagementService = class UserDataProfileManagementService ex
|
|
|
178
178
|
const shouldRestartExtensionHosts = this.userDataProfileService.currentProfile.id !== profile.id || !equals(this.userDataProfileService.currentProfile.useDefaultFlags, profile.useDefaultFlags);
|
|
179
179
|
if (shouldRestartExtensionHosts) {
|
|
180
180
|
if (!isRemoteWindow) {
|
|
181
|
-
if (!(await this.extensionService.stopExtensionHosts(( localize(
|
|
181
|
+
if (!(await this.extensionService.stopExtensionHosts(( localize(3725, "Switching to a profile."))))) {
|
|
182
182
|
if (( (this.userDataProfilesService.profiles.some(p => p.id === this.userDataProfileService.currentProfile.id)))) {
|
|
183
183
|
await this.userDataProfilesService.setProfileForWorkspace(toWorkspaceIdentifier(this.workspaceContextService.getWorkspace()), this.userDataProfileService.currentProfile);
|
|
184
184
|
}
|
|
@@ -190,8 +190,8 @@ let UserDataProfileManagementService = class UserDataProfileManagementService ex
|
|
|
190
190
|
if (shouldRestartExtensionHosts) {
|
|
191
191
|
if (isRemoteWindow) {
|
|
192
192
|
const { confirmed } = await this.dialogService.confirm({
|
|
193
|
-
message: reloadMessage ?? ( localize(
|
|
194
|
-
primaryButton: ( localize(
|
|
193
|
+
message: reloadMessage ?? ( localize(3726, "Switching a profile requires reloading VS Code.")),
|
|
194
|
+
primaryButton: ( localize(3727, "&&Reload")),
|
|
195
195
|
});
|
|
196
196
|
if (confirmed) {
|
|
197
197
|
await this.hostService.reload();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
2
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
|
|
3
|
-
import { AbstractExtensionsInitializer } from '
|
|
4
|
-
import { UserDataSyncStoreTypeSynchronizer, GlobalStateInitializer } from '
|
|
5
|
-
import { KeybindingsInitializer } from '
|
|
6
|
-
import { SettingsInitializer } from '
|
|
7
|
-
import { SnippetsInitializer } from '
|
|
3
|
+
import { AbstractExtensionsInitializer } from '@codingame/monaco-vscode-user-data-profile-user-data-sync-common/vscode/vs/platform/userDataSync/common/extensionsSync';
|
|
4
|
+
import { UserDataSyncStoreTypeSynchronizer, GlobalStateInitializer } from '@codingame/monaco-vscode-user-data-profile-user-data-sync-common/vscode/vs/platform/userDataSync/common/globalStateSync';
|
|
5
|
+
import { KeybindingsInitializer } from '@codingame/monaco-vscode-user-data-profile-user-data-sync-common/vscode/vs/platform/userDataSync/common/keybindingsSync';
|
|
6
|
+
import { SettingsInitializer } from '@codingame/monaco-vscode-user-data-profile-user-data-sync-common/vscode/vs/platform/userDataSync/common/settingsSync';
|
|
7
|
+
import { SnippetsInitializer } from '@codingame/monaco-vscode-user-data-profile-user-data-sync-common/vscode/vs/platform/userDataSync/common/snippetsSync';
|
|
8
8
|
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
|
|
9
9
|
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
|
|
10
10
|
import { UserDataSyncStoreClient } from 'vscode/vscode/vs/platform/userDataSync/common/userDataSyncStoreService';
|
|
@@ -26,7 +26,7 @@ import { isEqual } from 'vscode/vscode/vs/base/common/resources';
|
|
|
26
26
|
import { CancellationToken } from 'vscode/vscode/vs/base/common/cancellation';
|
|
27
27
|
import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
28
28
|
import { IExtensionStorageService } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionStorage.service';
|
|
29
|
-
import { TasksInitializer } from '
|
|
29
|
+
import { TasksInitializer } from '@codingame/monaco-vscode-user-data-profile-user-data-sync-common/vscode/vs/platform/userDataSync/common/tasksSync';
|
|
30
30
|
import { IUserDataProfilesService } from 'vscode/vscode/vs/platform/userDataProfile/common/userDataProfile.service';
|
|
31
31
|
import { IBrowserWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/browser/environmentService.service';
|
|
32
32
|
import { ISecretStorageService } from 'vscode/vscode/vs/platform/secrets/common/secrets.service';
|