@codingame/monaco-vscode-user-data-profile-service-override 17.2.0 → 18.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 +15 -14
- package/vscode/src/vs/platform/userDataProfile/browser/userDataProfile.js +1 -1
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.js +24 -24
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfileActions.js +5 -5
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditor.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditor.js +91 -91
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditorModel.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditorModel.js +53 -42
- package/vscode/src/vs/workbench/services/userDataProfile/browser/extensionsResource.js +6 -6
- 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/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 +41 -41
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.js +8 -8
- package/vscode/src/vs/workbench/services/userDataSync/browser/userDataSyncInit.js +1 -1
package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditorModel.js
CHANGED
|
@@ -14,7 +14,7 @@ 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-924e8f00-6faf-5059-b518-e43427d29ab3-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';
|
|
@@ -22,7 +22,7 @@ import { TasksResourceTreeItem, TasksResource } from '../../../services/userData
|
|
|
22
22
|
import { SnippetsResourceTreeItem, SnippetsResource } from '../../../services/userDataProfile/browser/snippetsResource.js';
|
|
23
23
|
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
24
24
|
import { IDialogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service';
|
|
25
|
-
import { InMemoryFileSystemProvider } from '@codingame/monaco-vscode-
|
|
25
|
+
import { InMemoryFileSystemProvider } from '@codingame/monaco-vscode-8a9062f2-d169-567b-848e-a2530c97ea18-common/vscode/vs/platform/files/common/inMemoryFilesystemProvider';
|
|
26
26
|
import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
|
|
27
27
|
import { generateUuid } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uuid';
|
|
28
28
|
import { RunOnceScheduler, createCancelablePromise } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
@@ -167,15 +167,15 @@ let AbstractUserDataProfileElement = class AbstractUserDataProfileElement extend
|
|
|
167
167
|
}
|
|
168
168
|
validate() {
|
|
169
169
|
if (!this.name) {
|
|
170
|
-
this.message = ( localize(
|
|
170
|
+
this.message = ( localize(11605, "Profile name is required and must be a non-empty value."));
|
|
171
171
|
return;
|
|
172
172
|
}
|
|
173
173
|
if (this.shouldValidateName() && this.name !== this.getInitialName() && ( this.userDataProfilesService.profiles.some(p => p.name === this.name))) {
|
|
174
|
-
this.message = ( localize(
|
|
174
|
+
this.message = ( localize(11606, "Profile with name {0} already exists.", this.name));
|
|
175
175
|
return;
|
|
176
176
|
}
|
|
177
177
|
if (this.flags && this.flags.settings && this.flags.keybindings && this.flags.tasks && this.flags.snippets && this.flags.extensions) {
|
|
178
|
-
this.message = ( localize(
|
|
178
|
+
this.message = ( localize(11607, "The profile should contain at least one configuration."));
|
|
179
179
|
return;
|
|
180
180
|
}
|
|
181
181
|
this.message = undefined;
|
|
@@ -200,7 +200,7 @@ let AbstractUserDataProfileElement = class AbstractUserDataProfileElement extend
|
|
|
200
200
|
openAction: children.length
|
|
201
201
|
? toAction({
|
|
202
202
|
id: '_open',
|
|
203
|
-
label: ( localize(
|
|
203
|
+
label: ( localize(11608, "Open to the Side")),
|
|
204
204
|
class: ThemeIcon.asClassName(Codicon.goToFile),
|
|
205
205
|
run: () => children[0]?.openAction?.run()
|
|
206
206
|
})
|
|
@@ -245,7 +245,7 @@ let AbstractUserDataProfileElement = class AbstractUserDataProfileElement extend
|
|
|
245
245
|
icon: child.themeIcon,
|
|
246
246
|
openAction: toAction({
|
|
247
247
|
id: '_openChild',
|
|
248
|
-
label: ( localize(
|
|
248
|
+
label: ( localize(11608, "Open to the Side")),
|
|
249
249
|
class: ThemeIcon.asClassName(Codicon.goToFile),
|
|
250
250
|
run: async () => {
|
|
251
251
|
if (child.parent.type === ProfileResourceType.Extensions) {
|
|
@@ -410,7 +410,7 @@ let UserDataProfileElement = class UserDataProfileElement extends AbstractUserDa
|
|
|
410
410
|
const children = await this.instantiationService.createInstance(ExtensionsResourceExportTreeItem, this.profile).getChildren();
|
|
411
411
|
return (children.map(child => this.toUserDataProfileResourceChildElement(child, undefined, [{
|
|
412
412
|
id: 'applyToAllProfiles',
|
|
413
|
-
label: ( localize(
|
|
413
|
+
label: ( localize(11609, "Apply Extension to all Profiles")),
|
|
414
414
|
checked: child.applicationScoped,
|
|
415
415
|
enabled: true,
|
|
416
416
|
class: '',
|
|
@@ -446,15 +446,15 @@ UserDataProfileElement = ( __decorate([
|
|
|
446
446
|
const USER_DATA_PROFILE_TEMPLATE_PREVIEW_SCHEME = 'userdataprofiletemplatepreview';
|
|
447
447
|
let NewProfileElement = class NewProfileElement extends AbstractUserDataProfileElement {
|
|
448
448
|
get copyFromTemplates() { return this._copyFromTemplates; }
|
|
449
|
-
constructor(
|
|
450
|
-
super(
|
|
449
|
+
constructor(copyFrom, titleButtons, actions, userDataProfileImportExportService, userDataProfileManagementService, userDataProfilesService, commandService, workspaceContextService, hostService, uriIdentityService, fileService, extensionManagementService, instantiationService) {
|
|
450
|
+
super('', undefined, undefined, undefined, false, userDataProfileManagementService, userDataProfilesService, commandService, workspaceContextService, hostService, uriIdentityService, fileService, extensionManagementService, instantiationService);
|
|
451
451
|
this.titleButtons = titleButtons;
|
|
452
452
|
this.actions = actions;
|
|
453
453
|
this.userDataProfileImportExportService = userDataProfileImportExportService;
|
|
454
454
|
this._copyFromTemplates = ( new ResourceMap());
|
|
455
455
|
this.template = null;
|
|
456
456
|
this.previewProfileWatchDisposables = this._register(( new DisposableStore()));
|
|
457
|
-
this.defaultName =
|
|
457
|
+
this.name = this.defaultName = this.getNewProfileName();
|
|
458
458
|
this._copyFrom = copyFrom;
|
|
459
459
|
this._copyFlags = this.getCopyFlagsFrom(copyFrom);
|
|
460
460
|
this.initialize();
|
|
@@ -541,7 +541,7 @@ let NewProfileElement = class NewProfileElement extends AbstractUserDataProfileE
|
|
|
541
541
|
}
|
|
542
542
|
if (isUserDataProfile(this.copyFrom)) {
|
|
543
543
|
if (this.defaultName === this.name) {
|
|
544
|
-
this.name = this.defaultName = ( localize(
|
|
544
|
+
this.name = this.defaultName = ( localize(11610, "{0} (Copy)", this.copyFrom.name));
|
|
545
545
|
}
|
|
546
546
|
if (this.defaultIcon === this.icon) {
|
|
547
547
|
this.icon = this.defaultIcon = this.copyFrom.icon;
|
|
@@ -555,7 +555,7 @@ let NewProfileElement = class NewProfileElement extends AbstractUserDataProfileE
|
|
|
555
555
|
return;
|
|
556
556
|
}
|
|
557
557
|
if (this.defaultName === this.name) {
|
|
558
|
-
this.name = this.defaultName = (
|
|
558
|
+
this.name = this.defaultName = this.getNewProfileName();
|
|
559
559
|
}
|
|
560
560
|
if (this.defaultIcon === this.icon) {
|
|
561
561
|
this.icon = this.defaultIcon = undefined;
|
|
@@ -571,6 +571,17 @@ let NewProfileElement = class NewProfileElement extends AbstractUserDataProfileE
|
|
|
571
571
|
this.disabled = false;
|
|
572
572
|
}
|
|
573
573
|
}
|
|
574
|
+
getNewProfileName() {
|
|
575
|
+
const name = ( localize(11611, "Untitled"));
|
|
576
|
+
const nameRegEx = ( new RegExp(`${name}\\s(\\d+)`));
|
|
577
|
+
let nameIndex = 0;
|
|
578
|
+
for (const profile of this.userDataProfilesService.profiles) {
|
|
579
|
+
const matches = nameRegEx.exec(profile.name);
|
|
580
|
+
const index = matches ? parseInt(matches[1]) : 0;
|
|
581
|
+
nameIndex = index > nameIndex ? index : nameIndex;
|
|
582
|
+
}
|
|
583
|
+
return `${name} ${nameIndex + 1}`;
|
|
584
|
+
}
|
|
574
585
|
async resolveTemplate(uri) {
|
|
575
586
|
if (!this.templatePromise) {
|
|
576
587
|
this.templatePromise = createCancelablePromise(async (token) => {
|
|
@@ -697,16 +708,16 @@ let NewProfileElement = class NewProfileElement extends AbstractUserDataProfileE
|
|
|
697
708
|
}
|
|
698
709
|
};
|
|
699
710
|
NewProfileElement = ( __decorate([
|
|
700
|
-
( __param(
|
|
701
|
-
( __param(
|
|
702
|
-
( __param(
|
|
703
|
-
( __param(
|
|
704
|
-
( __param(
|
|
705
|
-
( __param(
|
|
706
|
-
( __param(
|
|
707
|
-
( __param(
|
|
708
|
-
( __param(
|
|
709
|
-
( __param(
|
|
711
|
+
( __param(3, IUserDataProfileImportExportService)),
|
|
712
|
+
( __param(4, IUserDataProfileManagementService)),
|
|
713
|
+
( __param(5, IUserDataProfilesService)),
|
|
714
|
+
( __param(6, ICommandService)),
|
|
715
|
+
( __param(7, IWorkspaceContextService)),
|
|
716
|
+
( __param(8, IHostService)),
|
|
717
|
+
( __param(9, IUriIdentityService)),
|
|
718
|
+
( __param(10, IFileService)),
|
|
719
|
+
( __param(11, IWorkbenchExtensionManagementService)),
|
|
720
|
+
( __param(12, IInstantiationService))
|
|
710
721
|
], NewProfileElement));
|
|
711
722
|
let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends EditorModel {
|
|
712
723
|
static { UserDataProfilesEditorModel_1 = this; }
|
|
@@ -787,11 +798,11 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
|
|
|
787
798
|
}
|
|
788
799
|
createProfileElement(profile) {
|
|
789
800
|
const disposables = ( new DisposableStore());
|
|
790
|
-
const activateAction = disposables.add(( new Action('userDataProfile.activate', ( localize(
|
|
791
|
-
const copyFromProfileAction = disposables.add(( new Action('userDataProfile.copyFromProfile', ( localize(
|
|
792
|
-
const exportAction = disposables.add(( new Action('userDataProfile.export', ( localize(
|
|
793
|
-
const deleteAction = disposables.add(( new Action('userDataProfile.delete', ( localize(
|
|
794
|
-
const newWindowAction = disposables.add(( new Action('userDataProfile.newWindow', ( localize(
|
|
801
|
+
const activateAction = disposables.add(( new Action('userDataProfile.activate', ( localize(11612, "Use this Profile for Current Window")), ThemeIcon.asClassName(Codicon.check), true, () => this.userDataProfileManagementService.switchProfile(profileElement.profile))));
|
|
802
|
+
const copyFromProfileAction = disposables.add(( new Action('userDataProfile.copyFromProfile', ( localize(11613, "Duplicate...")), ThemeIcon.asClassName(Codicon.copy), true, () => this.createNewProfile(profileElement.profile))));
|
|
803
|
+
const exportAction = disposables.add(( new Action('userDataProfile.export', ( localize(11614, "Export...")), ThemeIcon.asClassName(Codicon.export), true, () => this.userDataProfileImportExportService.exportProfile(profile))));
|
|
804
|
+
const deleteAction = disposables.add(( new Action('userDataProfile.delete', ( localize(11615, "Delete")), ThemeIcon.asClassName(Codicon.trash), true, () => this.removeProfile(profileElement.profile))));
|
|
805
|
+
const newWindowAction = disposables.add(( new Action('userDataProfile.newWindow', ( localize(11616, "Open New Window with this Profile")), ThemeIcon.asClassName(Codicon.emptyWindow), true, () => this.openWindow(profileElement.profile))));
|
|
795
806
|
const primaryActions = [];
|
|
796
807
|
primaryActions.push(activateAction);
|
|
797
808
|
primaryActions.push(newWindowAction);
|
|
@@ -812,11 +823,11 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
|
|
|
812
823
|
const result = await this.dialogService.confirm({
|
|
813
824
|
type: 'info',
|
|
814
825
|
message: ( localize(
|
|
815
|
-
|
|
826
|
+
11617,
|
|
816
827
|
"A new profile is already being created. Do you want to discard it and create a new one?"
|
|
817
828
|
)),
|
|
818
|
-
primaryButton: ( localize(
|
|
819
|
-
cancelButton: ( localize(
|
|
829
|
+
primaryButton: ( localize(11618, "Discard & Create")),
|
|
830
|
+
cancelButton: ( localize(11619, "Cancel"))
|
|
820
831
|
});
|
|
821
832
|
if (!result.confirmed) {
|
|
822
833
|
return;
|
|
@@ -838,24 +849,24 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
|
|
|
838
849
|
disposables.add(toDisposable(() => cancellationTokenSource.dispose(true)));
|
|
839
850
|
const primaryActions = [];
|
|
840
851
|
const secondaryActions = [];
|
|
841
|
-
const createAction = disposables.add(( new Action('userDataProfile.create', ( localize(
|
|
852
|
+
const createAction = disposables.add(( new Action('userDataProfile.create', ( localize(11620, "Create")), undefined, true, () => this.saveNewProfile(false, cancellationTokenSource.token))));
|
|
842
853
|
primaryActions.push(createAction);
|
|
843
854
|
if (isWeb && copyFrom instanceof URI && isProfileURL(copyFrom)) {
|
|
844
|
-
primaryActions.push(disposables.add(( new Action('userDataProfile.createInDesktop', ( localize(
|
|
855
|
+
primaryActions.push(disposables.add(( new Action('userDataProfile.createInDesktop', ( localize(11621, "Create in {0}", this.productService.nameLong)), undefined, true, () => this.openerService.open(copyFrom, { openExternal: true })))));
|
|
845
856
|
}
|
|
846
|
-
const cancelAction = disposables.add(( new Action('userDataProfile.cancel', ( localize(
|
|
857
|
+
const cancelAction = disposables.add(( new Action('userDataProfile.cancel', ( localize(11619, "Cancel")), ThemeIcon.asClassName(Codicon.trash), true, () => this.discardNewProfile())));
|
|
847
858
|
secondaryActions.push(cancelAction);
|
|
848
|
-
const previewProfileAction = disposables.add(( new Action('userDataProfile.preview', ( localize(
|
|
859
|
+
const previewProfileAction = disposables.add(( new Action('userDataProfile.preview', ( localize(11622, "Preview")), ThemeIcon.asClassName(Codicon.openPreview), true, () => this.previewNewProfile(cancellationTokenSource.token))));
|
|
849
860
|
secondaryActions.push(previewProfileAction);
|
|
850
|
-
const exportAction = disposables.add(( new Action('userDataProfile.export', ( localize(
|
|
851
|
-
this.newProfileElement = disposables.add(this.instantiationService.createInstance(NewProfileElement, copyFrom
|
|
861
|
+
const exportAction = disposables.add(( new Action('userDataProfile.export', ( localize(11614, "Export...")), ThemeIcon.asClassName(Codicon.export), isUserDataProfile(copyFrom), () => this.exportNewProfile(cancellationTokenSource.token))));
|
|
862
|
+
this.newProfileElement = disposables.add(this.instantiationService.createInstance(NewProfileElement, copyFrom, [primaryActions, secondaryActions], [[cancelAction], [exportAction]]));
|
|
852
863
|
const updateCreateActionLabel = () => {
|
|
853
864
|
if (createAction.enabled) {
|
|
854
865
|
if (this.newProfileElement?.copyFrom && ( this.userDataProfilesService.profiles.some(p => !p.isTransient && p.name === this.newProfileElement?.name))) {
|
|
855
|
-
createAction.label = ( localize(
|
|
866
|
+
createAction.label = ( localize(11623, "Replace"));
|
|
856
867
|
}
|
|
857
868
|
else {
|
|
858
|
-
createAction.label = ( localize(
|
|
869
|
+
createAction.label = ( localize(11620, "Create"));
|
|
859
870
|
}
|
|
860
871
|
}
|
|
861
872
|
};
|
|
@@ -1010,9 +1021,9 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
|
|
|
1010
1021
|
async removeProfile(profile) {
|
|
1011
1022
|
const result = await this.dialogService.confirm({
|
|
1012
1023
|
type: 'info',
|
|
1013
|
-
message: ( localize(
|
|
1014
|
-
primaryButton: ( localize(
|
|
1015
|
-
cancelButton: ( localize(
|
|
1024
|
+
message: ( localize(11624, "Are you sure you want to delete the profile '{0}'?", profile.name)),
|
|
1025
|
+
primaryButton: ( localize(11615, "Delete")),
|
|
1026
|
+
cancelButton: ( localize(11619, "Cancel"))
|
|
1016
1027
|
});
|
|
1017
1028
|
if (result.confirmed) {
|
|
1018
1029
|
await this.userDataProfileManagementService.removeProfile(profile);
|
|
@@ -4,7 +4,7 @@ import { CancellationToken } from '@codingame/monaco-vscode-api/vscode/vs/base/c
|
|
|
4
4
|
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
5
5
|
import { DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
6
6
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
7
|
-
import { GlobalExtensionEnablementService } from '@codingame/monaco-vscode-
|
|
7
|
+
import { GlobalExtensionEnablementService } from '@codingame/monaco-vscode-249dc928-1da3-51c1-82d0-45e0ba9d08a1-common/vscode/vs/platform/extensionManagement/common/extensionEnablementService';
|
|
8
8
|
import { EXTENSION_INSTALL_SKIP_PUBLISHER_TRUST_CONTEXT, EXTENSION_INSTALL_SKIP_WALKTHROUGH_CONTEXT } from '@codingame/monaco-vscode-api/vscode/vs/platform/extensionManagement/common/extensionManagement';
|
|
9
9
|
import { IExtensionManagementService, IExtensionGalleryService, IGlobalExtensionEnablementService } from '@codingame/monaco-vscode-api/vscode/vs/platform/extensionManagement/common/extensionManagement.service';
|
|
10
10
|
import { areSameExtensions } from '@codingame/monaco-vscode-api/vscode/vs/platform/extensionManagement/common/extensionManagementUtil';
|
|
@@ -173,7 +173,7 @@ let ExtensionsResource = class ExtensionsResource {
|
|
|
173
173
|
return;
|
|
174
174
|
}
|
|
175
175
|
progress?.(( localize(
|
|
176
|
-
|
|
176
|
+
13083,
|
|
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(13084, "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(13085, "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(13086, "Select {0} Extension", e.displayName || e.identifier.id)),
|
|
295
295
|
accessibilityInformation: {
|
|
296
|
-
label: ( localize(
|
|
296
|
+
label: ( localize(13086, "Select {0} Extension", e.displayName || e.identifier.id)),
|
|
297
297
|
}
|
|
298
298
|
} : undefined,
|
|
299
299
|
themeIcon: Codicon.extensions,
|
|
@@ -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(13087, "UI State")) };
|
|
90
90
|
this.collapsibleState = TreeItemCollapsibleState.Collapsed;
|
|
91
91
|
}
|
|
92
92
|
async getChildren() {
|
|
@@ -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(13088, "Keyboard Shortcuts")) };
|
|
84
84
|
this.collapsibleState = TreeItemCollapsibleState.Expanded;
|
|
85
85
|
}
|
|
86
86
|
isFromDefaultProfile() {
|
|
@@ -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(13089, "Settings")) };
|
|
105
105
|
this.collapsibleState = TreeItemCollapsibleState.Expanded;
|
|
106
106
|
}
|
|
107
107
|
async getChildren() {
|
|
@@ -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(13090, "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
|
+
13091,
|
|
125
125
|
"Select Snippet {0}",
|
|
126
126
|
this.uriIdentityService.extUri.basename(resource)
|
|
127
127
|
)),
|
|
@@ -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(13092, "Tasks")) };
|
|
83
83
|
this.collapsibleState = TreeItemCollapsibleState.Expanded;
|
|
84
84
|
}
|
|
85
85
|
async getChildren() {
|
|
@@ -21,7 +21,7 @@ import { SnippetsResource, SnippetsResourceTreeItem } from './snippetsResource.j
|
|
|
21
21
|
import { TasksResource, TasksResourceTreeItem } from './tasksResource.js';
|
|
22
22
|
import { ExtensionsResource, ExtensionsResourceTreeItem, ExtensionsResourceExportTreeItem } from './extensionsResource.js';
|
|
23
23
|
import { GlobalStateResource, GlobalStateResourceTreeItem, GlobalStateResourceExportTreeItem } from './globalStateResource.js';
|
|
24
|
-
import { InMemoryFileSystemProvider } from '@codingame/monaco-vscode-
|
|
24
|
+
import { InMemoryFileSystemProvider } from '@codingame/monaco-vscode-8a9062f2-d169-567b-848e-a2530c97ea18-common/vscode/vs/platform/files/common/inMemoryFilesystemProvider';
|
|
25
25
|
import { IOpenerService } from '@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service';
|
|
26
26
|
import { ProgressLocation } from '@codingame/monaco-vscode-api/vscode/vs/platform/progress/common/progress';
|
|
27
27
|
import { IProgressService } from '@codingame/monaco-vscode-api/vscode/vs/platform/progress/common/progress.service';
|
|
@@ -90,7 +90,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
90
90
|
sticky: true,
|
|
91
91
|
cancellable: true,
|
|
92
92
|
}, async (progress) => {
|
|
93
|
-
const reportProgress = (message) => progress.report({ message: ( localize(
|
|
93
|
+
const reportProgress = (message) => progress.report({ message: ( localize(13093, "Create Profile: {0}", message)) });
|
|
94
94
|
creationPromise = createCancelablePromise(async (token) => {
|
|
95
95
|
const userDataProfilesExportState = disposables.add(this.instantiationService.createInstance(UserDataProfileExportState, from, { ...options?.resourceTypeFlags, extensions: false }));
|
|
96
96
|
const profileTemplate = await userDataProfilesExportState.getProfileTemplate(options.name ?? from.name, options?.icon);
|
|
@@ -106,7 +106,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
106
106
|
try {
|
|
107
107
|
await creationPromise;
|
|
108
108
|
if (profile && (options?.resourceTypeFlags?.extensions ?? true)) {
|
|
109
|
-
reportProgress(( localize(
|
|
109
|
+
reportProgress(( localize(13094, "Installing Extensions...")));
|
|
110
110
|
await this.instantiationService.createInstance(ExtensionsResource).copy(from, profile, false);
|
|
111
111
|
}
|
|
112
112
|
}
|
|
@@ -130,7 +130,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
130
130
|
sticky: true,
|
|
131
131
|
cancellable: true,
|
|
132
132
|
}, async (progress) => {
|
|
133
|
-
const reportProgress = (message) => progress.report({ message: ( localize(
|
|
133
|
+
const reportProgress = (message) => progress.report({ message: ( localize(13093, "Create Profile: {0}", message)) });
|
|
134
134
|
creationPromise = createCancelablePromise(async (token) => {
|
|
135
135
|
profile = await this.getProfileToImport({ ...profileTemplate, name: options.name ?? profileTemplate.name }, !!options.transient, options);
|
|
136
136
|
if (!profile) {
|
|
@@ -155,42 +155,42 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
155
155
|
}
|
|
156
156
|
async applyProfileTemplate(profileTemplate, profile, options, reportProgress, token) {
|
|
157
157
|
if (profileTemplate.settings && (options.resourceTypeFlags?.settings ?? true) && !profile.useDefaultFlags?.settings) {
|
|
158
|
-
reportProgress(( localize(
|
|
158
|
+
reportProgress(( localize(13095, "Creating Settings...")));
|
|
159
159
|
await this.instantiationService.createInstance(SettingsResource).apply(profileTemplate.settings, profile);
|
|
160
160
|
}
|
|
161
161
|
if (token.isCancellationRequested) {
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
164
|
if (profileTemplate.keybindings && (options.resourceTypeFlags?.keybindings ?? true) && !profile.useDefaultFlags?.keybindings) {
|
|
165
|
-
reportProgress(( localize(
|
|
165
|
+
reportProgress(( localize(13096, "Creating Keyboard Shortcuts...")));
|
|
166
166
|
await this.instantiationService.createInstance(KeybindingsResource).apply(profileTemplate.keybindings, profile);
|
|
167
167
|
}
|
|
168
168
|
if (token.isCancellationRequested) {
|
|
169
169
|
return;
|
|
170
170
|
}
|
|
171
171
|
if (profileTemplate.tasks && (options.resourceTypeFlags?.tasks ?? true) && !profile.useDefaultFlags?.tasks) {
|
|
172
|
-
reportProgress(( localize(
|
|
172
|
+
reportProgress(( localize(13097, "Creating Tasks...")));
|
|
173
173
|
await this.instantiationService.createInstance(TasksResource).apply(profileTemplate.tasks, profile);
|
|
174
174
|
}
|
|
175
175
|
if (token.isCancellationRequested) {
|
|
176
176
|
return;
|
|
177
177
|
}
|
|
178
178
|
if (profileTemplate.snippets && (options.resourceTypeFlags?.snippets ?? true) && !profile.useDefaultFlags?.snippets) {
|
|
179
|
-
reportProgress(( localize(
|
|
179
|
+
reportProgress(( localize(13098, "Creating Snippets...")));
|
|
180
180
|
await this.instantiationService.createInstance(SnippetsResource).apply(profileTemplate.snippets, profile);
|
|
181
181
|
}
|
|
182
182
|
if (token.isCancellationRequested) {
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
185
|
if (profileTemplate.globalState && !profile.useDefaultFlags?.globalState) {
|
|
186
|
-
reportProgress(( localize(
|
|
186
|
+
reportProgress(( localize(13099, "Applying UI State...")));
|
|
187
187
|
await this.instantiationService.createInstance(GlobalStateResource).apply(profileTemplate.globalState, profile);
|
|
188
188
|
}
|
|
189
189
|
if (token.isCancellationRequested) {
|
|
190
190
|
return;
|
|
191
191
|
}
|
|
192
192
|
if (profileTemplate.extensions && (options.resourceTypeFlags?.extensions ?? true) && !profile.useDefaultFlags?.extensions) {
|
|
193
|
-
reportProgress(( localize(
|
|
193
|
+
reportProgress(( localize(13094, "Installing Extensions...")));
|
|
194
194
|
await this.instantiationService.createInstance(ExtensionsResource).apply(profileTemplate.extensions, profile, reportProgress, token);
|
|
195
195
|
}
|
|
196
196
|
}
|
|
@@ -207,18 +207,18 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
207
207
|
async createTroubleshootProfile() {
|
|
208
208
|
const userDataProfilesExportState = this.instantiationService.createInstance(UserDataProfileExportState, this.userDataProfileService.currentProfile, undefined);
|
|
209
209
|
try {
|
|
210
|
-
const profileTemplate = await userDataProfilesExportState.getProfileTemplate(( localize(
|
|
210
|
+
const profileTemplate = await userDataProfilesExportState.getProfileTemplate(( localize(13100, "Troubleshoot Issue")), undefined);
|
|
211
211
|
await this.progressService.withProgress({
|
|
212
212
|
location: ProgressLocation.Notification,
|
|
213
213
|
delay: 1000,
|
|
214
214
|
sticky: true,
|
|
215
215
|
}, async (progress) => {
|
|
216
|
-
const reportProgress = (message) => progress.report({ message: ( localize(
|
|
216
|
+
const reportProgress = (message) => progress.report({ message: ( localize(13101, "Setting up Troubleshoot Profile: {0}", message)) });
|
|
217
217
|
const profile = await this.doCreateProfile(profileTemplate, true, false, { useDefaultFlags: this.userDataProfileService.currentProfile.useDefaultFlags }, reportProgress);
|
|
218
218
|
if (profile) {
|
|
219
|
-
reportProgress(( localize(
|
|
219
|
+
reportProgress(( localize(13102, "Applying Extensions...")));
|
|
220
220
|
await this.instantiationService.createInstance(ExtensionsResource).copy(this.userDataProfileService.currentProfile, profile, true);
|
|
221
|
-
reportProgress(( localize(
|
|
221
|
+
reportProgress(( localize(13103, "Switching Profile...")));
|
|
222
222
|
await this.userDataProfileManagementService.switchProfile(profile);
|
|
223
223
|
}
|
|
224
224
|
});
|
|
@@ -236,7 +236,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
236
236
|
try {
|
|
237
237
|
await this.progressService.withProgress({
|
|
238
238
|
location,
|
|
239
|
-
title: ( localize(
|
|
239
|
+
title: ( localize(13104, "{0}: Exporting...", PROFILES_CATEGORY.value)),
|
|
240
240
|
}, async (progress) => {
|
|
241
241
|
const id = await this.pickProfileContentHandler(profile.name);
|
|
242
242
|
if (!id) {
|
|
@@ -250,17 +250,17 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
250
250
|
if (!saveResult) {
|
|
251
251
|
return;
|
|
252
252
|
}
|
|
253
|
-
const message = ( localize(
|
|
253
|
+
const message = ( localize(13105, "Profile '{0}' was exported successfully.", profile.name));
|
|
254
254
|
if (profileContentHandler.extensionId) {
|
|
255
255
|
const buttons = [];
|
|
256
256
|
const link = this.productService.webUrl ? `${this.productService.webUrl}/${PROFILE_URL_AUTHORITY}/${id}/${saveResult.id}` : ( toUserDataProfileUri(`/${id}/${saveResult.id}`, this.productService).toString());
|
|
257
257
|
buttons.push({
|
|
258
|
-
label: ( localize(
|
|
258
|
+
label: ( localize(13106, "&&Copy Link")),
|
|
259
259
|
run: () => this.clipboardService.writeText(link)
|
|
260
260
|
});
|
|
261
261
|
if (this.productService.webUrl) {
|
|
262
262
|
buttons.push({
|
|
263
|
-
label: ( localize(
|
|
263
|
+
label: ( localize(13107, "&&Open Link")),
|
|
264
264
|
run: async () => {
|
|
265
265
|
await this.openerService.open(link);
|
|
266
266
|
}
|
|
@@ -268,7 +268,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
268
268
|
}
|
|
269
269
|
else {
|
|
270
270
|
buttons.push({
|
|
271
|
-
label: ( localize(
|
|
271
|
+
label: ( localize(13108, "&&Open in {0}", profileContentHandler.name)),
|
|
272
272
|
run: async () => {
|
|
273
273
|
await this.openerService.open(( saveResult.link.toString()));
|
|
274
274
|
}
|
|
@@ -278,7 +278,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
278
278
|
type: Severity.Info,
|
|
279
279
|
message,
|
|
280
280
|
buttons,
|
|
281
|
-
cancelButton: ( localize(
|
|
281
|
+
cancelButton: ( localize(13109, "Close"))
|
|
282
282
|
});
|
|
283
283
|
}
|
|
284
284
|
else {
|
|
@@ -300,10 +300,10 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
300
300
|
profileTemplate = JSON.parse(profileContent);
|
|
301
301
|
}
|
|
302
302
|
catch (error) {
|
|
303
|
-
throw ( new Error(( localize(
|
|
303
|
+
throw ( new Error(( localize(13110, "This profile is not valid."))));
|
|
304
304
|
}
|
|
305
305
|
if (!isUserDataProfileTemplate(profileTemplate)) {
|
|
306
|
-
throw ( new Error(( localize(
|
|
306
|
+
throw ( new Error(( localize(13110, "This profile is not valid."))));
|
|
307
307
|
}
|
|
308
308
|
if (options?.name) {
|
|
309
309
|
profileTemplate.name = options.name;
|
|
@@ -337,27 +337,27 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
337
337
|
return undefined;
|
|
338
338
|
}
|
|
339
339
|
if (profileTemplate.settings && !profile.useDefaultFlags?.settings) {
|
|
340
|
-
progress(( localize(
|
|
340
|
+
progress(( localize(13111, "Applying Settings...")));
|
|
341
341
|
await this.instantiationService.createInstance(SettingsResource).apply(profileTemplate.settings, profile);
|
|
342
342
|
}
|
|
343
343
|
if (profileTemplate.keybindings && !profile.useDefaultFlags?.keybindings) {
|
|
344
|
-
progress(( localize(
|
|
344
|
+
progress(( localize(13112, "Applying Keyboard Shortcuts...")));
|
|
345
345
|
await this.instantiationService.createInstance(KeybindingsResource).apply(profileTemplate.keybindings, profile);
|
|
346
346
|
}
|
|
347
347
|
if (profileTemplate.tasks && !profile.useDefaultFlags?.tasks) {
|
|
348
|
-
progress(( localize(
|
|
348
|
+
progress(( localize(13113, "Applying Tasks...")));
|
|
349
349
|
await this.instantiationService.createInstance(TasksResource).apply(profileTemplate.tasks, profile);
|
|
350
350
|
}
|
|
351
351
|
if (profileTemplate.snippets && !profile.useDefaultFlags?.snippets) {
|
|
352
|
-
progress(( localize(
|
|
352
|
+
progress(( localize(13114, "Applying Snippets...")));
|
|
353
353
|
await this.instantiationService.createInstance(SnippetsResource).apply(profileTemplate.snippets, profile);
|
|
354
354
|
}
|
|
355
355
|
if (profileTemplate.globalState && !profile.useDefaultFlags?.globalState) {
|
|
356
|
-
progress(( localize(
|
|
356
|
+
progress(( localize(13115, "Applying State...")));
|
|
357
357
|
await this.instantiationService.createInstance(GlobalStateResource).apply(profileTemplate.globalState, profile);
|
|
358
358
|
}
|
|
359
359
|
if (profileTemplate.extensions && extensions && !profile.useDefaultFlags?.extensions) {
|
|
360
|
-
progress(( localize(
|
|
360
|
+
progress(( localize(13102, "Applying Extensions...")));
|
|
361
361
|
await this.instantiationService.createInstance(ExtensionsResource).apply(profileTemplate.extensions, profile);
|
|
362
362
|
}
|
|
363
363
|
return profile;
|
|
@@ -408,7 +408,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
408
408
|
options.push({ id, label: profileContentHandler.name, description: profileContentHandler.description });
|
|
409
409
|
}
|
|
410
410
|
const result = await this.quickInputService.pick(options.reverse(), {
|
|
411
|
-
title: ( localize(
|
|
411
|
+
title: ( localize(13116, "Export '{0}' profile as...", name)),
|
|
412
412
|
hideInput: true
|
|
413
413
|
});
|
|
414
414
|
return result?.id;
|
|
@@ -423,11 +423,11 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
423
423
|
const { confirmed } = await this.dialogService.confirm({
|
|
424
424
|
type: Severity.Info,
|
|
425
425
|
message: ( localize(
|
|
426
|
-
|
|
426
|
+
13117,
|
|
427
427
|
"Profile with name '{0}' already exists. Do you want to replace its contents?",
|
|
428
428
|
profileName
|
|
429
429
|
)),
|
|
430
|
-
primaryButton: ( localize(
|
|
430
|
+
primaryButton: ( localize(13118, "&&Replace"))
|
|
431
431
|
});
|
|
432
432
|
if (!confirmed) {
|
|
433
433
|
return undefined;
|
|
@@ -471,12 +471,12 @@ let FileUserDataProfileContentHandler = class FileUserDataProfileContentHandler
|
|
|
471
471
|
this.fileService = fileService;
|
|
472
472
|
this.productService = productService;
|
|
473
473
|
this.textFileService = textFileService;
|
|
474
|
-
this.name = ( localize(
|
|
475
|
-
this.description = ( localize(
|
|
474
|
+
this.name = ( localize(13119, "Local"));
|
|
475
|
+
this.description = ( localize(13120, "file"));
|
|
476
476
|
}
|
|
477
477
|
async saveProfile(name, content, token) {
|
|
478
478
|
const link = await this.fileDialogService.showSaveDialog({
|
|
479
|
-
title: ( localize(
|
|
479
|
+
title: ( localize(13121, "Save Profile")),
|
|
480
480
|
filters: PROFILE_FILTER,
|
|
481
481
|
defaultUri: this.uriIdentityService.extUri.joinPath(await this.fileDialogService.defaultFilePath(), `${name}.${PROFILE_EXTENSION}`),
|
|
482
482
|
});
|
|
@@ -501,7 +501,7 @@ let FileUserDataProfileContentHandler = class FileUserDataProfileContentHandler
|
|
|
501
501
|
canSelectFiles: true,
|
|
502
502
|
canSelectMany: false,
|
|
503
503
|
filters: PROFILE_FILTER,
|
|
504
|
-
title: ( localize(
|
|
504
|
+
title: ( localize(13122, "Select Profile")),
|
|
505
505
|
});
|
|
506
506
|
return profileLocation ? profileLocation[0] : null;
|
|
507
507
|
}
|
|
@@ -548,13 +548,13 @@ let UserDataProfileImportExportState = class UserDataProfileImportExportState ex
|
|
|
548
548
|
for (const root of this.roots) {
|
|
549
549
|
root.checkbox = {
|
|
550
550
|
isChecked: !root.isFromDefaultProfile(),
|
|
551
|
-
tooltip: ( localize(
|
|
551
|
+
tooltip: ( localize(13123, "Select {0}", root.label.label)),
|
|
552
552
|
accessibilityInformation: {
|
|
553
|
-
label: ( localize(
|
|
553
|
+
label: ( localize(13123, "Select {0}", root.label.label)),
|
|
554
554
|
}
|
|
555
555
|
};
|
|
556
556
|
if (root.isFromDefaultProfile()) {
|
|
557
|
-
root.description = ( localize(
|
|
557
|
+
root.description = ( localize(13124, "From Default Profile"));
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
560
|
return this.roots;
|
|
@@ -713,11 +713,11 @@ let UserDataProfileExportState = class UserDataProfileExportState extends UserDa
|
|
|
713
713
|
let name = this.profile.name;
|
|
714
714
|
if (this.profile.isDefault) {
|
|
715
715
|
name = await this.quickInputService.input({
|
|
716
|
-
placeHolder: ( localize(
|
|
717
|
-
title: ( localize(
|
|
716
|
+
placeHolder: ( localize(13125, "Name the profile")),
|
|
717
|
+
title: ( localize(13126, "Export Profile")),
|
|
718
718
|
async validateInput(input) {
|
|
719
719
|
if (!input.trim()) {
|
|
720
|
-
return localize(
|
|
720
|
+
return localize(13127, "Profile name must be provided.");
|
|
721
721
|
}
|
|
722
722
|
return undefined;
|
|
723
723
|
},
|