@codingame/monaco-vscode-user-data-profile-service-override 25.1.2 → 26.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/platform/userDataProfile/browser/userDataProfile.js +18 -15
- package/vscode/src/vs/platform/userDataProfile/common/userDataProfileStorageService.js +31 -19
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/media/userDataProfilesEditor.css +9 -4
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.js +144 -115
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfileActions.js +16 -10
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditor.js +889 -623
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditorModel.js +449 -296
- package/vscode/src/vs/workbench/services/userData/browser/userDataInit.js +6 -8
- package/vscode/src/vs/workbench/services/userDataProfile/browser/extensionsResource.js +135 -77
- package/vscode/src/vs/workbench/services/userDataProfile/browser/globalStateResource.js +33 -32
- package/vscode/src/vs/workbench/services/userDataProfile/browser/keybindingsResource.js +33 -34
- package/vscode/src/vs/workbench/services/userDataProfile/browser/mcpProfileResource.js +28 -33
- package/vscode/src/vs/workbench/services/userDataProfile/browser/settingsResource.js +42 -40
- package/vscode/src/vs/workbench/services/userDataProfile/browser/snippetsResource.js +23 -28
- package/vscode/src/vs/workbench/services/userDataProfile/browser/tasksResource.js +28 -33
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileImportExportService.js +209 -153
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileInit.js +28 -25
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.js +55 -41
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileStorageService.js +20 -9
- package/vscode/src/vs/workbench/services/userDataSync/browser/userDataSyncInit.js +111 -73
- package/vscode/src/vs/workbench/services/userDataSync/common/userDataSyncUtil.js +20 -15
- package/vscode/src/vs/base/browser/ui/radio/radio.css +0 -69
- package/vscode/src/vs/base/browser/ui/radio/radio.d.ts +0 -37
- package/vscode/src/vs/base/browser/ui/radio/radio.js +0 -72
|
@@ -41,21 +41,19 @@ class UserDataInitializationService {
|
|
|
41
41
|
}
|
|
42
42
|
let InitializeOtherResourcesContribution = class InitializeOtherResourcesContribution {
|
|
43
43
|
constructor(userDataInitializeService, instantiationService, extensionService) {
|
|
44
|
-
extensionService.whenInstalledExtensionsRegistered().then(
|
|
44
|
+
extensionService.whenInstalledExtensionsRegistered().then(
|
|
45
|
+
() => this.initializeOtherResource(userDataInitializeService, instantiationService)
|
|
46
|
+
);
|
|
45
47
|
}
|
|
46
48
|
async initializeOtherResource(userDataInitializeService, instantiationService) {
|
|
47
49
|
if (await userDataInitializeService.requiresInitialization()) {
|
|
48
|
-
mark(
|
|
50
|
+
mark("code/willInitOtherUserData");
|
|
49
51
|
await userDataInitializeService.initializeOtherResources(instantiationService);
|
|
50
|
-
mark(
|
|
52
|
+
mark("code/didInitOtherUserData");
|
|
51
53
|
}
|
|
52
54
|
}
|
|
53
55
|
};
|
|
54
|
-
InitializeOtherResourcesContribution = ( __decorate([
|
|
55
|
-
( __param(0, IUserDataInitializationService)),
|
|
56
|
-
( __param(1, IInstantiationService)),
|
|
57
|
-
( __param(2, IExtensionService))
|
|
58
|
-
], InitializeOtherResourcesContribution));
|
|
56
|
+
InitializeOtherResourcesContribution = ( __decorate([( __param(0, IUserDataInitializationService)), ( __param(1, IInstantiationService)), ( __param(2, IExtensionService))], InitializeOtherResourcesContribution));
|
|
59
57
|
if (isWeb) {
|
|
60
58
|
const workbenchRegistry = ( Registry.as(Extensions.Workbench));
|
|
61
59
|
workbenchRegistry.registerWorkbenchContribution(InitializeOtherResourcesContribution, LifecyclePhase.Restored);
|
|
@@ -20,7 +20,13 @@ import { IWorkbenchExtensionManagementService } from '@codingame/monaco-vscode-a
|
|
|
20
20
|
import { IUserDataProfileService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.service';
|
|
21
21
|
|
|
22
22
|
let ExtensionsResourceInitializer = class ExtensionsResourceInitializer {
|
|
23
|
-
constructor(
|
|
23
|
+
constructor(
|
|
24
|
+
userDataProfileService,
|
|
25
|
+
extensionManagementService,
|
|
26
|
+
extensionGalleryService,
|
|
27
|
+
extensionEnablementService,
|
|
28
|
+
logService
|
|
29
|
+
) {
|
|
24
30
|
this.userDataProfileService = userDataProfileService;
|
|
25
31
|
this.extensionManagementService = extensionManagementService;
|
|
26
32
|
this.extensionGalleryService = extensionGalleryService;
|
|
@@ -39,45 +45,71 @@ let ExtensionsResourceInitializer = class ExtensionsResourceInitializer {
|
|
|
39
45
|
extensionsToInstall.push(e);
|
|
40
46
|
}
|
|
41
47
|
if (isDisabled !== !!e.disabled) {
|
|
42
|
-
extensionsToEnableOrDisable.push({
|
|
48
|
+
extensionsToEnableOrDisable.push({
|
|
49
|
+
extension: e.identifier,
|
|
50
|
+
enable: !e.disabled
|
|
51
|
+
});
|
|
43
52
|
}
|
|
44
53
|
}
|
|
45
|
-
const extensionsToUninstall = installedExtensions.filter(extension => !extension.isBuiltin && !( profileExtensions.some((
|
|
46
|
-
|
|
54
|
+
const extensionsToUninstall = installedExtensions.filter(extension => !extension.isBuiltin && !( profileExtensions.some((
|
|
55
|
+
{
|
|
56
|
+
identifier
|
|
57
|
+
}
|
|
58
|
+
) => areSameExtensions(identifier, extension.identifier))));
|
|
59
|
+
for (const {
|
|
60
|
+
extension,
|
|
61
|
+
enable
|
|
62
|
+
} of extensionsToEnableOrDisable) {
|
|
47
63
|
if (enable) {
|
|
48
64
|
this.logService.trace(`Initializing Profile: Enabling extension...`, extension.id);
|
|
49
65
|
await this.extensionEnablementService.enableExtension(extension);
|
|
50
66
|
this.logService.info(`Initializing Profile: Enabled extension...`, extension.id);
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
67
|
+
} else {
|
|
53
68
|
this.logService.trace(`Initializing Profile: Disabling extension...`, extension.id);
|
|
54
69
|
await this.extensionEnablementService.disableExtension(extension);
|
|
55
70
|
this.logService.info(`Initializing Profile: Disabled extension...`, extension.id);
|
|
56
71
|
}
|
|
57
72
|
}
|
|
58
73
|
if (extensionsToInstall.length) {
|
|
59
|
-
const galleryExtensions = await this.extensionGalleryService.getExtensions(( extensionsToInstall.map(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
74
|
+
const galleryExtensions = await this.extensionGalleryService.getExtensions(( extensionsToInstall.map(e => ({
|
|
75
|
+
...e.identifier,
|
|
76
|
+
version: e.version,
|
|
77
|
+
hasPreRelease: e.version ? undefined : e.preRelease
|
|
78
|
+
}))), CancellationToken.None);
|
|
79
|
+
await Promise.all(( extensionsToInstall.map(async e => {
|
|
80
|
+
const extension = galleryExtensions.find(
|
|
81
|
+
galleryExtension => areSameExtensions(galleryExtension.identifier, e.identifier)
|
|
82
|
+
);
|
|
64
83
|
if (!extension) {
|
|
65
84
|
return;
|
|
66
85
|
}
|
|
67
86
|
if ((await this.extensionManagementService.canInstall(extension)) === true) {
|
|
68
|
-
this.logService.trace(
|
|
87
|
+
this.logService.trace(
|
|
88
|
+
`Initializing Profile: Installing extension...`,
|
|
89
|
+
extension.identifier.id,
|
|
90
|
+
extension.version
|
|
91
|
+
);
|
|
69
92
|
await this.extensionManagementService.installFromGallery(extension, {
|
|
70
93
|
isMachineScoped: false,
|
|
71
94
|
donotIncludePackAndDependencies: true,
|
|
72
95
|
installGivenVersion: !!e.version,
|
|
73
96
|
installPreReleaseVersion: e.preRelease,
|
|
74
97
|
profileLocation: this.userDataProfileService.currentProfile.extensionsResource,
|
|
75
|
-
context: {
|
|
98
|
+
context: {
|
|
99
|
+
[EXTENSION_INSTALL_SKIP_WALKTHROUGH_CONTEXT]: true,
|
|
100
|
+
[EXTENSION_INSTALL_SKIP_PUBLISHER_TRUST_CONTEXT]: true
|
|
101
|
+
}
|
|
76
102
|
});
|
|
77
|
-
this.logService.info(
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
103
|
+
this.logService.info(
|
|
104
|
+
`Initializing Profile: Installed extension...`,
|
|
105
|
+
extension.identifier.id,
|
|
106
|
+
extension.version
|
|
107
|
+
);
|
|
108
|
+
} else {
|
|
109
|
+
this.logService.info(
|
|
110
|
+
`Initializing Profile: Skipped installing extension because it cannot be installed.`,
|
|
111
|
+
extension.identifier.id
|
|
112
|
+
);
|
|
81
113
|
}
|
|
82
114
|
})));
|
|
83
115
|
}
|
|
@@ -86,15 +118,15 @@ let ExtensionsResourceInitializer = class ExtensionsResourceInitializer {
|
|
|
86
118
|
}
|
|
87
119
|
}
|
|
88
120
|
};
|
|
89
|
-
ExtensionsResourceInitializer = ( __decorate([
|
|
90
|
-
( __param(0, IUserDataProfileService)),
|
|
91
|
-
( __param(1, IExtensionManagementService)),
|
|
92
|
-
( __param(2, IExtensionGalleryService)),
|
|
93
|
-
( __param(3, IGlobalExtensionEnablementService)),
|
|
94
|
-
( __param(4, ILogService))
|
|
95
|
-
], ExtensionsResourceInitializer));
|
|
121
|
+
ExtensionsResourceInitializer = ( __decorate([( __param(0, IUserDataProfileService)), ( __param(1, IExtensionManagementService)), ( __param(2, IExtensionGalleryService)), ( __param(3, IGlobalExtensionEnablementService)), ( __param(4, ILogService))], ExtensionsResourceInitializer));
|
|
96
122
|
let ExtensionsResource = class ExtensionsResource {
|
|
97
|
-
constructor(
|
|
123
|
+
constructor(
|
|
124
|
+
extensionManagementService,
|
|
125
|
+
extensionGalleryService,
|
|
126
|
+
userDataProfileStorageService,
|
|
127
|
+
instantiationService,
|
|
128
|
+
logService
|
|
129
|
+
) {
|
|
98
130
|
this.extensionManagementService = extensionManagementService;
|
|
99
131
|
this.extensionGalleryService = extensionGalleryService;
|
|
100
132
|
this.userDataProfileStorageService = userDataProfileStorageService;
|
|
@@ -106,10 +138,12 @@ let ExtensionsResource = class ExtensionsResource {
|
|
|
106
138
|
return this.toContent(extensions, exclude);
|
|
107
139
|
}
|
|
108
140
|
toContent(extensions, exclude) {
|
|
109
|
-
return JSON.stringify(
|
|
141
|
+
return JSON.stringify(
|
|
142
|
+
exclude?.length ? extensions.filter(e => !exclude.includes(e.identifier.id.toLowerCase())) : extensions
|
|
143
|
+
);
|
|
110
144
|
}
|
|
111
145
|
async apply(content, profile, progress, token) {
|
|
112
|
-
return this.withProfileScopedServices(profile, async
|
|
146
|
+
return this.withProfileScopedServices(profile, async extensionEnablementService => {
|
|
113
147
|
const profileExtensions = await this.getProfileExtensions(content);
|
|
114
148
|
const installedExtensions = await this.extensionManagementService.getInstalled(undefined, profile.extensionsResource);
|
|
115
149
|
const extensionsToEnableOrDisable = [];
|
|
@@ -121,30 +155,46 @@ let ExtensionsResource = class ExtensionsResource {
|
|
|
121
155
|
extensionsToInstall.push(e);
|
|
122
156
|
}
|
|
123
157
|
if (isDisabled !== !!e.disabled) {
|
|
124
|
-
extensionsToEnableOrDisable.push({
|
|
158
|
+
extensionsToEnableOrDisable.push({
|
|
159
|
+
extension: e.identifier,
|
|
160
|
+
enable: !e.disabled
|
|
161
|
+
});
|
|
125
162
|
}
|
|
126
163
|
}
|
|
127
|
-
const extensionsToUninstall = installedExtensions.filter(extension => !extension.isBuiltin && !( profileExtensions.some((
|
|
128
|
-
|
|
164
|
+
const extensionsToUninstall = installedExtensions.filter(extension => !extension.isBuiltin && !( profileExtensions.some((
|
|
165
|
+
{
|
|
166
|
+
identifier
|
|
167
|
+
}
|
|
168
|
+
) => areSameExtensions(identifier, extension.identifier))) && !extension.isApplicationScoped);
|
|
169
|
+
for (const {
|
|
170
|
+
extension,
|
|
171
|
+
enable
|
|
172
|
+
} of extensionsToEnableOrDisable) {
|
|
129
173
|
if (enable) {
|
|
130
174
|
this.logService.trace(`Importing Profile (${profile.name}): Enabling extension...`, extension.id);
|
|
131
175
|
await extensionEnablementService.enableExtension(extension);
|
|
132
176
|
this.logService.info(`Importing Profile (${profile.name}): Enabled extension...`, extension.id);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
177
|
+
} else {
|
|
178
|
+
this.logService.trace(
|
|
179
|
+
`Importing Profile (${profile.name}): Disabling extension...`,
|
|
180
|
+
extension.id
|
|
181
|
+
);
|
|
136
182
|
await extensionEnablementService.disableExtension(extension);
|
|
137
183
|
this.logService.info(`Importing Profile (${profile.name}): Disabled extension...`, extension.id);
|
|
138
184
|
}
|
|
139
185
|
}
|
|
140
186
|
if (extensionsToInstall.length) {
|
|
141
187
|
this.logService.info(`Importing Profile (${profile.name}): Started installing extensions.`);
|
|
142
|
-
const galleryExtensions = await this.extensionGalleryService.getExtensions(( extensionsToInstall.map(
|
|
143
|
-
|
|
144
|
-
|
|
188
|
+
const galleryExtensions = await this.extensionGalleryService.getExtensions(( extensionsToInstall.map(e => ({
|
|
189
|
+
...e.identifier,
|
|
190
|
+
version: e.version,
|
|
191
|
+
hasPreRelease: e.version ? undefined : e.preRelease
|
|
192
|
+
}))), CancellationToken.None);
|
|
145
193
|
const installExtensionInfos = [];
|
|
146
|
-
await Promise.all(( extensionsToInstall.map(async
|
|
147
|
-
const extension = galleryExtensions.find(
|
|
194
|
+
await Promise.all(( extensionsToInstall.map(async e => {
|
|
195
|
+
const extension = galleryExtensions.find(
|
|
196
|
+
galleryExtension => areSameExtensions(galleryExtension.identifier, e.identifier)
|
|
197
|
+
);
|
|
148
198
|
if (!extension) {
|
|
149
199
|
return;
|
|
150
200
|
}
|
|
@@ -157,12 +207,16 @@ let ExtensionsResource = class ExtensionsResource {
|
|
|
157
207
|
installGivenVersion: !!e.version,
|
|
158
208
|
installPreReleaseVersion: e.preRelease,
|
|
159
209
|
profileLocation: profile.extensionsResource,
|
|
160
|
-
context: {
|
|
210
|
+
context: {
|
|
211
|
+
[EXTENSION_INSTALL_SKIP_WALKTHROUGH_CONTEXT]: true
|
|
212
|
+
}
|
|
161
213
|
}
|
|
162
214
|
});
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
|
|
215
|
+
} else {
|
|
216
|
+
this.logService.info(
|
|
217
|
+
`Importing Profile (${profile.name}): Skipped installing extension because it cannot be installed.`,
|
|
218
|
+
extension.identifier.id
|
|
219
|
+
);
|
|
166
220
|
}
|
|
167
221
|
})));
|
|
168
222
|
if (installExtensionInfos.length) {
|
|
@@ -173,14 +227,13 @@ let ExtensionsResource = class ExtensionsResource {
|
|
|
173
227
|
return;
|
|
174
228
|
}
|
|
175
229
|
progress?.(( localize(
|
|
176
|
-
|
|
230
|
+
14908,
|
|
177
231
|
"Installing extension {0}...",
|
|
178
232
|
installExtensionInfo.extension.displayName ?? installExtensionInfo.extension.identifier.id
|
|
179
233
|
)));
|
|
180
234
|
await this.extensionManagementService.installFromGallery(installExtensionInfo.extension, installExtensionInfo.options);
|
|
181
235
|
}
|
|
182
|
-
}
|
|
183
|
-
else {
|
|
236
|
+
} else {
|
|
184
237
|
await this.extensionManagementService.installGalleryExtensions(installExtensionInfos);
|
|
185
238
|
}
|
|
186
239
|
}
|
|
@@ -193,22 +246,28 @@ let ExtensionsResource = class ExtensionsResource {
|
|
|
193
246
|
}
|
|
194
247
|
async copy(from, to, disableExtensions) {
|
|
195
248
|
await this.extensionManagementService.copyExtensions(from.extensionsResource, to.extensionsResource);
|
|
196
|
-
const extensionsToDisable = await this.withProfileScopedServices(
|
|
249
|
+
const extensionsToDisable = await this.withProfileScopedServices(
|
|
250
|
+
from,
|
|
251
|
+
async extensionEnablementService => extensionEnablementService.getDisabledExtensions()
|
|
252
|
+
);
|
|
197
253
|
if (disableExtensions) {
|
|
198
254
|
const extensions = await this.extensionManagementService.getInstalled(ExtensionType.User, to.extensionsResource);
|
|
199
255
|
for (const extension of extensions) {
|
|
200
256
|
extensionsToDisable.push(extension.identifier);
|
|
201
257
|
}
|
|
202
258
|
}
|
|
203
|
-
await this.withProfileScopedServices(to, async
|
|
259
|
+
await this.withProfileScopedServices(to, async extensionEnablementService => Promise.all(( extensionsToDisable.map(extension => extensionEnablementService.disableExtension(extension)))));
|
|
204
260
|
}
|
|
205
261
|
async getLocalExtensions(profile) {
|
|
206
|
-
return this.withProfileScopedServices(profile, async
|
|
262
|
+
return this.withProfileScopedServices(profile, async extensionEnablementService => {
|
|
207
263
|
const result = ( new Map());
|
|
208
264
|
const installedExtensions = await this.extensionManagementService.getInstalled(undefined, profile.extensionsResource);
|
|
209
265
|
const disabledExtensions = extensionEnablementService.getDisabledExtensions();
|
|
210
266
|
for (const extension of installedExtensions) {
|
|
211
|
-
const {
|
|
267
|
+
const {
|
|
268
|
+
identifier,
|
|
269
|
+
preRelease
|
|
270
|
+
} = extension;
|
|
212
271
|
const disabled = ( disabledExtensions.some(disabledExtension => areSameExtensions(disabledExtension, identifier)));
|
|
213
272
|
if (extension.isBuiltin && !disabled) {
|
|
214
273
|
continue;
|
|
@@ -222,7 +281,10 @@ let ExtensionsResource = class ExtensionsResource {
|
|
|
222
281
|
if (existing?.disabled) {
|
|
223
282
|
result.delete(identifier.id.toLowerCase());
|
|
224
283
|
}
|
|
225
|
-
const profileExtension = {
|
|
284
|
+
const profileExtension = {
|
|
285
|
+
identifier,
|
|
286
|
+
displayName: extension.manifest.displayName
|
|
287
|
+
};
|
|
226
288
|
if (disabled) {
|
|
227
289
|
profileExtension.disabled = true;
|
|
228
290
|
}
|
|
@@ -242,64 +304,64 @@ let ExtensionsResource = class ExtensionsResource {
|
|
|
242
304
|
return JSON.parse(content);
|
|
243
305
|
}
|
|
244
306
|
async withProfileScopedServices(profile, fn) {
|
|
245
|
-
return this.userDataProfileStorageService.withProfileScopedStorageService(profile, async
|
|
307
|
+
return this.userDataProfileStorageService.withProfileScopedStorageService(profile, async storageService => {
|
|
246
308
|
const disposables = ( new DisposableStore());
|
|
247
309
|
const instantiationService = disposables.add(this.instantiationService.createChild(( new ServiceCollection([IStorageService, storageService]))));
|
|
248
310
|
const extensionEnablementService = disposables.add(instantiationService.createInstance(GlobalExtensionEnablementService));
|
|
249
311
|
try {
|
|
250
312
|
return await fn(extensionEnablementService);
|
|
251
|
-
}
|
|
252
|
-
finally {
|
|
313
|
+
} finally {
|
|
253
314
|
disposables.dispose();
|
|
254
315
|
}
|
|
255
316
|
});
|
|
256
317
|
}
|
|
257
318
|
};
|
|
258
|
-
ExtensionsResource = ( __decorate([
|
|
259
|
-
( __param(0, IWorkbenchExtensionManagementService)),
|
|
260
|
-
( __param(1, IExtensionGalleryService)),
|
|
261
|
-
( __param(2, IUserDataProfileStorageService)),
|
|
262
|
-
( __param(3, IInstantiationService)),
|
|
263
|
-
( __param(4, ILogService))
|
|
264
|
-
], ExtensionsResource));
|
|
319
|
+
ExtensionsResource = ( __decorate([( __param(0, IWorkbenchExtensionManagementService)), ( __param(1, IExtensionGalleryService)), ( __param(2, IUserDataProfileStorageService)), ( __param(3, IInstantiationService)), ( __param(4, ILogService))], ExtensionsResource));
|
|
265
320
|
class ExtensionsResourceTreeItem {
|
|
266
321
|
constructor() {
|
|
267
322
|
this.type = ProfileResourceType.Extensions;
|
|
268
323
|
this.handle = ProfileResourceType.Extensions;
|
|
269
|
-
this.label = {
|
|
324
|
+
this.label = {
|
|
325
|
+
label: ( localize(14909, "Extensions"))
|
|
326
|
+
};
|
|
270
327
|
this.collapsibleState = TreeItemCollapsibleState.Expanded;
|
|
271
328
|
this.contextValue = ProfileResourceType.Extensions;
|
|
272
329
|
this.excludedExtensions = ( new Set());
|
|
273
330
|
}
|
|
274
331
|
async getChildren() {
|
|
275
|
-
const extensions = (await this.getExtensions()).sort(
|
|
332
|
+
const extensions = (await this.getExtensions()).sort(
|
|
333
|
+
(a, b) => (a.displayName ?? a.identifier.id).localeCompare(b.displayName ?? b.identifier.id)
|
|
334
|
+
);
|
|
276
335
|
const that = this;
|
|
277
336
|
return (extensions.map(e => ({
|
|
278
337
|
...e,
|
|
279
338
|
handle: e.identifier.id.toLowerCase(),
|
|
280
339
|
parent: this,
|
|
281
|
-
label: {
|
|
282
|
-
|
|
340
|
+
label: {
|
|
341
|
+
label: e.displayName || e.identifier.id
|
|
342
|
+
},
|
|
343
|
+
description: e.applicationScoped ? ( localize(14910, "All Profiles")) : undefined,
|
|
283
344
|
collapsibleState: TreeItemCollapsibleState.None,
|
|
284
345
|
checkbox: that.checkbox ? {
|
|
285
|
-
get isChecked() {
|
|
346
|
+
get isChecked() {
|
|
347
|
+
return !( that.excludedExtensions.has(e.identifier.id.toLowerCase()));
|
|
348
|
+
},
|
|
286
349
|
set isChecked(value) {
|
|
287
350
|
if (value) {
|
|
288
351
|
that.excludedExtensions.delete(e.identifier.id.toLowerCase());
|
|
289
|
-
}
|
|
290
|
-
else {
|
|
352
|
+
} else {
|
|
291
353
|
that.excludedExtensions.add(e.identifier.id.toLowerCase());
|
|
292
354
|
}
|
|
293
355
|
},
|
|
294
|
-
tooltip: ( localize(
|
|
356
|
+
tooltip: ( localize(14911, "Select {0} Extension", e.displayName || e.identifier.id)),
|
|
295
357
|
accessibilityInformation: {
|
|
296
|
-
label: ( localize(
|
|
358
|
+
label: ( localize(14911, "Select {0} Extension", e.displayName || e.identifier.id))
|
|
297
359
|
}
|
|
298
360
|
} : undefined,
|
|
299
361
|
themeIcon: Codicon.extensions,
|
|
300
362
|
command: {
|
|
301
|
-
id:
|
|
302
|
-
title:
|
|
363
|
+
id: "extension.open",
|
|
364
|
+
title: "",
|
|
303
365
|
arguments: [e.identifier.id, undefined, true]
|
|
304
366
|
}
|
|
305
367
|
})));
|
|
@@ -325,9 +387,7 @@ let ExtensionsResourceExportTreeItem = class ExtensionsResourceExportTreeItem ex
|
|
|
325
387
|
return this.instantiationService.createInstance(ExtensionsResource).getContent(this.profile, [...( this.excludedExtensions.values())]);
|
|
326
388
|
}
|
|
327
389
|
};
|
|
328
|
-
ExtensionsResourceExportTreeItem = ( __decorate([
|
|
329
|
-
( __param(1, IInstantiationService))
|
|
330
|
-
], ExtensionsResourceExportTreeItem));
|
|
390
|
+
ExtensionsResourceExportTreeItem = ( __decorate([( __param(1, IInstantiationService))], ExtensionsResourceExportTreeItem));
|
|
331
391
|
let ExtensionsResourceImportTreeItem = class ExtensionsResourceImportTreeItem extends ExtensionsResourceTreeItem {
|
|
332
392
|
constructor(content, instantiationService) {
|
|
333
393
|
super();
|
|
@@ -346,8 +406,6 @@ let ExtensionsResourceImportTreeItem = class ExtensionsResourceImportTreeItem ex
|
|
|
346
406
|
return extensionsResource.toContent(extensions, [...( this.excludedExtensions.values())]);
|
|
347
407
|
}
|
|
348
408
|
};
|
|
349
|
-
ExtensionsResourceImportTreeItem = ( __decorate([
|
|
350
|
-
( __param(1, IInstantiationService))
|
|
351
|
-
], ExtensionsResourceImportTreeItem));
|
|
409
|
+
ExtensionsResourceImportTreeItem = ( __decorate([( __param(1, IInstantiationService))], ExtensionsResourceImportTreeItem));
|
|
352
410
|
|
|
353
411
|
export { ExtensionsResource, ExtensionsResourceExportTreeItem, ExtensionsResourceImportTreeItem, ExtensionsResourceInitializer, ExtensionsResourceTreeItem };
|
|
@@ -21,15 +21,18 @@ let GlobalStateResourceInitializer = class GlobalStateResourceInitializer {
|
|
|
21
21
|
if (storageKeys.length) {
|
|
22
22
|
const storageEntries = [];
|
|
23
23
|
for (const key of storageKeys) {
|
|
24
|
-
storageEntries.push({
|
|
24
|
+
storageEntries.push({
|
|
25
|
+
key,
|
|
26
|
+
value: globalState.storage[key],
|
|
27
|
+
scope: StorageScope.PROFILE,
|
|
28
|
+
target: StorageTarget.USER
|
|
29
|
+
});
|
|
25
30
|
}
|
|
26
31
|
this.storageService.storeAll(storageEntries, true);
|
|
27
32
|
}
|
|
28
33
|
}
|
|
29
34
|
};
|
|
30
|
-
GlobalStateResourceInitializer = ( __decorate([
|
|
31
|
-
( __param(0, IStorageService))
|
|
32
|
-
], GlobalStateResourceInitializer));
|
|
35
|
+
GlobalStateResourceInitializer = ( __decorate([( __param(0, IStorageService))], GlobalStateResourceInitializer));
|
|
33
36
|
let GlobalStateResource = class GlobalStateResource {
|
|
34
37
|
constructor(storageService, userDataProfileStorageService, logService) {
|
|
35
38
|
this.storageService = storageService;
|
|
@@ -52,7 +55,9 @@ let GlobalStateResource = class GlobalStateResource {
|
|
|
52
55
|
storage[key] = value.value;
|
|
53
56
|
}
|
|
54
57
|
}
|
|
55
|
-
return {
|
|
58
|
+
return {
|
|
59
|
+
storage
|
|
60
|
+
};
|
|
56
61
|
}
|
|
57
62
|
async writeGlobalState(globalState, profile) {
|
|
58
63
|
const storageKeys = ( Object.keys(globalState.storage));
|
|
@@ -61,13 +66,14 @@ let GlobalStateResource = class GlobalStateResource {
|
|
|
61
66
|
const nonProfileKeys = [
|
|
62
67
|
...( this.storageService.keys(StorageScope.APPLICATION, StorageTarget.MACHINE)),
|
|
63
68
|
...( this.storageService.keys(StorageScope.WORKSPACE, StorageTarget.USER)),
|
|
64
|
-
...( this.storageService.keys(StorageScope.WORKSPACE, StorageTarget.MACHINE))
|
|
69
|
+
...( this.storageService.keys(StorageScope.WORKSPACE, StorageTarget.MACHINE))
|
|
65
70
|
];
|
|
66
71
|
for (const key of storageKeys) {
|
|
67
72
|
if (nonProfileKeys.includes(key)) {
|
|
68
|
-
this.logService.info(
|
|
69
|
-
|
|
70
|
-
|
|
73
|
+
this.logService.info(
|
|
74
|
+
`Importing Profile (${profile.name}): Ignoring global state key '${key}' because it is not a profile key.`
|
|
75
|
+
);
|
|
76
|
+
} else {
|
|
71
77
|
updatedStorage.set(key, globalState.storage[key]);
|
|
72
78
|
}
|
|
73
79
|
}
|
|
@@ -75,35 +81,33 @@ let GlobalStateResource = class GlobalStateResource {
|
|
|
75
81
|
}
|
|
76
82
|
}
|
|
77
83
|
};
|
|
78
|
-
GlobalStateResource = ( __decorate([
|
|
79
|
-
( __param(0, IStorageService)),
|
|
80
|
-
( __param(1, IUserDataProfileStorageService)),
|
|
81
|
-
( __param(2, ILogService))
|
|
82
|
-
], GlobalStateResource));
|
|
84
|
+
GlobalStateResource = ( __decorate([( __param(0, IStorageService)), ( __param(1, IUserDataProfileStorageService)), ( __param(2, ILogService))], GlobalStateResource));
|
|
83
85
|
class GlobalStateResourceTreeItem {
|
|
84
86
|
constructor(resource, uriIdentityService) {
|
|
85
87
|
this.resource = resource;
|
|
86
88
|
this.uriIdentityService = uriIdentityService;
|
|
87
89
|
this.type = ProfileResourceType.GlobalState;
|
|
88
90
|
this.handle = ProfileResourceType.GlobalState;
|
|
89
|
-
this.label = {
|
|
91
|
+
this.label = {
|
|
92
|
+
label: ( localize(14912, "UI State"))
|
|
93
|
+
};
|
|
90
94
|
this.collapsibleState = TreeItemCollapsibleState.Collapsed;
|
|
91
95
|
}
|
|
92
96
|
async getChildren() {
|
|
93
97
|
return [{
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
98
|
+
handle: ( this.resource.toString()),
|
|
99
|
+
resourceUri: this.resource,
|
|
100
|
+
collapsibleState: TreeItemCollapsibleState.None,
|
|
101
|
+
accessibilityInformation: {
|
|
102
|
+
label: this.uriIdentityService.extUri.basename(this.resource)
|
|
103
|
+
},
|
|
104
|
+
parent: this,
|
|
105
|
+
command: {
|
|
106
|
+
id: API_OPEN_EDITOR_COMMAND_ID,
|
|
107
|
+
title: "",
|
|
108
|
+
arguments: [this.resource, undefined, undefined]
|
|
109
|
+
}
|
|
110
|
+
}];
|
|
107
111
|
}
|
|
108
112
|
}
|
|
109
113
|
let GlobalStateResourceExportTreeItem = class GlobalStateResourceExportTreeItem extends GlobalStateResourceTreeItem {
|
|
@@ -123,9 +127,6 @@ let GlobalStateResourceExportTreeItem = class GlobalStateResourceExportTreeItem
|
|
|
123
127
|
return !this.profile.isDefault && !!this.profile.useDefaultFlags?.globalState;
|
|
124
128
|
}
|
|
125
129
|
};
|
|
126
|
-
GlobalStateResourceExportTreeItem = ( __decorate([
|
|
127
|
-
( __param(2, IUriIdentityService)),
|
|
128
|
-
( __param(3, IInstantiationService))
|
|
129
|
-
], GlobalStateResourceExportTreeItem));
|
|
130
|
+
GlobalStateResourceExportTreeItem = ( __decorate([( __param(2, IUriIdentityService)), ( __param(3, IInstantiationService))], GlobalStateResourceExportTreeItem));
|
|
130
131
|
|
|
131
132
|
export { GlobalStateResource, GlobalStateResourceExportTreeItem, GlobalStateResourceInitializer, GlobalStateResourceTreeItem };
|
|
@@ -25,14 +25,13 @@ let KeybindingsResourceInitializer = class KeybindingsResourceInitializer {
|
|
|
25
25
|
this.logService.info(`Initializing Profile: No keybindings to apply...`);
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
|
-
await this.fileService.writeFile(
|
|
28
|
+
await this.fileService.writeFile(
|
|
29
|
+
this.userDataProfileService.currentProfile.keybindingsResource,
|
|
30
|
+
VSBuffer.fromString(keybindingsContent.keybindings)
|
|
31
|
+
);
|
|
29
32
|
}
|
|
30
33
|
};
|
|
31
|
-
KeybindingsResourceInitializer = ( __decorate([
|
|
32
|
-
( __param(0, IUserDataProfileService)),
|
|
33
|
-
( __param(1, IFileService)),
|
|
34
|
-
( __param(2, ILogService))
|
|
35
|
-
], KeybindingsResourceInitializer));
|
|
34
|
+
KeybindingsResourceInitializer = ( __decorate([( __param(0, IUserDataProfileService)), ( __param(1, IFileService)), ( __param(2, ILogService))], KeybindingsResourceInitializer));
|
|
36
35
|
let KeybindingsResource = class KeybindingsResource {
|
|
37
36
|
constructor(fileService, logService) {
|
|
38
37
|
this.fileService = fileService;
|
|
@@ -44,7 +43,10 @@ let KeybindingsResource = class KeybindingsResource {
|
|
|
44
43
|
}
|
|
45
44
|
async getKeybindingsResourceContent(profile) {
|
|
46
45
|
const keybindings = await this.getKeybindingsContent(profile);
|
|
47
|
-
return {
|
|
46
|
+
return {
|
|
47
|
+
keybindings,
|
|
48
|
+
platform
|
|
49
|
+
};
|
|
48
50
|
}
|
|
49
51
|
async apply(content, profile) {
|
|
50
52
|
const keybindingsContent = JSON.parse(content);
|
|
@@ -52,27 +54,25 @@ let KeybindingsResource = class KeybindingsResource {
|
|
|
52
54
|
this.logService.info(`Importing Profile (${profile.name}): No keybindings to apply...`);
|
|
53
55
|
return;
|
|
54
56
|
}
|
|
55
|
-
await this.fileService.writeFile(
|
|
57
|
+
await this.fileService.writeFile(
|
|
58
|
+
profile.keybindingsResource,
|
|
59
|
+
VSBuffer.fromString(keybindingsContent.keybindings)
|
|
60
|
+
);
|
|
56
61
|
}
|
|
57
62
|
async getKeybindingsContent(profile) {
|
|
58
63
|
try {
|
|
59
64
|
const content = await this.fileService.readFile(profile.keybindingsResource);
|
|
60
65
|
return ( content.value.toString());
|
|
61
|
-
}
|
|
62
|
-
catch (error) {
|
|
66
|
+
} catch (error) {
|
|
63
67
|
if (error instanceof FileOperationError && error.fileOperationResult === FileOperationResult.FILE_NOT_FOUND) {
|
|
64
68
|
return null;
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
69
|
+
} else {
|
|
67
70
|
throw error;
|
|
68
71
|
}
|
|
69
72
|
}
|
|
70
73
|
}
|
|
71
74
|
};
|
|
72
|
-
KeybindingsResource = ( __decorate([
|
|
73
|
-
( __param(0, IFileService)),
|
|
74
|
-
( __param(1, ILogService))
|
|
75
|
-
], KeybindingsResource));
|
|
75
|
+
KeybindingsResource = ( __decorate([( __param(0, IFileService)), ( __param(1, ILogService))], KeybindingsResource));
|
|
76
76
|
let KeybindingsResourceTreeItem = class KeybindingsResourceTreeItem {
|
|
77
77
|
constructor(profile, uriIdentityService, instantiationService) {
|
|
78
78
|
this.profile = profile;
|
|
@@ -80,7 +80,9 @@ let KeybindingsResourceTreeItem = class KeybindingsResourceTreeItem {
|
|
|
80
80
|
this.instantiationService = instantiationService;
|
|
81
81
|
this.type = ProfileResourceType.Keybindings;
|
|
82
82
|
this.handle = ProfileResourceType.Keybindings;
|
|
83
|
-
this.label = {
|
|
83
|
+
this.label = {
|
|
84
|
+
label: ( localize(14913, "Keyboard Shortcuts"))
|
|
85
|
+
};
|
|
84
86
|
this.collapsibleState = TreeItemCollapsibleState.Expanded;
|
|
85
87
|
}
|
|
86
88
|
isFromDefaultProfile() {
|
|
@@ -88,19 +90,19 @@ let KeybindingsResourceTreeItem = class KeybindingsResourceTreeItem {
|
|
|
88
90
|
}
|
|
89
91
|
async getChildren() {
|
|
90
92
|
return [{
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
93
|
+
handle: ( this.profile.keybindingsResource.toString()),
|
|
94
|
+
resourceUri: this.profile.keybindingsResource,
|
|
95
|
+
collapsibleState: TreeItemCollapsibleState.None,
|
|
96
|
+
parent: this,
|
|
97
|
+
accessibilityInformation: {
|
|
98
|
+
label: this.uriIdentityService.extUri.basename(this.profile.settingsResource)
|
|
99
|
+
},
|
|
100
|
+
command: {
|
|
101
|
+
id: API_OPEN_EDITOR_COMMAND_ID,
|
|
102
|
+
title: "",
|
|
103
|
+
arguments: [this.profile.keybindingsResource, undefined, undefined]
|
|
104
|
+
}
|
|
105
|
+
}];
|
|
104
106
|
}
|
|
105
107
|
async hasContent() {
|
|
106
108
|
const keybindingsContent = await this.instantiationService.createInstance(KeybindingsResource).getKeybindingsResourceContent(this.profile);
|
|
@@ -110,9 +112,6 @@ let KeybindingsResourceTreeItem = class KeybindingsResourceTreeItem {
|
|
|
110
112
|
return this.instantiationService.createInstance(KeybindingsResource).getContent(this.profile);
|
|
111
113
|
}
|
|
112
114
|
};
|
|
113
|
-
KeybindingsResourceTreeItem = ( __decorate([
|
|
114
|
-
( __param(1, IUriIdentityService)),
|
|
115
|
-
( __param(2, IInstantiationService))
|
|
116
|
-
], KeybindingsResourceTreeItem));
|
|
115
|
+
KeybindingsResourceTreeItem = ( __decorate([( __param(1, IUriIdentityService)), ( __param(2, IInstantiationService))], KeybindingsResourceTreeItem));
|
|
117
116
|
|
|
118
117
|
export { KeybindingsResource, KeybindingsResourceInitializer, KeybindingsResourceTreeItem };
|