@codingame/monaco-vscode-user-data-profile-service-override 37.2.0 → 37.3.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 +2 -2
- package/vscode/src/vs/platform/userDataProfile/browser/userDataProfile.js +3 -3
- package/vscode/src/vs/platform/userDataProfile/common/userDataProfileStorageService.js +2 -2
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.js +38 -33
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfileActions.js +3 -3
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditor.js +90 -90
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditorModel.js +41 -35
- package/vscode/src/vs/workbench/services/userData/browser/userDataInit.js +12 -6
- package/vscode/src/vs/workbench/services/userDataProfile/browser/extensionsResource.js +24 -18
- 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 +4 -4
- package/vscode/src/vs/workbench/services/userDataProfile/browser/tasksResource.js +1 -1
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileImportExportService.js +40 -40
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.js +8 -8
- package/vscode/src/vs/workbench/services/userDataSync/browser/userDataSyncInit.js +2 -2
- package/vscode/src/vs/workbench/services/userDataSync/common/userDataSyncUtil.js +1 -1
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(20721, "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(20722, "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(20723, "The profile should contain at least one configuration."));
|
|
235
235
|
return;
|
|
236
236
|
}
|
|
237
237
|
this.message = undefined;
|
|
@@ -246,7 +246,7 @@ let AbstractUserDataProfileElement = class AbstractUserDataProfileElement extend
|
|
|
246
246
|
ProfileResourceType.Snippets,
|
|
247
247
|
ProfileResourceType.Extensions
|
|
248
248
|
];
|
|
249
|
-
return Promise.all(
|
|
249
|
+
return Promise.all(resourceTypes.map(async r => {
|
|
250
250
|
const children = (r === ProfileResourceType.Settings || r === ProfileResourceType.Keybindings || r === ProfileResourceType.Tasks || r === ProfileResourceType.Mcp) ? await this.getChildrenForResourceType(r) : [];
|
|
251
251
|
return {
|
|
252
252
|
handle: r,
|
|
@@ -254,12 +254,12 @@ 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(20724, "Open to the Side")),
|
|
258
258
|
class: ThemeIcon.asClassName(Codicon.goToFile),
|
|
259
259
|
run: () => children[0]?.openAction?.run()
|
|
260
260
|
}) : undefined
|
|
261
261
|
};
|
|
262
|
-
}))
|
|
262
|
+
}));
|
|
263
263
|
}
|
|
264
264
|
return this.getChildrenForResourceType(resourceType);
|
|
265
265
|
}
|
|
@@ -289,7 +289,7 @@ let AbstractUserDataProfileElement = class AbstractUserDataProfileElement extend
|
|
|
289
289
|
children = await this.instantiationService.createInstance(ExtensionsResourceExportTreeItem, profile).getChildren();
|
|
290
290
|
break;
|
|
291
291
|
}
|
|
292
|
-
return
|
|
292
|
+
return children.map(child => this.toUserDataProfileResourceChildElement(child));
|
|
293
293
|
}
|
|
294
294
|
toUserDataProfileResourceChildElement(child, primaryActions, contextMenuActions) {
|
|
295
295
|
return {
|
|
@@ -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(20724, "Open to the Side")),
|
|
305
305
|
class: ThemeIcon.asClassName(Codicon.goToFile),
|
|
306
306
|
run: async () => {
|
|
307
307
|
if (child.parent.type === ProfileResourceType.Extensions) {
|
|
@@ -502,9 +502,9 @@ let UserDataProfileElement = class UserDataProfileElement extends AbstractUserDa
|
|
|
502
502
|
async getChildrenForResourceType(resourceType) {
|
|
503
503
|
if (resourceType === ProfileResourceType.Extensions) {
|
|
504
504
|
const children = await this.instantiationService.createInstance(ExtensionsResourceExportTreeItem, this.profile).getChildren();
|
|
505
|
-
return
|
|
505
|
+
return children.map(child => this.toUserDataProfileResourceChildElement(child, undefined, [{
|
|
506
506
|
id: "applyToAllProfiles",
|
|
507
|
-
label: ( localize(
|
|
507
|
+
label: ( localize(20725, "Apply Extension to all Profiles")),
|
|
508
508
|
checked: child.applicationScoped,
|
|
509
509
|
enabled: true,
|
|
510
510
|
class: "",
|
|
@@ -516,7 +516,7 @@ let UserDataProfileElement = class UserDataProfileElement extends AbstractUserDa
|
|
|
516
516
|
await this.extensionManagementService.toggleApplicationScope(extension, this.profile.extensionsResource);
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
|
-
}]))
|
|
519
|
+
}]));
|
|
520
520
|
}
|
|
521
521
|
return this.getChildrenFromProfile(this.profile, resourceType);
|
|
522
522
|
}
|
|
@@ -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(20726, "{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(20727, "Untitled"));
|
|
714
714
|
const nameRegEx = ( new RegExp(`${name}\\s(\\d+)`));
|
|
715
715
|
let nameIndex = 0;
|
|
716
716
|
for (const profile of this.userDataProfilesService.profiles) {
|
|
@@ -834,7 +834,7 @@ let NewProfileElement = class NewProfileElement extends AbstractUserDataProfileE
|
|
|
834
834
|
case ProfileResourceType.Extensions:
|
|
835
835
|
if (profileTemplate.extensions) {
|
|
836
836
|
const children = await this.instantiationService.createInstance(ExtensionsResourceImportTreeItem, profileTemplate.extensions).getChildren();
|
|
837
|
-
return
|
|
837
|
+
return children.map(child => this.toUserDataProfileResourceChildElement(child));
|
|
838
838
|
}
|
|
839
839
|
return [];
|
|
840
840
|
}
|
|
@@ -867,7 +867,7 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
|
|
|
867
867
|
return UserDataProfilesEditorModel_1.INSTANCE;
|
|
868
868
|
}
|
|
869
869
|
get profiles() {
|
|
870
|
-
return
|
|
870
|
+
return this._profiles.map(([profile]) => profile).sort((a, b) => {
|
|
871
871
|
if (a instanceof NewProfileElement) {
|
|
872
872
|
return 1;
|
|
873
873
|
}
|
|
@@ -914,7 +914,9 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
|
|
|
914
914
|
this._profiles.push(this.createProfileElement(profile));
|
|
915
915
|
}
|
|
916
916
|
}
|
|
917
|
-
this._register(toDisposable(
|
|
917
|
+
this._register(toDisposable(
|
|
918
|
+
() => this._profiles.splice(0, this._profiles.length).map(([, disposables]) => disposables.dispose())
|
|
919
|
+
));
|
|
918
920
|
this._register(
|
|
919
921
|
userDataProfilesService.onDidChangeProfiles(e => this.onDidChangeProfiles(e))
|
|
920
922
|
);
|
|
@@ -936,6 +938,7 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
|
|
|
936
938
|
);
|
|
937
939
|
if (index !== -1) {
|
|
938
940
|
changed = true;
|
|
941
|
+
this._profiles.splice(index, 1).map(([, disposables]) => disposables.dispose());
|
|
939
942
|
}
|
|
940
943
|
}
|
|
941
944
|
if (changed) {
|
|
@@ -950,11 +953,11 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
|
|
|
950
953
|
}
|
|
951
954
|
createProfileElement(profile) {
|
|
952
955
|
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(
|
|
956
|
+
const activateAction = disposables.add(( new Action("userDataProfile.activate", ( localize(20728, "Use this Profile for Current Window")), ThemeIcon.asClassName(Codicon.check), true, () => this.userDataProfileManagementService.switchProfile(profileElement.profile))));
|
|
957
|
+
const copyFromProfileAction = disposables.add(( new Action("userDataProfile.copyFromProfile", ( localize(20729, "Duplicate...")), ThemeIcon.asClassName(Codicon.copy), true, () => this.createNewProfile(profileElement.profile))));
|
|
958
|
+
const exportAction = disposables.add(( new Action("userDataProfile.export", ( localize(20730, "Export...")), ThemeIcon.asClassName(Codicon.export), true, () => this.userDataProfileImportExportService.exportProfile(profile))));
|
|
959
|
+
const deleteAction = disposables.add(( new Action("userDataProfile.delete", ( localize(20731, "Delete")), ThemeIcon.asClassName(Codicon.trash), true, () => this.removeProfile(profileElement.profile))));
|
|
960
|
+
const newWindowAction = disposables.add(( new Action("userDataProfile.newWindow", ( localize(20732, "Open New Window with this Profile")), ThemeIcon.asClassName(Codicon.emptyWindow), true, () => this.openWindow(profileElement.profile))));
|
|
958
961
|
const primaryActions = [];
|
|
959
962
|
primaryActions.push(activateAction);
|
|
960
963
|
primaryActions.push(newWindowAction);
|
|
@@ -982,11 +985,11 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
|
|
|
982
985
|
const result = await this.dialogService.confirm({
|
|
983
986
|
type: "info",
|
|
984
987
|
message: ( localize(
|
|
985
|
-
|
|
988
|
+
20733,
|
|
986
989
|
"A new profile is already being created. Do you want to discard it and create a new one?"
|
|
987
990
|
)),
|
|
988
|
-
primaryButton: ( localize(
|
|
989
|
-
cancelButton: ( localize(
|
|
991
|
+
primaryButton: ( localize(20734, "Discard & Create")),
|
|
992
|
+
cancelButton: ( localize(20735, "Cancel"))
|
|
990
993
|
});
|
|
991
994
|
if (!result.confirmed) {
|
|
992
995
|
return;
|
|
@@ -1007,18 +1010,18 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
|
|
|
1007
1010
|
disposables.add(toDisposable(() => cancellationTokenSource.dispose(true)));
|
|
1008
1011
|
const primaryActions = [];
|
|
1009
1012
|
const secondaryActions = [];
|
|
1010
|
-
const createAction = disposables.add(( new Action("userDataProfile.create", ( localize(
|
|
1013
|
+
const createAction = disposables.add(( new Action("userDataProfile.create", ( localize(20736, "Create")), undefined, true, () => this.saveNewProfile(false, cancellationTokenSource.token))));
|
|
1011
1014
|
primaryActions.push(createAction);
|
|
1012
1015
|
if (isWeb && copyFrom instanceof URI && isProfileURL(copyFrom)) {
|
|
1013
|
-
primaryActions.push(disposables.add(( new Action("userDataProfile.createInDesktop", ( localize(
|
|
1016
|
+
primaryActions.push(disposables.add(( new Action("userDataProfile.createInDesktop", ( localize(20737, "Create in {0}", this.productService.nameLong)), undefined, true, () => this.openerService.open(copyFrom, {
|
|
1014
1017
|
openExternal: true
|
|
1015
1018
|
})))));
|
|
1016
1019
|
}
|
|
1017
|
-
const cancelAction = disposables.add(( new Action("userDataProfile.cancel", ( localize(
|
|
1020
|
+
const cancelAction = disposables.add(( new Action("userDataProfile.cancel", ( localize(20735, "Cancel")), ThemeIcon.asClassName(Codicon.trash), true, () => this.discardNewProfile())));
|
|
1018
1021
|
secondaryActions.push(cancelAction);
|
|
1019
|
-
const previewProfileAction = disposables.add(( new Action("userDataProfile.preview", ( localize(
|
|
1022
|
+
const previewProfileAction = disposables.add(( new Action("userDataProfile.preview", ( localize(20738, "Preview")), ThemeIcon.asClassName(Codicon.openPreview), true, () => this.previewNewProfile(cancellationTokenSource.token))));
|
|
1020
1023
|
secondaryActions.push(previewProfileAction);
|
|
1021
|
-
const exportAction = disposables.add(( new Action("userDataProfile.export", ( localize(
|
|
1024
|
+
const exportAction = disposables.add(( new Action("userDataProfile.export", ( localize(20730, "Export...")), ThemeIcon.asClassName(Codicon.export), isUserDataProfile(copyFrom), () => this.exportNewProfile(cancellationTokenSource.token))));
|
|
1022
1025
|
this.newProfileElement = disposables.add(this.instantiationService.createInstance(
|
|
1023
1026
|
NewProfileElement,
|
|
1024
1027
|
copyFrom,
|
|
@@ -1028,9 +1031,9 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
|
|
|
1028
1031
|
const updateCreateActionLabel = () => {
|
|
1029
1032
|
if (createAction.enabled) {
|
|
1030
1033
|
if (this.newProfileElement?.copyFrom && ( this.userDataProfilesService.profiles.some(p => !p.isInternal && p.name === this.newProfileElement?.name))) {
|
|
1031
|
-
createAction.label = ( localize(
|
|
1034
|
+
createAction.label = ( localize(20739, "Replace"));
|
|
1032
1035
|
} else {
|
|
1033
|
-
createAction.label = ( localize(
|
|
1036
|
+
createAction.label = ( localize(20736, "Create"));
|
|
1034
1037
|
}
|
|
1035
1038
|
}
|
|
1036
1039
|
};
|
|
@@ -1060,7 +1063,10 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
|
|
|
1060
1063
|
}
|
|
1061
1064
|
removeNewProfile() {
|
|
1062
1065
|
if (this.newProfileElement) {
|
|
1063
|
-
this._profiles.findIndex(([p]) => p === this.newProfileElement);
|
|
1066
|
+
const index = this._profiles.findIndex(([p]) => p === this.newProfileElement);
|
|
1067
|
+
if (index !== -1) {
|
|
1068
|
+
this._profiles.splice(index, 1).map(([, disposables]) => disposables.dispose());
|
|
1069
|
+
}
|
|
1064
1070
|
this.newProfileElement = undefined;
|
|
1065
1071
|
}
|
|
1066
1072
|
}
|
|
@@ -1200,9 +1206,9 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
|
|
|
1200
1206
|
async removeProfile(profile) {
|
|
1201
1207
|
const result = await this.dialogService.confirm({
|
|
1202
1208
|
type: "info",
|
|
1203
|
-
message: ( localize(
|
|
1204
|
-
primaryButton: ( localize(
|
|
1205
|
-
cancelButton: ( localize(
|
|
1209
|
+
message: ( localize(20740, "Are you sure you want to delete the profile '{0}'?", profile.name)),
|
|
1210
|
+
primaryButton: ( localize(20731, "Delete")),
|
|
1211
|
+
cancelButton: ( localize(20735, "Cancel"))
|
|
1206
1212
|
});
|
|
1207
1213
|
if (result.confirmed) {
|
|
1208
1214
|
await this.userDataProfileManagementService.removeProfile(profile);
|
|
@@ -15,27 +15,33 @@ class UserDataInitializationService {
|
|
|
15
15
|
}
|
|
16
16
|
async whenInitializationFinished() {
|
|
17
17
|
if (await this.requiresInitialization()) {
|
|
18
|
-
await Promise.all(
|
|
18
|
+
await Promise.all(
|
|
19
|
+
this.initializers.map(initializer => initializer.whenInitializationFinished())
|
|
20
|
+
);
|
|
19
21
|
}
|
|
20
22
|
}
|
|
21
23
|
async requiresInitialization() {
|
|
22
|
-
return ( (await Promise.all(
|
|
24
|
+
return ( (await Promise.all(this.initializers.map(initializer => initializer.requiresInitialization()))).some(result => result));
|
|
23
25
|
}
|
|
24
26
|
async initializeRequiredResources() {
|
|
25
27
|
if (await this.requiresInitialization()) {
|
|
26
|
-
await Promise.all(
|
|
28
|
+
await Promise.all(
|
|
29
|
+
this.initializers.map(initializer => initializer.initializeRequiredResources())
|
|
30
|
+
);
|
|
27
31
|
}
|
|
28
32
|
}
|
|
29
33
|
async initializeOtherResources(instantiationService) {
|
|
30
34
|
if (await this.requiresInitialization()) {
|
|
31
|
-
await Promise.all(
|
|
35
|
+
await Promise.all(
|
|
36
|
+
this.initializers.map(initializer => initializer.initializeOtherResources(instantiationService))
|
|
37
|
+
);
|
|
32
38
|
}
|
|
33
39
|
}
|
|
34
40
|
async initializeInstalledExtensions(instantiationService) {
|
|
35
41
|
if (await this.requiresInitialization()) {
|
|
36
|
-
await Promise.all(
|
|
42
|
+
await Promise.all(this.initializers.map(
|
|
37
43
|
initializer => initializer.initializeInstalledExtensions(instantiationService)
|
|
38
|
-
))
|
|
44
|
+
));
|
|
39
45
|
}
|
|
40
46
|
}
|
|
41
47
|
}
|
|
@@ -71,12 +71,12 @@ let ExtensionsResourceInitializer = class ExtensionsResourceInitializer {
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
if (extensionsToInstall.length) {
|
|
74
|
-
const galleryExtensions = await this.extensionGalleryService.getExtensions(
|
|
74
|
+
const galleryExtensions = await this.extensionGalleryService.getExtensions(extensionsToInstall.map(e => ({
|
|
75
75
|
...e.identifier,
|
|
76
76
|
version: e.version,
|
|
77
77
|
hasPreRelease: e.version ? undefined : e.preRelease
|
|
78
|
-
}))
|
|
79
|
-
await Promise.all(
|
|
78
|
+
})), CancellationToken.None);
|
|
79
|
+
await Promise.all(extensionsToInstall.map(async e => {
|
|
80
80
|
const extension = galleryExtensions.find(
|
|
81
81
|
galleryExtension => areSameExtensions(galleryExtension.identifier, e.identifier)
|
|
82
82
|
);
|
|
@@ -111,10 +111,12 @@ let ExtensionsResourceInitializer = class ExtensionsResourceInitializer {
|
|
|
111
111
|
extension.identifier.id
|
|
112
112
|
);
|
|
113
113
|
}
|
|
114
|
-
}))
|
|
114
|
+
}));
|
|
115
115
|
}
|
|
116
116
|
if (extensionsToUninstall.length) {
|
|
117
|
-
await Promise.all(
|
|
117
|
+
await Promise.all(
|
|
118
|
+
extensionsToUninstall.map(e => this.extensionManagementService.uninstall(e))
|
|
119
|
+
);
|
|
118
120
|
}
|
|
119
121
|
}
|
|
120
122
|
};
|
|
@@ -185,13 +187,13 @@ let ExtensionsResource = class ExtensionsResource {
|
|
|
185
187
|
}
|
|
186
188
|
if (extensionsToInstall.length) {
|
|
187
189
|
this.logService.info(`Importing Profile (${profile.name}): Started installing extensions.`);
|
|
188
|
-
const galleryExtensions = await this.extensionGalleryService.getExtensions(
|
|
190
|
+
const galleryExtensions = await this.extensionGalleryService.getExtensions(extensionsToInstall.map(e => ({
|
|
189
191
|
...e.identifier,
|
|
190
192
|
version: e.version,
|
|
191
193
|
hasPreRelease: e.version ? undefined : e.preRelease
|
|
192
|
-
}))
|
|
194
|
+
})), CancellationToken.None);
|
|
193
195
|
const installExtensionInfos = [];
|
|
194
|
-
await Promise.all(
|
|
196
|
+
await Promise.all(extensionsToInstall.map(async e => {
|
|
195
197
|
const extension = galleryExtensions.find(
|
|
196
198
|
galleryExtension => areSameExtensions(galleryExtension.identifier, e.identifier)
|
|
197
199
|
);
|
|
@@ -218,7 +220,7 @@ let ExtensionsResource = class ExtensionsResource {
|
|
|
218
220
|
extension.identifier.id
|
|
219
221
|
);
|
|
220
222
|
}
|
|
221
|
-
}))
|
|
223
|
+
}));
|
|
222
224
|
if (installExtensionInfos.length) {
|
|
223
225
|
if (token) {
|
|
224
226
|
await this.extensionManagementService.requestPublisherTrust(installExtensionInfos);
|
|
@@ -227,7 +229,7 @@ let ExtensionsResource = class ExtensionsResource {
|
|
|
227
229
|
return;
|
|
228
230
|
}
|
|
229
231
|
progress?.(( localize(
|
|
230
|
-
|
|
232
|
+
22417,
|
|
231
233
|
"Installing extension {0}...",
|
|
232
234
|
installExtensionInfo.extension.displayName ?? installExtensionInfo.extension.identifier.id
|
|
233
235
|
)));
|
|
@@ -240,7 +242,9 @@ let ExtensionsResource = class ExtensionsResource {
|
|
|
240
242
|
this.logService.info(`Importing Profile (${profile.name}): Finished installing extensions.`);
|
|
241
243
|
}
|
|
242
244
|
if (extensionsToUninstall.length) {
|
|
243
|
-
await Promise.all(
|
|
245
|
+
await Promise.all(
|
|
246
|
+
extensionsToUninstall.map(e => this.extensionManagementService.uninstall(e))
|
|
247
|
+
);
|
|
244
248
|
}
|
|
245
249
|
});
|
|
246
250
|
}
|
|
@@ -256,7 +260,9 @@ let ExtensionsResource = class ExtensionsResource {
|
|
|
256
260
|
extensionsToDisable.push(extension.identifier);
|
|
257
261
|
}
|
|
258
262
|
}
|
|
259
|
-
await this.withProfileScopedServices(to, async extensionEnablementService => Promise.all(
|
|
263
|
+
await this.withProfileScopedServices(to, async extensionEnablementService => Promise.all(
|
|
264
|
+
extensionsToDisable.map(extension => extensionEnablementService.disableExtension(extension))
|
|
265
|
+
));
|
|
260
266
|
}
|
|
261
267
|
async getLocalExtensions(profile) {
|
|
262
268
|
return this.withProfileScopedServices(profile, async extensionEnablementService => {
|
|
@@ -322,7 +328,7 @@ class ExtensionsResourceTreeItem {
|
|
|
322
328
|
this.type = ProfileResourceType.Extensions;
|
|
323
329
|
this.handle = ProfileResourceType.Extensions;
|
|
324
330
|
this.label = {
|
|
325
|
-
label: ( localize(
|
|
331
|
+
label: ( localize(22418, "Extensions"))
|
|
326
332
|
};
|
|
327
333
|
this.collapsibleState = TreeItemCollapsibleState.Expanded;
|
|
328
334
|
this.contextValue = ProfileResourceType.Extensions;
|
|
@@ -333,14 +339,14 @@ class ExtensionsResourceTreeItem {
|
|
|
333
339
|
(a, b) => (a.displayName ?? a.identifier.id).localeCompare(b.displayName ?? b.identifier.id)
|
|
334
340
|
);
|
|
335
341
|
const that = this;
|
|
336
|
-
return
|
|
342
|
+
return extensions.map(e => ({
|
|
337
343
|
...e,
|
|
338
344
|
handle: e.identifier.id.toLowerCase(),
|
|
339
345
|
parent: this,
|
|
340
346
|
label: {
|
|
341
347
|
label: e.displayName || e.identifier.id
|
|
342
348
|
},
|
|
343
|
-
description: e.applicationScoped ? ( localize(
|
|
349
|
+
description: e.applicationScoped ? ( localize(22419, "All Profiles")) : undefined,
|
|
344
350
|
collapsibleState: TreeItemCollapsibleState.None,
|
|
345
351
|
checkbox: that.checkbox ? {
|
|
346
352
|
get isChecked() {
|
|
@@ -353,9 +359,9 @@ class ExtensionsResourceTreeItem {
|
|
|
353
359
|
that.excludedExtensions.add(e.identifier.id.toLowerCase());
|
|
354
360
|
}
|
|
355
361
|
},
|
|
356
|
-
tooltip: ( localize(
|
|
362
|
+
tooltip: ( localize(22420, "Select {0} Extension", e.displayName || e.identifier.id)),
|
|
357
363
|
accessibilityInformation: {
|
|
358
|
-
label: ( localize(
|
|
364
|
+
label: ( localize(22420, "Select {0} Extension", e.displayName || e.identifier.id))
|
|
359
365
|
}
|
|
360
366
|
} : undefined,
|
|
361
367
|
themeIcon: Codicon.extensions,
|
|
@@ -364,7 +370,7 @@ class ExtensionsResourceTreeItem {
|
|
|
364
370
|
title: "",
|
|
365
371
|
arguments: [e.identifier.id, undefined, true]
|
|
366
372
|
}
|
|
367
|
-
}))
|
|
373
|
+
}));
|
|
368
374
|
}
|
|
369
375
|
async hasContent() {
|
|
370
376
|
const extensions = await this.getExtensions();
|
|
@@ -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(22421, "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(22422, "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(22423, "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(22424, "Settings"))
|
|
109
109
|
};
|
|
110
110
|
this.collapsibleState = TreeItemCollapsibleState.Expanded;
|
|
111
111
|
}
|
|
@@ -115,7 +115,7 @@ let SnippetsResourceTreeItem = class SnippetsResourceTreeItem {
|
|
|
115
115
|
this.uriIdentityService = uriIdentityService;
|
|
116
116
|
this.type = ProfileResourceType.Snippets;
|
|
117
117
|
this.label = {
|
|
118
|
-
label: ( localize(
|
|
118
|
+
label: ( localize(22425, "Snippets"))
|
|
119
119
|
};
|
|
120
120
|
this.collapsibleState = TreeItemCollapsibleState.Collapsed;
|
|
121
121
|
this.excludedSnippets = ( new ResourceSet());
|
|
@@ -124,7 +124,7 @@ let SnippetsResourceTreeItem = class SnippetsResourceTreeItem {
|
|
|
124
124
|
async getChildren() {
|
|
125
125
|
const snippetsResources = await this.instantiationService.createInstance(SnippetsResource).getSnippetsResources(this.profile);
|
|
126
126
|
const that = this;
|
|
127
|
-
return
|
|
127
|
+
return snippetsResources.map(resource => ({
|
|
128
128
|
handle: ( resource.toString()),
|
|
129
129
|
parent: that,
|
|
130
130
|
resourceUri: resource,
|
|
@@ -145,7 +145,7 @@ let SnippetsResourceTreeItem = class SnippetsResourceTreeItem {
|
|
|
145
145
|
},
|
|
146
146
|
accessibilityInformation: {
|
|
147
147
|
label: ( localize(
|
|
148
|
-
|
|
148
|
+
22426,
|
|
149
149
|
"Select Snippet {0}",
|
|
150
150
|
this.uriIdentityService.extUri.basename(resource)
|
|
151
151
|
))
|
|
@@ -156,7 +156,7 @@ let SnippetsResourceTreeItem = class SnippetsResourceTreeItem {
|
|
|
156
156
|
title: "",
|
|
157
157
|
arguments: [resource, undefined, undefined]
|
|
158
158
|
}
|
|
159
|
-
}))
|
|
159
|
+
}));
|
|
160
160
|
}
|
|
161
161
|
async hasContent() {
|
|
162
162
|
const snippetsResources = await this.instantiationService.createInstance(SnippetsResource).getSnippetsResources(this.profile);
|
|
@@ -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(22427, "Tasks"))
|
|
80
80
|
};
|
|
81
81
|
this.collapsibleState = TreeItemCollapsibleState.Expanded;
|
|
82
82
|
}
|