@codingame/monaco-vscode-user-data-profile-service-override 24.2.0 → 25.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.js +44 -24
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfileActions.js +3 -3
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditor.js +79 -79
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditorModel.js +26 -26
- package/vscode/src/vs/workbench/services/userDataProfile/browser/extensionsResource.js +5 -5
- package/vscode/src/vs/workbench/services/userDataProfile/browser/globalStateResource.js +1 -1
- package/vscode/src/vs/workbench/services/userDataProfile/browser/keybindingsResource.js +1 -1
- package/vscode/src/vs/workbench/services/userDataProfile/browser/mcpProfileResource.js +1 -1
- package/vscode/src/vs/workbench/services/userDataProfile/browser/settingsResource.js +1 -1
- package/vscode/src/vs/workbench/services/userDataProfile/browser/snippetsResource.js +2 -2
- package/vscode/src/vs/workbench/services/userDataProfile/browser/tasksResource.js +1 -1
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileImportExportService.js +40 -40
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.js +8 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-user-data-profile-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "25.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - user-data-profile service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-api": "
|
|
18
|
+
"@codingame/monaco-vscode-api": "25.0.0"
|
|
19
19
|
},
|
|
20
20
|
"main": "index.js",
|
|
21
21
|
"module": "index.js",
|
|
@@ -34,6 +34,7 @@ export declare class UserDataProfilesWorkbenchContribution extends Disposable im
|
|
|
34
34
|
handleURL(uri: URI): Promise<boolean>;
|
|
35
35
|
private openProfilesEditor;
|
|
36
36
|
private registerEditor;
|
|
37
|
+
private registerDropHandler;
|
|
37
38
|
private registerActions;
|
|
38
39
|
private registerProfileSubMenu;
|
|
39
40
|
private registerOpenProfileSubMenu;
|
|
@@ -9,7 +9,7 @@ import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platf
|
|
|
9
9
|
import { IUserDataProfilesService } from '@codingame/monaco-vscode-api/vscode/vs/platform/userDataProfile/common/userDataProfile.service';
|
|
10
10
|
import { LifecyclePhase } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/lifecycle/common/lifecycle';
|
|
11
11
|
import { ILifecycleService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/lifecycle/common/lifecycle.service';
|
|
12
|
-
import { CURRENT_PROFILE_CONTEXT, IS_CURRENT_PROFILE_TRANSIENT_CONTEXT, HAS_PROFILES_CONTEXT, isProfileURL, PROFILES_CATEGORY, PROFILES_TITLE } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/userDataProfile/common/userDataProfile';
|
|
12
|
+
import { CURRENT_PROFILE_CONTEXT, IS_CURRENT_PROFILE_TRANSIENT_CONTEXT, HAS_PROFILES_CONTEXT, isProfileURL, PROFILE_EXTENSION, PROFILES_CATEGORY, PROFILES_TITLE } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/userDataProfile/common/userDataProfile';
|
|
13
13
|
import { IUserDataProfileService, IUserDataProfileManagementService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.service';
|
|
14
14
|
import { IQuickInputService } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service';
|
|
15
15
|
import { INotificationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/notification.service';
|
|
@@ -29,6 +29,8 @@ import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/pl
|
|
|
29
29
|
import { IHostService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/host/browser/host.service';
|
|
30
30
|
import { IURLService } from '@codingame/monaco-vscode-api/vscode/vs/platform/url/common/url.service';
|
|
31
31
|
import { IBrowserWorkbenchEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/browser/environmentService.service';
|
|
32
|
+
import { Extensions } from '@codingame/monaco-vscode-api/vscode/vs/platform/dnd/browser/dnd';
|
|
33
|
+
import { IUriIdentityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
32
34
|
|
|
33
35
|
const OpenProfileMenu = ( new MenuId('OpenProfile'));
|
|
34
36
|
const ProfilesMenu = ( new MenuId('Profiles'));
|
|
@@ -68,6 +70,7 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
68
70
|
if (environmentService.options?.profileToPreview) {
|
|
69
71
|
lifecycleService.when(LifecyclePhase.Restored).then(() => this.handleURL(URI.revive(environmentService.options.profileToPreview)));
|
|
70
72
|
}
|
|
73
|
+
this.registerDropHandler();
|
|
71
74
|
}
|
|
72
75
|
async handleURL(uri) {
|
|
73
76
|
if (isProfileURL(uri)) {
|
|
@@ -84,11 +87,28 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
84
87
|
return editor;
|
|
85
88
|
}
|
|
86
89
|
registerEditor() {
|
|
87
|
-
( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(EditorPaneDescriptor.create(UserDataProfilesEditor, UserDataProfilesEditor.ID, ( localize(
|
|
90
|
+
( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(EditorPaneDescriptor.create(UserDataProfilesEditor, UserDataProfilesEditor.ID, ( localize(12924, "Profiles Editor"))), [
|
|
88
91
|
( new SyncDescriptor(UserDataProfilesEditorInput))
|
|
89
92
|
]);
|
|
90
93
|
( Registry.as(EditorExtensions.EditorFactory)).registerEditorSerializer(UserDataProfilesEditorInput.ID, UserDataProfilesEditorInputSerializer);
|
|
91
94
|
}
|
|
95
|
+
registerDropHandler() {
|
|
96
|
+
const dndRegistry = ( Registry.as(Extensions.DragAndDropContribution));
|
|
97
|
+
const that = this;
|
|
98
|
+
this._register(dndRegistry.registerDropHandler(new (class UserDataProfileDropHandler {
|
|
99
|
+
async handleDrop(resource, accessor) {
|
|
100
|
+
const uriIdentityService = accessor.get(IUriIdentityService);
|
|
101
|
+
if (uriIdentityService.extUri.extname(resource) === `.${PROFILE_EXTENSION}`) {
|
|
102
|
+
const editor = await that.openProfilesEditor();
|
|
103
|
+
if (editor) {
|
|
104
|
+
editor.createNewProfile(resource);
|
|
105
|
+
}
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
})));
|
|
111
|
+
}
|
|
92
112
|
registerActions() {
|
|
93
113
|
this.registerProfileSubMenu();
|
|
94
114
|
this._register(this.registerManageProfilesAction());
|
|
@@ -105,7 +125,7 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
105
125
|
}
|
|
106
126
|
registerProfileSubMenu() {
|
|
107
127
|
const getProfilesTitle = () => {
|
|
108
|
-
return localize(
|
|
128
|
+
return localize(12925, "Profile ({0})", this.userDataProfileService.currentProfile.name);
|
|
109
129
|
};
|
|
110
130
|
MenuRegistry.appendMenuItem(MenuId.GlobalActivity, {
|
|
111
131
|
get title() {
|
|
@@ -128,7 +148,7 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
128
148
|
}
|
|
129
149
|
registerOpenProfileSubMenu() {
|
|
130
150
|
MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
|
|
131
|
-
title: ( localize(
|
|
151
|
+
title: ( localize(12926, "New Window with Profile")),
|
|
132
152
|
submenu: OpenProfileMenu,
|
|
133
153
|
group: '1_new',
|
|
134
154
|
order: 4,
|
|
@@ -151,7 +171,7 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
151
171
|
id: `workbench.profiles.actions.profileEntry.${profile.id}`,
|
|
152
172
|
title: profile.name,
|
|
153
173
|
metadata: {
|
|
154
|
-
description: ( localize2(
|
|
174
|
+
description: ( localize2(12927, "Switch to {0} profile", profile.name)),
|
|
155
175
|
},
|
|
156
176
|
toggled: ( ContextKeyExpr.equals(CURRENT_PROFILE_CONTEXT.key, profile.id)),
|
|
157
177
|
menu: [
|
|
@@ -174,7 +194,7 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
174
194
|
constructor() {
|
|
175
195
|
super({
|
|
176
196
|
id: `workbench.profiles.actions.newWindowWithProfile`,
|
|
177
|
-
title: ( localize2(
|
|
197
|
+
title: ( localize2(12928, "New Window with Profile...")),
|
|
178
198
|
category: PROFILES_CATEGORY,
|
|
179
199
|
precondition: HAS_PROFILES_CONTEXT,
|
|
180
200
|
f1: true,
|
|
@@ -188,8 +208,8 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
188
208
|
label: profile.name,
|
|
189
209
|
profile
|
|
190
210
|
}))), {
|
|
191
|
-
title: ( localize(
|
|
192
|
-
placeHolder: ( localize(
|
|
211
|
+
title: ( localize(12929, "New Window with Profile")),
|
|
212
|
+
placeHolder: ( localize(12930, "Select Profile")),
|
|
193
213
|
canPickMany: false
|
|
194
214
|
});
|
|
195
215
|
if (pick) {
|
|
@@ -205,9 +225,9 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
205
225
|
constructor() {
|
|
206
226
|
super({
|
|
207
227
|
id,
|
|
208
|
-
title: ( localize2(
|
|
228
|
+
title: ( localize2(12931, "{0}", profile.name)),
|
|
209
229
|
metadata: {
|
|
210
|
-
description: ( localize2(
|
|
230
|
+
description: ( localize2(12932, "Open New Window with {0} Profile", profile.name)),
|
|
211
231
|
},
|
|
212
232
|
menu: {
|
|
213
233
|
id: OpenProfileMenu,
|
|
@@ -225,7 +245,7 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
225
245
|
command: {
|
|
226
246
|
id,
|
|
227
247
|
category: PROFILES_CATEGORY,
|
|
228
|
-
title: ( localize2(
|
|
248
|
+
title: ( localize2(12933, "Open {0} Profile", profile.name)),
|
|
229
249
|
precondition: HAS_PROFILES_CONTEXT
|
|
230
250
|
},
|
|
231
251
|
}));
|
|
@@ -237,7 +257,7 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
237
257
|
constructor() {
|
|
238
258
|
super({
|
|
239
259
|
id: `workbench.profiles.actions.switchProfile`,
|
|
240
|
-
title: ( localize2(
|
|
260
|
+
title: ( localize2(12934, 'Switch Profile...')),
|
|
241
261
|
category: PROFILES_CATEGORY,
|
|
242
262
|
f1: true,
|
|
243
263
|
});
|
|
@@ -253,7 +273,7 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
253
273
|
});
|
|
254
274
|
}
|
|
255
275
|
const result = await quickInputService.pick(items.sort((a, b) => a.profile.name.localeCompare(b.profile.name)), {
|
|
256
|
-
placeHolder: ( localize(
|
|
276
|
+
placeHolder: ( localize(12935, "Select Profile"))
|
|
257
277
|
});
|
|
258
278
|
if (result) {
|
|
259
279
|
await that.userDataProfileManagementService.switchProfile(result.profile);
|
|
@@ -268,8 +288,8 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
268
288
|
super({
|
|
269
289
|
id: `workbench.profiles.actions.manageProfiles`,
|
|
270
290
|
title: {
|
|
271
|
-
...( localize2(
|
|
272
|
-
mnemonicTitle: ( localize(
|
|
291
|
+
...( localize2(12936, "Profiles")),
|
|
292
|
+
mnemonicTitle: ( localize(12937, "&&Profiles")),
|
|
273
293
|
},
|
|
274
294
|
menu: [
|
|
275
295
|
{
|
|
@@ -302,7 +322,7 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
302
322
|
command: {
|
|
303
323
|
id: 'workbench.profiles.actions.manageProfiles',
|
|
304
324
|
category: Categories.Preferences,
|
|
305
|
-
title: ( localize2(
|
|
325
|
+
title: ( localize2(12938, "Open Profiles (UI)")),
|
|
306
326
|
},
|
|
307
327
|
}));
|
|
308
328
|
return disposables;
|
|
@@ -315,7 +335,7 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
315
335
|
constructor() {
|
|
316
336
|
super({
|
|
317
337
|
id,
|
|
318
|
-
title: ( localize2(
|
|
338
|
+
title: ( localize2(12939, "Export Profile...")),
|
|
319
339
|
category: PROFILES_CATEGORY,
|
|
320
340
|
f1: true,
|
|
321
341
|
});
|
|
@@ -329,7 +349,7 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
329
349
|
command: {
|
|
330
350
|
id,
|
|
331
351
|
title: ( localize2(
|
|
332
|
-
|
|
352
|
+
12940,
|
|
333
353
|
"Export Profile ({0})...",
|
|
334
354
|
that.userDataProfileService.currentProfile.name
|
|
335
355
|
)),
|
|
@@ -343,7 +363,7 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
343
363
|
constructor() {
|
|
344
364
|
super({
|
|
345
365
|
id: 'workbench.profiles.actions.createFromCurrentProfile',
|
|
346
|
-
title: ( localize2(
|
|
366
|
+
title: ( localize2(12941, "Save Current Profile As...")),
|
|
347
367
|
category: PROFILES_CATEGORY,
|
|
348
368
|
f1: true,
|
|
349
369
|
});
|
|
@@ -360,7 +380,7 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
360
380
|
constructor() {
|
|
361
381
|
super({
|
|
362
382
|
id: 'workbench.profiles.actions.createProfile',
|
|
363
|
-
title: ( localize2(
|
|
383
|
+
title: ( localize2(12942, "New Profile...")),
|
|
364
384
|
category: PROFILES_CATEGORY,
|
|
365
385
|
f1: true,
|
|
366
386
|
menu: [
|
|
@@ -383,7 +403,7 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
383
403
|
constructor() {
|
|
384
404
|
super({
|
|
385
405
|
id: 'workbench.profiles.actions.deleteProfile',
|
|
386
|
-
title: ( localize2(
|
|
406
|
+
title: ( localize2(12943, "Delete Profile...")),
|
|
387
407
|
category: PROFILES_CATEGORY,
|
|
388
408
|
f1: true,
|
|
389
409
|
precondition: HAS_PROFILES_CONTEXT,
|
|
@@ -399,11 +419,11 @@ let UserDataProfilesWorkbenchContribution = class UserDataProfilesWorkbenchContr
|
|
|
399
419
|
if (profiles.length) {
|
|
400
420
|
const picks = await quickInputService.pick(( profiles.map(profile => ({
|
|
401
421
|
label: profile.name,
|
|
402
|
-
description: profile.id === userDataProfileService.currentProfile.id ? ( localize(
|
|
422
|
+
description: profile.id === userDataProfileService.currentProfile.id ? ( localize(12944, "Current")) : undefined,
|
|
403
423
|
profile
|
|
404
424
|
}))), {
|
|
405
|
-
title: ( localize(
|
|
406
|
-
placeHolder: ( localize(
|
|
425
|
+
title: ( localize(12945, "Delete Profile...")),
|
|
426
|
+
placeHolder: ( localize(12946, "Select Profiles to Delete")),
|
|
407
427
|
canPickMany: true
|
|
408
428
|
});
|
|
409
429
|
if (picks) {
|
|
@@ -8,7 +8,7 @@ import { PROFILES_CATEGORY } from '@codingame/monaco-vscode-api/vscode/vs/workbe
|
|
|
8
8
|
|
|
9
9
|
class CreateTransientProfileAction extends Action2 {
|
|
10
10
|
static { this.ID = 'workbench.profiles.actions.createTemporaryProfile'; }
|
|
11
|
-
static { this.TITLE = ( localize2(
|
|
11
|
+
static { this.TITLE = ( localize2(12947, "New Window with Temporary Profile")); }
|
|
12
12
|
constructor() {
|
|
13
13
|
super({
|
|
14
14
|
id: CreateTransientProfileAction.ID,
|
|
@@ -26,7 +26,7 @@ registerAction2(class CleanupProfilesAction extends Action2 {
|
|
|
26
26
|
constructor() {
|
|
27
27
|
super({
|
|
28
28
|
id: 'workbench.profiles.actions.cleanupProfiles',
|
|
29
|
-
title: ( localize2(
|
|
29
|
+
title: ( localize2(12948, "Cleanup Profiles")),
|
|
30
30
|
category: Categories.Developer,
|
|
31
31
|
f1: true,
|
|
32
32
|
});
|
|
@@ -39,7 +39,7 @@ registerAction2(class ResetWorkspacesAction extends Action2 {
|
|
|
39
39
|
constructor() {
|
|
40
40
|
super({
|
|
41
41
|
id: 'workbench.profiles.actions.resetWorkspaces',
|
|
42
|
-
title: ( localize2(
|
|
42
|
+
title: ( localize2(12949, "Reset Workspace Profiles Associations")),
|
|
43
43
|
category: Categories.Developer,
|
|
44
44
|
f1: true,
|
|
45
45
|
});
|