@codingame/monaco-vscode-user-data-profile-service-override 7.1.0 → 7.1.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/base/browser/ui/radio/radio.css.js +6 -0
- package/vscode/src/vs/base/browser/ui/radio/radio.js +69 -0
- package/vscode/src/vs/platform/userDataSync/common/keybindingsSync.js +5 -8
- package/vscode/src/vs/platform/userDataSync/common/settingsSync.js +28 -11
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/media/userDataProfilesEditor.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.js +96 -60
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfileActions.js +13 -15
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditor.js +744 -349
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditorModel.js +114 -70
- package/vscode/src/vs/workbench/services/userDataProfile/browser/extensionsResource.js +7 -9
- package/vscode/src/vs/workbench/services/userDataProfile/browser/globalStateResource.js +2 -3
- package/vscode/src/vs/workbench/services/userDataProfile/browser/keybindingsResource.js +2 -3
- package/vscode/src/vs/workbench/services/userDataProfile/browser/settingsResource.js +2 -3
- package/vscode/src/vs/workbench/services/userDataProfile/browser/snippetsResource.js +4 -6
- package/vscode/src/vs/workbench/services/userDataProfile/browser/tasksResource.js +2 -3
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileImportExportService.js +93 -130
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.js +12 -16
- package/vscode/src/vs/workbench/services/userDataSync/common/userDataSyncUtil.js +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
2
|
import { Disposable, MutableDisposable, DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
3
|
import { isWeb } from 'vscode/vscode/vs/base/common/platform';
|
|
4
|
-
import {
|
|
4
|
+
import { localize, localize2 } from 'vscode/vscode/vs/nls';
|
|
5
5
|
import { MenuId, MenuRegistry, registerAction2, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
6
6
|
import { IMenuService } from 'vscode/vscode/vs/platform/actions/common/actions.service';
|
|
7
7
|
import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
@@ -35,7 +35,6 @@ import { Extensions, ConfigurationScope } from 'vscode/vscode/vs/platform/config
|
|
|
35
35
|
import { workbenchConfigurationNodeBase } from 'vscode/vscode/vs/workbench/common/configuration';
|
|
36
36
|
import { IProductService } from 'vscode/vscode/vs/platform/product/common/productService.service';
|
|
37
37
|
|
|
38
|
-
const _moduleId = "vs/workbench/contrib/userDataProfile/browser/userDataProfile";
|
|
39
38
|
const OpenProfileMenu = ( (new MenuId('OpenProfile')));
|
|
40
39
|
const CONFIG_ENABLE_NEW_PROFILES_UI = 'workbench.experimental.enableNewProfilesUI';
|
|
41
40
|
const CONTEXT_ENABLE_NEW_PROFILES_UI = ( (ContextKeyExpr.equals('config.workbench.experimental.enableNewProfilesUI', true)));
|
|
@@ -78,8 +77,9 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
78
77
|
}
|
|
79
78
|
this.reportWorkspaceProfileInfo();
|
|
80
79
|
}
|
|
81
|
-
openProfilesEditor() {
|
|
82
|
-
|
|
80
|
+
async openProfilesEditor() {
|
|
81
|
+
const editor = await this.editorGroupsService.activeGroup.openEditor(( (new UserDataProfilesEditorInput(this.instantiationService))));
|
|
82
|
+
return editor;
|
|
83
83
|
}
|
|
84
84
|
isNewProfilesUIEnabled() {
|
|
85
85
|
return this.configurationService.getValue(CONFIG_ENABLE_NEW_PROFILES_UI) === true;
|
|
@@ -91,7 +91,7 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
91
91
|
properties: {
|
|
92
92
|
[CONFIG_ENABLE_NEW_PROFILES_UI]: {
|
|
93
93
|
type: 'boolean',
|
|
94
|
-
description: (
|
|
94
|
+
description: ( localize(8813, "Enables the new profiles UI.")),
|
|
95
95
|
default: this.productService.quality !== 'stable',
|
|
96
96
|
scope: ConfigurationScope.APPLICATION,
|
|
97
97
|
}
|
|
@@ -99,7 +99,7 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
101
|
registerEditor() {
|
|
102
|
-
( (Registry.as(EditorExtensions.EditorPane))).registerEditorPane(EditorPaneDescriptor.create(UserDataProfilesEditor, UserDataProfilesEditor.ID, (
|
|
102
|
+
( (Registry.as(EditorExtensions.EditorPane))).registerEditorPane(EditorPaneDescriptor.create(UserDataProfilesEditor, UserDataProfilesEditor.ID, ( localize(8814, "Profiles Editor"))), [
|
|
103
103
|
( (new SyncDescriptor(UserDataProfilesEditorInput)))
|
|
104
104
|
]);
|
|
105
105
|
( (Registry.as(EditorExtensions.EditorFactory))).registerEditorSerializer(UserDataProfilesEditorInput.ID, UserDataProfilesEditorInputSerializer);
|
|
@@ -109,23 +109,19 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
109
109
|
this._register(this.registerManageProfilesAction());
|
|
110
110
|
this._register(this.registerSwitchProfileAction());
|
|
111
111
|
this.registerOpenProfileSubMenu();
|
|
112
|
+
this.registerNewWindowWithProfileAction();
|
|
112
113
|
this.registerProfilesActions();
|
|
113
114
|
this._register(this.userDataProfilesService.onDidChangeProfiles(() => this.registerProfilesActions()));
|
|
114
115
|
this.registerCurrentProfilesActions();
|
|
115
116
|
this._register(this.userDataProfileService.onDidChangeCurrentProfile(() => this.registerCurrentProfilesActions()));
|
|
116
117
|
this.registerCreateFromCurrentProfileAction();
|
|
117
|
-
this.
|
|
118
|
+
this.registerNewProfileAction();
|
|
118
119
|
this.registerDeleteProfileAction();
|
|
119
120
|
this.registerHelpAction();
|
|
120
121
|
}
|
|
121
122
|
registerProfileSubMenu() {
|
|
122
123
|
const getProfilesTitle = () => {
|
|
123
|
-
return (
|
|
124
|
-
_moduleId,
|
|
125
|
-
2,
|
|
126
|
-
"Profile ({0})",
|
|
127
|
-
this.userDataProfileService.currentProfile.name
|
|
128
|
-
));
|
|
124
|
+
return ( localize(8815, "Profile ({0})", this.userDataProfileService.currentProfile.name));
|
|
129
125
|
};
|
|
130
126
|
const when = ( (ContextKeyExpr.or(
|
|
131
127
|
(CONTEXT_ENABLE_NEW_PROFILES_UI.negate()),
|
|
@@ -152,11 +148,10 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
152
148
|
}
|
|
153
149
|
registerOpenProfileSubMenu() {
|
|
154
150
|
MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
|
|
155
|
-
title: (
|
|
151
|
+
title: ( localize(8816, "New Window with Profile")),
|
|
156
152
|
submenu: OpenProfileMenu,
|
|
157
153
|
group: '1_new',
|
|
158
154
|
order: 4,
|
|
159
|
-
when: HAS_PROFILES_CONTEXT,
|
|
160
155
|
});
|
|
161
156
|
}
|
|
162
157
|
registerProfilesActions() {
|
|
@@ -197,6 +192,35 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
197
192
|
}
|
|
198
193
|
});
|
|
199
194
|
}
|
|
195
|
+
registerNewWindowWithProfileAction() {
|
|
196
|
+
return registerAction2(class NewWindowWithProfileAction extends Action2 {
|
|
197
|
+
constructor() {
|
|
198
|
+
super({
|
|
199
|
+
id: `workbench.profiles.actions.newWindowWithProfile`,
|
|
200
|
+
title: ( localize2(8817, "New Window with Profile...")),
|
|
201
|
+
category: PROFILES_CATEGORY,
|
|
202
|
+
precondition: HAS_PROFILES_CONTEXT,
|
|
203
|
+
f1: true,
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
async run(accessor) {
|
|
207
|
+
const quickInputService = accessor.get(IQuickInputService);
|
|
208
|
+
const userDataProfilesService = accessor.get(IUserDataProfilesService);
|
|
209
|
+
const hostService = accessor.get(IHostService);
|
|
210
|
+
const pick = await quickInputService.pick(( (userDataProfilesService.profiles.map(profile => ({
|
|
211
|
+
label: profile.name,
|
|
212
|
+
profile
|
|
213
|
+
})))), {
|
|
214
|
+
title: ( localize(8818, "New Window with Profile")),
|
|
215
|
+
placeHolder: ( localize(8819, "Select Profile")),
|
|
216
|
+
canPickMany: false
|
|
217
|
+
});
|
|
218
|
+
if (pick) {
|
|
219
|
+
return hostService.openWindow({ remoteAuthority: null, forceProfile: pick.profile.name });
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
}
|
|
200
224
|
registerNewWindowAction(profile) {
|
|
201
225
|
const disposables = ( (new DisposableStore()));
|
|
202
226
|
const id = `workbench.action.openProfile.${profile.name.toLowerCase().replace('/\s+/', '_')}`;
|
|
@@ -204,9 +228,10 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
204
228
|
constructor() {
|
|
205
229
|
super({
|
|
206
230
|
id,
|
|
207
|
-
title: (
|
|
231
|
+
title: ( localize2(8820, "{0}", profile.name)),
|
|
208
232
|
menu: {
|
|
209
233
|
id: OpenProfileMenu,
|
|
234
|
+
group: '0_profiles',
|
|
210
235
|
when: HAS_PROFILES_CONTEXT
|
|
211
236
|
}
|
|
212
237
|
});
|
|
@@ -220,7 +245,7 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
220
245
|
command: {
|
|
221
246
|
id,
|
|
222
247
|
category: PROFILES_CATEGORY,
|
|
223
|
-
title: (
|
|
248
|
+
title: ( localize2(8821, "Open {0} Profile", profile.name)),
|
|
224
249
|
precondition: HAS_PROFILES_CONTEXT
|
|
225
250
|
},
|
|
226
251
|
}));
|
|
@@ -231,7 +256,7 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
231
256
|
constructor() {
|
|
232
257
|
super({
|
|
233
258
|
id: `workbench.profiles.actions.switchProfile`,
|
|
234
|
-
title: (
|
|
259
|
+
title: ( localize2(8822, 'Switch Profile...')),
|
|
235
260
|
category: PROFILES_CATEGORY,
|
|
236
261
|
f1: true,
|
|
237
262
|
precondition: PROFILES_ENABLEMENT_CONTEXT,
|
|
@@ -240,20 +265,15 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
240
265
|
async run(accessor) {
|
|
241
266
|
const quickInputService = accessor.get(IQuickInputService);
|
|
242
267
|
const menuService = accessor.get(IMenuService);
|
|
243
|
-
const menu = menuService.
|
|
244
|
-
const actions = menu.
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
await result?.action.run();
|
|
253
|
-
}
|
|
254
|
-
finally {
|
|
255
|
-
menu.dispose();
|
|
256
|
-
}
|
|
268
|
+
const menu = menuService.getMenuActions(ProfilesMenu, accessor.get(IContextKeyService));
|
|
269
|
+
const actions = menu.find(([group]) => group === '0_profiles')?.[1] ?? [];
|
|
270
|
+
const result = await quickInputService.pick(( (actions.map(action => ({
|
|
271
|
+
action,
|
|
272
|
+
label: action.checked ? `$(check) ${action.label}` : action.label,
|
|
273
|
+
})))), {
|
|
274
|
+
placeHolder: ( localize(8823, "Select Profile"))
|
|
275
|
+
});
|
|
276
|
+
await result?.action.run();
|
|
257
277
|
}
|
|
258
278
|
});
|
|
259
279
|
}
|
|
@@ -271,21 +291,32 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
271
291
|
super({
|
|
272
292
|
id: `workbench.profiles.actions.manageProfiles`,
|
|
273
293
|
title: {
|
|
274
|
-
...(
|
|
275
|
-
mnemonicTitle: (
|
|
294
|
+
...( localize2(8824, "Profiles")),
|
|
295
|
+
mnemonicTitle: ( localize(8825, "&&Profiles")),
|
|
276
296
|
},
|
|
277
297
|
menu: [
|
|
278
298
|
{
|
|
279
299
|
id: MenuId.GlobalActivity,
|
|
280
300
|
group: '2_configuration',
|
|
281
301
|
order: 1,
|
|
282
|
-
when:
|
|
302
|
+
when: ( (ContextKeyExpr.and(
|
|
303
|
+
CONTEXT_ENABLE_NEW_PROFILES_UI,
|
|
304
|
+
(HAS_PROFILES_CONTEXT.negate())
|
|
305
|
+
))),
|
|
283
306
|
},
|
|
284
307
|
{
|
|
285
308
|
id: MenuId.MenubarPreferencesMenu,
|
|
286
309
|
group: '2_configuration',
|
|
287
310
|
order: 1,
|
|
288
|
-
when:
|
|
311
|
+
when: ( (ContextKeyExpr.and(
|
|
312
|
+
CONTEXT_ENABLE_NEW_PROFILES_UI,
|
|
313
|
+
(HAS_PROFILES_CONTEXT.negate())
|
|
314
|
+
))),
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
id: ProfilesMenu,
|
|
318
|
+
group: '1_manage',
|
|
319
|
+
when: ( (ContextKeyExpr.and(CONTEXT_ENABLE_NEW_PROFILES_UI, HAS_PROFILES_CONTEXT))),
|
|
289
320
|
},
|
|
290
321
|
]
|
|
291
322
|
});
|
|
@@ -300,7 +331,7 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
300
331
|
command: {
|
|
301
332
|
id: 'workbench.profiles.actions.manageProfiles',
|
|
302
333
|
category: Categories.Preferences,
|
|
303
|
-
title: (
|
|
334
|
+
title: ( localize2(8826, "Open Profiles (UI)")),
|
|
304
335
|
precondition: CONTEXT_ENABLE_NEW_PROFILES_UI,
|
|
305
336
|
},
|
|
306
337
|
}));
|
|
@@ -316,7 +347,7 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
316
347
|
)), (IS_CURRENT_PROFILE_TRANSIENT_CONTEXT.toNegated()))));
|
|
317
348
|
super({
|
|
318
349
|
id: `workbench.profiles.actions.editCurrentProfile`,
|
|
319
|
-
title: (
|
|
350
|
+
title: ( localize2(8827, "Edit Profile...")),
|
|
320
351
|
precondition,
|
|
321
352
|
f1: true,
|
|
322
353
|
menu: [
|
|
@@ -345,7 +376,7 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
345
376
|
constructor() {
|
|
346
377
|
super({
|
|
347
378
|
id,
|
|
348
|
-
title: (
|
|
379
|
+
title: ( localize2(8828, "Show Profile Contents")),
|
|
349
380
|
category: PROFILES_CATEGORY,
|
|
350
381
|
menu: [
|
|
351
382
|
{
|
|
@@ -371,7 +402,7 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
371
402
|
constructor() {
|
|
372
403
|
super({
|
|
373
404
|
id,
|
|
374
|
-
title: (
|
|
405
|
+
title: ( localize2(8829, "Export Profile...")),
|
|
375
406
|
category: PROFILES_CATEGORY,
|
|
376
407
|
precondition: ( (IS_PROFILE_EXPORT_IN_PROGRESS_CONTEXT.toNegated())),
|
|
377
408
|
menu: [
|
|
@@ -398,9 +429,8 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
398
429
|
disposables.add(MenuRegistry.appendMenuItem(MenuId.MenubarShare, {
|
|
399
430
|
command: {
|
|
400
431
|
id,
|
|
401
|
-
title: (
|
|
402
|
-
|
|
403
|
-
14,
|
|
432
|
+
title: ( localize2(
|
|
433
|
+
8830,
|
|
404
434
|
"Export Profile ({0})...",
|
|
405
435
|
that.userDataProfileService.currentProfile.name
|
|
406
436
|
)),
|
|
@@ -417,7 +447,7 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
417
447
|
constructor() {
|
|
418
448
|
super({
|
|
419
449
|
id,
|
|
420
|
-
title: (
|
|
450
|
+
title: ( localize2(8831, "Import Profile...")),
|
|
421
451
|
category: PROFILES_CATEGORY,
|
|
422
452
|
precondition: ( (IS_PROFILE_IMPORT_IN_PROGRESS_CONTEXT.toNegated())),
|
|
423
453
|
menu: [
|
|
@@ -447,19 +477,19 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
447
477
|
const updateQuickPickItems = (value) => {
|
|
448
478
|
const quickPickItems = [];
|
|
449
479
|
if (value) {
|
|
450
|
-
quickPickItems.push({ label: quickPick.value, description: (
|
|
480
|
+
quickPickItems.push({ label: quickPick.value, description: ( localize(8832, "Import from URL")) });
|
|
451
481
|
}
|
|
452
|
-
quickPickItems.push({ label: (
|
|
482
|
+
quickPickItems.push({ label: ( localize(8833, "Select File...")) });
|
|
453
483
|
if (profileTemplateQuickPickItems.length) {
|
|
454
484
|
quickPickItems.push({
|
|
455
485
|
type: 'separator',
|
|
456
|
-
label: (
|
|
486
|
+
label: ( localize(8834, "Profile Templates"))
|
|
457
487
|
}, ...profileTemplateQuickPickItems);
|
|
458
488
|
}
|
|
459
489
|
quickPick.items = quickPickItems;
|
|
460
490
|
};
|
|
461
|
-
quickPick.title = (
|
|
462
|
-
quickPick.placeholder = (
|
|
491
|
+
quickPick.title = ( localize(8835, "Import from Profile Template..."));
|
|
492
|
+
quickPick.placeholder = ( localize(8836, "Provide Profile Template URL"));
|
|
463
493
|
quickPick.ignoreFocusOut = true;
|
|
464
494
|
disposables.add(quickPick.onDidChangeValue(updateQuickPickItems));
|
|
465
495
|
updateQuickPickItems();
|
|
@@ -481,7 +511,7 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
481
511
|
}
|
|
482
512
|
}
|
|
483
513
|
catch (error) {
|
|
484
|
-
notificationService.error((
|
|
514
|
+
notificationService.error(( localize(8837, "Error while creating profile: {0}", getErrorMessage(error))));
|
|
485
515
|
}
|
|
486
516
|
}));
|
|
487
517
|
disposables.add(quickPick.onDidHide(() => disposables.dispose()));
|
|
@@ -493,7 +523,7 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
493
523
|
canSelectFiles: true,
|
|
494
524
|
canSelectMany: false,
|
|
495
525
|
filters: PROFILE_FILTER,
|
|
496
|
-
title: (
|
|
526
|
+
title: ( localize(8838, "Select Profile Template File")),
|
|
497
527
|
});
|
|
498
528
|
if (!profileLocation) {
|
|
499
529
|
return null;
|
|
@@ -504,7 +534,7 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
504
534
|
disposables.add(MenuRegistry.appendMenuItem(MenuId.MenubarShare, {
|
|
505
535
|
command: {
|
|
506
536
|
id,
|
|
507
|
-
title: (
|
|
537
|
+
title: ( localize2(8839, "Import Profile...")),
|
|
508
538
|
precondition: PROFILES_ENABLEMENT_CONTEXT,
|
|
509
539
|
},
|
|
510
540
|
}));
|
|
@@ -516,7 +546,7 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
516
546
|
constructor() {
|
|
517
547
|
super({
|
|
518
548
|
id: 'workbench.profiles.actions.createFromCurrentProfile',
|
|
519
|
-
title: (
|
|
549
|
+
title: ( localize2(8840, "Save Current Profile As...")),
|
|
520
550
|
category: PROFILES_CATEGORY,
|
|
521
551
|
f1: true,
|
|
522
552
|
precondition: PROFILES_ENABLEMENT_CONTEXT
|
|
@@ -527,13 +557,13 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
527
557
|
}
|
|
528
558
|
}));
|
|
529
559
|
}
|
|
530
|
-
|
|
560
|
+
registerNewProfileAction() {
|
|
531
561
|
const that = this;
|
|
532
562
|
this._register(registerAction2(class CreateProfileAction extends Action2 {
|
|
533
563
|
constructor() {
|
|
534
564
|
super({
|
|
535
565
|
id: 'workbench.profiles.actions.createProfile',
|
|
536
|
-
title: (
|
|
566
|
+
title: ( localize2(8841, "New Profile...")),
|
|
537
567
|
category: PROFILES_CATEGORY,
|
|
538
568
|
precondition: PROFILES_ENABLEMENT_CONTEXT,
|
|
539
569
|
f1: true,
|
|
@@ -546,13 +576,19 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
546
576
|
(CONTEXT_ENABLE_NEW_PROFILES_UI.negate())
|
|
547
577
|
))),
|
|
548
578
|
order: 1
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
id: OpenProfileMenu,
|
|
582
|
+
group: '1_manage_profiles',
|
|
583
|
+
order: 1
|
|
549
584
|
}
|
|
550
585
|
]
|
|
551
586
|
});
|
|
552
587
|
}
|
|
553
588
|
async run(accessor) {
|
|
554
589
|
if (that.isNewProfilesUIEnabled()) {
|
|
555
|
-
|
|
590
|
+
const editor = await that.openProfilesEditor();
|
|
591
|
+
return editor?.createNewProfile();
|
|
556
592
|
}
|
|
557
593
|
else {
|
|
558
594
|
return that.userDataProfileImportExportService.createProfile();
|
|
@@ -565,7 +601,7 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
565
601
|
constructor() {
|
|
566
602
|
super({
|
|
567
603
|
id: 'workbench.profiles.actions.deleteProfile',
|
|
568
|
-
title: (
|
|
604
|
+
title: ( localize2(8842, "Delete Profile...")),
|
|
569
605
|
category: PROFILES_CATEGORY,
|
|
570
606
|
f1: true,
|
|
571
607
|
precondition: ( (ContextKeyExpr.and(PROFILES_ENABLEMENT_CONTEXT, HAS_PROFILES_CONTEXT))),
|
|
@@ -592,11 +628,11 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
592
628
|
if (profiles.length) {
|
|
593
629
|
const picks = await quickInputService.pick(( (profiles.map(profile => ({
|
|
594
630
|
label: profile.name,
|
|
595
|
-
description: profile.id === userDataProfileService.currentProfile.id ? (
|
|
631
|
+
description: profile.id === userDataProfileService.currentProfile.id ? ( localize(8843, "Current")) : undefined,
|
|
596
632
|
profile
|
|
597
633
|
})))), {
|
|
598
|
-
title: (
|
|
599
|
-
placeHolder: (
|
|
634
|
+
title: ( localize(8844, "Delete Profile...")),
|
|
635
|
+
placeHolder: ( localize(8845, "Select Profiles to Delete")),
|
|
600
636
|
canPickMany: true
|
|
601
637
|
});
|
|
602
638
|
if (picks) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Separator } from 'vscode/vscode/vs/base/common/actions';
|
|
2
2
|
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
3
|
-
import {
|
|
3
|
+
import { localize2, localize } from 'vscode/vscode/vs/nls';
|
|
4
4
|
import { Categories } from 'vscode/vscode/vs/platform/action/common/actionCommonCategories';
|
|
5
5
|
import { createAndFillInActionBarActions } from 'vscode/vscode/vs/platform/actions/browser/menuEntryActionViewItem';
|
|
6
6
|
import { Action2, registerAction2 } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
@@ -14,10 +14,9 @@ import { IUserDataProfilesService } from 'vscode/vscode/vs/platform/userDataProf
|
|
|
14
14
|
import { PROFILES_CATEGORY, PROFILES_ENABLEMENT_CONTEXT, HAS_PROFILES_CONTEXT, MANAGE_PROFILES_ACTION_ID, ProfilesMenu } from 'vscode/vscode/vs/workbench/services/userDataProfile/common/userDataProfile';
|
|
15
15
|
import { IUserDataProfileManagementService, IUserDataProfileService } from 'vscode/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.service';
|
|
16
16
|
|
|
17
|
-
const _moduleId = "vs/workbench/contrib/userDataProfile/browser/userDataProfileActions";
|
|
18
17
|
class CreateTransientProfileAction extends Action2 {
|
|
19
18
|
static { this.ID = 'workbench.profiles.actions.createTemporaryProfile'; }
|
|
20
|
-
static { this.TITLE = (
|
|
19
|
+
static { this.TITLE = ( localize2(8846, "Create a Temporary Profile")); }
|
|
21
20
|
constructor() {
|
|
22
21
|
super({
|
|
23
22
|
id: CreateTransientProfileAction.ID,
|
|
@@ -37,7 +36,7 @@ class RenameProfileAction extends Action2 {
|
|
|
37
36
|
constructor() {
|
|
38
37
|
super({
|
|
39
38
|
id: RenameProfileAction.ID,
|
|
40
|
-
title: (
|
|
39
|
+
title: ( localize2(8847, "Rename...")),
|
|
41
40
|
category: PROFILES_CATEGORY,
|
|
42
41
|
f1: true,
|
|
43
42
|
precondition: ( (ContextKeyExpr.and(PROFILES_ENABLEMENT_CONTEXT, HAS_PROFILES_CONTEXT))),
|
|
@@ -57,10 +56,10 @@ class RenameProfileAction extends Action2 {
|
|
|
57
56
|
}
|
|
58
57
|
const name = await quickInputService.input({
|
|
59
58
|
value: profile.name,
|
|
60
|
-
title: (
|
|
59
|
+
title: ( localize(8848, 'Rename {0}', profile.name)),
|
|
61
60
|
validateInput: async (value) => {
|
|
62
61
|
if (profile.name !== value && ( (userDataProfilesService.profiles.some(p => p.name === value)))) {
|
|
63
|
-
return (
|
|
62
|
+
return ( localize(8849, "Profile with name {0} already exists.", value));
|
|
64
63
|
}
|
|
65
64
|
return undefined;
|
|
66
65
|
}
|
|
@@ -81,11 +80,11 @@ class RenameProfileAction extends Action2 {
|
|
|
81
80
|
}
|
|
82
81
|
const pick = await quickInputService.pick(( (profiles.map(profile => ({
|
|
83
82
|
label: profile.name,
|
|
84
|
-
description: profile.id === userDataProfileService.currentProfile.id ? (
|
|
83
|
+
description: profile.id === userDataProfileService.currentProfile.id ? ( localize(8850, "Current")) : undefined,
|
|
85
84
|
profile
|
|
86
85
|
})))), {
|
|
87
|
-
title: (
|
|
88
|
-
placeHolder: (
|
|
86
|
+
title: ( localize(8851, "Rename Profile...")),
|
|
87
|
+
placeHolder: ( localize(8852, "Select Profile to Rename")),
|
|
89
88
|
});
|
|
90
89
|
return pick?.profile;
|
|
91
90
|
}
|
|
@@ -95,7 +94,7 @@ registerAction2(class ManageProfilesAction extends Action2 {
|
|
|
95
94
|
constructor() {
|
|
96
95
|
super({
|
|
97
96
|
id: MANAGE_PROFILES_ACTION_ID,
|
|
98
|
-
title: (
|
|
97
|
+
title: ( localize2(8853, "Manage...")),
|
|
99
98
|
category: PROFILES_CATEGORY,
|
|
100
99
|
precondition: ( (ContextKeyExpr.and(PROFILES_ENABLEMENT_CONTEXT, HAS_PROFILES_CONTEXT))),
|
|
101
100
|
});
|
|
@@ -105,10 +104,9 @@ registerAction2(class ManageProfilesAction extends Action2 {
|
|
|
105
104
|
const menuService = accessor.get(IMenuService);
|
|
106
105
|
const contextKeyService = accessor.get(IContextKeyService);
|
|
107
106
|
const commandService = accessor.get(ICommandService);
|
|
108
|
-
const menu = menuService.
|
|
107
|
+
const menu = menuService.getMenuActions(ProfilesMenu, contextKeyService);
|
|
109
108
|
const actions = [];
|
|
110
|
-
createAndFillInActionBarActions(menu,
|
|
111
|
-
menu.dispose();
|
|
109
|
+
createAndFillInActionBarActions(menu, actions);
|
|
112
110
|
if (actions.length) {
|
|
113
111
|
const picks = ( (actions.map(action => {
|
|
114
112
|
if (action instanceof Separator) {
|
|
@@ -130,7 +128,7 @@ registerAction2(class CleanupProfilesAction extends Action2 {
|
|
|
130
128
|
constructor() {
|
|
131
129
|
super({
|
|
132
130
|
id: 'workbench.profiles.actions.cleanupProfiles',
|
|
133
|
-
title: (
|
|
131
|
+
title: ( localize2(8854, "Cleanup Profiles")),
|
|
134
132
|
category: Categories.Developer,
|
|
135
133
|
f1: true,
|
|
136
134
|
precondition: PROFILES_ENABLEMENT_CONTEXT,
|
|
@@ -144,7 +142,7 @@ registerAction2(class ResetWorkspacesAction extends Action2 {
|
|
|
144
142
|
constructor() {
|
|
145
143
|
super({
|
|
146
144
|
id: 'workbench.profiles.actions.resetWorkspaces',
|
|
147
|
-
title: (
|
|
145
|
+
title: ( localize2(8855, "Reset Workspace Profiles Associations")),
|
|
148
146
|
category: Categories.Developer,
|
|
149
147
|
f1: true,
|
|
150
148
|
precondition: PROFILES_ENABLEMENT_CONTEXT,
|