@codingame/monaco-vscode-user-data-profile-service-override 10.1.4 → 11.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.
Files changed (26) hide show
  1. package/package.json +3 -2
  2. package/vscode/src/vs/platform/userDataProfile/browser/userDataProfile.js +1 -8
  3. package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.js +84 -27
  4. package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfileActions.js +4 -7
  5. package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditor.js +101 -85
  6. package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditorModel.js +27 -27
  7. package/vscode/src/vs/workbench/services/userDataProfile/browser/extensionsResource.js +5 -5
  8. package/vscode/src/vs/workbench/services/userDataProfile/browser/globalStateResource.js +1 -1
  9. package/vscode/src/vs/workbench/services/userDataProfile/browser/keybindingsResource.js +1 -1
  10. package/vscode/src/vs/workbench/services/userDataProfile/browser/settingsResource.js +1 -1
  11. package/vscode/src/vs/workbench/services/userDataProfile/browser/snippetsResource.js +2 -2
  12. package/vscode/src/vs/workbench/services/userDataProfile/browser/tasksResource.js +1 -1
  13. package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileImportExportService.js +40 -41
  14. package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.js +8 -8
  15. package/vscode/src/vs/workbench/services/userDataSync/browser/userDataSyncInit.js +6 -6
  16. package/_virtual/semver.js +0 -5
  17. package/vscode/src/vs/platform/userDataSync/common/extensionsMerge.js +0 -331
  18. package/vscode/src/vs/platform/userDataSync/common/extensionsSync.js +0 -546
  19. package/vscode/src/vs/platform/userDataSync/common/globalStateMerge.js +0 -102
  20. package/vscode/src/vs/platform/userDataSync/common/globalStateSync.js +0 -431
  21. package/vscode/src/vs/platform/userDataSync/common/keybindingsMerge.js +0 -277
  22. package/vscode/src/vs/platform/userDataSync/common/keybindingsSync.js +0 -325
  23. package/vscode/src/vs/platform/userDataSync/common/settingsSync.js +0 -338
  24. package/vscode/src/vs/platform/userDataSync/common/snippetsMerge.js +0 -126
  25. package/vscode/src/vs/platform/userDataSync/common/snippetsSync.js +0 -478
  26. package/vscode/src/vs/platform/userDataSync/common/tasksSync.js +0 -245
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-user-data-profile-service-override",
3
- "version": "10.1.4",
3
+ "version": "11.0.0",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -26,6 +26,7 @@
26
26
  }
27
27
  },
28
28
  "dependencies": {
29
- "vscode": "npm:@codingame/monaco-vscode-api@10.1.4"
29
+ "vscode": "npm:@codingame/monaco-vscode-api@11.0.0",
30
+ "@codingame/monaco-vscode-user-data-profile-user-data-sync-common": "11.0.0"
30
31
  }
31
32
  }
@@ -63,17 +63,10 @@ let BrowserUserDataProfilesService = class BrowserUserDataProfilesService extend
63
63
  localStorage.setItem(UserDataProfilesService.PROFILES_KEY, JSON.stringify(storedProfiles));
64
64
  }
65
65
  getStoredProfileAssociations() {
66
- const migrateKey = 'profileAssociationsMigration';
67
66
  try {
68
67
  const value = localStorage.getItem(UserDataProfilesService.PROFILE_ASSOCIATIONS_KEY);
69
68
  if (value) {
70
- let associations = JSON.parse(value);
71
- if (!localStorage.getItem(migrateKey)) {
72
- associations = this.migrateStoredProfileAssociations(associations);
73
- this.saveStoredProfileAssociations(associations);
74
- localStorage.setItem(migrateKey, 'true');
75
- }
76
- return associations;
69
+ return JSON.parse(value);
77
70
  }
78
71
  }
79
72
  catch (error) {
@@ -7,7 +7,7 @@ import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/cont
7
7
  import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
8
8
  import { IUserDataProfilesService } from 'vscode/vscode/vs/platform/userDataProfile/common/userDataProfile.service';
9
9
  import { ILifecycleService } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle.service';
10
- import { CURRENT_PROFILE_CONTEXT, PROFILES_ENABLEMENT_CONTEXT, IS_CURRENT_PROFILE_TRANSIENT_CONTEXT, HAS_PROFILES_CONTEXT, isProfileURL, PROFILES_CATEGORY, PROFILES_TITLE } from 'vscode/vscode/vs/workbench/services/userDataProfile/common/userDataProfile';
10
+ import { CURRENT_PROFILE_CONTEXT, IS_CURRENT_PROFILE_TRANSIENT_CONTEXT, HAS_PROFILES_CONTEXT, isProfileURL, PROFILES_CATEGORY, PROFILES_TITLE } from 'vscode/vscode/vs/workbench/services/userDataProfile/common/userDataProfile';
11
11
  import { IUserDataProfileService, IUserDataProfileManagementService } from 'vscode/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.service';
12
12
  import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput.service';
13
13
  import { INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification.service';
@@ -29,6 +29,7 @@ import { IURLService } from 'vscode/vscode/vs/platform/url/common/url.service';
29
29
  import { IBrowserWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/browser/environmentService.service';
30
30
 
31
31
  const OpenProfileMenu = ( (new MenuId('OpenProfile')));
32
+ const ProfilesMenu = ( (new MenuId('Profiles')));
32
33
  let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContribution extends Disposable {
33
34
  static { this.ID = 'workbench.contrib.userDataProfiles'; }
34
35
  constructor(userDataProfileService, userDataProfilesService, userDataProfileManagementService, telemetryService, workspaceContextService, workspaceTagsService, contextKeyService, editorGroupsService, instantiationService, lifecycleService, urlService, environmentService) {
@@ -45,7 +46,6 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
45
46
  this.urlService = urlService;
46
47
  this.profilesDisposable = this._register(( (new MutableDisposable())));
47
48
  this.currentProfileContext = CURRENT_PROFILE_CONTEXT.bindTo(contextKeyService);
48
- PROFILES_ENABLEMENT_CONTEXT.bindTo(contextKeyService).set(this.userDataProfilesService.isEnabled());
49
49
  this.isCurrentProfileTransientContext = IS_CURRENT_PROFILE_TRANSIENT_CONTEXT.bindTo(contextKeyService);
50
50
  this.currentProfileContext.set(this.userDataProfileService.currentProfile.id);
51
51
  this.isCurrentProfileTransientContext.set(!!this.userDataProfileService.currentProfile.isTransient);
@@ -82,12 +82,13 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
82
82
  return editor;
83
83
  }
84
84
  registerEditor() {
85
- ( (Registry.as(EditorExtensions.EditorPane))).registerEditorPane(EditorPaneDescriptor.create(UserDataProfilesEditor, UserDataProfilesEditor.ID, ( localize(8916, "Profiles Editor"))), [
85
+ ( (Registry.as(EditorExtensions.EditorPane))).registerEditorPane(EditorPaneDescriptor.create(UserDataProfilesEditor, UserDataProfilesEditor.ID, ( localize(8970, "Profiles Editor"))), [
86
86
  ( (new SyncDescriptor(UserDataProfilesEditorInput)))
87
87
  ]);
88
88
  ( (Registry.as(EditorExtensions.EditorFactory))).registerEditorSerializer(UserDataProfilesEditorInput.ID, UserDataProfilesEditorInputSerializer);
89
89
  }
90
90
  registerActions() {
91
+ this.registerProfileSubMenu();
91
92
  this._register(this.registerManageProfilesAction());
92
93
  this._register(this.registerSwitchProfileAction());
93
94
  this.registerOpenProfileSubMenu();
@@ -100,9 +101,32 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
100
101
  this.registerDeleteProfileAction();
101
102
  this.registerHelpAction();
102
103
  }
104
+ registerProfileSubMenu() {
105
+ const getProfilesTitle = () => {
106
+ return ( localize(8971, "Profile ({0})", this.userDataProfileService.currentProfile.name));
107
+ };
108
+ MenuRegistry.appendMenuItem(MenuId.GlobalActivity, {
109
+ get title() {
110
+ return getProfilesTitle();
111
+ },
112
+ submenu: ProfilesMenu,
113
+ group: '2_configuration',
114
+ order: 1,
115
+ when: HAS_PROFILES_CONTEXT
116
+ });
117
+ MenuRegistry.appendMenuItem(MenuId.MenubarPreferencesMenu, {
118
+ get title() {
119
+ return getProfilesTitle();
120
+ },
121
+ submenu: ProfilesMenu,
122
+ group: '2_configuration',
123
+ order: 1,
124
+ when: HAS_PROFILES_CONTEXT
125
+ });
126
+ }
103
127
  registerOpenProfileSubMenu() {
104
128
  MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
105
- title: ( localize(8917, "New Window with Profile")),
129
+ title: ( localize(8972, "New Window with Profile")),
106
130
  submenu: OpenProfileMenu,
107
131
  group: '1_new',
108
132
  order: 4,
@@ -112,16 +136,43 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
112
136
  this.profilesDisposable.value = ( (new DisposableStore()));
113
137
  for (const profile of this.userDataProfilesService.profiles) {
114
138
  if (!profile.isTransient) {
139
+ this.profilesDisposable.value.add(this.registerProfileEntryAction(profile));
115
140
  this.profilesDisposable.value.add(this.registerNewWindowAction(profile));
116
141
  }
117
142
  }
118
143
  }
144
+ registerProfileEntryAction(profile) {
145
+ const that = this;
146
+ return registerAction2(class ProfileEntryAction extends Action2 {
147
+ constructor() {
148
+ super({
149
+ id: `workbench.profiles.actions.profileEntry.${profile.id}`,
150
+ title: profile.name,
151
+ metadata: {
152
+ description: ( localize2(8973, "Switch to {0} profile", profile.name)),
153
+ },
154
+ toggled: ( (ContextKeyExpr.equals(CURRENT_PROFILE_CONTEXT.key, profile.id))),
155
+ menu: [
156
+ {
157
+ id: ProfilesMenu,
158
+ group: '0_profiles',
159
+ }
160
+ ]
161
+ });
162
+ }
163
+ async run(accessor) {
164
+ if (that.userDataProfileService.currentProfile.id !== profile.id) {
165
+ return that.userDataProfileManagementService.switchProfile(profile);
166
+ }
167
+ }
168
+ });
169
+ }
119
170
  registerNewWindowWithProfileAction() {
120
171
  return registerAction2(class NewWindowWithProfileAction extends Action2 {
121
172
  constructor() {
122
173
  super({
123
174
  id: `workbench.profiles.actions.newWindowWithProfile`,
124
- title: ( localize2(8918, "New Window with Profile...")),
175
+ title: ( localize2(8974, "New Window with Profile...")),
125
176
  category: PROFILES_CATEGORY,
126
177
  precondition: HAS_PROFILES_CONTEXT,
127
178
  f1: true,
@@ -135,8 +186,8 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
135
186
  label: profile.name,
136
187
  profile
137
188
  })))), {
138
- title: ( localize(8919, "New Window with Profile")),
139
- placeHolder: ( localize(8920, "Select Profile")),
189
+ title: ( localize(8975, "New Window with Profile")),
190
+ placeHolder: ( localize(8976, "Select Profile")),
140
191
  canPickMany: false
141
192
  });
142
193
  if (pick) {
@@ -152,7 +203,10 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
152
203
  constructor() {
153
204
  super({
154
205
  id,
155
- title: ( localize2(8921, "{0}", profile.name)),
206
+ title: ( localize2(8977, "{0}", profile.name)),
207
+ metadata: {
208
+ description: ( localize2(8978, "Open New Window with {0} Profile", profile.name)),
209
+ },
156
210
  menu: {
157
211
  id: OpenProfileMenu,
158
212
  group: '0_profiles',
@@ -169,7 +223,7 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
169
223
  command: {
170
224
  id,
171
225
  category: PROFILES_CATEGORY,
172
- title: ( localize2(8922, "Open {0} Profile", profile.name)),
226
+ title: ( localize2(8979, "Open {0} Profile", profile.name)),
173
227
  precondition: HAS_PROFILES_CONTEXT
174
228
  },
175
229
  }));
@@ -181,10 +235,9 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
181
235
  constructor() {
182
236
  super({
183
237
  id: `workbench.profiles.actions.switchProfile`,
184
- title: ( localize2(8923, 'Switch Profile...')),
238
+ title: ( localize2(8980, 'Switch Profile...')),
185
239
  category: PROFILES_CATEGORY,
186
240
  f1: true,
187
- precondition: PROFILES_ENABLEMENT_CONTEXT,
188
241
  });
189
242
  }
190
243
  async run(accessor) {
@@ -198,7 +251,7 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
198
251
  });
199
252
  }
200
253
  const result = await quickInputService.pick(items.sort((a, b) => a.profile.name.localeCompare(b.profile.name)), {
201
- placeHolder: ( localize(8924, "Select Profile"))
254
+ placeHolder: ( localize(8981, "Select Profile"))
202
255
  });
203
256
  if (result) {
204
257
  await that.userDataProfileManagementService.switchProfile(result.profile);
@@ -213,19 +266,26 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
213
266
  super({
214
267
  id: `workbench.profiles.actions.manageProfiles`,
215
268
  title: {
216
- ...( localize2(8925, "Profiles")),
217
- mnemonicTitle: ( localize(8926, "&&Profiles")),
269
+ ...( localize2(8982, "Profiles")),
270
+ mnemonicTitle: ( localize(8983, "&&Profiles")),
218
271
  },
219
272
  menu: [
220
273
  {
221
274
  id: MenuId.GlobalActivity,
222
275
  group: '2_configuration',
223
276
  order: 1,
277
+ when: ( (HAS_PROFILES_CONTEXT.negate()))
224
278
  },
225
279
  {
226
280
  id: MenuId.MenubarPreferencesMenu,
227
281
  group: '2_configuration',
228
282
  order: 1,
283
+ when: ( (HAS_PROFILES_CONTEXT.negate()))
284
+ },
285
+ {
286
+ id: ProfilesMenu,
287
+ group: '1_manage',
288
+ order: 1,
229
289
  },
230
290
  ]
231
291
  });
@@ -240,7 +300,7 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
240
300
  command: {
241
301
  id: 'workbench.profiles.actions.manageProfiles',
242
302
  category: Categories.Preferences,
243
- title: ( localize2(8927, "Open Profiles (UI)")),
303
+ title: ( localize2(8984, "Open Profiles (UI)")),
244
304
  },
245
305
  }));
246
306
  return disposables;
@@ -253,7 +313,7 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
253
313
  constructor() {
254
314
  super({
255
315
  id,
256
- title: ( localize2(8928, "Export Profile...")),
316
+ title: ( localize2(8985, "Export Profile...")),
257
317
  category: PROFILES_CATEGORY,
258
318
  f1: true,
259
319
  });
@@ -267,11 +327,10 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
267
327
  command: {
268
328
  id,
269
329
  title: ( localize2(
270
- 8929,
330
+ 8986,
271
331
  "Export Profile ({0})...",
272
332
  that.userDataProfileService.currentProfile.name
273
333
  )),
274
- precondition: PROFILES_ENABLEMENT_CONTEXT,
275
334
  },
276
335
  }));
277
336
  return disposables;
@@ -282,10 +341,9 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
282
341
  constructor() {
283
342
  super({
284
343
  id: 'workbench.profiles.actions.createFromCurrentProfile',
285
- title: ( localize2(8930, "Save Current Profile As...")),
344
+ title: ( localize2(8987, "Save Current Profile As...")),
286
345
  category: PROFILES_CATEGORY,
287
346
  f1: true,
288
- precondition: PROFILES_ENABLEMENT_CONTEXT
289
347
  });
290
348
  }
291
349
  async run() {
@@ -300,9 +358,8 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
300
358
  constructor() {
301
359
  super({
302
360
  id: 'workbench.profiles.actions.createProfile',
303
- title: ( localize2(8931, "New Profile...")),
361
+ title: ( localize2(8988, "New Profile...")),
304
362
  category: PROFILES_CATEGORY,
305
- precondition: PROFILES_ENABLEMENT_CONTEXT,
306
363
  f1: true,
307
364
  menu: [
308
365
  {
@@ -324,10 +381,10 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
324
381
  constructor() {
325
382
  super({
326
383
  id: 'workbench.profiles.actions.deleteProfile',
327
- title: ( localize2(8932, "Delete Profile...")),
384
+ title: ( localize2(8989, "Delete Profile...")),
328
385
  category: PROFILES_CATEGORY,
329
386
  f1: true,
330
- precondition: ( (ContextKeyExpr.and(PROFILES_ENABLEMENT_CONTEXT, HAS_PROFILES_CONTEXT))),
387
+ precondition: HAS_PROFILES_CONTEXT,
331
388
  });
332
389
  }
333
390
  async run(accessor) {
@@ -340,11 +397,11 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
340
397
  if (profiles.length) {
341
398
  const picks = await quickInputService.pick(( (profiles.map(profile => ({
342
399
  label: profile.name,
343
- description: profile.id === userDataProfileService.currentProfile.id ? ( localize(8933, "Current")) : undefined,
400
+ description: profile.id === userDataProfileService.currentProfile.id ? ( localize(8990, "Current")) : undefined,
344
401
  profile
345
402
  })))), {
346
- title: ( localize(8934, "Delete Profile...")),
347
- placeHolder: ( localize(8935, "Select Profiles to Delete")),
403
+ title: ( localize(8991, "Delete Profile...")),
404
+ placeHolder: ( localize(8992, "Select Profiles to Delete")),
348
405
  canPickMany: true
349
406
  });
350
407
  if (picks) {
@@ -2,19 +2,18 @@ import { localize2 } from 'vscode/vscode/vs/nls';
2
2
  import { Categories } from 'vscode/vscode/vs/platform/action/common/actionCommonCategories';
3
3
  import { Action2, registerAction2 } from 'vscode/vscode/vs/platform/actions/common/actions';
4
4
  import { IUserDataProfilesService } from 'vscode/vscode/vs/platform/userDataProfile/common/userDataProfile.service';
5
- import { PROFILES_CATEGORY, PROFILES_ENABLEMENT_CONTEXT } from 'vscode/vscode/vs/workbench/services/userDataProfile/common/userDataProfile';
5
+ import { PROFILES_CATEGORY } from 'vscode/vscode/vs/workbench/services/userDataProfile/common/userDataProfile';
6
6
  import { IUserDataProfileManagementService } from 'vscode/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.service';
7
7
 
8
8
  class CreateTransientProfileAction extends Action2 {
9
9
  static { this.ID = 'workbench.profiles.actions.createTemporaryProfile'; }
10
- static { this.TITLE = ( localize2(8936, "Create a Temporary Profile")); }
10
+ static { this.TITLE = ( localize2(8993, "Create a Temporary Profile")); }
11
11
  constructor() {
12
12
  super({
13
13
  id: CreateTransientProfileAction.ID,
14
14
  title: CreateTransientProfileAction.TITLE,
15
15
  category: PROFILES_CATEGORY,
16
16
  f1: true,
17
- precondition: PROFILES_ENABLEMENT_CONTEXT,
18
17
  });
19
18
  }
20
19
  async run(accessor) {
@@ -26,10 +25,9 @@ registerAction2(class CleanupProfilesAction extends Action2 {
26
25
  constructor() {
27
26
  super({
28
27
  id: 'workbench.profiles.actions.cleanupProfiles',
29
- title: ( localize2(8937, "Cleanup Profiles")),
28
+ title: ( localize2(8994, "Cleanup Profiles")),
30
29
  category: Categories.Developer,
31
30
  f1: true,
32
- precondition: PROFILES_ENABLEMENT_CONTEXT,
33
31
  });
34
32
  }
35
33
  async run(accessor) {
@@ -40,10 +38,9 @@ registerAction2(class ResetWorkspacesAction extends Action2 {
40
38
  constructor() {
41
39
  super({
42
40
  id: 'workbench.profiles.actions.resetWorkspaces',
43
- title: ( localize2(8938, "Reset Workspace Profiles Associations")),
41
+ title: ( localize2(8995, "Reset Workspace Profiles Associations")),
44
42
  category: Categories.Developer,
45
43
  f1: true,
46
- precondition: PROFILES_ENABLEMENT_CONTEXT,
47
44
  });
48
45
  }
49
46
  async run(accessor) {