@codingame/monaco-vscode-user-data-profile-service-override 28.4.1 → 29.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 +26 -27
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfileActions.js +3 -3
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditor.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditor.js +83 -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 +41 -40
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileInit.js +2 -1
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.js +10 -9
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(14963, "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(14964, "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(14965, "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(14966, "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(14966, "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(14967, "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(14968, "{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(14969, "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(14970, "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(14971, "Duplicate...")), ThemeIcon.asClassName(Codicon.copy), true, () => this.createNewProfile(profileElement.profile))));
|
|
955
|
+
const exportAction = disposables.add(( new Action("userDataProfile.export", ( localize(14972, "Export...")), ThemeIcon.asClassName(Codicon.export), true, () => this.userDataProfileImportExportService.exportProfile(profile))));
|
|
956
|
+
const deleteAction = disposables.add(( new Action("userDataProfile.delete", ( localize(14973, "Delete")), ThemeIcon.asClassName(Codicon.trash), true, () => this.removeProfile(profileElement.profile))));
|
|
957
|
+
const newWindowAction = disposables.add(( new Action("userDataProfile.newWindow", ( localize(14974, "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
|
+
14975,
|
|
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(14976, "Discard & Create")),
|
|
989
|
+
cancelButton: ( localize(14977, "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(14978, "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(14979, "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(14977, "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(14980, "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(14972, "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(14981, "Replace"));
|
|
1032
1032
|
} else {
|
|
1033
|
-
createAction.label = ( localize(
|
|
1033
|
+
createAction.label = ( localize(14978, "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(14982, "Are you sure you want to delete the profile '{0}'?", profile.name)),
|
|
1204
|
+
primaryButton: ( localize(14973, "Delete")),
|
|
1205
|
+
cancelButton: ( localize(14977, "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
|
+
16522,
|
|
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(16523, "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(16524, "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(16525, "Select {0} Extension", e.displayName || e.identifier.id)),
|
|
357
357
|
accessibilityInformation: {
|
|
358
|
-
label: ( localize(
|
|
358
|
+
label: ( localize(16525, "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(16526, "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(16527, "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(16528, "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(16529, "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(16530, "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
|
+
16531,
|
|
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(16532, "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(16533, "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(16534, "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(16533, "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(16535, "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(16536, "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(16537, "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(16538, "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(16539, "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(16534, "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(16540, "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(16541, "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(16542, "Applying Extensions...")));
|
|
255
255
|
await this.instantiationService.createInstance(ExtensionsResource).copy(this.userDataProfileService.currentProfile, profile, true);
|
|
256
|
-
reportProgress(( localize(
|
|
256
|
+
reportProgress(( localize(16543, "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(16544, "{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(16545, "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(16546, "&&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(16547, "&&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(16548, "&&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(16549, "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(16550, "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(16551, "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(16552, "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(16553, "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(16554, "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(16555, "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(16542, "Applying Extensions...")));
|
|
395
395
|
await this.instantiationService.createInstance(ExtensionsResource).apply(profileTemplate.extensions, profile);
|
|
396
396
|
}
|
|
397
397
|
return profile;
|
|
@@ -424,7 +424,8 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
424
424
|
}
|
|
425
425
|
const context = await this.requestService.request({
|
|
426
426
|
type: "GET",
|
|
427
|
-
url: ( resource.toString(true))
|
|
427
|
+
url: ( resource.toString(true)),
|
|
428
|
+
callSite: "userDataProfileImportExportService.resolveContent"
|
|
428
429
|
}, CancellationToken.None);
|
|
429
430
|
if (context.res.statusCode === 200) {
|
|
430
431
|
return await asText(context);
|
|
@@ -447,7 +448,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
447
448
|
});
|
|
448
449
|
}
|
|
449
450
|
const result = await this.quickInputService.pick(options.reverse(), {
|
|
450
|
-
title: ( localize(
|
|
451
|
+
title: ( localize(16556, "Export '{0}' profile as...", name)),
|
|
451
452
|
hideInput: true
|
|
452
453
|
});
|
|
453
454
|
return result?.id;
|
|
@@ -467,11 +468,11 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
467
468
|
} = await this.dialogService.confirm({
|
|
468
469
|
type: Severity.Info,
|
|
469
470
|
message: ( localize(
|
|
470
|
-
|
|
471
|
+
16557,
|
|
471
472
|
"Profile with name '{0}' already exists. Do you want to replace its contents?",
|
|
472
473
|
profileName
|
|
473
474
|
)),
|
|
474
|
-
primaryButton: ( localize(
|
|
475
|
+
primaryButton: ( localize(16558, "&&Replace"))
|
|
475
476
|
});
|
|
476
477
|
if (!confirmed) {
|
|
477
478
|
return undefined;
|
|
@@ -509,12 +510,12 @@ let FileUserDataProfileContentHandler = class FileUserDataProfileContentHandler
|
|
|
509
510
|
this.fileService = fileService;
|
|
510
511
|
this.productService = productService;
|
|
511
512
|
this.textFileService = textFileService;
|
|
512
|
-
this.name = ( localize(
|
|
513
|
-
this.description = ( localize(
|
|
513
|
+
this.name = ( localize(16559, "Local"));
|
|
514
|
+
this.description = ( localize(16560, "file"));
|
|
514
515
|
}
|
|
515
516
|
async saveProfile(name, content, token) {
|
|
516
517
|
const link = await this.fileDialogService.showSaveDialog({
|
|
517
|
-
title: ( localize(
|
|
518
|
+
title: ( localize(16561, "Save Profile")),
|
|
518
519
|
filters: PROFILE_FILTER,
|
|
519
520
|
defaultUri: this.uriIdentityService.extUri.joinPath(
|
|
520
521
|
await this.fileDialogService.defaultFilePath(),
|
|
@@ -551,7 +552,7 @@ let FileUserDataProfileContentHandler = class FileUserDataProfileContentHandler
|
|
|
551
552
|
canSelectFiles: true,
|
|
552
553
|
canSelectMany: false,
|
|
553
554
|
filters: PROFILE_FILTER,
|
|
554
|
-
title: ( localize(
|
|
555
|
+
title: ( localize(16562, "Select Profile"))
|
|
555
556
|
});
|
|
556
557
|
return profileLocation ? profileLocation[0] : null;
|
|
557
558
|
}
|
|
@@ -592,13 +593,13 @@ let UserDataProfileImportExportState = class UserDataProfileImportExportState ex
|
|
|
592
593
|
const labelText = isMarkdownString(root.label.label) ? root.label.label.value : root.label.label;
|
|
593
594
|
root.checkbox = {
|
|
594
595
|
isChecked: !root.isFromDefaultProfile(),
|
|
595
|
-
tooltip: ( localize(
|
|
596
|
+
tooltip: ( localize(16563, "Select {0}", labelText)),
|
|
596
597
|
accessibilityInformation: {
|
|
597
|
-
label: ( localize(
|
|
598
|
+
label: ( localize(16563, "Select {0}", labelText))
|
|
598
599
|
}
|
|
599
600
|
};
|
|
600
601
|
if (root.isFromDefaultProfile()) {
|
|
601
|
-
root.description = ( localize(
|
|
602
|
+
root.description = ( localize(16564, "From Default Profile"));
|
|
602
603
|
}
|
|
603
604
|
}
|
|
604
605
|
return this.roots;
|
|
@@ -776,11 +777,11 @@ let UserDataProfileExportState = class UserDataProfileExportState extends UserDa
|
|
|
776
777
|
let name = this.profile.name;
|
|
777
778
|
if (this.profile.isDefault) {
|
|
778
779
|
name = await this.quickInputService.input({
|
|
779
|
-
placeHolder: ( localize(
|
|
780
|
-
title: ( localize(
|
|
780
|
+
placeHolder: ( localize(16565, "Name the profile")),
|
|
781
|
+
title: ( localize(16566, "Export Profile")),
|
|
781
782
|
async validateInput(input) {
|
|
782
783
|
if (!input.trim()) {
|
|
783
|
-
return localize(
|
|
784
|
+
return localize(16567, "Profile name must be provided.");
|
|
784
785
|
}
|
|
785
786
|
return undefined;
|
|
786
787
|
}
|
|
@@ -126,7 +126,8 @@ let UserDataProfileInitializer = class UserDataProfileInitializer {
|
|
|
126
126
|
const url = ( URI.revive(this.environmentService.options.profile.contents).toString(true));
|
|
127
127
|
const context = await this.requestService.request({
|
|
128
128
|
type: "GET",
|
|
129
|
-
url
|
|
129
|
+
url,
|
|
130
|
+
callSite: "userDataProfileInit.initializeProfile"
|
|
130
131
|
}, CancellationToken.None);
|
|
131
132
|
if (context.res.statusCode === 200) {
|
|
132
133
|
return await asJson(context);
|
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
|
+
16568,
|
|
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
|
+
16569,
|
|
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
|
+
16570,
|
|
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(16571, "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(16572, "Cannot delete the default profile"))));
|
|
153
153
|
}
|
|
154
154
|
await this.userDataProfilesService.removeProfile(profile);
|
|
155
155
|
}
|
|
@@ -175,7 +175,8 @@ let UserDataProfileManagementService = class UserDataProfileManagementService ex
|
|
|
175
175
|
try {
|
|
176
176
|
const context = await this.requestService.request({
|
|
177
177
|
type: "GET",
|
|
178
|
-
url: this.productService.profileTemplatesUrl
|
|
178
|
+
url: this.productService.profileTemplatesUrl,
|
|
179
|
+
callSite: "userDataProfileManagement.getProfileTemplates"
|
|
179
180
|
}, CancellationToken.None);
|
|
180
181
|
if (context.res.statusCode === 200) {
|
|
181
182
|
return (await asJson(context)) || [];
|
|
@@ -196,7 +197,7 @@ let UserDataProfileManagementService = class UserDataProfileManagementService ex
|
|
|
196
197
|
);
|
|
197
198
|
if (shouldRestartExtensionHosts) {
|
|
198
199
|
if (!isRemoteWindow) {
|
|
199
|
-
if (!(await this.extensionService.stopExtensionHosts(( localize(
|
|
200
|
+
if (!(await this.extensionService.stopExtensionHosts(( localize(16573, "Switching to a profile"))))) {
|
|
200
201
|
if (( this.userDataProfilesService.profiles.some(p => p.id === this.userDataProfileService.currentProfile.id))) {
|
|
201
202
|
await this.userDataProfilesService.setProfileForWorkspace(
|
|
202
203
|
toWorkspaceIdentifier(this.workspaceContextService.getWorkspace()),
|
|
@@ -213,8 +214,8 @@ let UserDataProfileManagementService = class UserDataProfileManagementService ex
|
|
|
213
214
|
const {
|
|
214
215
|
confirmed
|
|
215
216
|
} = await this.dialogService.confirm({
|
|
216
|
-
message: reloadMessage ?? ( localize(
|
|
217
|
-
primaryButton: ( localize(
|
|
217
|
+
message: reloadMessage ?? ( localize(16574, "Switching a profile requires reloading VS Code.")),
|
|
218
|
+
primaryButton: ( localize(16575, "&&Reload"))
|
|
218
219
|
});
|
|
219
220
|
if (confirmed) {
|
|
220
221
|
await this.hostService.reload();
|