@codingame/monaco-vscode-user-data-profile-service-override 13.0.0 → 13.1.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/index.js +1 -1
- package/package.json +14 -22
- package/vscode/src/vs/platform/userDataProfile/browser/userDataProfile.js +1 -1
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.js +24 -24
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfileActions.js +3 -3
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditor.js +78 -78
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditorModel.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditorModel.js +28 -28
- 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/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/userDataProfileInit.d.ts +1 -1
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileInit.js +1 -1
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.js +8 -8
- package/vscode/src/vs/workbench/services/userDataSync/browser/userDataSyncInit.d.ts +1 -1
- 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-e7080bda-ce3e-5243-9a35-98cd9634dbda-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';
|
|
@@ -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(10591, "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(10592, "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(10593, "The profile should contain at least one configuration."));
|
|
179
179
|
return;
|
|
180
180
|
}
|
|
181
181
|
this.message = undefined;
|
|
@@ -198,7 +198,7 @@ let AbstractUserDataProfileElement = class AbstractUserDataProfileElement extend
|
|
|
198
198
|
checkbox: undefined,
|
|
199
199
|
resourceType: r,
|
|
200
200
|
openAction: children.length
|
|
201
|
-
? ( new Action('_open', ( localize(
|
|
201
|
+
? ( new Action('_open', ( localize(10594, "Open to the Side")), ThemeIcon.asClassName(Codicon.goToFile), true, () => children[0]?.openAction?.run()))
|
|
202
202
|
: undefined
|
|
203
203
|
};
|
|
204
204
|
})));
|
|
@@ -238,7 +238,7 @@ let AbstractUserDataProfileElement = class AbstractUserDataProfileElement extend
|
|
|
238
238
|
description: isString(child.description) ? child.description : undefined,
|
|
239
239
|
resource: URI.revive(child.resourceUri),
|
|
240
240
|
icon: child.themeIcon,
|
|
241
|
-
openAction: ( new Action('_openChild', ( localize(
|
|
241
|
+
openAction: ( new Action('_openChild', ( localize(10594, "Open to the Side")), ThemeIcon.asClassName(Codicon.goToFile), true, async () => {
|
|
242
242
|
if (child.parent.type === ProfileResourceType.Extensions) {
|
|
243
243
|
await this.commandService.executeCommand('extension.open', child.handle, undefined, true, undefined, true);
|
|
244
244
|
}
|
|
@@ -400,7 +400,7 @@ let UserDataProfileElement = class UserDataProfileElement extends AbstractUserDa
|
|
|
400
400
|
const children = await this.instantiationService.createInstance(ExtensionsResourceExportTreeItem, this.profile).getChildren();
|
|
401
401
|
return (children.map(child => this.toUserDataProfileResourceChildElement(child, undefined, [{
|
|
402
402
|
id: 'applyToAllProfiles',
|
|
403
|
-
label: ( localize(
|
|
403
|
+
label: ( localize(10595, "Apply Extension to all Profiles")),
|
|
404
404
|
checked: child.applicationScoped,
|
|
405
405
|
enabled: true,
|
|
406
406
|
class: '',
|
|
@@ -531,7 +531,7 @@ let NewProfileElement = class NewProfileElement extends AbstractUserDataProfileE
|
|
|
531
531
|
}
|
|
532
532
|
if (isUserDataProfile(this.copyFrom)) {
|
|
533
533
|
if (this.defaultName === this.name) {
|
|
534
|
-
this.name = this.defaultName = ( localize(
|
|
534
|
+
this.name = this.defaultName = ( localize(10596, "{0} (Copy)", this.copyFrom.name));
|
|
535
535
|
}
|
|
536
536
|
if (this.defaultIcon === this.icon) {
|
|
537
537
|
this.icon = this.defaultIcon = this.copyFrom.icon;
|
|
@@ -545,7 +545,7 @@ let NewProfileElement = class NewProfileElement extends AbstractUserDataProfileE
|
|
|
545
545
|
return;
|
|
546
546
|
}
|
|
547
547
|
if (this.defaultName === this.name) {
|
|
548
|
-
this.name = this.defaultName = ( localize(
|
|
548
|
+
this.name = this.defaultName = ( localize(10597, "Untitled"));
|
|
549
549
|
}
|
|
550
550
|
if (this.defaultIcon === this.icon) {
|
|
551
551
|
this.icon = this.defaultIcon = undefined;
|
|
@@ -777,11 +777,11 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
|
|
|
777
777
|
}
|
|
778
778
|
createProfileElement(profile) {
|
|
779
779
|
const disposables = ( new DisposableStore());
|
|
780
|
-
const activateAction = disposables.add(( new Action('userDataProfile.activate', ( localize(
|
|
781
|
-
const copyFromProfileAction = disposables.add(( new Action('userDataProfile.copyFromProfile', ( localize(
|
|
782
|
-
const exportAction = disposables.add(( new Action('userDataProfile.export', ( localize(
|
|
783
|
-
const deleteAction = disposables.add(( new Action('userDataProfile.delete', ( localize(
|
|
784
|
-
const newWindowAction = disposables.add(( new Action('userDataProfile.newWindow', ( localize(
|
|
780
|
+
const activateAction = disposables.add(( new Action('userDataProfile.activate', ( localize(10598, "Use this Profile for Current Window")), ThemeIcon.asClassName(Codicon.check), true, () => this.userDataProfileManagementService.switchProfile(profileElement.profile))));
|
|
781
|
+
const copyFromProfileAction = disposables.add(( new Action('userDataProfile.copyFromProfile', ( localize(10599, "Duplicate...")), ThemeIcon.asClassName(Codicon.copy), true, () => this.createNewProfile(profileElement.profile))));
|
|
782
|
+
const exportAction = disposables.add(( new Action('userDataProfile.export', ( localize(10600, "Export...")), ThemeIcon.asClassName(Codicon.export), true, () => this.userDataProfileImportExportService.exportProfile(profile))));
|
|
783
|
+
const deleteAction = disposables.add(( new Action('userDataProfile.delete', ( localize(10601, "Delete")), ThemeIcon.asClassName(Codicon.trash), true, () => this.removeProfile(profileElement.profile))));
|
|
784
|
+
const newWindowAction = disposables.add(( new Action('userDataProfile.newWindow', ( localize(10602, "Open New Window with this Profile")), ThemeIcon.asClassName(Codicon.emptyWindow), true, () => this.openWindow(profileElement.profile))));
|
|
785
785
|
const primaryActions = [];
|
|
786
786
|
primaryActions.push(activateAction);
|
|
787
787
|
primaryActions.push(newWindowAction);
|
|
@@ -802,11 +802,11 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
|
|
|
802
802
|
const result = await this.dialogService.confirm({
|
|
803
803
|
type: 'info',
|
|
804
804
|
message: ( localize(
|
|
805
|
-
|
|
805
|
+
10603,
|
|
806
806
|
"A new profile is already being created. Do you want to discard it and create a new one?"
|
|
807
807
|
)),
|
|
808
|
-
primaryButton: ( localize(
|
|
809
|
-
cancelButton: ( localize(
|
|
808
|
+
primaryButton: ( localize(10604, "Discard & Create")),
|
|
809
|
+
cancelButton: ( localize(10605, "Cancel"))
|
|
810
810
|
});
|
|
811
811
|
if (!result.confirmed) {
|
|
812
812
|
return;
|
|
@@ -828,24 +828,24 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
|
|
|
828
828
|
disposables.add(toDisposable(() => cancellationTokenSource.dispose(true)));
|
|
829
829
|
const primaryActions = [];
|
|
830
830
|
const secondaryActions = [];
|
|
831
|
-
const createAction = disposables.add(( new Action('userDataProfile.create', ( localize(
|
|
831
|
+
const createAction = disposables.add(( new Action('userDataProfile.create', ( localize(10606, "Create")), undefined, true, () => this.saveNewProfile(false, cancellationTokenSource.token))));
|
|
832
832
|
primaryActions.push(createAction);
|
|
833
833
|
if (isWeb && copyFrom instanceof URI && isProfileURL(copyFrom)) {
|
|
834
|
-
primaryActions.push(( new Action('userDataProfile.createInDesktop', ( localize(
|
|
834
|
+
primaryActions.push(( new Action('userDataProfile.createInDesktop', ( localize(10607, "Create in {0}", this.productService.nameLong)), undefined, true, () => this.openerService.open(copyFrom, { openExternal: true }))));
|
|
835
835
|
}
|
|
836
|
-
const cancelAction = disposables.add(( new Action('userDataProfile.cancel', ( localize(
|
|
836
|
+
const cancelAction = disposables.add(( new Action('userDataProfile.cancel', ( localize(10605, "Cancel")), ThemeIcon.asClassName(Codicon.trash), true, () => this.discardNewProfile())));
|
|
837
837
|
secondaryActions.push(cancelAction);
|
|
838
|
-
const previewProfileAction = disposables.add(( new Action('userDataProfile.preview', ( localize(
|
|
838
|
+
const previewProfileAction = disposables.add(( new Action('userDataProfile.preview', ( localize(10608, "Preview")), ThemeIcon.asClassName(Codicon.openPreview), true, () => this.previewNewProfile(cancellationTokenSource.token))));
|
|
839
839
|
secondaryActions.push(previewProfileAction);
|
|
840
|
-
const exportAction = disposables.add(( new Action('userDataProfile.export', ( localize(
|
|
841
|
-
this.newProfileElement = disposables.add(this.instantiationService.createInstance(NewProfileElement, copyFrom ? '' : ( localize(
|
|
840
|
+
const exportAction = disposables.add(( new Action('userDataProfile.export', ( localize(10600, "Export...")), ThemeIcon.asClassName(Codicon.export), isUserDataProfile(copyFrom), () => this.exportNewProfile(cancellationTokenSource.token))));
|
|
841
|
+
this.newProfileElement = disposables.add(this.instantiationService.createInstance(NewProfileElement, copyFrom ? '' : ( localize(10597, "Untitled")), copyFrom, [primaryActions, secondaryActions], [[cancelAction], [exportAction]]));
|
|
842
842
|
const updateCreateActionLabel = () => {
|
|
843
843
|
if (createAction.enabled) {
|
|
844
844
|
if (this.newProfileElement?.copyFrom && ( this.userDataProfilesService.profiles.some(p => !p.isTransient && p.name === this.newProfileElement?.name))) {
|
|
845
|
-
createAction.label = ( localize(
|
|
845
|
+
createAction.label = ( localize(10609, "Replace"));
|
|
846
846
|
}
|
|
847
847
|
else {
|
|
848
|
-
createAction.label = ( localize(
|
|
848
|
+
createAction.label = ( localize(10606, "Create"));
|
|
849
849
|
}
|
|
850
850
|
}
|
|
851
851
|
};
|
|
@@ -1002,9 +1002,9 @@ let UserDataProfilesEditorModel = class UserDataProfilesEditorModel extends Edit
|
|
|
1002
1002
|
async removeProfile(profile) {
|
|
1003
1003
|
const result = await this.dialogService.confirm({
|
|
1004
1004
|
type: 'info',
|
|
1005
|
-
message: ( localize(
|
|
1006
|
-
primaryButton: ( localize(
|
|
1007
|
-
cancelButton: ( localize(
|
|
1005
|
+
message: ( localize(10610, "Are you sure you want to delete the profile '{0}'?", profile.name)),
|
|
1006
|
+
primaryButton: ( localize(10601, "Delete")),
|
|
1007
|
+
cancelButton: ( localize(10605, "Cancel"))
|
|
1008
1008
|
});
|
|
1009
1009
|
if (result.confirmed) {
|
|
1010
1010
|
await this.userDataProfileManagementService.removeProfile(profile);
|
|
@@ -171,7 +171,7 @@ let ExtensionsResource = class ExtensionsResource {
|
|
|
171
171
|
return;
|
|
172
172
|
}
|
|
173
173
|
progress?.(( localize(
|
|
174
|
-
|
|
174
|
+
11991,
|
|
175
175
|
"Installing extension {0}...",
|
|
176
176
|
installExtensionInfo.extension.displayName ?? installExtensionInfo.extension.identifier.id
|
|
177
177
|
)));
|
|
@@ -264,7 +264,7 @@ class ExtensionsResourceTreeItem {
|
|
|
264
264
|
constructor() {
|
|
265
265
|
this.type = ProfileResourceType.Extensions;
|
|
266
266
|
this.handle = ProfileResourceType.Extensions;
|
|
267
|
-
this.label = { label: ( localize(
|
|
267
|
+
this.label = { label: ( localize(11992, "Extensions")) };
|
|
268
268
|
this.collapsibleState = TreeItemCollapsibleState.Expanded;
|
|
269
269
|
this.contextValue = ProfileResourceType.Extensions;
|
|
270
270
|
this.excludedExtensions = ( new Set());
|
|
@@ -277,7 +277,7 @@ class ExtensionsResourceTreeItem {
|
|
|
277
277
|
handle: e.identifier.id.toLowerCase(),
|
|
278
278
|
parent: this,
|
|
279
279
|
label: { label: e.displayName || e.identifier.id },
|
|
280
|
-
description: e.applicationScoped ? ( localize(
|
|
280
|
+
description: e.applicationScoped ? ( localize(11993, "All Profiles")) : undefined,
|
|
281
281
|
collapsibleState: TreeItemCollapsibleState.None,
|
|
282
282
|
checkbox: that.checkbox ? {
|
|
283
283
|
get isChecked() { return !( that.excludedExtensions.has(e.identifier.id.toLowerCase())); },
|
|
@@ -289,9 +289,9 @@ class ExtensionsResourceTreeItem {
|
|
|
289
289
|
that.excludedExtensions.add(e.identifier.id.toLowerCase());
|
|
290
290
|
}
|
|
291
291
|
},
|
|
292
|
-
tooltip: ( localize(
|
|
292
|
+
tooltip: ( localize(11994, "Select {0} Extension", e.displayName || e.identifier.id)),
|
|
293
293
|
accessibilityInformation: {
|
|
294
|
-
label: ( localize(
|
|
294
|
+
label: ( localize(11994, "Select {0} Extension", e.displayName || e.identifier.id)),
|
|
295
295
|
}
|
|
296
296
|
} : undefined,
|
|
297
297
|
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(11995, "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(11996, "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(11997, "Settings")) };
|
|
105
105
|
this.collapsibleState = TreeItemCollapsibleState.Expanded;
|
|
106
106
|
}
|
|
107
107
|
async getChildren() {
|
|
@@ -94,7 +94,7 @@ let SnippetsResourceTreeItem = class SnippetsResourceTreeItem {
|
|
|
94
94
|
this.uriIdentityService = uriIdentityService;
|
|
95
95
|
this.type = ProfileResourceType.Snippets;
|
|
96
96
|
this.handle = ( this.profile.snippetsHome.toString());
|
|
97
|
-
this.label = { label: ( localize(
|
|
97
|
+
this.label = { label: ( localize(11998, "Snippets")) };
|
|
98
98
|
this.collapsibleState = TreeItemCollapsibleState.Collapsed;
|
|
99
99
|
this.excludedSnippets = ( new ResourceSet());
|
|
100
100
|
}
|
|
@@ -121,7 +121,7 @@ let SnippetsResourceTreeItem = class SnippetsResourceTreeItem {
|
|
|
121
121
|
},
|
|
122
122
|
accessibilityInformation: {
|
|
123
123
|
label: ( localize(
|
|
124
|
-
|
|
124
|
+
11999,
|
|
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(12000, "Tasks")) };
|
|
83
83
|
this.collapsibleState = TreeItemCollapsibleState.Expanded;
|
|
84
84
|
}
|
|
85
85
|
async getChildren() {
|
|
@@ -88,7 +88,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
88
88
|
sticky: true,
|
|
89
89
|
cancellable: true,
|
|
90
90
|
}, async (progress) => {
|
|
91
|
-
const reportProgress = (message) => progress.report({ message: ( localize(
|
|
91
|
+
const reportProgress = (message) => progress.report({ message: ( localize(12001, "Create Profile: {0}", message)) });
|
|
92
92
|
creationPromise = createCancelablePromise(async (token) => {
|
|
93
93
|
const userDataProfilesExportState = disposables.add(this.instantiationService.createInstance(UserDataProfileExportState, from, { ...options?.resourceTypeFlags, extensions: false }));
|
|
94
94
|
const profileTemplate = await userDataProfilesExportState.getProfileTemplate(options.name ?? from.name, options?.icon);
|
|
@@ -104,7 +104,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
104
104
|
try {
|
|
105
105
|
await creationPromise;
|
|
106
106
|
if (profile && (options?.resourceTypeFlags?.extensions ?? true)) {
|
|
107
|
-
reportProgress(( localize(
|
|
107
|
+
reportProgress(( localize(12002, "Installing Extensions...")));
|
|
108
108
|
await this.instantiationService.createInstance(ExtensionsResource).copy(from, profile, false);
|
|
109
109
|
}
|
|
110
110
|
}
|
|
@@ -128,7 +128,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
128
128
|
sticky: true,
|
|
129
129
|
cancellable: true,
|
|
130
130
|
}, async (progress) => {
|
|
131
|
-
const reportProgress = (message) => progress.report({ message: ( localize(
|
|
131
|
+
const reportProgress = (message) => progress.report({ message: ( localize(12001, "Create Profile: {0}", message)) });
|
|
132
132
|
creationPromise = createCancelablePromise(async (token) => {
|
|
133
133
|
profile = await this.getProfileToImport({ ...profileTemplate, name: options.name ?? profileTemplate.name }, !!options.transient, options);
|
|
134
134
|
if (!profile) {
|
|
@@ -153,42 +153,42 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
153
153
|
}
|
|
154
154
|
async applyProfileTemplate(profileTemplate, profile, options, reportProgress, token) {
|
|
155
155
|
if (profileTemplate.settings && (options.resourceTypeFlags?.settings ?? true) && !profile.useDefaultFlags?.settings) {
|
|
156
|
-
reportProgress(( localize(
|
|
156
|
+
reportProgress(( localize(12003, "Creating Settings...")));
|
|
157
157
|
await this.instantiationService.createInstance(SettingsResource).apply(profileTemplate.settings, profile);
|
|
158
158
|
}
|
|
159
159
|
if (token.isCancellationRequested) {
|
|
160
160
|
return;
|
|
161
161
|
}
|
|
162
162
|
if (profileTemplate.keybindings && (options.resourceTypeFlags?.keybindings ?? true) && !profile.useDefaultFlags?.keybindings) {
|
|
163
|
-
reportProgress(( localize(
|
|
163
|
+
reportProgress(( localize(12004, "Creating Keyboard Shortcuts...")));
|
|
164
164
|
await this.instantiationService.createInstance(KeybindingsResource).apply(profileTemplate.keybindings, profile);
|
|
165
165
|
}
|
|
166
166
|
if (token.isCancellationRequested) {
|
|
167
167
|
return;
|
|
168
168
|
}
|
|
169
169
|
if (profileTemplate.tasks && (options.resourceTypeFlags?.tasks ?? true) && !profile.useDefaultFlags?.tasks) {
|
|
170
|
-
reportProgress(( localize(
|
|
170
|
+
reportProgress(( localize(12005, "Creating Tasks...")));
|
|
171
171
|
await this.instantiationService.createInstance(TasksResource).apply(profileTemplate.tasks, profile);
|
|
172
172
|
}
|
|
173
173
|
if (token.isCancellationRequested) {
|
|
174
174
|
return;
|
|
175
175
|
}
|
|
176
176
|
if (profileTemplate.snippets && (options.resourceTypeFlags?.snippets ?? true) && !profile.useDefaultFlags?.snippets) {
|
|
177
|
-
reportProgress(( localize(
|
|
177
|
+
reportProgress(( localize(12006, "Creating Snippets...")));
|
|
178
178
|
await this.instantiationService.createInstance(SnippetsResource).apply(profileTemplate.snippets, profile);
|
|
179
179
|
}
|
|
180
180
|
if (token.isCancellationRequested) {
|
|
181
181
|
return;
|
|
182
182
|
}
|
|
183
183
|
if (profileTemplate.globalState && !profile.useDefaultFlags?.globalState) {
|
|
184
|
-
reportProgress(( localize(
|
|
184
|
+
reportProgress(( localize(12007, "Applying UI State...")));
|
|
185
185
|
await this.instantiationService.createInstance(GlobalStateResource).apply(profileTemplate.globalState, profile);
|
|
186
186
|
}
|
|
187
187
|
if (token.isCancellationRequested) {
|
|
188
188
|
return;
|
|
189
189
|
}
|
|
190
190
|
if (profileTemplate.extensions && (options.resourceTypeFlags?.extensions ?? true) && !profile.useDefaultFlags?.extensions) {
|
|
191
|
-
reportProgress(( localize(
|
|
191
|
+
reportProgress(( localize(12002, "Installing Extensions...")));
|
|
192
192
|
await this.instantiationService.createInstance(ExtensionsResource).apply(profileTemplate.extensions, profile, reportProgress, token);
|
|
193
193
|
}
|
|
194
194
|
}
|
|
@@ -205,18 +205,18 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
205
205
|
async createTroubleshootProfile() {
|
|
206
206
|
const userDataProfilesExportState = this.instantiationService.createInstance(UserDataProfileExportState, this.userDataProfileService.currentProfile, undefined);
|
|
207
207
|
try {
|
|
208
|
-
const profileTemplate = await userDataProfilesExportState.getProfileTemplate(( localize(
|
|
208
|
+
const profileTemplate = await userDataProfilesExportState.getProfileTemplate(( localize(12008, "Troubleshoot Issue")), undefined);
|
|
209
209
|
await this.progressService.withProgress({
|
|
210
210
|
location: ProgressLocation.Notification,
|
|
211
211
|
delay: 1000,
|
|
212
212
|
sticky: true,
|
|
213
213
|
}, async (progress) => {
|
|
214
|
-
const reportProgress = (message) => progress.report({ message: ( localize(
|
|
214
|
+
const reportProgress = (message) => progress.report({ message: ( localize(12009, "Setting up Troubleshoot Profile: {0}", message)) });
|
|
215
215
|
const profile = await this.doCreateProfile(profileTemplate, true, false, { useDefaultFlags: this.userDataProfileService.currentProfile.useDefaultFlags }, reportProgress);
|
|
216
216
|
if (profile) {
|
|
217
|
-
reportProgress(( localize(
|
|
217
|
+
reportProgress(( localize(12010, "Applying Extensions...")));
|
|
218
218
|
await this.instantiationService.createInstance(ExtensionsResource).copy(this.userDataProfileService.currentProfile, profile, true);
|
|
219
|
-
reportProgress(( localize(
|
|
219
|
+
reportProgress(( localize(12011, "Switching Profile...")));
|
|
220
220
|
await this.userDataProfileManagementService.switchProfile(profile);
|
|
221
221
|
}
|
|
222
222
|
});
|
|
@@ -234,7 +234,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
234
234
|
try {
|
|
235
235
|
await this.progressService.withProgress({
|
|
236
236
|
location,
|
|
237
|
-
title: ( localize(
|
|
237
|
+
title: ( localize(12012, "{0}: Exporting...", PROFILES_CATEGORY.value)),
|
|
238
238
|
}, async (progress) => {
|
|
239
239
|
const id = await this.pickProfileContentHandler(profile.name);
|
|
240
240
|
if (!id) {
|
|
@@ -248,17 +248,17 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
248
248
|
if (!saveResult) {
|
|
249
249
|
return;
|
|
250
250
|
}
|
|
251
|
-
const message = ( localize(
|
|
251
|
+
const message = ( localize(12013, "Profile '{0}' was exported successfully.", profile.name));
|
|
252
252
|
if (profileContentHandler.extensionId) {
|
|
253
253
|
const buttons = [];
|
|
254
254
|
const link = this.productService.webUrl ? `${this.productService.webUrl}/${PROFILE_URL_AUTHORITY}/${id}/${saveResult.id}` : ( toUserDataProfileUri(`/${id}/${saveResult.id}`, this.productService).toString());
|
|
255
255
|
buttons.push({
|
|
256
|
-
label: ( localize(
|
|
256
|
+
label: ( localize(12014, "&&Copy Link")),
|
|
257
257
|
run: () => this.clipboardService.writeText(link)
|
|
258
258
|
});
|
|
259
259
|
if (this.productService.webUrl) {
|
|
260
260
|
buttons.push({
|
|
261
|
-
label: ( localize(
|
|
261
|
+
label: ( localize(12015, "&&Open Link")),
|
|
262
262
|
run: async () => {
|
|
263
263
|
await this.openerService.open(link);
|
|
264
264
|
}
|
|
@@ -266,7 +266,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
266
266
|
}
|
|
267
267
|
else {
|
|
268
268
|
buttons.push({
|
|
269
|
-
label: ( localize(
|
|
269
|
+
label: ( localize(12016, "&&Open in {0}", profileContentHandler.name)),
|
|
270
270
|
run: async () => {
|
|
271
271
|
await this.openerService.open(( saveResult.link.toString()));
|
|
272
272
|
}
|
|
@@ -276,7 +276,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
276
276
|
type: Severity.Info,
|
|
277
277
|
message,
|
|
278
278
|
buttons,
|
|
279
|
-
cancelButton: ( localize(
|
|
279
|
+
cancelButton: ( localize(12017, "Close"))
|
|
280
280
|
});
|
|
281
281
|
}
|
|
282
282
|
else {
|
|
@@ -298,10 +298,10 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
298
298
|
profileTemplate = JSON.parse(profileContent);
|
|
299
299
|
}
|
|
300
300
|
catch (error) {
|
|
301
|
-
throw ( new Error(( localize(
|
|
301
|
+
throw ( new Error(( localize(12018, "This profile is not valid."))));
|
|
302
302
|
}
|
|
303
303
|
if (!isUserDataProfileTemplate(profileTemplate)) {
|
|
304
|
-
throw ( new Error(( localize(
|
|
304
|
+
throw ( new Error(( localize(12018, "This profile is not valid."))));
|
|
305
305
|
}
|
|
306
306
|
if (options?.name) {
|
|
307
307
|
profileTemplate.name = options.name;
|
|
@@ -335,27 +335,27 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
335
335
|
return undefined;
|
|
336
336
|
}
|
|
337
337
|
if (profileTemplate.settings && !profile.useDefaultFlags?.settings) {
|
|
338
|
-
progress(( localize(
|
|
338
|
+
progress(( localize(12019, "Applying Settings...")));
|
|
339
339
|
await this.instantiationService.createInstance(SettingsResource).apply(profileTemplate.settings, profile);
|
|
340
340
|
}
|
|
341
341
|
if (profileTemplate.keybindings && !profile.useDefaultFlags?.keybindings) {
|
|
342
|
-
progress(( localize(
|
|
342
|
+
progress(( localize(12020, "Applying Keyboard Shortcuts...")));
|
|
343
343
|
await this.instantiationService.createInstance(KeybindingsResource).apply(profileTemplate.keybindings, profile);
|
|
344
344
|
}
|
|
345
345
|
if (profileTemplate.tasks && !profile.useDefaultFlags?.tasks) {
|
|
346
|
-
progress(( localize(
|
|
346
|
+
progress(( localize(12021, "Applying Tasks...")));
|
|
347
347
|
await this.instantiationService.createInstance(TasksResource).apply(profileTemplate.tasks, profile);
|
|
348
348
|
}
|
|
349
349
|
if (profileTemplate.snippets && !profile.useDefaultFlags?.snippets) {
|
|
350
|
-
progress(( localize(
|
|
350
|
+
progress(( localize(12022, "Applying Snippets...")));
|
|
351
351
|
await this.instantiationService.createInstance(SnippetsResource).apply(profileTemplate.snippets, profile);
|
|
352
352
|
}
|
|
353
353
|
if (profileTemplate.globalState && !profile.useDefaultFlags?.globalState) {
|
|
354
|
-
progress(( localize(
|
|
354
|
+
progress(( localize(12023, "Applying State...")));
|
|
355
355
|
await this.instantiationService.createInstance(GlobalStateResource).apply(profileTemplate.globalState, profile);
|
|
356
356
|
}
|
|
357
357
|
if (profileTemplate.extensions && extensions && !profile.useDefaultFlags?.extensions) {
|
|
358
|
-
progress(( localize(
|
|
358
|
+
progress(( localize(12010, "Applying Extensions...")));
|
|
359
359
|
await this.instantiationService.createInstance(ExtensionsResource).apply(profileTemplate.extensions, profile);
|
|
360
360
|
}
|
|
361
361
|
return profile;
|
|
@@ -406,7 +406,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
406
406
|
options.push({ id, label: profileContentHandler.name, description: profileContentHandler.description });
|
|
407
407
|
}
|
|
408
408
|
const result = await this.quickInputService.pick(options.reverse(), {
|
|
409
|
-
title: ( localize(
|
|
409
|
+
title: ( localize(12024, "Export '{0}' profile as...", name)),
|
|
410
410
|
hideInput: true
|
|
411
411
|
});
|
|
412
412
|
return result?.id;
|
|
@@ -421,11 +421,11 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
421
421
|
const { confirmed } = await this.dialogService.confirm({
|
|
422
422
|
type: Severity.Info,
|
|
423
423
|
message: ( localize(
|
|
424
|
-
|
|
424
|
+
12025,
|
|
425
425
|
"Profile with name '{0}' already exists. Do you want to replace its contents?",
|
|
426
426
|
profileName
|
|
427
427
|
)),
|
|
428
|
-
primaryButton: ( localize(
|
|
428
|
+
primaryButton: ( localize(12026, "&&Replace"))
|
|
429
429
|
});
|
|
430
430
|
if (!confirmed) {
|
|
431
431
|
return undefined;
|
|
@@ -469,12 +469,12 @@ let FileUserDataProfileContentHandler = class FileUserDataProfileContentHandler
|
|
|
469
469
|
this.fileService = fileService;
|
|
470
470
|
this.productService = productService;
|
|
471
471
|
this.textFileService = textFileService;
|
|
472
|
-
this.name = ( localize(
|
|
473
|
-
this.description = ( localize(
|
|
472
|
+
this.name = ( localize(12027, "Local"));
|
|
473
|
+
this.description = ( localize(12028, "file"));
|
|
474
474
|
}
|
|
475
475
|
async saveProfile(name, content, token) {
|
|
476
476
|
const link = await this.fileDialogService.showSaveDialog({
|
|
477
|
-
title: ( localize(
|
|
477
|
+
title: ( localize(12029, "Save Profile")),
|
|
478
478
|
filters: PROFILE_FILTER,
|
|
479
479
|
defaultUri: this.uriIdentityService.extUri.joinPath(await this.fileDialogService.defaultFilePath(), `${name}.${PROFILE_EXTENSION}`),
|
|
480
480
|
});
|
|
@@ -499,7 +499,7 @@ let FileUserDataProfileContentHandler = class FileUserDataProfileContentHandler
|
|
|
499
499
|
canSelectFiles: true,
|
|
500
500
|
canSelectMany: false,
|
|
501
501
|
filters: PROFILE_FILTER,
|
|
502
|
-
title: ( localize(
|
|
502
|
+
title: ( localize(12030, "Select Profile")),
|
|
503
503
|
});
|
|
504
504
|
return profileLocation ? profileLocation[0] : null;
|
|
505
505
|
}
|
|
@@ -546,13 +546,13 @@ let UserDataProfileImportExportState = class UserDataProfileImportExportState ex
|
|
|
546
546
|
for (const root of this.roots) {
|
|
547
547
|
root.checkbox = {
|
|
548
548
|
isChecked: !root.isFromDefaultProfile(),
|
|
549
|
-
tooltip: ( localize(
|
|
549
|
+
tooltip: ( localize(12031, "Select {0}", root.label.label)),
|
|
550
550
|
accessibilityInformation: {
|
|
551
|
-
label: ( localize(
|
|
551
|
+
label: ( localize(12031, "Select {0}", root.label.label)),
|
|
552
552
|
}
|
|
553
553
|
};
|
|
554
554
|
if (root.isFromDefaultProfile()) {
|
|
555
|
-
root.description = ( localize(
|
|
555
|
+
root.description = ( localize(12032, "From Default Profile"));
|
|
556
556
|
}
|
|
557
557
|
}
|
|
558
558
|
return this.roots;
|
|
@@ -710,11 +710,11 @@ let UserDataProfileExportState = class UserDataProfileExportState extends UserDa
|
|
|
710
710
|
let name = this.profile.name;
|
|
711
711
|
if (this.profile.isDefault) {
|
|
712
712
|
name = await this.quickInputService.input({
|
|
713
|
-
placeHolder: ( localize(
|
|
714
|
-
title: ( localize(
|
|
713
|
+
placeHolder: ( localize(12033, "Name the profile")),
|
|
714
|
+
title: ( localize(12034, "Export Profile")),
|
|
715
715
|
async validateInput(input) {
|
|
716
716
|
if (!input.trim()) {
|
|
717
|
-
return localize(
|
|
717
|
+
return localize(12035, "Profile name must be provided.");
|
|
718
718
|
}
|
|
719
719
|
return undefined;
|
|
720
720
|
},
|
|
@@ -5,7 +5,7 @@ import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log
|
|
|
5
5
|
import { IUriIdentityService } from "@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service";
|
|
6
6
|
import { IUserDataInitializer } from "../../userData/browser/userDataInit.js";
|
|
7
7
|
import { IUserDataProfileService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.service";
|
|
8
|
-
import { IBrowserWorkbenchEnvironmentService } from "@codingame/monaco-vscode-
|
|
8
|
+
import { IBrowserWorkbenchEnvironmentService } from "@codingame/monaco-vscode-411e0589-fa79-504b-b32c-80a88847b23a-common/vscode/vs/workbench/services/environment/browser/environmentService.service";
|
|
9
9
|
import { IRequestService } from "@codingame/monaco-vscode-api/vscode/vs/platform/request/common/request.service";
|
|
10
10
|
export declare class UserDataProfileInitializer implements IUserDataInitializer {
|
|
11
11
|
private readonly environmentService;
|
|
@@ -13,7 +13,7 @@ import { KeybindingsResourceInitializer } from './keybindingsResource.js';
|
|
|
13
13
|
import { TasksResourceInitializer } from './tasksResource.js';
|
|
14
14
|
import { SnippetsResourceInitializer } from './snippetsResource.js';
|
|
15
15
|
import { ExtensionsResourceInitializer } from './extensionsResource.js';
|
|
16
|
-
import { IBrowserWorkbenchEnvironmentService } from '@codingame/monaco-vscode-
|
|
16
|
+
import { IBrowserWorkbenchEnvironmentService } from '@codingame/monaco-vscode-411e0589-fa79-504b-b32c-80a88847b23a-common/vscode/vs/workbench/services/environment/browser/environmentService.service';
|
|
17
17
|
import { isString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
18
18
|
import { asJson } from '@codingame/monaco-vscode-api/vscode/vs/platform/request/common/request';
|
|
19
19
|
import { IRequestService } from '@codingame/monaco-vscode-api/vscode/vs/platform/request/common/request.service';
|
package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.js
CHANGED
|
@@ -45,7 +45,7 @@ let UserDataProfileManagementService = class UserDataProfileManagementService ex
|
|
|
45
45
|
const profileToUse = this.getProfileToUseForCurrentWorkspace();
|
|
46
46
|
this.switchProfile(profileToUse);
|
|
47
47
|
this.changeCurrentProfile(profileToUse, ( localize(
|
|
48
|
-
|
|
48
|
+
12036,
|
|
49
49
|
"The current profile has been removed. Please reload to switch back to default profile"
|
|
50
50
|
)));
|
|
51
51
|
return;
|
|
@@ -56,13 +56,13 @@ let UserDataProfileManagementService = class UserDataProfileManagementService ex
|
|
|
56
56
|
if (profileToUse?.id !== updatedCurrentProfile.id) {
|
|
57
57
|
this.switchProfile(profileToUse);
|
|
58
58
|
this.changeCurrentProfile(profileToUse, ( localize(
|
|
59
|
-
|
|
59
|
+
12037,
|
|
60
60
|
"The current workspace has been removed from the current profile. Please reload to switch back to the updated profile"
|
|
61
61
|
)));
|
|
62
62
|
}
|
|
63
63
|
else {
|
|
64
64
|
this.changeCurrentProfile(updatedCurrentProfile, ( localize(
|
|
65
|
-
|
|
65
|
+
12038,
|
|
66
66
|
"The current profile has been updated. Please reload to switch back to the updated profile"
|
|
67
67
|
)));
|
|
68
68
|
}
|
|
@@ -124,7 +124,7 @@ let UserDataProfileManagementService = class UserDataProfileManagementService ex
|
|
|
124
124
|
throw ( new Error(`Profile ${profile.name} does not exist`));
|
|
125
125
|
}
|
|
126
126
|
if (profile.isDefault) {
|
|
127
|
-
throw ( new Error(( localize(
|
|
127
|
+
throw ( new Error(( localize(12039, "Cannot rename the default profile"))));
|
|
128
128
|
}
|
|
129
129
|
const updatedProfile = await this.userDataProfilesService.updateProfile(profile, updateOptions);
|
|
130
130
|
this.telemetryService.publicLog2('profileManagementActionExecuted', { id: 'updateProfile' });
|
|
@@ -135,7 +135,7 @@ let UserDataProfileManagementService = class UserDataProfileManagementService ex
|
|
|
135
135
|
throw ( new Error(`Profile ${profile.name} does not exist`));
|
|
136
136
|
}
|
|
137
137
|
if (profile.isDefault) {
|
|
138
|
-
throw ( new Error(( localize(
|
|
138
|
+
throw ( new Error(( localize(12040, "Cannot delete the default profile"))));
|
|
139
139
|
}
|
|
140
140
|
await this.userDataProfilesService.removeProfile(profile);
|
|
141
141
|
this.telemetryService.publicLog2('profileManagementActionExecuted', { id: 'removeProfile' });
|
|
@@ -180,7 +180,7 @@ let UserDataProfileManagementService = class UserDataProfileManagementService ex
|
|
|
180
180
|
const shouldRestartExtensionHosts = this.userDataProfileService.currentProfile.id !== profile.id || !equals(this.userDataProfileService.currentProfile.useDefaultFlags, profile.useDefaultFlags);
|
|
181
181
|
if (shouldRestartExtensionHosts) {
|
|
182
182
|
if (!isRemoteWindow) {
|
|
183
|
-
if (!(await this.extensionService.stopExtensionHosts(( localize(
|
|
183
|
+
if (!(await this.extensionService.stopExtensionHosts(( localize(12041, "Switching to a profile."))))) {
|
|
184
184
|
if (( this.userDataProfilesService.profiles.some(p => p.id === this.userDataProfileService.currentProfile.id))) {
|
|
185
185
|
await this.userDataProfilesService.setProfileForWorkspace(toWorkspaceIdentifier(this.workspaceContextService.getWorkspace()), this.userDataProfileService.currentProfile);
|
|
186
186
|
}
|
|
@@ -192,8 +192,8 @@ let UserDataProfileManagementService = class UserDataProfileManagementService ex
|
|
|
192
192
|
if (shouldRestartExtensionHosts) {
|
|
193
193
|
if (isRemoteWindow) {
|
|
194
194
|
const { confirmed } = await this.dialogService.confirm({
|
|
195
|
-
message: reloadMessage ?? ( localize(
|
|
196
|
-
primaryButton: ( localize(
|
|
195
|
+
message: reloadMessage ?? ( localize(12042, "Switching a profile requires reloading VS Code.")),
|
|
196
|
+
primaryButton: ( localize(12043, "&&Reload")),
|
|
197
197
|
});
|
|
198
198
|
if (confirmed) {
|
|
199
199
|
await this.hostService.reload();
|
|
@@ -7,7 +7,7 @@ import { IRequestService } from "@codingame/monaco-vscode-api/vscode/vs/platform
|
|
|
7
7
|
import { IUserDataSyncStoreManagementService } from "@codingame/monaco-vscode-api/vscode/vs/platform/userDataSync/common/userDataSync.service";
|
|
8
8
|
import { IUriIdentityService } from "@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service";
|
|
9
9
|
import { IUserDataProfilesService } from "@codingame/monaco-vscode-api/vscode/vs/platform/userDataProfile/common/userDataProfile.service";
|
|
10
|
-
import { IBrowserWorkbenchEnvironmentService } from "@codingame/monaco-vscode-
|
|
10
|
+
import { IBrowserWorkbenchEnvironmentService } from "@codingame/monaco-vscode-411e0589-fa79-504b-b32c-80a88847b23a-common/vscode/vs/workbench/services/environment/browser/environmentService.service";
|
|
11
11
|
import { IUserDataInitializer } from "../../userData/browser/userDataInit.js";
|
|
12
12
|
import { ISecretStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/secrets/common/secrets.service";
|
|
13
13
|
export declare class UserDataSyncInitializer implements IUserDataInitializer {
|