@codingame/monaco-vscode-user-data-profile-service-override 18.4.0 → 19.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 +14 -15
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.js +23 -23
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfileActions.js +3 -3
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditor.js +81 -79
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditorModel.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditorModel.js +47 -31
- package/vscode/src/vs/workbench/services/userDataProfile/browser/extensionsResource.js +5 -5
- package/vscode/src/vs/workbench/services/userDataProfile/browser/globalStateResource.js +2 -2
- package/vscode/src/vs/workbench/services/userDataProfile/browser/keybindingsResource.js +2 -2
- package/vscode/src/vs/workbench/services/userDataProfile/browser/mcpProfileResource.d.ts +45 -0
- package/vscode/src/vs/workbench/services/userDataProfile/browser/mcpProfileResource.js +117 -0
- package/vscode/src/vs/workbench/services/userDataProfile/browser/settingsResource.js +2 -2
- package/vscode/src/vs/workbench/services/userDataProfile/browser/snippetsResource.js +3 -3
- package/vscode/src/vs/workbench/services/userDataProfile/browser/tasksResource.js +2 -2
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileImportExportService.js +42 -41
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileInit.js +4 -0
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.js +8 -8
package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditorModel.js
CHANGED
|
@@ -14,21 +14,22 @@ import { Disposable, DisposableStore, toDisposable } from '@codingame/monaco-vsc
|
|
|
14
14
|
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
15
15
|
import { equals } from '@codingame/monaco-vscode-api/vscode/vs/base/common/arrays';
|
|
16
16
|
import { equals as equals$1 } from '@codingame/monaco-vscode-api/vscode/vs/base/common/objects';
|
|
17
|
-
import { EditorModel } from '@codingame/monaco-vscode-
|
|
17
|
+
import { EditorModel } from '@codingame/monaco-vscode-ca445022-b812-53ca-a041-e46c7e0b13de-common/vscode/vs/workbench/common/editor/editorModel';
|
|
18
18
|
import { ExtensionsResourceExportTreeItem, ExtensionsResourceImportTreeItem } from '../../../services/userDataProfile/browser/extensionsResource.js';
|
|
19
19
|
import { SettingsResourceTreeItem, SettingsResource } from '../../../services/userDataProfile/browser/settingsResource.js';
|
|
20
20
|
import { KeybindingsResourceTreeItem, KeybindingsResource } from '../../../services/userDataProfile/browser/keybindingsResource.js';
|
|
21
21
|
import { TasksResourceTreeItem, TasksResource } from '../../../services/userDataProfile/browser/tasksResource.js';
|
|
22
22
|
import { SnippetsResourceTreeItem, SnippetsResource } from '../../../services/userDataProfile/browser/snippetsResource.js';
|
|
23
|
+
import { McpResourceTreeItem, McpProfileResource } from '../../../services/userDataProfile/browser/mcpProfileResource.js';
|
|
23
24
|
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
24
25
|
import { IDialogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service';
|
|
25
|
-
import { InMemoryFileSystemProvider } from '@codingame/monaco-vscode-
|
|
26
|
+
import { InMemoryFileSystemProvider } from '@codingame/monaco-vscode-2f06fe84-148e-5e6b-a7ca-c7989c5f128a-common/vscode/vs/platform/files/common/inMemoryFilesystemProvider';
|
|
26
27
|
import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
|
|
27
28
|
import { generateUuid } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uuid';
|
|
28
29
|
import { RunOnceScheduler, createCancelablePromise } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
29
30
|
import { IHostService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/host/browser/host.service';
|
|
30
31
|
import { CancellationTokenSource, CancellationToken } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
31
|
-
import { API_OPEN_EDITOR_COMMAND_ID } from '@codingame/monaco-vscode-
|
|
32
|
+
import { API_OPEN_EDITOR_COMMAND_ID } from '@codingame/monaco-vscode-dbfe5f85-b426-55ed-a79b-5f811b395762-common/vscode/vs/workbench/browser/parts/editor/editorCommands';
|
|
32
33
|
import { SIDE_GROUP } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService';
|
|
33
34
|
import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
|
|
34
35
|
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
@@ -167,15 +168,15 @@ let AbstractUserDataProfileElement = class AbstractUserDataProfileElement extend
|
|
|
167
168
|
}
|
|
168
169
|
validate() {
|
|
169
170
|
if (!this.name) {
|
|
170
|
-
this.message = ( localize(
|
|
171
|
+
this.message = ( localize(11893, "Profile name is required and must be a non-empty value."));
|
|
171
172
|
return;
|
|
172
173
|
}
|
|
173
174
|
if (this.shouldValidateName() && this.name !== this.getInitialName() && ( this.userDataProfilesService.profiles.some(p => p.name === this.name))) {
|
|
174
|
-
this.message = ( localize(
|
|
175
|
+
this.message = ( localize(11894, "Profile with name {0} already exists.", this.name));
|
|
175
176
|
return;
|
|
176
177
|
}
|
|
177
178
|
if (this.flags && this.flags.settings && this.flags.keybindings && this.flags.tasks && this.flags.snippets && this.flags.extensions) {
|
|
178
|
-
this.message = ( localize(
|
|
179
|
+
this.message = ( localize(11895, "The profile should contain at least one configuration."));
|
|
179
180
|
return;
|
|
180
181
|
}
|
|
181
182
|
this.message = undefined;
|
|
@@ -186,13 +187,15 @@ let AbstractUserDataProfileElement = class AbstractUserDataProfileElement extend
|
|
|
186
187
|
ProfileResourceType.Settings,
|
|
187
188
|
ProfileResourceType.Keybindings,
|
|
188
189
|
ProfileResourceType.Tasks,
|
|
190
|
+
ProfileResourceType.Mcp,
|
|
189
191
|
ProfileResourceType.Snippets,
|
|
190
192
|
ProfileResourceType.Extensions
|
|
191
193
|
];
|
|
192
194
|
return Promise.all(( resourceTypes.map(async (r) => {
|
|
193
195
|
const children = (r === ProfileResourceType.Settings
|
|
194
196
|
|| r === ProfileResourceType.Keybindings
|
|
195
|
-
|| r === ProfileResourceType.Tasks
|
|
197
|
+
|| r === ProfileResourceType.Tasks
|
|
198
|
+
|| r === ProfileResourceType.Mcp) ? await this.getChildrenForResourceType(r) : [];
|
|
196
199
|
return {
|
|
197
200
|
handle: r,
|
|
198
201
|
checkbox: undefined,
|
|
@@ -200,7 +203,7 @@ let AbstractUserDataProfileElement = class AbstractUserDataProfileElement extend
|
|
|
200
203
|
openAction: children.length
|
|
201
204
|
? toAction({
|
|
202
205
|
id: '_open',
|
|
203
|
-
label: ( localize(
|
|
206
|
+
label: ( localize(11896, "Open to the Side")),
|
|
204
207
|
class: ThemeIcon.asClassName(Codicon.goToFile),
|
|
205
208
|
run: () => children[0]?.openAction?.run()
|
|
206
209
|
})
|
|
@@ -229,6 +232,9 @@ let AbstractUserDataProfileElement = class AbstractUserDataProfileElement extend
|
|
|
229
232
|
case ProfileResourceType.Tasks:
|
|
230
233
|
children = await this.instantiationService.createInstance(TasksResourceTreeItem, profile).getChildren();
|
|
231
234
|
break;
|
|
235
|
+
case ProfileResourceType.Mcp:
|
|
236
|
+
children = await this.instantiationService.createInstance(McpResourceTreeItem, profile).getChildren();
|
|
237
|
+
break;
|
|
232
238
|
case ProfileResourceType.Extensions:
|
|
233
239
|
children = await this.instantiationService.createInstance(ExtensionsResourceExportTreeItem, profile).getChildren();
|
|
234
240
|
break;
|
|
@@ -245,7 +251,7 @@ let AbstractUserDataProfileElement = class AbstractUserDataProfileElement extend
|
|
|
245
251
|
icon: child.themeIcon,
|
|
246
252
|
openAction: toAction({
|
|
247
253
|
id: '_openChild',
|
|
248
|
-
label: ( localize(
|
|
254
|
+
label: ( localize(11896, "Open to the Side")),
|
|
249
255
|
class: ThemeIcon.asClassName(Codicon.goToFile),
|
|
250
256
|
run: async () => {
|
|
251
257
|
if (child.parent.type === ProfileResourceType.Extensions) {
|
|
@@ -410,7 +416,7 @@ let UserDataProfileElement = class UserDataProfileElement extends AbstractUserDa
|
|
|
410
416
|
const children = await this.instantiationService.createInstance(ExtensionsResourceExportTreeItem, this.profile).getChildren();
|
|
411
417
|
return (children.map(child => this.toUserDataProfileResourceChildElement(child, undefined, [{
|
|
412
418
|
id: 'applyToAllProfiles',
|
|
413
|
-
label: ( localize(
|
|
419
|
+
label: ( localize(11897, "Apply Extension to all Profiles")),
|
|
414
420
|
checked: child.applicationScoped,
|
|
415
421
|
enabled: true,
|
|
416
422
|
class: '',
|
|
@@ -514,7 +520,8 @@ let NewProfileElement = class NewProfileElement extends AbstractUserDataProfileE
|
|
|
514
520
|
keybindings: true,
|
|
515
521
|
snippets: true,
|
|
516
522
|
tasks: true,
|
|
517
|
-
extensions: true
|
|
523
|
+
extensions: true,
|
|
524
|
+
mcp: true
|
|
518
525
|
} : undefined;
|
|
519
526
|
}
|
|
520
527
|
async initialize() {
|
|
@@ -535,13 +542,14 @@ let NewProfileElement = class NewProfileElement extends AbstractUserDataProfileE
|
|
|
535
542
|
this.setCopyFlag(ProfileResourceType.Tasks, !!this.template.tasks);
|
|
536
543
|
this.setCopyFlag(ProfileResourceType.Snippets, !!this.template.snippets);
|
|
537
544
|
this.setCopyFlag(ProfileResourceType.Extensions, !!this.template.extensions);
|
|
545
|
+
this.setCopyFlag(ProfileResourceType.Mcp, !!this.template.mcp);
|
|
538
546
|
this._onDidChange.fire({ copyFromInfo: true });
|
|
539
547
|
}
|
|
540
548
|
return;
|
|
541
549
|
}
|
|
542
550
|
if (isUserDataProfile(this.copyFrom)) {
|
|
543
551
|
if (this.defaultName === this.name) {
|
|
544
|
-
this.name = this.defaultName = ( localize(
|
|
552
|
+
this.name = this.defaultName = ( localize(11898, "{0} (Copy)", this.copyFrom.name));
|
|
545
553
|
}
|
|
546
554
|
if (this.defaultIcon === this.icon) {
|
|
547
555
|
this.icon = this.defaultIcon = this.copyFrom.icon;
|
|
@@ -551,6 +559,7 @@ let NewProfileElement = class NewProfileElement extends AbstractUserDataProfileE
|
|
|
551
559
|
this.setCopyFlag(ProfileResourceType.Tasks, true);
|
|
552
560
|
this.setCopyFlag(ProfileResourceType.Snippets, true);
|
|
553
561
|
this.setCopyFlag(ProfileResourceType.Extensions, true);
|
|
562
|
+
this.setCopyFlag(ProfileResourceType.Mcp, true);
|
|
554
563
|
this._onDidChange.fire({ copyFromInfo: true });
|
|
555
564
|
return;
|
|
556
565
|
}
|
|
@@ -565,6 +574,7 @@ let NewProfileElement = class NewProfileElement extends AbstractUserDataProfileE
|
|
|
565
574
|
this.setCopyFlag(ProfileResourceType.Tasks, false);
|
|
566
575
|
this.setCopyFlag(ProfileResourceType.Snippets, false);
|
|
567
576
|
this.setCopyFlag(ProfileResourceType.Extensions, false);
|
|
577
|
+
this.setCopyFlag(ProfileResourceType.Mcp, false);
|
|
568
578
|
this._onDidChange.fire({ copyFromInfo: true });
|
|
569
579
|
}
|
|
570
580
|
finally {
|
|
@@ -572,7 +582,7 @@ let NewProfileElement = class NewProfileElement extends AbstractUserDataProfileE
|
|
|
572
582
|
}
|
|
573
583
|
}
|
|
574
584
|
getNewProfileName() {
|
|
575
|
-
const name = ( localize(
|
|
585
|
+
const name = ( localize(11899, "Untitled"));
|
|
576
586
|
const nameRegEx = ( new RegExp(`${name}\\s(\\d+)`));
|
|
577
587
|
let nameIndex = 0;
|
|
578
588
|
for (const profile of this.userDataProfilesService.profiles) {
|
|
@@ -683,6 +693,12 @@ let NewProfileElement = class NewProfileElement extends AbstractUserDataProfileE
|
|
|
683
693
|
return this.getChildrenFromProfile(profile, resourceType);
|
|
684
694
|
}
|
|
685
695
|
return [];
|
|
696
|
+
case ProfileResourceType.Mcp:
|
|
697
|
+
if (profileTemplate.mcp) {
|
|
698
|
+
await this.instantiationService.createInstance(McpProfileResource).apply(profileTemplate.mcp, profile);
|
|
699
|
+
return this.getChildrenFromProfile(profile, resourceType);
|
|
700
|
+
}
|
|
701
|
+
return [];
|
|
686
702
|
case ProfileResourceType.Extensions:
|
|
687
703
|
if (profileTemplate.extensions) {
|
|
688
704
|
const children = await this.instantiationService.createInstance(ExtensionsResourceImportTreeItem, profileTemplate.extensions).getChildren();
|
|
@@ -798,11 +814,11 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
|
|
|
798
814
|
}
|
|
799
815
|
createProfileElement(profile) {
|
|
800
816
|
const disposables = ( new DisposableStore());
|
|
801
|
-
const activateAction = disposables.add(( new Action('userDataProfile.activate', ( localize(
|
|
802
|
-
const copyFromProfileAction = disposables.add(( new Action('userDataProfile.copyFromProfile', ( localize(
|
|
803
|
-
const exportAction = disposables.add(( new Action('userDataProfile.export', ( localize(
|
|
804
|
-
const deleteAction = disposables.add(( new Action('userDataProfile.delete', ( localize(
|
|
805
|
-
const newWindowAction = disposables.add(( new Action('userDataProfile.newWindow', ( localize(
|
|
817
|
+
const activateAction = disposables.add(( new Action('userDataProfile.activate', ( localize(11900, "Use this Profile for Current Window")), ThemeIcon.asClassName(Codicon.check), true, () => this.userDataProfileManagementService.switchProfile(profileElement.profile))));
|
|
818
|
+
const copyFromProfileAction = disposables.add(( new Action('userDataProfile.copyFromProfile', ( localize(11901, "Duplicate...")), ThemeIcon.asClassName(Codicon.copy), true, () => this.createNewProfile(profileElement.profile))));
|
|
819
|
+
const exportAction = disposables.add(( new Action('userDataProfile.export', ( localize(11902, "Export...")), ThemeIcon.asClassName(Codicon.export), true, () => this.userDataProfileImportExportService.exportProfile(profile))));
|
|
820
|
+
const deleteAction = disposables.add(( new Action('userDataProfile.delete', ( localize(11903, "Delete")), ThemeIcon.asClassName(Codicon.trash), true, () => this.removeProfile(profileElement.profile))));
|
|
821
|
+
const newWindowAction = disposables.add(( new Action('userDataProfile.newWindow', ( localize(11904, "Open New Window with this Profile")), ThemeIcon.asClassName(Codicon.emptyWindow), true, () => this.openWindow(profileElement.profile))));
|
|
806
822
|
const primaryActions = [];
|
|
807
823
|
primaryActions.push(activateAction);
|
|
808
824
|
primaryActions.push(newWindowAction);
|
|
@@ -823,11 +839,11 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
|
|
|
823
839
|
const result = await this.dialogService.confirm({
|
|
824
840
|
type: 'info',
|
|
825
841
|
message: ( localize(
|
|
826
|
-
|
|
842
|
+
11905,
|
|
827
843
|
"A new profile is already being created. Do you want to discard it and create a new one?"
|
|
828
844
|
)),
|
|
829
|
-
primaryButton: ( localize(
|
|
830
|
-
cancelButton: ( localize(
|
|
845
|
+
primaryButton: ( localize(11906, "Discard & Create")),
|
|
846
|
+
cancelButton: ( localize(11907, "Cancel"))
|
|
831
847
|
});
|
|
832
848
|
if (!result.confirmed) {
|
|
833
849
|
return;
|
|
@@ -849,24 +865,24 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
|
|
|
849
865
|
disposables.add(toDisposable(() => cancellationTokenSource.dispose(true)));
|
|
850
866
|
const primaryActions = [];
|
|
851
867
|
const secondaryActions = [];
|
|
852
|
-
const createAction = disposables.add(( new Action('userDataProfile.create', ( localize(
|
|
868
|
+
const createAction = disposables.add(( new Action('userDataProfile.create', ( localize(11908, "Create")), undefined, true, () => this.saveNewProfile(false, cancellationTokenSource.token))));
|
|
853
869
|
primaryActions.push(createAction);
|
|
854
870
|
if (isWeb && copyFrom instanceof URI && isProfileURL(copyFrom)) {
|
|
855
|
-
primaryActions.push(disposables.add(( new Action('userDataProfile.createInDesktop', ( localize(
|
|
871
|
+
primaryActions.push(disposables.add(( new Action('userDataProfile.createInDesktop', ( localize(11909, "Create in {0}", this.productService.nameLong)), undefined, true, () => this.openerService.open(copyFrom, { openExternal: true })))));
|
|
856
872
|
}
|
|
857
|
-
const cancelAction = disposables.add(( new Action('userDataProfile.cancel', ( localize(
|
|
873
|
+
const cancelAction = disposables.add(( new Action('userDataProfile.cancel', ( localize(11907, "Cancel")), ThemeIcon.asClassName(Codicon.trash), true, () => this.discardNewProfile())));
|
|
858
874
|
secondaryActions.push(cancelAction);
|
|
859
|
-
const previewProfileAction = disposables.add(( new Action('userDataProfile.preview', ( localize(
|
|
875
|
+
const previewProfileAction = disposables.add(( new Action('userDataProfile.preview', ( localize(11910, "Preview")), ThemeIcon.asClassName(Codicon.openPreview), true, () => this.previewNewProfile(cancellationTokenSource.token))));
|
|
860
876
|
secondaryActions.push(previewProfileAction);
|
|
861
|
-
const exportAction = disposables.add(( new Action('userDataProfile.export', ( localize(
|
|
877
|
+
const exportAction = disposables.add(( new Action('userDataProfile.export', ( localize(11902, "Export...")), ThemeIcon.asClassName(Codicon.export), isUserDataProfile(copyFrom), () => this.exportNewProfile(cancellationTokenSource.token))));
|
|
862
878
|
this.newProfileElement = disposables.add(this.instantiationService.createInstance(NewProfileElement, copyFrom, [primaryActions, secondaryActions], [[cancelAction], [exportAction]]));
|
|
863
879
|
const updateCreateActionLabel = () => {
|
|
864
880
|
if (createAction.enabled) {
|
|
865
881
|
if (this.newProfileElement?.copyFrom && ( this.userDataProfilesService.profiles.some(p => !p.isTransient && p.name === this.newProfileElement?.name))) {
|
|
866
|
-
createAction.label = ( localize(
|
|
882
|
+
createAction.label = ( localize(11911, "Replace"));
|
|
867
883
|
}
|
|
868
884
|
else {
|
|
869
|
-
createAction.label = ( localize(
|
|
885
|
+
createAction.label = ( localize(11908, "Create"));
|
|
870
886
|
}
|
|
871
887
|
}
|
|
872
888
|
};
|
|
@@ -1021,9 +1037,9 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
|
|
|
1021
1037
|
async removeProfile(profile) {
|
|
1022
1038
|
const result = await this.dialogService.confirm({
|
|
1023
1039
|
type: 'info',
|
|
1024
|
-
message: ( localize(
|
|
1025
|
-
primaryButton: ( localize(
|
|
1026
|
-
cancelButton: ( localize(
|
|
1040
|
+
message: ( localize(11912, "Are you sure you want to delete the profile '{0}'?", profile.name)),
|
|
1041
|
+
primaryButton: ( localize(11903, "Delete")),
|
|
1042
|
+
cancelButton: ( localize(11907, "Cancel"))
|
|
1027
1043
|
});
|
|
1028
1044
|
if (result.confirmed) {
|
|
1029
1045
|
await this.userDataProfileManagementService.removeProfile(profile);
|
|
@@ -173,7 +173,7 @@ let ExtensionsResource = class ExtensionsResource {
|
|
|
173
173
|
return;
|
|
174
174
|
}
|
|
175
175
|
progress?.(( localize(
|
|
176
|
-
|
|
176
|
+
13375,
|
|
177
177
|
"Installing extension {0}...",
|
|
178
178
|
installExtensionInfo.extension.displayName ?? installExtensionInfo.extension.identifier.id
|
|
179
179
|
)));
|
|
@@ -266,7 +266,7 @@ class ExtensionsResourceTreeItem {
|
|
|
266
266
|
constructor() {
|
|
267
267
|
this.type = ProfileResourceType.Extensions;
|
|
268
268
|
this.handle = ProfileResourceType.Extensions;
|
|
269
|
-
this.label = { label: ( localize(
|
|
269
|
+
this.label = { label: ( localize(13376, "Extensions")) };
|
|
270
270
|
this.collapsibleState = TreeItemCollapsibleState.Expanded;
|
|
271
271
|
this.contextValue = ProfileResourceType.Extensions;
|
|
272
272
|
this.excludedExtensions = ( new Set());
|
|
@@ -279,7 +279,7 @@ class ExtensionsResourceTreeItem {
|
|
|
279
279
|
handle: e.identifier.id.toLowerCase(),
|
|
280
280
|
parent: this,
|
|
281
281
|
label: { label: e.displayName || e.identifier.id },
|
|
282
|
-
description: e.applicationScoped ? ( localize(
|
|
282
|
+
description: e.applicationScoped ? ( localize(13377, "All Profiles")) : undefined,
|
|
283
283
|
collapsibleState: TreeItemCollapsibleState.None,
|
|
284
284
|
checkbox: that.checkbox ? {
|
|
285
285
|
get isChecked() { return !( that.excludedExtensions.has(e.identifier.id.toLowerCase())); },
|
|
@@ -291,9 +291,9 @@ class ExtensionsResourceTreeItem {
|
|
|
291
291
|
that.excludedExtensions.add(e.identifier.id.toLowerCase());
|
|
292
292
|
}
|
|
293
293
|
},
|
|
294
|
-
tooltip: ( localize(
|
|
294
|
+
tooltip: ( localize(13378, "Select {0} Extension", e.displayName || e.identifier.id)),
|
|
295
295
|
accessibilityInformation: {
|
|
296
|
-
label: ( localize(
|
|
296
|
+
label: ( localize(13378, "Select {0} Extension", e.displayName || e.identifier.id)),
|
|
297
297
|
}
|
|
298
298
|
} : undefined,
|
|
299
299
|
themeIcon: Codicon.extensions,
|
|
@@ -8,7 +8,7 @@ import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform
|
|
|
8
8
|
import { IUriIdentityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
9
9
|
import { ProfileResourceType } from '@codingame/monaco-vscode-api/vscode/vs/platform/userDataProfile/common/userDataProfile';
|
|
10
10
|
import { IUserDataProfileStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/userDataProfile/common/userDataProfileStorageService.service';
|
|
11
|
-
import { API_OPEN_EDITOR_COMMAND_ID } from '@codingame/monaco-vscode-
|
|
11
|
+
import { API_OPEN_EDITOR_COMMAND_ID } from '@codingame/monaco-vscode-dbfe5f85-b426-55ed-a79b-5f811b395762-common/vscode/vs/workbench/browser/parts/editor/editorCommands';
|
|
12
12
|
import { TreeItemCollapsibleState } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/views';
|
|
13
13
|
|
|
14
14
|
let GlobalStateResourceInitializer = class GlobalStateResourceInitializer {
|
|
@@ -86,7 +86,7 @@ class GlobalStateResourceTreeItem {
|
|
|
86
86
|
this.uriIdentityService = uriIdentityService;
|
|
87
87
|
this.type = ProfileResourceType.GlobalState;
|
|
88
88
|
this.handle = ProfileResourceType.GlobalState;
|
|
89
|
-
this.label = { label: ( localize(
|
|
89
|
+
this.label = { label: ( localize(13379, "UI State")) };
|
|
90
90
|
this.collapsibleState = TreeItemCollapsibleState.Collapsed;
|
|
91
91
|
}
|
|
92
92
|
async getChildren() {
|
|
@@ -8,7 +8,7 @@ import { IUserDataProfileService } from '@codingame/monaco-vscode-api/vscode/vs/
|
|
|
8
8
|
import { platform } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
9
9
|
import { TreeItemCollapsibleState } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/views';
|
|
10
10
|
import { ProfileResourceType } from '@codingame/monaco-vscode-api/vscode/vs/platform/userDataProfile/common/userDataProfile';
|
|
11
|
-
import { API_OPEN_EDITOR_COMMAND_ID } from '@codingame/monaco-vscode-
|
|
11
|
+
import { API_OPEN_EDITOR_COMMAND_ID } from '@codingame/monaco-vscode-dbfe5f85-b426-55ed-a79b-5f811b395762-common/vscode/vs/workbench/browser/parts/editor/editorCommands';
|
|
12
12
|
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
13
13
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
14
14
|
import { IUriIdentityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
@@ -80,7 +80,7 @@ let KeybindingsResourceTreeItem = class KeybindingsResourceTreeItem {
|
|
|
80
80
|
this.instantiationService = instantiationService;
|
|
81
81
|
this.type = ProfileResourceType.Keybindings;
|
|
82
82
|
this.handle = ProfileResourceType.Keybindings;
|
|
83
|
-
this.label = { label: ( localize(
|
|
83
|
+
this.label = { label: ( localize(13380, "Keyboard Shortcuts")) };
|
|
84
84
|
this.collapsibleState = TreeItemCollapsibleState.Expanded;
|
|
85
85
|
}
|
|
86
86
|
isFromDefaultProfile() {
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service";
|
|
2
|
+
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
3
|
+
import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
|
|
4
|
+
import { IUriIdentityService } from "@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service";
|
|
5
|
+
import { IUserDataProfile, ProfileResourceType } from "@codingame/monaco-vscode-api/vscode/vs/platform/userDataProfile/common/userDataProfile";
|
|
6
|
+
import { ITreeItemCheckboxState, TreeItemCollapsibleState } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/views";
|
|
7
|
+
import { IProfileResource, IProfileResourceChildTreeItem, IProfileResourceInitializer, IProfileResourceTreeItem } from "@codingame/monaco-vscode-e72c94ca-257a-5b75-8b68-5a5fa3c18255-common/vscode/vs/workbench/services/userDataProfile/common/userDataProfile";
|
|
8
|
+
import { IUserDataProfileService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.service";
|
|
9
|
+
interface IMcpResourceContent {
|
|
10
|
+
readonly mcp: string | null;
|
|
11
|
+
}
|
|
12
|
+
export declare class McpResourceInitializer implements IProfileResourceInitializer {
|
|
13
|
+
private readonly userDataProfileService;
|
|
14
|
+
private readonly fileService;
|
|
15
|
+
private readonly logService;
|
|
16
|
+
constructor(userDataProfileService: IUserDataProfileService, fileService: IFileService, logService: ILogService);
|
|
17
|
+
initialize(content: string): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
export declare class McpProfileResource implements IProfileResource {
|
|
20
|
+
private readonly fileService;
|
|
21
|
+
private readonly logService;
|
|
22
|
+
constructor(fileService: IFileService, logService: ILogService);
|
|
23
|
+
getContent(profile: IUserDataProfile): Promise<string>;
|
|
24
|
+
getMcpResourceContent(profile: IUserDataProfile): Promise<IMcpResourceContent>;
|
|
25
|
+
apply(content: string, profile: IUserDataProfile): Promise<void>;
|
|
26
|
+
private getMcpContent;
|
|
27
|
+
}
|
|
28
|
+
export declare class McpResourceTreeItem implements IProfileResourceTreeItem {
|
|
29
|
+
private readonly profile;
|
|
30
|
+
private readonly uriIdentityService;
|
|
31
|
+
private readonly instantiationService;
|
|
32
|
+
readonly type = ProfileResourceType.Mcp;
|
|
33
|
+
readonly handle = ProfileResourceType.Mcp;
|
|
34
|
+
readonly label: {
|
|
35
|
+
label: string;
|
|
36
|
+
};
|
|
37
|
+
readonly collapsibleState = TreeItemCollapsibleState.Expanded;
|
|
38
|
+
checkbox: ITreeItemCheckboxState | undefined;
|
|
39
|
+
constructor(profile: IUserDataProfile, uriIdentityService: IUriIdentityService, instantiationService: IInstantiationService);
|
|
40
|
+
getChildren(): Promise<IProfileResourceChildTreeItem[]>;
|
|
41
|
+
hasContent(): Promise<boolean>;
|
|
42
|
+
getContent(): Promise<string>;
|
|
43
|
+
isFromDefaultProfile(): boolean;
|
|
44
|
+
}
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { VSBuffer } from '@codingame/monaco-vscode-api/vscode/vs/base/common/buffer';
|
|
4
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
5
|
+
import { FileOperationError, FileOperationResult } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files';
|
|
6
|
+
import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
|
|
7
|
+
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
8
|
+
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
9
|
+
import { IUriIdentityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
10
|
+
import { ProfileResourceType } from '@codingame/monaco-vscode-api/vscode/vs/platform/userDataProfile/common/userDataProfile';
|
|
11
|
+
import { API_OPEN_EDITOR_COMMAND_ID } from '@codingame/monaco-vscode-dbfe5f85-b426-55ed-a79b-5f811b395762-common/vscode/vs/workbench/browser/parts/editor/editorCommands';
|
|
12
|
+
import { TreeItemCollapsibleState } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/views';
|
|
13
|
+
import { IUserDataProfileService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.service';
|
|
14
|
+
|
|
15
|
+
let McpResourceInitializer = class McpResourceInitializer {
|
|
16
|
+
constructor(userDataProfileService, fileService, logService) {
|
|
17
|
+
this.userDataProfileService = userDataProfileService;
|
|
18
|
+
this.fileService = fileService;
|
|
19
|
+
this.logService = logService;
|
|
20
|
+
}
|
|
21
|
+
async initialize(content) {
|
|
22
|
+
const mcpContent = JSON.parse(content);
|
|
23
|
+
if (!mcpContent.mcp) {
|
|
24
|
+
this.logService.info(`Initializing Profile: No MCP servers to apply...`);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
await this.fileService.writeFile(this.userDataProfileService.currentProfile.mcpResource, VSBuffer.fromString(mcpContent.mcp));
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
McpResourceInitializer = ( __decorate([
|
|
31
|
+
( __param(0, IUserDataProfileService)),
|
|
32
|
+
( __param(1, IFileService)),
|
|
33
|
+
( __param(2, ILogService))
|
|
34
|
+
], McpResourceInitializer));
|
|
35
|
+
let McpProfileResource = class McpProfileResource {
|
|
36
|
+
constructor(fileService, logService) {
|
|
37
|
+
this.fileService = fileService;
|
|
38
|
+
this.logService = logService;
|
|
39
|
+
}
|
|
40
|
+
async getContent(profile) {
|
|
41
|
+
const mcpContent = await this.getMcpResourceContent(profile);
|
|
42
|
+
return JSON.stringify(mcpContent);
|
|
43
|
+
}
|
|
44
|
+
async getMcpResourceContent(profile) {
|
|
45
|
+
const mcpContent = await this.getMcpContent(profile);
|
|
46
|
+
return { mcp: mcpContent };
|
|
47
|
+
}
|
|
48
|
+
async apply(content, profile) {
|
|
49
|
+
const mcpContent = JSON.parse(content);
|
|
50
|
+
if (!mcpContent.mcp) {
|
|
51
|
+
this.logService.info(`Importing Profile (${profile.name}): No MCP servers to apply...`);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
await this.fileService.writeFile(profile.mcpResource, VSBuffer.fromString(mcpContent.mcp));
|
|
55
|
+
}
|
|
56
|
+
async getMcpContent(profile) {
|
|
57
|
+
try {
|
|
58
|
+
const content = await this.fileService.readFile(profile.mcpResource);
|
|
59
|
+
return ( content.value.toString());
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
if (error instanceof FileOperationError && error.fileOperationResult === FileOperationResult.FILE_NOT_FOUND) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
throw error;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
McpProfileResource = ( __decorate([
|
|
72
|
+
( __param(0, IFileService)),
|
|
73
|
+
( __param(1, ILogService))
|
|
74
|
+
], McpProfileResource));
|
|
75
|
+
let McpResourceTreeItem = class McpResourceTreeItem {
|
|
76
|
+
constructor(profile, uriIdentityService, instantiationService) {
|
|
77
|
+
this.profile = profile;
|
|
78
|
+
this.uriIdentityService = uriIdentityService;
|
|
79
|
+
this.instantiationService = instantiationService;
|
|
80
|
+
this.type = ProfileResourceType.Mcp;
|
|
81
|
+
this.handle = ProfileResourceType.Mcp;
|
|
82
|
+
this.label = { label: ( localize(13381, "MCP Servers")) };
|
|
83
|
+
this.collapsibleState = TreeItemCollapsibleState.Expanded;
|
|
84
|
+
}
|
|
85
|
+
async getChildren() {
|
|
86
|
+
return [{
|
|
87
|
+
handle: ( this.profile.mcpResource.toString()),
|
|
88
|
+
resourceUri: this.profile.mcpResource,
|
|
89
|
+
collapsibleState: TreeItemCollapsibleState.None,
|
|
90
|
+
parent: this,
|
|
91
|
+
accessibilityInformation: {
|
|
92
|
+
label: this.uriIdentityService.extUri.basename(this.profile.mcpResource)
|
|
93
|
+
},
|
|
94
|
+
command: {
|
|
95
|
+
id: API_OPEN_EDITOR_COMMAND_ID,
|
|
96
|
+
title: '',
|
|
97
|
+
arguments: [this.profile.mcpResource, undefined, undefined]
|
|
98
|
+
}
|
|
99
|
+
}];
|
|
100
|
+
}
|
|
101
|
+
async hasContent() {
|
|
102
|
+
const mcpContent = await this.instantiationService.createInstance(McpProfileResource).getMcpResourceContent(this.profile);
|
|
103
|
+
return mcpContent.mcp !== null;
|
|
104
|
+
}
|
|
105
|
+
async getContent() {
|
|
106
|
+
return this.instantiationService.createInstance(McpProfileResource).getContent(this.profile);
|
|
107
|
+
}
|
|
108
|
+
isFromDefaultProfile() {
|
|
109
|
+
return !this.profile.isDefault && !!this.profile.useDefaultFlags?.mcp;
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
McpResourceTreeItem = ( __decorate([
|
|
113
|
+
( __param(1, IUriIdentityService)),
|
|
114
|
+
( __param(2, IInstantiationService))
|
|
115
|
+
], McpResourceTreeItem));
|
|
116
|
+
|
|
117
|
+
export { McpProfileResource, McpResourceInitializer, McpResourceTreeItem };
|
|
@@ -11,7 +11,7 @@ import { updateIgnoredSettings } from '@codingame/monaco-vscode-e72c94ca-257a-5b
|
|
|
11
11
|
import { IUserDataSyncUtilService } from '@codingame/monaco-vscode-api/vscode/vs/platform/userDataSync/common/userDataSync.service';
|
|
12
12
|
import { TreeItemCollapsibleState } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/views';
|
|
13
13
|
import { ProfileResourceType } from '@codingame/monaco-vscode-api/vscode/vs/platform/userDataProfile/common/userDataProfile';
|
|
14
|
-
import { API_OPEN_EDITOR_COMMAND_ID } from '@codingame/monaco-vscode-
|
|
14
|
+
import { API_OPEN_EDITOR_COMMAND_ID } from '@codingame/monaco-vscode-dbfe5f85-b426-55ed-a79b-5f811b395762-common/vscode/vs/workbench/browser/parts/editor/editorCommands';
|
|
15
15
|
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
16
16
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
17
17
|
import { IUriIdentityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
@@ -101,7 +101,7 @@ let SettingsResourceTreeItem = class SettingsResourceTreeItem {
|
|
|
101
101
|
this.instantiationService = instantiationService;
|
|
102
102
|
this.type = ProfileResourceType.Settings;
|
|
103
103
|
this.handle = ProfileResourceType.Settings;
|
|
104
|
-
this.label = { label: ( localize(
|
|
104
|
+
this.label = { label: ( localize(13382, "Settings")) };
|
|
105
105
|
this.collapsibleState = TreeItemCollapsibleState.Expanded;
|
|
106
106
|
}
|
|
107
107
|
async getChildren() {
|
|
@@ -8,7 +8,7 @@ import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/fi
|
|
|
8
8
|
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
9
9
|
import { IUriIdentityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
10
10
|
import { ProfileResourceType } from '@codingame/monaco-vscode-api/vscode/vs/platform/userDataProfile/common/userDataProfile';
|
|
11
|
-
import { API_OPEN_EDITOR_COMMAND_ID } from '@codingame/monaco-vscode-
|
|
11
|
+
import { API_OPEN_EDITOR_COMMAND_ID } from '@codingame/monaco-vscode-dbfe5f85-b426-55ed-a79b-5f811b395762-common/vscode/vs/workbench/browser/parts/editor/editorCommands';
|
|
12
12
|
import { TreeItemCollapsibleState } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/views';
|
|
13
13
|
import { IUserDataProfileService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.service';
|
|
14
14
|
|
|
@@ -93,7 +93,7 @@ let SnippetsResourceTreeItem = class SnippetsResourceTreeItem {
|
|
|
93
93
|
this.instantiationService = instantiationService;
|
|
94
94
|
this.uriIdentityService = uriIdentityService;
|
|
95
95
|
this.type = ProfileResourceType.Snippets;
|
|
96
|
-
this.label = { label: ( localize(
|
|
96
|
+
this.label = { label: ( localize(13383, "Snippets")) };
|
|
97
97
|
this.collapsibleState = TreeItemCollapsibleState.Collapsed;
|
|
98
98
|
this.excludedSnippets = ( new ResourceSet());
|
|
99
99
|
this.handle = ( this.profile.snippetsHome.toString());
|
|
@@ -121,7 +121,7 @@ let SnippetsResourceTreeItem = class SnippetsResourceTreeItem {
|
|
|
121
121
|
},
|
|
122
122
|
accessibilityInformation: {
|
|
123
123
|
label: ( localize(
|
|
124
|
-
|
|
124
|
+
13384,
|
|
125
125
|
"Select Snippet {0}",
|
|
126
126
|
this.uriIdentityService.extUri.basename(resource)
|
|
127
127
|
)),
|
|
@@ -8,7 +8,7 @@ import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/pl
|
|
|
8
8
|
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
9
9
|
import { IUriIdentityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
10
10
|
import { ProfileResourceType } from '@codingame/monaco-vscode-api/vscode/vs/platform/userDataProfile/common/userDataProfile';
|
|
11
|
-
import { API_OPEN_EDITOR_COMMAND_ID } from '@codingame/monaco-vscode-
|
|
11
|
+
import { API_OPEN_EDITOR_COMMAND_ID } from '@codingame/monaco-vscode-dbfe5f85-b426-55ed-a79b-5f811b395762-common/vscode/vs/workbench/browser/parts/editor/editorCommands';
|
|
12
12
|
import { TreeItemCollapsibleState } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/views';
|
|
13
13
|
import { IUserDataProfileService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.service';
|
|
14
14
|
|
|
@@ -79,7 +79,7 @@ let TasksResourceTreeItem = class TasksResourceTreeItem {
|
|
|
79
79
|
this.instantiationService = instantiationService;
|
|
80
80
|
this.type = ProfileResourceType.Tasks;
|
|
81
81
|
this.handle = ProfileResourceType.Tasks;
|
|
82
|
-
this.label = { label: ( localize(
|
|
82
|
+
this.label = { label: ( localize(13385, "Tasks")) };
|
|
83
83
|
this.collapsibleState = TreeItemCollapsibleState.Expanded;
|
|
84
84
|
}
|
|
85
85
|
async getChildren() {
|