@codingame/monaco-vscode-user-data-profile-service-override 22.1.8 → 23.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 -13
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/media/userDataProfilesEditor.css +2 -2
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.js +24 -24
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfileActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditor.js +82 -82
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditorModel.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditorModel.js +30 -29
- package/vscode/src/vs/workbench/services/userDataProfile/browser/extensionsResource.d.ts +1 -1
- package/vscode/src/vs/workbench/services/userDataProfile/browser/extensionsResource.js +5 -5
- package/vscode/src/vs/workbench/services/userDataProfile/browser/globalStateResource.d.ts +1 -1
- package/vscode/src/vs/workbench/services/userDataProfile/browser/globalStateResource.js +2 -2
- package/vscode/src/vs/workbench/services/userDataProfile/browser/keybindingsResource.d.ts +1 -1
- package/vscode/src/vs/workbench/services/userDataProfile/browser/keybindingsResource.js +2 -2
- package/vscode/src/vs/workbench/services/userDataProfile/browser/mcpProfileResource.d.ts +1 -1
- package/vscode/src/vs/workbench/services/userDataProfile/browser/mcpProfileResource.js +2 -2
- package/vscode/src/vs/workbench/services/userDataProfile/browser/settingsResource.d.ts +1 -1
- package/vscode/src/vs/workbench/services/userDataProfile/browser/settingsResource.js +3 -3
- package/vscode/src/vs/workbench/services/userDataProfile/browser/snippetsResource.d.ts +1 -1
- package/vscode/src/vs/workbench/services/userDataProfile/browser/snippetsResource.js +3 -3
- package/vscode/src/vs/workbench/services/userDataProfile/browser/tasksResource.d.ts +1 -1
- package/vscode/src/vs/workbench/services/userDataProfile/browser/tasksResource.js +2 -2
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileImportExportService.d.ts +1 -1
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileImportExportService.js +43 -41
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.d.ts +1 -1
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.js +8 -8
|
@@ -3,10 +3,11 @@ import { registerCss } from '@codingame/monaco-vscode-api/css';
|
|
|
3
3
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
4
4
|
import * as userDataProfileView from './media/userDataProfileView.css';
|
|
5
5
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
6
|
+
import { isMarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
|
|
6
7
|
import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/extensions';
|
|
7
8
|
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
8
9
|
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
9
|
-
import { PROFILES_CATEGORY, PROFILE_URL_AUTHORITY, toUserDataProfileUri, isProfileURL, PROFILE_URL_AUTHORITY_PREFIX, PROFILE_EXTENSION, PROFILE_FILTER } from '@codingame/monaco-vscode-
|
|
10
|
+
import { PROFILES_CATEGORY, PROFILE_URL_AUTHORITY, toUserDataProfileUri, isProfileURL, PROFILE_URL_AUTHORITY_PREFIX, PROFILE_EXTENSION, PROFILE_FILTER } from '@codingame/monaco-vscode-dd5b2d07-86ca-557c-8510-224a400e258d-common/vscode/vs/workbench/services/userDataProfile/common/userDataProfile';
|
|
10
11
|
import { IUserDataProfileService, IUserDataProfileManagementService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.service';
|
|
11
12
|
import { Disposable, toDisposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
12
13
|
import { IDialogService, IFileDialogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service';
|
|
@@ -90,7 +91,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
90
91
|
sticky: true,
|
|
91
92
|
cancellable: true,
|
|
92
93
|
}, async (progress) => {
|
|
93
|
-
const reportProgress = (message) => progress.report({ message: ( localize(
|
|
94
|
+
const reportProgress = (message) => progress.report({ message: ( localize(14300, "Create Profile: {0}", message)) });
|
|
94
95
|
creationPromise = createCancelablePromise(async (token) => {
|
|
95
96
|
const userDataProfilesExportState = disposables.add(this.instantiationService.createInstance(UserDataProfileExportState, from, { ...options?.resourceTypeFlags, extensions: false }));
|
|
96
97
|
const profileTemplate = await userDataProfilesExportState.getProfileTemplate(options.name ?? from.name, options?.icon);
|
|
@@ -106,7 +107,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
106
107
|
try {
|
|
107
108
|
await creationPromise;
|
|
108
109
|
if (profile && (options?.resourceTypeFlags?.extensions ?? true)) {
|
|
109
|
-
reportProgress(( localize(
|
|
110
|
+
reportProgress(( localize(14301, "Installing Extensions...")));
|
|
110
111
|
await this.instantiationService.createInstance(ExtensionsResource).copy(from, profile, false);
|
|
111
112
|
}
|
|
112
113
|
}
|
|
@@ -130,7 +131,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
130
131
|
sticky: true,
|
|
131
132
|
cancellable: true,
|
|
132
133
|
}, async (progress) => {
|
|
133
|
-
const reportProgress = (message) => progress.report({ message: ( localize(
|
|
134
|
+
const reportProgress = (message) => progress.report({ message: ( localize(14300, "Create Profile: {0}", message)) });
|
|
134
135
|
creationPromise = createCancelablePromise(async (token) => {
|
|
135
136
|
profile = await this.getProfileToImport({ ...profileTemplate, name: options.name ?? profileTemplate.name }, !!options.transient, options);
|
|
136
137
|
if (!profile) {
|
|
@@ -155,42 +156,42 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
155
156
|
}
|
|
156
157
|
async applyProfileTemplate(profileTemplate, profile, options, reportProgress, token) {
|
|
157
158
|
if (profileTemplate.settings && (options.resourceTypeFlags?.settings ?? true) && !profile.useDefaultFlags?.settings) {
|
|
158
|
-
reportProgress(( localize(
|
|
159
|
+
reportProgress(( localize(14302, "Creating Settings...")));
|
|
159
160
|
await this.instantiationService.createInstance(SettingsResource).apply(profileTemplate.settings, profile);
|
|
160
161
|
}
|
|
161
162
|
if (token.isCancellationRequested) {
|
|
162
163
|
return;
|
|
163
164
|
}
|
|
164
165
|
if (profileTemplate.keybindings && (options.resourceTypeFlags?.keybindings ?? true) && !profile.useDefaultFlags?.keybindings) {
|
|
165
|
-
reportProgress(( localize(
|
|
166
|
+
reportProgress(( localize(14303, "Creating Keyboard Shortcuts...")));
|
|
166
167
|
await this.instantiationService.createInstance(KeybindingsResource).apply(profileTemplate.keybindings, profile);
|
|
167
168
|
}
|
|
168
169
|
if (token.isCancellationRequested) {
|
|
169
170
|
return;
|
|
170
171
|
}
|
|
171
172
|
if (profileTemplate.tasks && (options.resourceTypeFlags?.tasks ?? true) && !profile.useDefaultFlags?.tasks) {
|
|
172
|
-
reportProgress(( localize(
|
|
173
|
+
reportProgress(( localize(14304, "Creating Tasks...")));
|
|
173
174
|
await this.instantiationService.createInstance(TasksResource).apply(profileTemplate.tasks, profile);
|
|
174
175
|
}
|
|
175
176
|
if (token.isCancellationRequested) {
|
|
176
177
|
return;
|
|
177
178
|
}
|
|
178
179
|
if (profileTemplate.snippets && (options.resourceTypeFlags?.snippets ?? true) && !profile.useDefaultFlags?.snippets) {
|
|
179
|
-
reportProgress(( localize(
|
|
180
|
+
reportProgress(( localize(14305, "Creating Snippets...")));
|
|
180
181
|
await this.instantiationService.createInstance(SnippetsResource).apply(profileTemplate.snippets, profile);
|
|
181
182
|
}
|
|
182
183
|
if (token.isCancellationRequested) {
|
|
183
184
|
return;
|
|
184
185
|
}
|
|
185
186
|
if (profileTemplate.globalState && !profile.useDefaultFlags?.globalState) {
|
|
186
|
-
reportProgress(( localize(
|
|
187
|
+
reportProgress(( localize(14306, "Applying UI State...")));
|
|
187
188
|
await this.instantiationService.createInstance(GlobalStateResource).apply(profileTemplate.globalState, profile);
|
|
188
189
|
}
|
|
189
190
|
if (token.isCancellationRequested) {
|
|
190
191
|
return;
|
|
191
192
|
}
|
|
192
193
|
if (profileTemplate.extensions && (options.resourceTypeFlags?.extensions ?? true) && !profile.useDefaultFlags?.extensions) {
|
|
193
|
-
reportProgress(( localize(
|
|
194
|
+
reportProgress(( localize(14301, "Installing Extensions...")));
|
|
194
195
|
await this.instantiationService.createInstance(ExtensionsResource).apply(profileTemplate.extensions, profile, reportProgress, token);
|
|
195
196
|
}
|
|
196
197
|
}
|
|
@@ -207,18 +208,18 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
207
208
|
async createTroubleshootProfile() {
|
|
208
209
|
const userDataProfilesExportState = this.instantiationService.createInstance(UserDataProfileExportState, this.userDataProfileService.currentProfile, undefined);
|
|
209
210
|
try {
|
|
210
|
-
const profileTemplate = await userDataProfilesExportState.getProfileTemplate(( localize(
|
|
211
|
+
const profileTemplate = await userDataProfilesExportState.getProfileTemplate(( localize(14307, "Troubleshoot Issue")), undefined);
|
|
211
212
|
await this.progressService.withProgress({
|
|
212
213
|
location: ProgressLocation.Notification,
|
|
213
214
|
delay: 1000,
|
|
214
215
|
sticky: true,
|
|
215
216
|
}, async (progress) => {
|
|
216
|
-
const reportProgress = (message) => progress.report({ message: ( localize(
|
|
217
|
+
const reportProgress = (message) => progress.report({ message: ( localize(14308, "Setting up Troubleshoot Profile: {0}", message)) });
|
|
217
218
|
const profile = await this.doCreateProfile(profileTemplate, true, false, { useDefaultFlags: this.userDataProfileService.currentProfile.useDefaultFlags }, reportProgress);
|
|
218
219
|
if (profile) {
|
|
219
|
-
reportProgress(( localize(
|
|
220
|
+
reportProgress(( localize(14309, "Applying Extensions...")));
|
|
220
221
|
await this.instantiationService.createInstance(ExtensionsResource).copy(this.userDataProfileService.currentProfile, profile, true);
|
|
221
|
-
reportProgress(( localize(
|
|
222
|
+
reportProgress(( localize(14310, "Switching Profile...")));
|
|
222
223
|
await this.userDataProfileManagementService.switchProfile(profile);
|
|
223
224
|
}
|
|
224
225
|
});
|
|
@@ -236,7 +237,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
236
237
|
try {
|
|
237
238
|
await this.progressService.withProgress({
|
|
238
239
|
location,
|
|
239
|
-
title: ( localize(
|
|
240
|
+
title: ( localize(14311, "{0}: Exporting...", PROFILES_CATEGORY.value)),
|
|
240
241
|
}, async (progress) => {
|
|
241
242
|
const id = await this.pickProfileContentHandler(profile.name);
|
|
242
243
|
if (!id) {
|
|
@@ -250,17 +251,17 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
250
251
|
if (!saveResult) {
|
|
251
252
|
return;
|
|
252
253
|
}
|
|
253
|
-
const message = ( localize(
|
|
254
|
+
const message = ( localize(14312, "Profile '{0}' was exported successfully.", profile.name));
|
|
254
255
|
if (profileContentHandler.extensionId) {
|
|
255
256
|
const buttons = [];
|
|
256
257
|
const link = this.productService.webUrl ? `${this.productService.webUrl}/${PROFILE_URL_AUTHORITY}/${id}/${saveResult.id}` : ( toUserDataProfileUri(`/${id}/${saveResult.id}`, this.productService).toString());
|
|
257
258
|
buttons.push({
|
|
258
|
-
label: ( localize(
|
|
259
|
+
label: ( localize(14313, "&&Copy Link")),
|
|
259
260
|
run: () => this.clipboardService.writeText(link)
|
|
260
261
|
});
|
|
261
262
|
if (this.productService.webUrl) {
|
|
262
263
|
buttons.push({
|
|
263
|
-
label: ( localize(
|
|
264
|
+
label: ( localize(14314, "&&Open Link")),
|
|
264
265
|
run: async () => {
|
|
265
266
|
await this.openerService.open(link);
|
|
266
267
|
}
|
|
@@ -268,7 +269,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
268
269
|
}
|
|
269
270
|
else {
|
|
270
271
|
buttons.push({
|
|
271
|
-
label: ( localize(
|
|
272
|
+
label: ( localize(14315, "&&Open in {0}", profileContentHandler.name)),
|
|
272
273
|
run: async () => {
|
|
273
274
|
await this.openerService.open(( saveResult.link.toString()));
|
|
274
275
|
}
|
|
@@ -278,7 +279,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
278
279
|
type: Severity.Info,
|
|
279
280
|
message,
|
|
280
281
|
buttons,
|
|
281
|
-
cancelButton: ( localize(
|
|
282
|
+
cancelButton: ( localize(14316, "Close"))
|
|
282
283
|
});
|
|
283
284
|
}
|
|
284
285
|
else {
|
|
@@ -300,10 +301,10 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
300
301
|
profileTemplate = JSON.parse(profileContent);
|
|
301
302
|
}
|
|
302
303
|
catch (error) {
|
|
303
|
-
throw ( new Error(( localize(
|
|
304
|
+
throw ( new Error(( localize(14317, "This profile is not valid."))));
|
|
304
305
|
}
|
|
305
306
|
if (!isUserDataProfileTemplate(profileTemplate)) {
|
|
306
|
-
throw ( new Error(( localize(
|
|
307
|
+
throw ( new Error(( localize(14317, "This profile is not valid."))));
|
|
307
308
|
}
|
|
308
309
|
if (options?.name) {
|
|
309
310
|
profileTemplate.name = options.name;
|
|
@@ -337,27 +338,27 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
337
338
|
return undefined;
|
|
338
339
|
}
|
|
339
340
|
if (profileTemplate.settings && !profile.useDefaultFlags?.settings) {
|
|
340
|
-
progress(( localize(
|
|
341
|
+
progress(( localize(14318, "Applying Settings...")));
|
|
341
342
|
await this.instantiationService.createInstance(SettingsResource).apply(profileTemplate.settings, profile);
|
|
342
343
|
}
|
|
343
344
|
if (profileTemplate.keybindings && !profile.useDefaultFlags?.keybindings) {
|
|
344
|
-
progress(( localize(
|
|
345
|
+
progress(( localize(14319, "Applying Keyboard Shortcuts...")));
|
|
345
346
|
await this.instantiationService.createInstance(KeybindingsResource).apply(profileTemplate.keybindings, profile);
|
|
346
347
|
}
|
|
347
348
|
if (profileTemplate.tasks && !profile.useDefaultFlags?.tasks) {
|
|
348
|
-
progress(( localize(
|
|
349
|
+
progress(( localize(14320, "Applying Tasks...")));
|
|
349
350
|
await this.instantiationService.createInstance(TasksResource).apply(profileTemplate.tasks, profile);
|
|
350
351
|
}
|
|
351
352
|
if (profileTemplate.snippets && !profile.useDefaultFlags?.snippets) {
|
|
352
|
-
progress(( localize(
|
|
353
|
+
progress(( localize(14321, "Applying Snippets...")));
|
|
353
354
|
await this.instantiationService.createInstance(SnippetsResource).apply(profileTemplate.snippets, profile);
|
|
354
355
|
}
|
|
355
356
|
if (profileTemplate.globalState && !profile.useDefaultFlags?.globalState) {
|
|
356
|
-
progress(( localize(
|
|
357
|
+
progress(( localize(14322, "Applying State...")));
|
|
357
358
|
await this.instantiationService.createInstance(GlobalStateResource).apply(profileTemplate.globalState, profile);
|
|
358
359
|
}
|
|
359
360
|
if (profileTemplate.extensions && extensions && !profile.useDefaultFlags?.extensions) {
|
|
360
|
-
progress(( localize(
|
|
361
|
+
progress(( localize(14309, "Applying Extensions...")));
|
|
361
362
|
await this.instantiationService.createInstance(ExtensionsResource).apply(profileTemplate.extensions, profile);
|
|
362
363
|
}
|
|
363
364
|
return profile;
|
|
@@ -408,7 +409,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
408
409
|
options.push({ id, label: profileContentHandler.name, description: profileContentHandler.description });
|
|
409
410
|
}
|
|
410
411
|
const result = await this.quickInputService.pick(options.reverse(), {
|
|
411
|
-
title: ( localize(
|
|
412
|
+
title: ( localize(14323, "Export '{0}' profile as...", name)),
|
|
412
413
|
hideInput: true
|
|
413
414
|
});
|
|
414
415
|
return result?.id;
|
|
@@ -423,11 +424,11 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
423
424
|
const { confirmed } = await this.dialogService.confirm({
|
|
424
425
|
type: Severity.Info,
|
|
425
426
|
message: ( localize(
|
|
426
|
-
|
|
427
|
+
14324,
|
|
427
428
|
"Profile with name '{0}' already exists. Do you want to replace its contents?",
|
|
428
429
|
profileName
|
|
429
430
|
)),
|
|
430
|
-
primaryButton: ( localize(
|
|
431
|
+
primaryButton: ( localize(14325, "&&Replace"))
|
|
431
432
|
});
|
|
432
433
|
if (!confirmed) {
|
|
433
434
|
return undefined;
|
|
@@ -471,12 +472,12 @@ let FileUserDataProfileContentHandler = class FileUserDataProfileContentHandler
|
|
|
471
472
|
this.fileService = fileService;
|
|
472
473
|
this.productService = productService;
|
|
473
474
|
this.textFileService = textFileService;
|
|
474
|
-
this.name = ( localize(
|
|
475
|
-
this.description = ( localize(
|
|
475
|
+
this.name = ( localize(14326, "Local"));
|
|
476
|
+
this.description = ( localize(14327, "file"));
|
|
476
477
|
}
|
|
477
478
|
async saveProfile(name, content, token) {
|
|
478
479
|
const link = await this.fileDialogService.showSaveDialog({
|
|
479
|
-
title: ( localize(
|
|
480
|
+
title: ( localize(14328, "Save Profile")),
|
|
480
481
|
filters: PROFILE_FILTER,
|
|
481
482
|
defaultUri: this.uriIdentityService.extUri.joinPath(await this.fileDialogService.defaultFilePath(), `${name}.${PROFILE_EXTENSION}`),
|
|
482
483
|
});
|
|
@@ -501,7 +502,7 @@ let FileUserDataProfileContentHandler = class FileUserDataProfileContentHandler
|
|
|
501
502
|
canSelectFiles: true,
|
|
502
503
|
canSelectMany: false,
|
|
503
504
|
filters: PROFILE_FILTER,
|
|
504
|
-
title: ( localize(
|
|
505
|
+
title: ( localize(14329, "Select Profile")),
|
|
505
506
|
});
|
|
506
507
|
return profileLocation ? profileLocation[0] : null;
|
|
507
508
|
}
|
|
@@ -546,15 +547,16 @@ let UserDataProfileImportExportState = class UserDataProfileImportExportState ex
|
|
|
546
547
|
this.rootsPromise = (async () => {
|
|
547
548
|
this.roots = await this.fetchRoots();
|
|
548
549
|
for (const root of this.roots) {
|
|
550
|
+
const labelText = isMarkdownString(root.label.label) ? root.label.label.value : root.label.label;
|
|
549
551
|
root.checkbox = {
|
|
550
552
|
isChecked: !root.isFromDefaultProfile(),
|
|
551
|
-
tooltip: ( localize(
|
|
553
|
+
tooltip: ( localize(14330, "Select {0}", labelText)),
|
|
552
554
|
accessibilityInformation: {
|
|
553
|
-
label: ( localize(
|
|
555
|
+
label: ( localize(14330, "Select {0}", labelText)),
|
|
554
556
|
}
|
|
555
557
|
};
|
|
556
558
|
if (root.isFromDefaultProfile()) {
|
|
557
|
-
root.description = ( localize(
|
|
559
|
+
root.description = ( localize(14331, "From Default Profile"));
|
|
558
560
|
}
|
|
559
561
|
}
|
|
560
562
|
return this.roots;
|
|
@@ -714,11 +716,11 @@ let UserDataProfileExportState = class UserDataProfileExportState extends UserDa
|
|
|
714
716
|
let name = this.profile.name;
|
|
715
717
|
if (this.profile.isDefault) {
|
|
716
718
|
name = await this.quickInputService.input({
|
|
717
|
-
placeHolder: ( localize(
|
|
718
|
-
title: ( localize(
|
|
719
|
+
placeHolder: ( localize(14332, "Name the profile")),
|
|
720
|
+
title: ( localize(14333, "Export Profile")),
|
|
719
721
|
async validateInput(input) {
|
|
720
722
|
if (!input.trim()) {
|
|
721
|
-
return localize(
|
|
723
|
+
return localize(14334, "Profile name must be provided.");
|
|
722
724
|
}
|
|
723
725
|
return undefined;
|
|
724
726
|
},
|
package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { IWorkspaceContextService } from "@codingame/monaco-vscode-api/vscode/vs
|
|
|
11
11
|
import { IWorkbenchEnvironmentService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/common/environmentService.service";
|
|
12
12
|
import { IExtensionService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service";
|
|
13
13
|
import { IHostService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/host/browser/host.service";
|
|
14
|
-
import { IProfileTemplateInfo } from "@codingame/monaco-vscode-
|
|
14
|
+
import { IProfileTemplateInfo } from "@codingame/monaco-vscode-dd5b2d07-86ca-557c-8510-224a400e258d-common/vscode/vs/workbench/services/userDataProfile/common/userDataProfile";
|
|
15
15
|
import { IUserDataProfileManagementService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.service";
|
|
16
16
|
import { IUserDataProfileService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.service";
|
|
17
17
|
export declare class UserDataProfileManagementService extends Disposable implements IUserDataProfileManagementService {
|
package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.js
CHANGED
|
@@ -43,7 +43,7 @@ let UserDataProfileManagementService = class UserDataProfileManagementService ex
|
|
|
43
43
|
const profileToUse = this.getProfileToUseForCurrentWorkspace();
|
|
44
44
|
this.switchProfile(profileToUse);
|
|
45
45
|
this.changeCurrentProfile(profileToUse, ( localize(
|
|
46
|
-
|
|
46
|
+
14335,
|
|
47
47
|
"The current profile has been removed. Please reload to switch back to default profile"
|
|
48
48
|
)));
|
|
49
49
|
return;
|
|
@@ -54,13 +54,13 @@ let UserDataProfileManagementService = class UserDataProfileManagementService ex
|
|
|
54
54
|
if (profileToUse?.id !== updatedCurrentProfile.id) {
|
|
55
55
|
this.switchProfile(profileToUse);
|
|
56
56
|
this.changeCurrentProfile(profileToUse, ( localize(
|
|
57
|
-
|
|
57
|
+
14336,
|
|
58
58
|
"The current workspace has been removed from the current profile. Please reload to switch back to the updated profile"
|
|
59
59
|
)));
|
|
60
60
|
}
|
|
61
61
|
else {
|
|
62
62
|
this.changeCurrentProfile(updatedCurrentProfile, ( localize(
|
|
63
|
-
|
|
63
|
+
14337,
|
|
64
64
|
"The current profile has been updated. Please reload to switch back to the updated profile"
|
|
65
65
|
)));
|
|
66
66
|
}
|
|
@@ -120,7 +120,7 @@ let UserDataProfileManagementService = class UserDataProfileManagementService ex
|
|
|
120
120
|
throw ( new Error(`Profile ${profile.name} does not exist`));
|
|
121
121
|
}
|
|
122
122
|
if (profile.isDefault) {
|
|
123
|
-
throw ( new Error(( localize(
|
|
123
|
+
throw ( new Error(( localize(14338, "Cannot rename the default profile"))));
|
|
124
124
|
}
|
|
125
125
|
const updatedProfile = await this.userDataProfilesService.updateProfile(profile, updateOptions);
|
|
126
126
|
return updatedProfile;
|
|
@@ -130,7 +130,7 @@ let UserDataProfileManagementService = class UserDataProfileManagementService ex
|
|
|
130
130
|
throw ( new Error(`Profile ${profile.name} does not exist`));
|
|
131
131
|
}
|
|
132
132
|
if (profile.isDefault) {
|
|
133
|
-
throw ( new Error(( localize(
|
|
133
|
+
throw ( new Error(( localize(14339, "Cannot delete the default profile"))));
|
|
134
134
|
}
|
|
135
135
|
await this.userDataProfilesService.removeProfile(profile);
|
|
136
136
|
}
|
|
@@ -173,7 +173,7 @@ let UserDataProfileManagementService = class UserDataProfileManagementService ex
|
|
|
173
173
|
const shouldRestartExtensionHosts = this.userDataProfileService.currentProfile.id !== profile.id || !equals(this.userDataProfileService.currentProfile.useDefaultFlags, profile.useDefaultFlags);
|
|
174
174
|
if (shouldRestartExtensionHosts) {
|
|
175
175
|
if (!isRemoteWindow) {
|
|
176
|
-
if (!(await this.extensionService.stopExtensionHosts(( localize(
|
|
176
|
+
if (!(await this.extensionService.stopExtensionHosts(( localize(14340, "Switching to a profile"))))) {
|
|
177
177
|
if (( this.userDataProfilesService.profiles.some(p => p.id === this.userDataProfileService.currentProfile.id))) {
|
|
178
178
|
await this.userDataProfilesService.setProfileForWorkspace(toWorkspaceIdentifier(this.workspaceContextService.getWorkspace()), this.userDataProfileService.currentProfile);
|
|
179
179
|
}
|
|
@@ -185,8 +185,8 @@ let UserDataProfileManagementService = class UserDataProfileManagementService ex
|
|
|
185
185
|
if (shouldRestartExtensionHosts) {
|
|
186
186
|
if (isRemoteWindow) {
|
|
187
187
|
const { confirmed } = await this.dialogService.confirm({
|
|
188
|
-
message: reloadMessage ?? ( localize(
|
|
189
|
-
primaryButton: ( localize(
|
|
188
|
+
message: reloadMessage ?? ( localize(14341, "Switching a profile requires reloading VS Code.")),
|
|
189
|
+
primaryButton: ( localize(14342, "&&Reload")),
|
|
190
190
|
});
|
|
191
191
|
if (confirmed) {
|
|
192
192
|
await this.hostService.reload();
|