@codingame/monaco-vscode-user-data-profile-service-override 30.0.0 → 31.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/workbench/contrib/userDataProfile/browser/userDataProfile.js +29 -27
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfileActions.js +3 -3
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditor.js +79 -79
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditorModel.js +26 -26
- 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/mcpProfileResource.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 +39 -39
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.js +8 -8
package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditorModel.js
CHANGED
|
@@ -223,15 +223,15 @@ let AbstractUserDataProfileElement = class AbstractUserDataProfileElement extend
|
|
|
223
223
|
}
|
|
224
224
|
validate() {
|
|
225
225
|
if (!this.name) {
|
|
226
|
-
this.message = ( localize(
|
|
226
|
+
this.message = ( localize(15181, "Profile name is required and must be a non-empty value."));
|
|
227
227
|
return;
|
|
228
228
|
}
|
|
229
229
|
if (this.shouldValidateName() && this.name !== this.getInitialName() && ( this.userDataProfilesService.profiles.some(p => p.name === this.name))) {
|
|
230
|
-
this.message = ( localize(
|
|
230
|
+
this.message = ( localize(15182, "Profile with name {0} already exists.", this.name));
|
|
231
231
|
return;
|
|
232
232
|
}
|
|
233
233
|
if (this.flags && this.flags.settings && this.flags.keybindings && this.flags.tasks && this.flags.snippets && this.flags.extensions) {
|
|
234
|
-
this.message = ( localize(
|
|
234
|
+
this.message = ( localize(15183, "The profile should contain at least one configuration."));
|
|
235
235
|
return;
|
|
236
236
|
}
|
|
237
237
|
this.message = undefined;
|
|
@@ -254,7 +254,7 @@ let AbstractUserDataProfileElement = class AbstractUserDataProfileElement extend
|
|
|
254
254
|
resourceType: r,
|
|
255
255
|
openAction: children.length ? toAction({
|
|
256
256
|
id: "_open",
|
|
257
|
-
label: ( localize(
|
|
257
|
+
label: ( localize(15184, "Open to the Side")),
|
|
258
258
|
class: ThemeIcon.asClassName(Codicon.goToFile),
|
|
259
259
|
run: () => children[0]?.openAction?.run()
|
|
260
260
|
}) : undefined
|
|
@@ -301,7 +301,7 @@ let AbstractUserDataProfileElement = class AbstractUserDataProfileElement extend
|
|
|
301
301
|
icon: child.themeIcon,
|
|
302
302
|
openAction: toAction({
|
|
303
303
|
id: "_openChild",
|
|
304
|
-
label: ( localize(
|
|
304
|
+
label: ( localize(15184, "Open to the Side")),
|
|
305
305
|
class: ThemeIcon.asClassName(Codicon.goToFile),
|
|
306
306
|
run: async () => {
|
|
307
307
|
if (child.parent.type === ProfileResourceType.Extensions) {
|
|
@@ -504,7 +504,7 @@ let UserDataProfileElement = class UserDataProfileElement extends AbstractUserDa
|
|
|
504
504
|
const children = await this.instantiationService.createInstance(ExtensionsResourceExportTreeItem, this.profile).getChildren();
|
|
505
505
|
return (children.map(child => this.toUserDataProfileResourceChildElement(child, undefined, [{
|
|
506
506
|
id: "applyToAllProfiles",
|
|
507
|
-
label: ( localize(
|
|
507
|
+
label: ( localize(15185, "Apply Extension to all Profiles")),
|
|
508
508
|
checked: child.applicationScoped,
|
|
509
509
|
enabled: true,
|
|
510
510
|
class: "",
|
|
@@ -674,7 +674,7 @@ let NewProfileElement = class NewProfileElement extends AbstractUserDataProfileE
|
|
|
674
674
|
}
|
|
675
675
|
if (isUserDataProfile(this.copyFrom)) {
|
|
676
676
|
if (this.defaultName === this.name) {
|
|
677
|
-
this.name = this.defaultName = ( localize(
|
|
677
|
+
this.name = this.defaultName = ( localize(15186, "{0} (Copy)", this.copyFrom.name));
|
|
678
678
|
}
|
|
679
679
|
if (this.defaultIcon === this.icon) {
|
|
680
680
|
this.icon = this.defaultIcon = this.copyFrom.icon;
|
|
@@ -710,7 +710,7 @@ let NewProfileElement = class NewProfileElement extends AbstractUserDataProfileE
|
|
|
710
710
|
}
|
|
711
711
|
}
|
|
712
712
|
getNewProfileName() {
|
|
713
|
-
const name = ( localize(
|
|
713
|
+
const name = ( localize(15187, "Untitled"));
|
|
714
714
|
const nameRegEx = ( new RegExp(`${name}\\s(\\d+)`));
|
|
715
715
|
let nameIndex = 0;
|
|
716
716
|
for (const profile of this.userDataProfilesService.profiles) {
|
|
@@ -950,11 +950,11 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
|
|
|
950
950
|
}
|
|
951
951
|
createProfileElement(profile) {
|
|
952
952
|
const disposables = ( new DisposableStore());
|
|
953
|
-
const activateAction = disposables.add(( new Action("userDataProfile.activate", ( localize(
|
|
954
|
-
const copyFromProfileAction = disposables.add(( new Action("userDataProfile.copyFromProfile", ( localize(
|
|
955
|
-
const exportAction = disposables.add(( new Action("userDataProfile.export", ( localize(
|
|
956
|
-
const deleteAction = disposables.add(( new Action("userDataProfile.delete", ( localize(
|
|
957
|
-
const newWindowAction = disposables.add(( new Action("userDataProfile.newWindow", ( localize(
|
|
953
|
+
const activateAction = disposables.add(( new Action("userDataProfile.activate", ( localize(15188, "Use this Profile for Current Window")), ThemeIcon.asClassName(Codicon.check), true, () => this.userDataProfileManagementService.switchProfile(profileElement.profile))));
|
|
954
|
+
const copyFromProfileAction = disposables.add(( new Action("userDataProfile.copyFromProfile", ( localize(15189, "Duplicate...")), ThemeIcon.asClassName(Codicon.copy), true, () => this.createNewProfile(profileElement.profile))));
|
|
955
|
+
const exportAction = disposables.add(( new Action("userDataProfile.export", ( localize(15190, "Export...")), ThemeIcon.asClassName(Codicon.export), true, () => this.userDataProfileImportExportService.exportProfile(profile))));
|
|
956
|
+
const deleteAction = disposables.add(( new Action("userDataProfile.delete", ( localize(15191, "Delete")), ThemeIcon.asClassName(Codicon.trash), true, () => this.removeProfile(profileElement.profile))));
|
|
957
|
+
const newWindowAction = disposables.add(( new Action("userDataProfile.newWindow", ( localize(15192, "Open New Window with this Profile")), ThemeIcon.asClassName(Codicon.emptyWindow), true, () => this.openWindow(profileElement.profile))));
|
|
958
958
|
const primaryActions = [];
|
|
959
959
|
primaryActions.push(activateAction);
|
|
960
960
|
primaryActions.push(newWindowAction);
|
|
@@ -982,11 +982,11 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
|
|
|
982
982
|
const result = await this.dialogService.confirm({
|
|
983
983
|
type: "info",
|
|
984
984
|
message: ( localize(
|
|
985
|
-
|
|
985
|
+
15193,
|
|
986
986
|
"A new profile is already being created. Do you want to discard it and create a new one?"
|
|
987
987
|
)),
|
|
988
|
-
primaryButton: ( localize(
|
|
989
|
-
cancelButton: ( localize(
|
|
988
|
+
primaryButton: ( localize(15194, "Discard & Create")),
|
|
989
|
+
cancelButton: ( localize(15195, "Cancel"))
|
|
990
990
|
});
|
|
991
991
|
if (!result.confirmed) {
|
|
992
992
|
return;
|
|
@@ -1007,18 +1007,18 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
|
|
|
1007
1007
|
disposables.add(toDisposable(() => cancellationTokenSource.dispose(true)));
|
|
1008
1008
|
const primaryActions = [];
|
|
1009
1009
|
const secondaryActions = [];
|
|
1010
|
-
const createAction = disposables.add(( new Action("userDataProfile.create", ( localize(
|
|
1010
|
+
const createAction = disposables.add(( new Action("userDataProfile.create", ( localize(15196, "Create")), undefined, true, () => this.saveNewProfile(false, cancellationTokenSource.token))));
|
|
1011
1011
|
primaryActions.push(createAction);
|
|
1012
1012
|
if (isWeb && copyFrom instanceof URI && isProfileURL(copyFrom)) {
|
|
1013
|
-
primaryActions.push(disposables.add(( new Action("userDataProfile.createInDesktop", ( localize(
|
|
1013
|
+
primaryActions.push(disposables.add(( new Action("userDataProfile.createInDesktop", ( localize(15197, "Create in {0}", this.productService.nameLong)), undefined, true, () => this.openerService.open(copyFrom, {
|
|
1014
1014
|
openExternal: true
|
|
1015
1015
|
})))));
|
|
1016
1016
|
}
|
|
1017
|
-
const cancelAction = disposables.add(( new Action("userDataProfile.cancel", ( localize(
|
|
1017
|
+
const cancelAction = disposables.add(( new Action("userDataProfile.cancel", ( localize(15195, "Cancel")), ThemeIcon.asClassName(Codicon.trash), true, () => this.discardNewProfile())));
|
|
1018
1018
|
secondaryActions.push(cancelAction);
|
|
1019
|
-
const previewProfileAction = disposables.add(( new Action("userDataProfile.preview", ( localize(
|
|
1019
|
+
const previewProfileAction = disposables.add(( new Action("userDataProfile.preview", ( localize(15198, "Preview")), ThemeIcon.asClassName(Codicon.openPreview), true, () => this.previewNewProfile(cancellationTokenSource.token))));
|
|
1020
1020
|
secondaryActions.push(previewProfileAction);
|
|
1021
|
-
const exportAction = disposables.add(( new Action("userDataProfile.export", ( localize(
|
|
1021
|
+
const exportAction = disposables.add(( new Action("userDataProfile.export", ( localize(15190, "Export...")), ThemeIcon.asClassName(Codicon.export), isUserDataProfile(copyFrom), () => this.exportNewProfile(cancellationTokenSource.token))));
|
|
1022
1022
|
this.newProfileElement = disposables.add(this.instantiationService.createInstance(
|
|
1023
1023
|
NewProfileElement,
|
|
1024
1024
|
copyFrom,
|
|
@@ -1028,9 +1028,9 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
|
|
|
1028
1028
|
const updateCreateActionLabel = () => {
|
|
1029
1029
|
if (createAction.enabled) {
|
|
1030
1030
|
if (this.newProfileElement?.copyFrom && ( this.userDataProfilesService.profiles.some(p => !p.isTransient && p.name === this.newProfileElement?.name))) {
|
|
1031
|
-
createAction.label = ( localize(
|
|
1031
|
+
createAction.label = ( localize(15199, "Replace"));
|
|
1032
1032
|
} else {
|
|
1033
|
-
createAction.label = ( localize(
|
|
1033
|
+
createAction.label = ( localize(15196, "Create"));
|
|
1034
1034
|
}
|
|
1035
1035
|
}
|
|
1036
1036
|
};
|
|
@@ -1200,9 +1200,9 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
|
|
|
1200
1200
|
async removeProfile(profile) {
|
|
1201
1201
|
const result = await this.dialogService.confirm({
|
|
1202
1202
|
type: "info",
|
|
1203
|
-
message: ( localize(
|
|
1204
|
-
primaryButton: ( localize(
|
|
1205
|
-
cancelButton: ( localize(
|
|
1203
|
+
message: ( localize(15200, "Are you sure you want to delete the profile '{0}'?", profile.name)),
|
|
1204
|
+
primaryButton: ( localize(15191, "Delete")),
|
|
1205
|
+
cancelButton: ( localize(15195, "Cancel"))
|
|
1206
1206
|
});
|
|
1207
1207
|
if (result.confirmed) {
|
|
1208
1208
|
await this.userDataProfileManagementService.removeProfile(profile);
|
|
@@ -227,7 +227,7 @@ let ExtensionsResource = class ExtensionsResource {
|
|
|
227
227
|
return;
|
|
228
228
|
}
|
|
229
229
|
progress?.(( localize(
|
|
230
|
-
|
|
230
|
+
16826,
|
|
231
231
|
"Installing extension {0}...",
|
|
232
232
|
installExtensionInfo.extension.displayName ?? installExtensionInfo.extension.identifier.id
|
|
233
233
|
)));
|
|
@@ -322,7 +322,7 @@ class ExtensionsResourceTreeItem {
|
|
|
322
322
|
this.type = ProfileResourceType.Extensions;
|
|
323
323
|
this.handle = ProfileResourceType.Extensions;
|
|
324
324
|
this.label = {
|
|
325
|
-
label: ( localize(
|
|
325
|
+
label: ( localize(16827, "Extensions"))
|
|
326
326
|
};
|
|
327
327
|
this.collapsibleState = TreeItemCollapsibleState.Expanded;
|
|
328
328
|
this.contextValue = ProfileResourceType.Extensions;
|
|
@@ -340,7 +340,7 @@ class ExtensionsResourceTreeItem {
|
|
|
340
340
|
label: {
|
|
341
341
|
label: e.displayName || e.identifier.id
|
|
342
342
|
},
|
|
343
|
-
description: e.applicationScoped ? ( localize(
|
|
343
|
+
description: e.applicationScoped ? ( localize(16828, "All Profiles")) : undefined,
|
|
344
344
|
collapsibleState: TreeItemCollapsibleState.None,
|
|
345
345
|
checkbox: that.checkbox ? {
|
|
346
346
|
get isChecked() {
|
|
@@ -353,9 +353,9 @@ class ExtensionsResourceTreeItem {
|
|
|
353
353
|
that.excludedExtensions.add(e.identifier.id.toLowerCase());
|
|
354
354
|
}
|
|
355
355
|
},
|
|
356
|
-
tooltip: ( localize(
|
|
356
|
+
tooltip: ( localize(16829, "Select {0} Extension", e.displayName || e.identifier.id)),
|
|
357
357
|
accessibilityInformation: {
|
|
358
|
-
label: ( localize(
|
|
358
|
+
label: ( localize(16829, "Select {0} Extension", e.displayName || e.identifier.id))
|
|
359
359
|
}
|
|
360
360
|
} : undefined,
|
|
361
361
|
themeIcon: Codicon.extensions,
|
|
@@ -89,7 +89,7 @@ class GlobalStateResourceTreeItem {
|
|
|
89
89
|
this.type = ProfileResourceType.GlobalState;
|
|
90
90
|
this.handle = ProfileResourceType.GlobalState;
|
|
91
91
|
this.label = {
|
|
92
|
-
label: ( localize(
|
|
92
|
+
label: ( localize(16830, "UI State"))
|
|
93
93
|
};
|
|
94
94
|
this.collapsibleState = TreeItemCollapsibleState.Collapsed;
|
|
95
95
|
}
|
|
@@ -81,7 +81,7 @@ let KeybindingsResourceTreeItem = class KeybindingsResourceTreeItem {
|
|
|
81
81
|
this.type = ProfileResourceType.Keybindings;
|
|
82
82
|
this.handle = ProfileResourceType.Keybindings;
|
|
83
83
|
this.label = {
|
|
84
|
-
label: ( localize(
|
|
84
|
+
label: ( localize(16831, "Keyboard Shortcuts"))
|
|
85
85
|
};
|
|
86
86
|
this.collapsibleState = TreeItemCollapsibleState.Expanded;
|
|
87
87
|
}
|
|
@@ -76,7 +76,7 @@ let McpResourceTreeItem = class McpResourceTreeItem {
|
|
|
76
76
|
this.type = ProfileResourceType.Mcp;
|
|
77
77
|
this.handle = ProfileResourceType.Mcp;
|
|
78
78
|
this.label = {
|
|
79
|
-
label: ( localize(
|
|
79
|
+
label: ( localize(16832, "MCP Servers"))
|
|
80
80
|
};
|
|
81
81
|
this.collapsibleState = TreeItemCollapsibleState.Expanded;
|
|
82
82
|
}
|
|
@@ -105,7 +105,7 @@ let SettingsResourceTreeItem = class SettingsResourceTreeItem {
|
|
|
105
105
|
this.type = ProfileResourceType.Settings;
|
|
106
106
|
this.handle = ProfileResourceType.Settings;
|
|
107
107
|
this.label = {
|
|
108
|
-
label: ( localize(
|
|
108
|
+
label: ( localize(16833, "Settings"))
|
|
109
109
|
};
|
|
110
110
|
this.collapsibleState = TreeItemCollapsibleState.Expanded;
|
|
111
111
|
}
|
|
@@ -89,7 +89,7 @@ let SnippetsResourceTreeItem = class SnippetsResourceTreeItem {
|
|
|
89
89
|
this.uriIdentityService = uriIdentityService;
|
|
90
90
|
this.type = ProfileResourceType.Snippets;
|
|
91
91
|
this.label = {
|
|
92
|
-
label: ( localize(
|
|
92
|
+
label: ( localize(16834, "Snippets"))
|
|
93
93
|
};
|
|
94
94
|
this.collapsibleState = TreeItemCollapsibleState.Collapsed;
|
|
95
95
|
this.excludedSnippets = ( new ResourceSet());
|
|
@@ -119,7 +119,7 @@ let SnippetsResourceTreeItem = class SnippetsResourceTreeItem {
|
|
|
119
119
|
},
|
|
120
120
|
accessibilityInformation: {
|
|
121
121
|
label: ( localize(
|
|
122
|
-
|
|
122
|
+
16835,
|
|
123
123
|
"Select Snippet {0}",
|
|
124
124
|
this.uriIdentityService.extUri.basename(resource)
|
|
125
125
|
))
|
|
@@ -76,7 +76,7 @@ let TasksResourceTreeItem = class TasksResourceTreeItem {
|
|
|
76
76
|
this.type = ProfileResourceType.Tasks;
|
|
77
77
|
this.handle = ProfileResourceType.Tasks;
|
|
78
78
|
this.label = {
|
|
79
|
-
label: ( localize(
|
|
79
|
+
label: ( localize(16836, "Tasks"))
|
|
80
80
|
};
|
|
81
81
|
this.collapsibleState = TreeItemCollapsibleState.Expanded;
|
|
82
82
|
}
|
|
@@ -104,7 +104,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
104
104
|
cancellable: true
|
|
105
105
|
}, async progress => {
|
|
106
106
|
const reportProgress = message => progress.report({
|
|
107
|
-
message: ( localize(
|
|
107
|
+
message: ( localize(16837, "Create Profile: {0}", message))
|
|
108
108
|
});
|
|
109
109
|
creationPromise = createCancelablePromise(async token => {
|
|
110
110
|
const userDataProfilesExportState = disposables.add(
|
|
@@ -129,7 +129,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
129
129
|
try {
|
|
130
130
|
await creationPromise;
|
|
131
131
|
if (profile && (options?.resourceTypeFlags?.extensions ?? true)) {
|
|
132
|
-
reportProgress(( localize(
|
|
132
|
+
reportProgress(( localize(16838, "Installing Extensions...")));
|
|
133
133
|
await this.instantiationService.createInstance(ExtensionsResource).copy(from, profile, false);
|
|
134
134
|
}
|
|
135
135
|
} catch (error) {
|
|
@@ -153,7 +153,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
153
153
|
cancellable: true
|
|
154
154
|
}, async progress => {
|
|
155
155
|
const reportProgress = message => progress.report({
|
|
156
|
-
message: ( localize(
|
|
156
|
+
message: ( localize(16837, "Create Profile: {0}", message))
|
|
157
157
|
});
|
|
158
158
|
creationPromise = createCancelablePromise(async token => {
|
|
159
159
|
profile = await this.getProfileToImport({
|
|
@@ -181,42 +181,42 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
181
181
|
}
|
|
182
182
|
async applyProfileTemplate(profileTemplate, profile, options, reportProgress, token) {
|
|
183
183
|
if (profileTemplate.settings && (options.resourceTypeFlags?.settings ?? true) && !profile.useDefaultFlags?.settings) {
|
|
184
|
-
reportProgress(( localize(
|
|
184
|
+
reportProgress(( localize(16839, "Creating Settings...")));
|
|
185
185
|
await this.instantiationService.createInstance(SettingsResource).apply(profileTemplate.settings, profile);
|
|
186
186
|
}
|
|
187
187
|
if (token.isCancellationRequested) {
|
|
188
188
|
return;
|
|
189
189
|
}
|
|
190
190
|
if (profileTemplate.keybindings && (options.resourceTypeFlags?.keybindings ?? true) && !profile.useDefaultFlags?.keybindings) {
|
|
191
|
-
reportProgress(( localize(
|
|
191
|
+
reportProgress(( localize(16840, "Creating Keyboard Shortcuts...")));
|
|
192
192
|
await this.instantiationService.createInstance(KeybindingsResource).apply(profileTemplate.keybindings, profile);
|
|
193
193
|
}
|
|
194
194
|
if (token.isCancellationRequested) {
|
|
195
195
|
return;
|
|
196
196
|
}
|
|
197
197
|
if (profileTemplate.tasks && (options.resourceTypeFlags?.tasks ?? true) && !profile.useDefaultFlags?.tasks) {
|
|
198
|
-
reportProgress(( localize(
|
|
198
|
+
reportProgress(( localize(16841, "Creating Tasks...")));
|
|
199
199
|
await this.instantiationService.createInstance(TasksResource).apply(profileTemplate.tasks, profile);
|
|
200
200
|
}
|
|
201
201
|
if (token.isCancellationRequested) {
|
|
202
202
|
return;
|
|
203
203
|
}
|
|
204
204
|
if (profileTemplate.snippets && (options.resourceTypeFlags?.snippets ?? true) && !profile.useDefaultFlags?.snippets) {
|
|
205
|
-
reportProgress(( localize(
|
|
205
|
+
reportProgress(( localize(16842, "Creating Snippets...")));
|
|
206
206
|
await this.instantiationService.createInstance(SnippetsResource).apply(profileTemplate.snippets, profile);
|
|
207
207
|
}
|
|
208
208
|
if (token.isCancellationRequested) {
|
|
209
209
|
return;
|
|
210
210
|
}
|
|
211
211
|
if (profileTemplate.globalState && !profile.useDefaultFlags?.globalState) {
|
|
212
|
-
reportProgress(( localize(
|
|
212
|
+
reportProgress(( localize(16843, "Applying UI State...")));
|
|
213
213
|
await this.instantiationService.createInstance(GlobalStateResource).apply(profileTemplate.globalState, profile);
|
|
214
214
|
}
|
|
215
215
|
if (token.isCancellationRequested) {
|
|
216
216
|
return;
|
|
217
217
|
}
|
|
218
218
|
if (profileTemplate.extensions && (options.resourceTypeFlags?.extensions ?? true) && !profile.useDefaultFlags?.extensions) {
|
|
219
|
-
reportProgress(( localize(
|
|
219
|
+
reportProgress(( localize(16838, "Installing Extensions...")));
|
|
220
220
|
await this.instantiationService.createInstance(ExtensionsResource).apply(profileTemplate.extensions, profile, reportProgress, token);
|
|
221
221
|
}
|
|
222
222
|
}
|
|
@@ -238,22 +238,22 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
238
238
|
undefined
|
|
239
239
|
);
|
|
240
240
|
try {
|
|
241
|
-
const profileTemplate = await userDataProfilesExportState.getProfileTemplate(( localize(
|
|
241
|
+
const profileTemplate = await userDataProfilesExportState.getProfileTemplate(( localize(16844, "Troubleshoot Issue")), undefined);
|
|
242
242
|
await this.progressService.withProgress({
|
|
243
243
|
location: ProgressLocation.Notification,
|
|
244
244
|
delay: 1000,
|
|
245
245
|
sticky: true
|
|
246
246
|
}, async progress => {
|
|
247
247
|
const reportProgress = message => progress.report({
|
|
248
|
-
message: ( localize(
|
|
248
|
+
message: ( localize(16845, "Setting up Troubleshoot Profile: {0}", message))
|
|
249
249
|
});
|
|
250
250
|
const profile = await this.doCreateProfile(profileTemplate, true, false, {
|
|
251
251
|
useDefaultFlags: this.userDataProfileService.currentProfile.useDefaultFlags
|
|
252
252
|
}, reportProgress);
|
|
253
253
|
if (profile) {
|
|
254
|
-
reportProgress(( localize(
|
|
254
|
+
reportProgress(( localize(16846, "Applying Extensions...")));
|
|
255
255
|
await this.instantiationService.createInstance(ExtensionsResource).copy(this.userDataProfileService.currentProfile, profile, true);
|
|
256
|
-
reportProgress(( localize(
|
|
256
|
+
reportProgress(( localize(16847, "Switching Profile...")));
|
|
257
257
|
await this.userDataProfileManagementService.switchProfile(profile);
|
|
258
258
|
}
|
|
259
259
|
});
|
|
@@ -270,7 +270,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
270
270
|
try {
|
|
271
271
|
await this.progressService.withProgress({
|
|
272
272
|
location,
|
|
273
|
-
title: ( localize(
|
|
273
|
+
title: ( localize(16848, "{0}: Exporting...", PROFILES_CATEGORY.value))
|
|
274
274
|
}, async progress => {
|
|
275
275
|
const id = await this.pickProfileContentHandler(profile.name);
|
|
276
276
|
if (!id) {
|
|
@@ -288,24 +288,24 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
288
288
|
if (!saveResult) {
|
|
289
289
|
return;
|
|
290
290
|
}
|
|
291
|
-
const message = ( localize(
|
|
291
|
+
const message = ( localize(16849, "Profile '{0}' was exported successfully.", profile.name));
|
|
292
292
|
if (profileContentHandler.extensionId) {
|
|
293
293
|
const buttons = [];
|
|
294
294
|
const link = this.productService.webUrl ? `${this.productService.webUrl}/${PROFILE_URL_AUTHORITY}/${id}/${saveResult.id}` : ( toUserDataProfileUri(`/${id}/${saveResult.id}`, this.productService).toString());
|
|
295
295
|
buttons.push({
|
|
296
|
-
label: ( localize(
|
|
296
|
+
label: ( localize(16850, "&&Copy Link")),
|
|
297
297
|
run: () => this.clipboardService.writeText(link)
|
|
298
298
|
});
|
|
299
299
|
if (this.productService.webUrl) {
|
|
300
300
|
buttons.push({
|
|
301
|
-
label: ( localize(
|
|
301
|
+
label: ( localize(16851, "&&Open Link")),
|
|
302
302
|
run: async () => {
|
|
303
303
|
await this.openerService.open(link);
|
|
304
304
|
}
|
|
305
305
|
});
|
|
306
306
|
} else {
|
|
307
307
|
buttons.push({
|
|
308
|
-
label: ( localize(
|
|
308
|
+
label: ( localize(16852, "&&Open in {0}", profileContentHandler.name)),
|
|
309
309
|
run: async () => {
|
|
310
310
|
await this.openerService.open(( saveResult.link.toString()));
|
|
311
311
|
}
|
|
@@ -315,7 +315,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
315
315
|
type: Severity.Info,
|
|
316
316
|
message,
|
|
317
317
|
buttons,
|
|
318
|
-
cancelButton: ( localize(
|
|
318
|
+
cancelButton: ( localize(16853, "Close"))
|
|
319
319
|
});
|
|
320
320
|
} else {
|
|
321
321
|
await this.dialogService.info(message);
|
|
@@ -334,7 +334,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
334
334
|
try {
|
|
335
335
|
profileTemplate = JSON.parse(profileContent);
|
|
336
336
|
} catch (error) {
|
|
337
|
-
throw ( new Error(( localize(
|
|
337
|
+
throw ( new Error(( localize(16854, "This profile is not valid."))));
|
|
338
338
|
}
|
|
339
339
|
if (!isUserDataProfileTemplate(profileTemplate)) {
|
|
340
340
|
return null;
|
|
@@ -371,27 +371,27 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
371
371
|
return undefined;
|
|
372
372
|
}
|
|
373
373
|
if (profileTemplate.settings && !profile.useDefaultFlags?.settings) {
|
|
374
|
-
progress(( localize(
|
|
374
|
+
progress(( localize(16855, "Applying Settings...")));
|
|
375
375
|
await this.instantiationService.createInstance(SettingsResource).apply(profileTemplate.settings, profile);
|
|
376
376
|
}
|
|
377
377
|
if (profileTemplate.keybindings && !profile.useDefaultFlags?.keybindings) {
|
|
378
|
-
progress(( localize(
|
|
378
|
+
progress(( localize(16856, "Applying Keyboard Shortcuts...")));
|
|
379
379
|
await this.instantiationService.createInstance(KeybindingsResource).apply(profileTemplate.keybindings, profile);
|
|
380
380
|
}
|
|
381
381
|
if (profileTemplate.tasks && !profile.useDefaultFlags?.tasks) {
|
|
382
|
-
progress(( localize(
|
|
382
|
+
progress(( localize(16857, "Applying Tasks...")));
|
|
383
383
|
await this.instantiationService.createInstance(TasksResource).apply(profileTemplate.tasks, profile);
|
|
384
384
|
}
|
|
385
385
|
if (profileTemplate.snippets && !profile.useDefaultFlags?.snippets) {
|
|
386
|
-
progress(( localize(
|
|
386
|
+
progress(( localize(16858, "Applying Snippets...")));
|
|
387
387
|
await this.instantiationService.createInstance(SnippetsResource).apply(profileTemplate.snippets, profile);
|
|
388
388
|
}
|
|
389
389
|
if (profileTemplate.globalState && !profile.useDefaultFlags?.globalState) {
|
|
390
|
-
progress(( localize(
|
|
390
|
+
progress(( localize(16859, "Applying State...")));
|
|
391
391
|
await this.instantiationService.createInstance(GlobalStateResource).apply(profileTemplate.globalState, profile);
|
|
392
392
|
}
|
|
393
393
|
if (profileTemplate.extensions && extensions && !profile.useDefaultFlags?.extensions) {
|
|
394
|
-
progress(( localize(
|
|
394
|
+
progress(( localize(16846, "Applying Extensions...")));
|
|
395
395
|
await this.instantiationService.createInstance(ExtensionsResource).apply(profileTemplate.extensions, profile);
|
|
396
396
|
}
|
|
397
397
|
return profile;
|
|
@@ -448,7 +448,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
448
448
|
});
|
|
449
449
|
}
|
|
450
450
|
const result = await this.quickInputService.pick(options.reverse(), {
|
|
451
|
-
title: ( localize(
|
|
451
|
+
title: ( localize(16860, "Export '{0}' profile as...", name)),
|
|
452
452
|
hideInput: true
|
|
453
453
|
});
|
|
454
454
|
return result?.id;
|
|
@@ -468,11 +468,11 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
468
468
|
} = await this.dialogService.confirm({
|
|
469
469
|
type: Severity.Info,
|
|
470
470
|
message: ( localize(
|
|
471
|
-
|
|
471
|
+
16861,
|
|
472
472
|
"Profile with name '{0}' already exists. Do you want to replace its contents?",
|
|
473
473
|
profileName
|
|
474
474
|
)),
|
|
475
|
-
primaryButton: ( localize(
|
|
475
|
+
primaryButton: ( localize(16862, "&&Replace"))
|
|
476
476
|
});
|
|
477
477
|
if (!confirmed) {
|
|
478
478
|
return undefined;
|
|
@@ -510,12 +510,12 @@ let FileUserDataProfileContentHandler = class FileUserDataProfileContentHandler
|
|
|
510
510
|
this.fileService = fileService;
|
|
511
511
|
this.productService = productService;
|
|
512
512
|
this.textFileService = textFileService;
|
|
513
|
-
this.name = ( localize(
|
|
514
|
-
this.description = ( localize(
|
|
513
|
+
this.name = ( localize(16863, "Local"));
|
|
514
|
+
this.description = ( localize(16864, "file"));
|
|
515
515
|
}
|
|
516
516
|
async saveProfile(name, content, token) {
|
|
517
517
|
const link = await this.fileDialogService.showSaveDialog({
|
|
518
|
-
title: ( localize(
|
|
518
|
+
title: ( localize(16865, "Save Profile")),
|
|
519
519
|
filters: PROFILE_FILTER,
|
|
520
520
|
defaultUri: this.uriIdentityService.extUri.joinPath(
|
|
521
521
|
await this.fileDialogService.defaultFilePath(),
|
|
@@ -552,7 +552,7 @@ let FileUserDataProfileContentHandler = class FileUserDataProfileContentHandler
|
|
|
552
552
|
canSelectFiles: true,
|
|
553
553
|
canSelectMany: false,
|
|
554
554
|
filters: PROFILE_FILTER,
|
|
555
|
-
title: ( localize(
|
|
555
|
+
title: ( localize(16866, "Select Profile"))
|
|
556
556
|
});
|
|
557
557
|
return profileLocation ? profileLocation[0] : null;
|
|
558
558
|
}
|
|
@@ -593,13 +593,13 @@ let UserDataProfileImportExportState = class UserDataProfileImportExportState ex
|
|
|
593
593
|
const labelText = isMarkdownString(root.label.label) ? root.label.label.value : root.label.label;
|
|
594
594
|
root.checkbox = {
|
|
595
595
|
isChecked: !root.isFromDefaultProfile(),
|
|
596
|
-
tooltip: ( localize(
|
|
596
|
+
tooltip: ( localize(16867, "Select {0}", labelText)),
|
|
597
597
|
accessibilityInformation: {
|
|
598
|
-
label: ( localize(
|
|
598
|
+
label: ( localize(16867, "Select {0}", labelText))
|
|
599
599
|
}
|
|
600
600
|
};
|
|
601
601
|
if (root.isFromDefaultProfile()) {
|
|
602
|
-
root.description = ( localize(
|
|
602
|
+
root.description = ( localize(16868, "From Default Profile"));
|
|
603
603
|
}
|
|
604
604
|
}
|
|
605
605
|
return this.roots;
|
|
@@ -777,11 +777,11 @@ let UserDataProfileExportState = class UserDataProfileExportState extends UserDa
|
|
|
777
777
|
let name = this.profile.name;
|
|
778
778
|
if (this.profile.isDefault) {
|
|
779
779
|
name = await this.quickInputService.input({
|
|
780
|
-
placeHolder: ( localize(
|
|
781
|
-
title: ( localize(
|
|
780
|
+
placeHolder: ( localize(16869, "Name the profile")),
|
|
781
|
+
title: ( localize(16870, "Export Profile")),
|
|
782
782
|
async validateInput(input) {
|
|
783
783
|
if (!input.trim()) {
|
|
784
|
-
return localize(
|
|
784
|
+
return localize(16871, "Profile name must be provided.");
|
|
785
785
|
}
|
|
786
786
|
return undefined;
|
|
787
787
|
}
|
package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.js
CHANGED
|
@@ -58,7 +58,7 @@ let UserDataProfileManagementService = class UserDataProfileManagementService ex
|
|
|
58
58
|
const profileToUse = this.getProfileToUseForCurrentWorkspace();
|
|
59
59
|
this.switchProfile(profileToUse);
|
|
60
60
|
this.changeCurrentProfile(profileToUse, ( localize(
|
|
61
|
-
|
|
61
|
+
16872,
|
|
62
62
|
"The current profile has been removed. Please reload to switch back to default profile"
|
|
63
63
|
)));
|
|
64
64
|
return;
|
|
@@ -69,12 +69,12 @@ let UserDataProfileManagementService = class UserDataProfileManagementService ex
|
|
|
69
69
|
if (profileToUse?.id !== updatedCurrentProfile.id) {
|
|
70
70
|
this.switchProfile(profileToUse);
|
|
71
71
|
this.changeCurrentProfile(profileToUse, ( localize(
|
|
72
|
-
|
|
72
|
+
16873,
|
|
73
73
|
"The current workspace has been removed from the current profile. Please reload to switch back to the updated profile"
|
|
74
74
|
)));
|
|
75
75
|
} else {
|
|
76
76
|
this.changeCurrentProfile(updatedCurrentProfile, ( localize(
|
|
77
|
-
|
|
77
|
+
16874,
|
|
78
78
|
"The current profile has been updated. Please reload to switch back to the updated profile"
|
|
79
79
|
)));
|
|
80
80
|
}
|
|
@@ -139,7 +139,7 @@ let UserDataProfileManagementService = class UserDataProfileManagementService ex
|
|
|
139
139
|
throw ( new Error(`Profile ${profile.name} does not exist`));
|
|
140
140
|
}
|
|
141
141
|
if (profile.isDefault) {
|
|
142
|
-
throw ( new Error(( localize(
|
|
142
|
+
throw ( new Error(( localize(16875, "Cannot rename the default profile"))));
|
|
143
143
|
}
|
|
144
144
|
const updatedProfile = await this.userDataProfilesService.updateProfile(profile, updateOptions);
|
|
145
145
|
return updatedProfile;
|
|
@@ -149,7 +149,7 @@ let UserDataProfileManagementService = class UserDataProfileManagementService ex
|
|
|
149
149
|
throw ( new Error(`Profile ${profile.name} does not exist`));
|
|
150
150
|
}
|
|
151
151
|
if (profile.isDefault) {
|
|
152
|
-
throw ( new Error(( localize(
|
|
152
|
+
throw ( new Error(( localize(16876, "Cannot delete the default profile"))));
|
|
153
153
|
}
|
|
154
154
|
await this.userDataProfilesService.removeProfile(profile);
|
|
155
155
|
}
|
|
@@ -197,7 +197,7 @@ let UserDataProfileManagementService = class UserDataProfileManagementService ex
|
|
|
197
197
|
);
|
|
198
198
|
if (shouldRestartExtensionHosts) {
|
|
199
199
|
if (!isRemoteWindow) {
|
|
200
|
-
if (!(await this.extensionService.stopExtensionHosts(( localize(
|
|
200
|
+
if (!(await this.extensionService.stopExtensionHosts(( localize(16877, "Switching to a profile"))))) {
|
|
201
201
|
if (( this.userDataProfilesService.profiles.some(p => p.id === this.userDataProfileService.currentProfile.id))) {
|
|
202
202
|
await this.userDataProfilesService.setProfileForWorkspace(
|
|
203
203
|
toWorkspaceIdentifier(this.workspaceContextService.getWorkspace()),
|
|
@@ -214,8 +214,8 @@ let UserDataProfileManagementService = class UserDataProfileManagementService ex
|
|
|
214
214
|
const {
|
|
215
215
|
confirmed
|
|
216
216
|
} = await this.dialogService.confirm({
|
|
217
|
-
message: reloadMessage ?? ( localize(
|
|
218
|
-
primaryButton: ( localize(
|
|
217
|
+
message: reloadMessage ?? ( localize(16878, "Switching a profile requires reloading VS Code.")),
|
|
218
|
+
primaryButton: ( localize(16879, "&&Reload"))
|
|
219
219
|
});
|
|
220
220
|
if (confirmed) {
|
|
221
221
|
await this.hostService.reload();
|