@codingame/monaco-vscode-user-data-profile-service-override 25.1.2 → 26.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/vscode/src/vs/platform/userDataProfile/browser/userDataProfile.js +18 -15
- package/vscode/src/vs/platform/userDataProfile/common/userDataProfileStorageService.js +31 -19
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/media/userDataProfilesEditor.css +9 -4
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.js +144 -115
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfileActions.js +16 -10
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditor.js +889 -623
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditorModel.js +449 -296
- package/vscode/src/vs/workbench/services/userData/browser/userDataInit.js +6 -8
- package/vscode/src/vs/workbench/services/userDataProfile/browser/extensionsResource.js +135 -77
- package/vscode/src/vs/workbench/services/userDataProfile/browser/globalStateResource.js +33 -32
- package/vscode/src/vs/workbench/services/userDataProfile/browser/keybindingsResource.js +33 -34
- package/vscode/src/vs/workbench/services/userDataProfile/browser/mcpProfileResource.js +28 -33
- package/vscode/src/vs/workbench/services/userDataProfile/browser/settingsResource.js +42 -40
- package/vscode/src/vs/workbench/services/userDataProfile/browser/snippetsResource.js +23 -28
- package/vscode/src/vs/workbench/services/userDataProfile/browser/tasksResource.js +28 -33
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileImportExportService.js +209 -153
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileInit.js +28 -25
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.js +55 -41
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileStorageService.js +20 -9
- package/vscode/src/vs/workbench/services/userDataSync/browser/userDataSyncInit.js +111 -73
- package/vscode/src/vs/workbench/services/userDataSync/common/userDataSyncUtil.js +20 -15
- package/vscode/src/vs/base/browser/ui/radio/radio.css +0 -69
- package/vscode/src/vs/base/browser/ui/radio/radio.d.ts +0 -37
- package/vscode/src/vs/base/browser/ui/radio/radio.js +0 -72
|
@@ -58,7 +58,7 @@ import { UserDataProfileElement, AbstractUserDataProfileElement, NewProfileEleme
|
|
|
58
58
|
import { WorkbenchToolBar } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/toolbar';
|
|
59
59
|
import { createInstantHoverDelegate, getDefaultHoverDelegate } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/hover/hoverDelegateFactory';
|
|
60
60
|
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
61
|
-
import { Radio } from '
|
|
61
|
+
import { Radio } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/radio/radio';
|
|
62
62
|
import { MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
|
|
63
63
|
import { settingsTextInputBorder } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/preferences/common/settingsEditorColorRegistry';
|
|
64
64
|
import { renderMarkdown } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/markdownRenderer';
|
|
@@ -71,13 +71,14 @@ import { normalizeDriveLetter } from '@codingame/monaco-vscode-api/vscode/vs/bas
|
|
|
71
71
|
import { ActionBar } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/actionbar/actionbar';
|
|
72
72
|
import { registerIcon } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/iconRegistry';
|
|
73
73
|
import { DropdownMenuActionViewItem } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/dropdown/dropdownActionViewItem';
|
|
74
|
+
import { IEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/platform/environment/common/environment.service';
|
|
74
75
|
import { Orientation } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/sash/sash';
|
|
75
76
|
|
|
76
77
|
var UserDataProfilesEditor_1, ExistingProfileResourceTreeRenderer_1, NewProfileResourceTreeRenderer_1, ProfileResourceChildTreeItemRenderer_1, WorkspaceUriHostColumnRenderer_1, WorkspaceUriPathColumnRenderer_1, WorkspaceUriActionsColumnRenderer_1, UserDataProfilesEditorInput_1;
|
|
77
78
|
registerCss(userDataProfilesEditor);
|
|
78
|
-
const editIcon = registerIcon(
|
|
79
|
-
const removeIcon = registerIcon(
|
|
80
|
-
const profilesSashBorder = registerColor(
|
|
79
|
+
const editIcon = registerIcon("profiles-editor-edit-folder", Codicon.edit, ( localize(13312, "Icon for the edit folder icon in the profiles editor.")));
|
|
80
|
+
const removeIcon = registerIcon("profiles-editor-remove-folder", Codicon.close, ( localize(13313, "Icon for the remove folder icon in the profiles editor.")));
|
|
81
|
+
const profilesSashBorder = registerColor("profiles.sashBorder", PANEL_BORDER, ( localize(13314, "The color of the Profiles editor splitview sash border.")));
|
|
81
82
|
const listStyles = getListStyles({
|
|
82
83
|
listActiveSelectionBackground: editorBackground,
|
|
83
84
|
listActiveSelectionForeground: foreground,
|
|
@@ -95,13 +96,32 @@ const listStyles = getListStyles({
|
|
|
95
96
|
listInactiveFocusOutline: editorBackground,
|
|
96
97
|
treeIndentGuidesStroke: undefined,
|
|
97
98
|
treeInactiveIndentGuidesStroke: undefined,
|
|
98
|
-
tableOddRowsBackgroundColor: editorBackground
|
|
99
|
+
tableOddRowsBackgroundColor: editorBackground
|
|
99
100
|
});
|
|
100
101
|
let UserDataProfilesEditor = class UserDataProfilesEditor extends EditorPane {
|
|
101
|
-
static {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
static {
|
|
103
|
+
UserDataProfilesEditor_1 = this;
|
|
104
|
+
}
|
|
105
|
+
static {
|
|
106
|
+
this.ID = "workbench.editor.userDataProfiles";
|
|
107
|
+
}
|
|
108
|
+
constructor(
|
|
109
|
+
group,
|
|
110
|
+
telemetryService,
|
|
111
|
+
themeService,
|
|
112
|
+
storageService,
|
|
113
|
+
quickInputService,
|
|
114
|
+
fileDialogService,
|
|
115
|
+
contextMenuService,
|
|
116
|
+
instantiationService
|
|
117
|
+
) {
|
|
118
|
+
super(
|
|
119
|
+
UserDataProfilesEditor_1.ID,
|
|
120
|
+
group,
|
|
121
|
+
telemetryService,
|
|
122
|
+
themeService,
|
|
123
|
+
storageService
|
|
124
|
+
);
|
|
105
125
|
this.quickInputService = quickInputService;
|
|
106
126
|
this.fileDialogService = fileDialogService;
|
|
107
127
|
this.contextMenuService = contextMenuService;
|
|
@@ -116,11 +136,11 @@ let UserDataProfilesEditor = class UserDataProfilesEditor extends EditorPane {
|
|
|
116
136
|
}
|
|
117
137
|
}
|
|
118
138
|
createEditor(parent) {
|
|
119
|
-
this.container = append(parent, $(
|
|
120
|
-
const sidebarView = append(this.container, $(
|
|
121
|
-
const sidebarContainer = append(sidebarView, $(
|
|
122
|
-
const contentsView = append(this.container, $(
|
|
123
|
-
const contentsContainer = append(contentsView, $(
|
|
139
|
+
this.container = append(parent, $(".profiles-editor"));
|
|
140
|
+
const sidebarView = append(this.container, $(".sidebar-view"));
|
|
141
|
+
const sidebarContainer = append(sidebarView, $(".sidebar-container"));
|
|
142
|
+
const contentsView = append(this.container, $(".contents-view"));
|
|
143
|
+
const contentsContainer = append(contentsView, $(".contents-container"));
|
|
124
144
|
this.profileWidget = this._register(this.instantiationService.createInstance(ProfileWidget, contentsContainer));
|
|
125
145
|
this.splitView = ( new SplitView(this.container, {
|
|
126
146
|
orientation: Orientation.HORIZONTAL,
|
|
@@ -158,35 +178,44 @@ let UserDataProfilesEditor = class UserDataProfilesEditor extends EditorPane {
|
|
|
158
178
|
}
|
|
159
179
|
updateStyles() {
|
|
160
180
|
const borderColor = this.theme.getColor(profilesSashBorder);
|
|
161
|
-
this.splitView?.style({
|
|
181
|
+
this.splitView?.style({
|
|
182
|
+
separatorBorder: borderColor
|
|
183
|
+
});
|
|
162
184
|
}
|
|
163
185
|
renderSidebar(parent) {
|
|
164
|
-
this.renderNewProfileButton(append(parent, $(
|
|
186
|
+
this.renderNewProfileButton(append(parent, $(".new-profile-button")));
|
|
165
187
|
const renderer = this.instantiationService.createInstance(ProfileElementRenderer);
|
|
166
188
|
const delegate = ( new ProfileElementDelegate());
|
|
167
|
-
this.profilesList = this._register(this.instantiationService.createInstance(
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
189
|
+
this.profilesList = this._register(this.instantiationService.createInstance(
|
|
190
|
+
WorkbenchList,
|
|
191
|
+
"ProfilesList",
|
|
192
|
+
append(parent, $(".profiles-list")),
|
|
193
|
+
delegate,
|
|
194
|
+
[renderer],
|
|
195
|
+
{
|
|
196
|
+
multipleSelectionSupport: false,
|
|
197
|
+
setRowLineHeight: false,
|
|
198
|
+
horizontalScrolling: false,
|
|
199
|
+
accessibilityProvider: {
|
|
200
|
+
getAriaLabel(profileElement) {
|
|
201
|
+
return profileElement?.name ?? "";
|
|
202
|
+
},
|
|
203
|
+
getWidgetAriaLabel() {
|
|
204
|
+
return localize(13315, "Profiles");
|
|
205
|
+
}
|
|
174
206
|
},
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
if (e instanceof UserDataProfileElement) {
|
|
183
|
-
return e.profile.id;
|
|
207
|
+
openOnSingleClick: true,
|
|
208
|
+
identityProvider: {
|
|
209
|
+
getId(e) {
|
|
210
|
+
if (e instanceof UserDataProfileElement) {
|
|
211
|
+
return e.profile.id;
|
|
212
|
+
}
|
|
213
|
+
return e.name;
|
|
184
214
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
}));
|
|
215
|
+
},
|
|
216
|
+
alwaysConsumeMouseWheel: false
|
|
217
|
+
}
|
|
218
|
+
));
|
|
190
219
|
}
|
|
191
220
|
renderNewProfileButton(parent) {
|
|
192
221
|
const button = this._register(( new ButtonWithDropdown(parent, {
|
|
@@ -194,12 +223,12 @@ let UserDataProfilesEditor = class UserDataProfilesEditor extends EditorPane {
|
|
|
194
223
|
getActions: () => {
|
|
195
224
|
const actions = [];
|
|
196
225
|
if (this.templates.length) {
|
|
197
|
-
actions.push(( new SubmenuAction(
|
|
226
|
+
actions.push(( new SubmenuAction("from.template", ( localize(13316, "From Template")), this.getCreateFromTemplateActions())));
|
|
198
227
|
actions.push(( new Separator()));
|
|
199
228
|
}
|
|
200
229
|
actions.push(toAction({
|
|
201
|
-
id:
|
|
202
|
-
label: ( localize(
|
|
230
|
+
id: "importProfile",
|
|
231
|
+
label: ( localize(13317, "Import Profile...")),
|
|
203
232
|
run: () => this.importProfile()
|
|
204
233
|
}));
|
|
205
234
|
return actions;
|
|
@@ -210,7 +239,7 @@ let UserDataProfilesEditor = class UserDataProfilesEditor extends EditorPane {
|
|
|
210
239
|
supportIcons: true,
|
|
211
240
|
...defaultButtonStyles
|
|
212
241
|
})));
|
|
213
|
-
button.label = ( localize(
|
|
242
|
+
button.label = ( localize(13318, "New Profile"));
|
|
214
243
|
this._register(button.onDidClick(e => this.createNewProfile()));
|
|
215
244
|
}
|
|
216
245
|
getCreateFromTemplateActions() {
|
|
@@ -254,18 +283,18 @@ let UserDataProfilesEditor = class UserDataProfilesEditor extends EditorPane {
|
|
|
254
283
|
getTreeContextMenuActions() {
|
|
255
284
|
const actions = [];
|
|
256
285
|
actions.push(toAction({
|
|
257
|
-
id:
|
|
258
|
-
label: ( localize(
|
|
286
|
+
id: "newProfile",
|
|
287
|
+
label: ( localize(13318, "New Profile")),
|
|
259
288
|
run: () => this.createNewProfile()
|
|
260
289
|
}));
|
|
261
290
|
const templateActions = this.getCreateFromTemplateActions();
|
|
262
291
|
if (templateActions.length) {
|
|
263
|
-
actions.push(( new SubmenuAction(
|
|
292
|
+
actions.push(( new SubmenuAction("from.template", ( localize(13319, "New Profile From Template")), templateActions)));
|
|
264
293
|
}
|
|
265
294
|
actions.push(( new Separator()));
|
|
266
295
|
actions.push(toAction({
|
|
267
|
-
id:
|
|
268
|
-
label: ( localize(
|
|
296
|
+
id: "importProfile",
|
|
297
|
+
label: ( localize(13317, "Import Profile...")),
|
|
269
298
|
run: () => this.importProfile()
|
|
270
299
|
}));
|
|
271
300
|
return actions;
|
|
@@ -273,16 +302,21 @@ let UserDataProfilesEditor = class UserDataProfilesEditor extends EditorPane {
|
|
|
273
302
|
async importProfile() {
|
|
274
303
|
const disposables = ( new DisposableStore());
|
|
275
304
|
const quickPick = disposables.add(this.quickInputService.createQuickPick());
|
|
276
|
-
const updateQuickPickItems =
|
|
305
|
+
const updateQuickPickItems = value => {
|
|
277
306
|
const quickPickItems = [];
|
|
278
307
|
if (value) {
|
|
279
|
-
quickPickItems.push({
|
|
308
|
+
quickPickItems.push({
|
|
309
|
+
label: quickPick.value,
|
|
310
|
+
description: ( localize(13320, "Import from URL"))
|
|
311
|
+
});
|
|
280
312
|
}
|
|
281
|
-
quickPickItems.push({
|
|
313
|
+
quickPickItems.push({
|
|
314
|
+
label: ( localize(13321, "Select File..."))
|
|
315
|
+
});
|
|
282
316
|
quickPick.items = quickPickItems;
|
|
283
317
|
};
|
|
284
|
-
quickPick.title = ( localize(
|
|
285
|
-
quickPick.placeholder = ( localize(
|
|
318
|
+
quickPick.title = ( localize(13322, "Import from Profile Template..."));
|
|
319
|
+
quickPick.placeholder = ( localize(13323, "Provide Profile Template URL"));
|
|
286
320
|
quickPick.ignoreFocusOut = true;
|
|
287
321
|
disposables.add(quickPick.onDidChangeValue(updateQuickPickItems));
|
|
288
322
|
updateQuickPickItems();
|
|
@@ -317,7 +351,7 @@ let UserDataProfilesEditor = class UserDataProfilesEditor extends EditorPane {
|
|
|
317
351
|
canSelectFiles: true,
|
|
318
352
|
canSelectMany: false,
|
|
319
353
|
filters: PROFILE_FILTER,
|
|
320
|
-
title: ( localize(
|
|
354
|
+
title: ( localize(13324, "Select Profile Template File"))
|
|
321
355
|
});
|
|
322
356
|
if (!profileLocation) {
|
|
323
357
|
return null;
|
|
@@ -349,16 +383,14 @@ let UserDataProfilesEditor = class UserDataProfilesEditor extends EditorPane {
|
|
|
349
383
|
this.profilesList?.splice(0, this.profilesList.length, this.model.profiles);
|
|
350
384
|
if (elementToSelect) {
|
|
351
385
|
this.profilesList?.setSelection([this.model.profiles.indexOf(elementToSelect)]);
|
|
352
|
-
}
|
|
353
|
-
else if (currentSelection) {
|
|
386
|
+
} else if (currentSelection) {
|
|
354
387
|
if (!this.model.profiles.includes(currentSelection)) {
|
|
355
388
|
const elementToSelect = this.model.profiles.find(profile => profile.name === currentSelection.name) ?? this.model.profiles[0];
|
|
356
389
|
if (elementToSelect) {
|
|
357
390
|
this.profilesList?.setSelection([this.model.profiles.indexOf(elementToSelect)]);
|
|
358
391
|
}
|
|
359
392
|
}
|
|
360
|
-
}
|
|
361
|
-
else {
|
|
393
|
+
} else {
|
|
362
394
|
const elementToSelect = this.model.profiles.find(profile => profile.active) ?? this.model.profiles[0];
|
|
363
395
|
if (elementToSelect) {
|
|
364
396
|
this.profilesList?.setSelection([this.model.profiles.indexOf(elementToSelect)]);
|
|
@@ -366,49 +398,57 @@ let UserDataProfilesEditor = class UserDataProfilesEditor extends EditorPane {
|
|
|
366
398
|
}
|
|
367
399
|
}
|
|
368
400
|
};
|
|
369
|
-
UserDataProfilesEditor = UserDataProfilesEditor_1 = ( __decorate([
|
|
370
|
-
( __param(1, ITelemetryService)),
|
|
371
|
-
( __param(2, IThemeService)),
|
|
372
|
-
( __param(3, IStorageService)),
|
|
373
|
-
( __param(4, IQuickInputService)),
|
|
374
|
-
( __param(5, IFileDialogService)),
|
|
375
|
-
( __param(6, IContextMenuService)),
|
|
376
|
-
( __param(7, IInstantiationService))
|
|
377
|
-
], UserDataProfilesEditor));
|
|
401
|
+
UserDataProfilesEditor = UserDataProfilesEditor_1 = ( __decorate([( __param(1, ITelemetryService)), ( __param(2, IThemeService)), ( __param(3, IStorageService)), ( __param(4, IQuickInputService)), ( __param(5, IFileDialogService)), ( __param(6, IContextMenuService)), ( __param(7, IInstantiationService))], UserDataProfilesEditor));
|
|
378
402
|
class ProfileElementDelegate {
|
|
379
403
|
getHeight(element) {
|
|
380
404
|
return 22;
|
|
381
405
|
}
|
|
382
|
-
getTemplateId() {
|
|
406
|
+
getTemplateId() {
|
|
407
|
+
return "profileListElement";
|
|
408
|
+
}
|
|
383
409
|
}
|
|
384
410
|
let ProfileElementRenderer = class ProfileElementRenderer {
|
|
385
411
|
constructor(instantiationService) {
|
|
386
412
|
this.instantiationService = instantiationService;
|
|
387
|
-
this.templateId =
|
|
413
|
+
this.templateId = "profileListElement";
|
|
388
414
|
}
|
|
389
415
|
renderTemplate(container) {
|
|
390
416
|
const disposables = ( new DisposableStore());
|
|
391
417
|
const elementDisposables = ( new DisposableStore());
|
|
392
|
-
container.classList.add(
|
|
393
|
-
const icon = append(container, $(
|
|
394
|
-
const label = append(container, $(
|
|
418
|
+
container.classList.add("profile-list-item");
|
|
419
|
+
const icon = append(container, $(".profile-list-item-icon"));
|
|
420
|
+
const label = append(container, $(".profile-list-item-label"));
|
|
395
421
|
const dirty = append(container, $(`span${ThemeIcon.asCSSSelector(Codicon.circleFilled)}`));
|
|
396
|
-
const description = append(container, $(
|
|
397
|
-
append(
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
422
|
+
const description = append(container, $(".profile-list-item-description"));
|
|
423
|
+
append(
|
|
424
|
+
description,
|
|
425
|
+
$(`span${ThemeIcon.asCSSSelector(Codicon.check)}`),
|
|
426
|
+
$("span", undefined, ( localize(13325, "Active")))
|
|
427
|
+
);
|
|
428
|
+
const actionsContainer = append(container, $(".profile-tree-item-actions-container"));
|
|
429
|
+
const actionBar = disposables.add(
|
|
430
|
+
this.instantiationService.createInstance(WorkbenchToolBar, actionsContainer, {
|
|
431
|
+
hoverDelegate: disposables.add(createInstantHoverDelegate()),
|
|
432
|
+
highlightToggledItems: true
|
|
433
|
+
})
|
|
434
|
+
);
|
|
435
|
+
return {
|
|
436
|
+
label,
|
|
437
|
+
icon,
|
|
438
|
+
dirty,
|
|
439
|
+
description,
|
|
440
|
+
actionBar,
|
|
441
|
+
disposables,
|
|
442
|
+
elementDisposables
|
|
443
|
+
};
|
|
404
444
|
}
|
|
405
445
|
renderElement(element, index, templateData) {
|
|
406
446
|
templateData.elementDisposables.clear();
|
|
407
447
|
templateData.label.textContent = element.name;
|
|
408
|
-
templateData.label.classList.toggle(
|
|
448
|
+
templateData.label.classList.toggle("new-profile", element instanceof NewProfileElement);
|
|
409
449
|
templateData.icon.className = ThemeIcon.asClassName(element.icon ? ThemeIcon.fromId(element.icon) : DEFAULT_ICON);
|
|
410
|
-
templateData.dirty.classList.toggle(
|
|
411
|
-
templateData.description.classList.toggle(
|
|
450
|
+
templateData.dirty.classList.toggle("hide", !(element instanceof NewProfileElement));
|
|
451
|
+
templateData.description.classList.toggle("hide", !element.active);
|
|
412
452
|
templateData.elementDisposables.add(element.onDidChange(e => {
|
|
413
453
|
if (e.name) {
|
|
414
454
|
templateData.label.textContent = element.name;
|
|
@@ -416,16 +456,18 @@ let ProfileElementRenderer = class ProfileElementRenderer {
|
|
|
416
456
|
if (e.icon) {
|
|
417
457
|
if (element.icon) {
|
|
418
458
|
templateData.icon.className = ThemeIcon.asClassName(ThemeIcon.fromId(element.icon));
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
templateData.icon.className = 'hide';
|
|
459
|
+
} else {
|
|
460
|
+
templateData.icon.className = "hide";
|
|
422
461
|
}
|
|
423
462
|
}
|
|
424
463
|
if (e.active) {
|
|
425
|
-
templateData.description.classList.toggle(
|
|
464
|
+
templateData.description.classList.toggle("hide", !element.active);
|
|
426
465
|
}
|
|
427
466
|
}));
|
|
428
|
-
const setActions = () => templateData.actionBar.setActions(
|
|
467
|
+
const setActions = () => templateData.actionBar.setActions(
|
|
468
|
+
element.actions[0].filter(a => a.enabled),
|
|
469
|
+
element.actions[1].filter(a => a.enabled)
|
|
470
|
+
);
|
|
429
471
|
setActions();
|
|
430
472
|
const events = [];
|
|
431
473
|
for (const action of element.actions.flat()) {
|
|
@@ -447,9 +489,7 @@ let ProfileElementRenderer = class ProfileElementRenderer {
|
|
|
447
489
|
templateData.elementDisposables.dispose();
|
|
448
490
|
}
|
|
449
491
|
};
|
|
450
|
-
ProfileElementRenderer = ( __decorate([
|
|
451
|
-
( __param(0, IInstantiationService))
|
|
452
|
-
], ProfileElementRenderer));
|
|
492
|
+
ProfileElementRenderer = ( __decorate([( __param(0, IInstantiationService))], ProfileElementRenderer));
|
|
453
493
|
let ProfileWidget = class ProfileWidget extends Disposable {
|
|
454
494
|
set templates(templates) {
|
|
455
495
|
this.copyFromProfileRenderer.setTemplates(templates);
|
|
@@ -461,73 +501,92 @@ let ProfileWidget = class ProfileWidget extends Disposable {
|
|
|
461
501
|
this.instantiationService = instantiationService;
|
|
462
502
|
this._profileElement = this._register(( new MutableDisposable()));
|
|
463
503
|
this.layoutParticipants = [];
|
|
464
|
-
const header = append(parent, $(
|
|
465
|
-
const title = append(header, $(
|
|
466
|
-
this.profileTitle = append(title, $(
|
|
467
|
-
|
|
504
|
+
const header = append(parent, $(".profile-header"));
|
|
505
|
+
const title = append(header, $(".profile-title-container"));
|
|
506
|
+
this.profileTitle = append(title, $(".profile-title"));
|
|
507
|
+
this.builtInLabel = append(title, $(".profile-built-in-label", undefined, ( localize(13326, "Built-in"))));
|
|
508
|
+
this.builtInLabel.classList.add("hide");
|
|
509
|
+
const body = append(parent, $(".profile-body"));
|
|
468
510
|
const delegate = ( new ProfileTreeDelegate());
|
|
469
511
|
const contentsRenderer = this._register(this.instantiationService.createInstance(ContentsProfileRenderer));
|
|
470
512
|
const associationsRenderer = this._register(this.instantiationService.createInstance(ProfileWorkspacesRenderer));
|
|
471
513
|
this.layoutParticipants.push(associationsRenderer);
|
|
472
514
|
this.copyFromProfileRenderer = this._register(this.instantiationService.createInstance(CopyFromProfileRenderer));
|
|
473
|
-
this.profileTreeContainer = append(body, $(
|
|
474
|
-
this.profileTree = this._register(this.instantiationService.createInstance(
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
this.
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
515
|
+
this.profileTreeContainer = append(body, $(".profile-tree"));
|
|
516
|
+
this.profileTree = this._register(this.instantiationService.createInstance(
|
|
517
|
+
WorkbenchAsyncDataTree,
|
|
518
|
+
"ProfileEditor-Tree",
|
|
519
|
+
this.profileTreeContainer,
|
|
520
|
+
delegate,
|
|
521
|
+
[
|
|
522
|
+
this._register(this.instantiationService.createInstance(ProfileNameRenderer)),
|
|
523
|
+
this._register(this.instantiationService.createInstance(ProfileIconRenderer)),
|
|
524
|
+
this._register(
|
|
525
|
+
this.instantiationService.createInstance(UseForCurrentWindowPropertyRenderer)
|
|
526
|
+
),
|
|
527
|
+
this._register(this.instantiationService.createInstance(UseAsDefaultProfileRenderer)),
|
|
528
|
+
this.copyFromProfileRenderer,
|
|
529
|
+
contentsRenderer,
|
|
530
|
+
associationsRenderer
|
|
531
|
+
],
|
|
532
|
+
this.instantiationService.createInstance(ProfileTreeDataSource),
|
|
533
|
+
{
|
|
534
|
+
multipleSelectionSupport: false,
|
|
535
|
+
horizontalScrolling: false,
|
|
536
|
+
accessibilityProvider: {
|
|
537
|
+
getAriaLabel(element) {
|
|
538
|
+
return element?.element ?? "";
|
|
539
|
+
},
|
|
540
|
+
getWidgetAriaLabel() {
|
|
541
|
+
return "";
|
|
542
|
+
}
|
|
488
543
|
},
|
|
489
|
-
|
|
490
|
-
|
|
544
|
+
identityProvider: {
|
|
545
|
+
getId(element) {
|
|
546
|
+
return element.element;
|
|
547
|
+
}
|
|
491
548
|
},
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
openOnSingleClick: false,
|
|
502
|
-
setRowLineHeight: false,
|
|
503
|
-
supportDynamicHeights: true,
|
|
504
|
-
alwaysConsumeMouseWheel: false,
|
|
505
|
-
}));
|
|
549
|
+
expandOnlyOnTwistieClick: true,
|
|
550
|
+
renderIndentGuides: RenderIndentGuides.None,
|
|
551
|
+
enableStickyScroll: false,
|
|
552
|
+
openOnSingleClick: false,
|
|
553
|
+
setRowLineHeight: false,
|
|
554
|
+
supportDynamicHeights: true,
|
|
555
|
+
alwaysConsumeMouseWheel: false
|
|
556
|
+
}
|
|
557
|
+
));
|
|
506
558
|
this.profileTree.style(listStyles);
|
|
507
|
-
this._register(
|
|
508
|
-
|
|
509
|
-
|
|
559
|
+
this._register(
|
|
560
|
+
contentsRenderer.onDidChangeContentHeight(e => this.profileTree.updateElementHeight(e, undefined))
|
|
561
|
+
);
|
|
562
|
+
this._register(
|
|
563
|
+
associationsRenderer.onDidChangeContentHeight(e => this.profileTree.updateElementHeight(e, undefined))
|
|
564
|
+
);
|
|
565
|
+
this._register(contentsRenderer.onDidChangeSelection(e => {
|
|
510
566
|
if (e.selected) {
|
|
511
567
|
this.profileTree.setFocus([]);
|
|
512
568
|
this.profileTree.setSelection([]);
|
|
513
569
|
}
|
|
514
570
|
}));
|
|
515
|
-
this._register(this.profileTree.onDidChangeContentHeight(
|
|
571
|
+
this._register(this.profileTree.onDidChangeContentHeight(e => {
|
|
516
572
|
if (this.dimension) {
|
|
517
573
|
this.layout(this.dimension);
|
|
518
574
|
}
|
|
519
575
|
}));
|
|
520
|
-
this._register(this.profileTree.onDidChangeSelection(
|
|
576
|
+
this._register(this.profileTree.onDidChangeSelection(e => {
|
|
521
577
|
if (e.elements.length) {
|
|
522
578
|
contentsRenderer.clearSelection();
|
|
523
579
|
}
|
|
524
580
|
}));
|
|
525
|
-
this.buttonContainer = append(body, $(
|
|
581
|
+
this.buttonContainer = append(body, $(".profile-row-container.profile-button-container"));
|
|
526
582
|
}
|
|
527
583
|
layout(dimension) {
|
|
528
584
|
this.dimension = dimension;
|
|
529
585
|
const treeContentHeight = this.profileTree.contentHeight;
|
|
530
|
-
const height = Math.min(
|
|
586
|
+
const height = Math.min(
|
|
587
|
+
treeContentHeight,
|
|
588
|
+
dimension.height - (this._profileElement.value?.element instanceof NewProfileElement ? 116 : 54)
|
|
589
|
+
);
|
|
531
590
|
this.profileTreeContainer.style.height = `${height}px`;
|
|
532
591
|
this.profileTree.layout(height, dimension.width);
|
|
533
592
|
for (const participant of this.layoutParticipants) {
|
|
@@ -543,8 +602,15 @@ let ProfileWidget = class ProfileWidget extends Disposable {
|
|
|
543
602
|
}
|
|
544
603
|
this.profileTree.setInput(profileElement);
|
|
545
604
|
const disposables = ( new DisposableStore());
|
|
546
|
-
this._profileElement.value = {
|
|
605
|
+
this._profileElement.value = {
|
|
606
|
+
element: profileElement,
|
|
607
|
+
dispose: () => disposables.dispose()
|
|
608
|
+
};
|
|
547
609
|
this.profileTitle.textContent = profileElement.name;
|
|
610
|
+
this.builtInLabel.classList.toggle(
|
|
611
|
+
"hide",
|
|
612
|
+
!(profileElement instanceof UserDataProfileElement && profileElement.profile.isDefault)
|
|
613
|
+
);
|
|
548
614
|
disposables.add(profileElement.onDidChange(e => {
|
|
549
615
|
if (e.name) {
|
|
550
616
|
this.profileTitle.textContent = profileElement.name;
|
|
@@ -552,7 +618,7 @@ let ProfileWidget = class ProfileWidget extends Disposable {
|
|
|
552
618
|
}));
|
|
553
619
|
const [primaryTitleButtons, secondatyTitleButtons] = profileElement.titleButtons;
|
|
554
620
|
if (primaryTitleButtons?.length || secondatyTitleButtons?.length) {
|
|
555
|
-
this.buttonContainer.classList.remove(
|
|
621
|
+
this.buttonContainer.classList.remove("hide");
|
|
556
622
|
if (secondatyTitleButtons?.length) {
|
|
557
623
|
for (const action of secondatyTitleButtons) {
|
|
558
624
|
const button = disposables.add(( new Button(this.buttonContainer, {
|
|
@@ -561,8 +627,10 @@ let ProfileWidget = class ProfileWidget extends Disposable {
|
|
|
561
627
|
})));
|
|
562
628
|
button.label = action.label;
|
|
563
629
|
button.enabled = action.enabled;
|
|
564
|
-
disposables.add(
|
|
565
|
-
|
|
630
|
+
disposables.add(
|
|
631
|
+
button.onDidClick(() => this.editorProgressService.showWhile(action.run()))
|
|
632
|
+
);
|
|
633
|
+
disposables.add(action.onDidChange(e => {
|
|
566
634
|
if (!isUndefined(e.enabled)) {
|
|
567
635
|
button.enabled = action.enabled;
|
|
568
636
|
}
|
|
@@ -579,8 +647,10 @@ let ProfileWidget = class ProfileWidget extends Disposable {
|
|
|
579
647
|
})));
|
|
580
648
|
button.label = action.label;
|
|
581
649
|
button.enabled = action.enabled;
|
|
582
|
-
disposables.add(
|
|
583
|
-
|
|
650
|
+
disposables.add(
|
|
651
|
+
button.onDidClick(() => this.editorProgressService.showWhile(action.run()))
|
|
652
|
+
);
|
|
653
|
+
disposables.add(action.onDidChange(e => {
|
|
584
654
|
if (!isUndefined(e.enabled)) {
|
|
585
655
|
button.enabled = action.enabled;
|
|
586
656
|
}
|
|
@@ -591,14 +661,13 @@ let ProfileWidget = class ProfileWidget extends Disposable {
|
|
|
591
661
|
disposables.add(profileElement.onDidChange(e => {
|
|
592
662
|
if (e.message) {
|
|
593
663
|
button.setTitle(profileElement.message ?? action.label);
|
|
594
|
-
button.element.classList.toggle(
|
|
664
|
+
button.element.classList.toggle("error", !!profileElement.message);
|
|
595
665
|
}
|
|
596
666
|
}));
|
|
597
667
|
}
|
|
598
668
|
}
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
this.buttonContainer.classList.add('hide');
|
|
669
|
+
} else {
|
|
670
|
+
this.buttonContainer.classList.add("hide");
|
|
602
671
|
}
|
|
603
672
|
if (profileElement instanceof NewProfileElement) {
|
|
604
673
|
this.profileTree.focusFirst();
|
|
@@ -608,32 +677,42 @@ let ProfileWidget = class ProfileWidget extends Disposable {
|
|
|
608
677
|
}
|
|
609
678
|
}
|
|
610
679
|
};
|
|
611
|
-
ProfileWidget = ( __decorate([
|
|
612
|
-
( __param(1, IEditorProgressService)),
|
|
613
|
-
( __param(2, IInstantiationService))
|
|
614
|
-
], ProfileWidget));
|
|
680
|
+
ProfileWidget = ( __decorate([( __param(1, IEditorProgressService)), ( __param(2, IInstantiationService))], ProfileWidget));
|
|
615
681
|
class ProfileTreeDelegate extends CachedListVirtualDelegate {
|
|
616
|
-
getTemplateId(
|
|
682
|
+
getTemplateId(
|
|
683
|
+
{
|
|
684
|
+
element
|
|
685
|
+
}
|
|
686
|
+
) {
|
|
617
687
|
return element;
|
|
618
688
|
}
|
|
619
|
-
hasDynamicHeight(
|
|
620
|
-
|
|
689
|
+
hasDynamicHeight(
|
|
690
|
+
{
|
|
691
|
+
element
|
|
692
|
+
}
|
|
693
|
+
) {
|
|
694
|
+
return element === "contents" || element === "workspaces";
|
|
621
695
|
}
|
|
622
|
-
estimateHeight(
|
|
696
|
+
estimateHeight(
|
|
697
|
+
{
|
|
698
|
+
element,
|
|
699
|
+
root
|
|
700
|
+
}
|
|
701
|
+
) {
|
|
623
702
|
switch (element) {
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
703
|
+
case "name":
|
|
704
|
+
return 72;
|
|
705
|
+
case "icon":
|
|
706
|
+
return 68;
|
|
707
|
+
case "copyFrom":
|
|
708
|
+
return 90;
|
|
709
|
+
case "useForCurrent":
|
|
710
|
+
case "useAsDefault":
|
|
711
|
+
return 68;
|
|
712
|
+
case "contents":
|
|
713
|
+
return 258;
|
|
714
|
+
case "workspaces":
|
|
715
|
+
return (root.workspaces ? (root.workspaces.length * 24) + 30 : 0) + 112;
|
|
637
716
|
}
|
|
638
717
|
}
|
|
639
718
|
}
|
|
@@ -645,19 +724,45 @@ class ProfileTreeDataSource {
|
|
|
645
724
|
if (element instanceof AbstractUserDataProfileElement) {
|
|
646
725
|
const children = [];
|
|
647
726
|
if (element instanceof NewProfileElement) {
|
|
648
|
-
children.push({
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
727
|
+
children.push({
|
|
728
|
+
element: "name",
|
|
729
|
+
root: element
|
|
730
|
+
});
|
|
731
|
+
children.push({
|
|
732
|
+
element: "icon",
|
|
733
|
+
root: element
|
|
734
|
+
});
|
|
735
|
+
children.push({
|
|
736
|
+
element: "copyFrom",
|
|
737
|
+
root: element
|
|
738
|
+
});
|
|
739
|
+
children.push({
|
|
740
|
+
element: "contents",
|
|
741
|
+
root: element
|
|
742
|
+
});
|
|
743
|
+
} else if (element instanceof UserDataProfileElement) {
|
|
654
744
|
if (!element.profile.isDefault) {
|
|
655
|
-
children.push({
|
|
656
|
-
|
|
745
|
+
children.push({
|
|
746
|
+
element: "name",
|
|
747
|
+
root: element
|
|
748
|
+
});
|
|
749
|
+
children.push({
|
|
750
|
+
element: "icon",
|
|
751
|
+
root: element
|
|
752
|
+
});
|
|
657
753
|
}
|
|
658
|
-
children.push({
|
|
659
|
-
|
|
660
|
-
|
|
754
|
+
children.push({
|
|
755
|
+
element: "useAsDefault",
|
|
756
|
+
root: element
|
|
757
|
+
});
|
|
758
|
+
children.push({
|
|
759
|
+
element: "contents",
|
|
760
|
+
root: element
|
|
761
|
+
});
|
|
762
|
+
children.push({
|
|
763
|
+
element: "workspaces",
|
|
764
|
+
root: element
|
|
765
|
+
});
|
|
661
766
|
}
|
|
662
767
|
return children;
|
|
663
768
|
}
|
|
@@ -712,41 +817,44 @@ let ProfileResourceTreeDataSource = class ProfileResourceTreeDataSource {
|
|
|
712
817
|
async getChildren(element) {
|
|
713
818
|
if (element instanceof AbstractUserDataProfileElement) {
|
|
714
819
|
const children = await element.getChildren();
|
|
715
|
-
return ( children.map(e => ({
|
|
820
|
+
return ( children.map(e => ({
|
|
821
|
+
element: e,
|
|
822
|
+
root: element
|
|
823
|
+
})));
|
|
716
824
|
}
|
|
717
825
|
if (element.element.resourceType) {
|
|
718
826
|
const progressRunner = this.editorProgressService.show(true, 500);
|
|
719
827
|
try {
|
|
720
828
|
const extensions = await element.root.getChildren(element.element.resourceType);
|
|
721
|
-
return ( extensions.map(e => ({
|
|
722
|
-
|
|
723
|
-
|
|
829
|
+
return ( extensions.map(e => ({
|
|
830
|
+
element: e,
|
|
831
|
+
root: element.root
|
|
832
|
+
})));
|
|
833
|
+
} finally {
|
|
724
834
|
progressRunner.done();
|
|
725
835
|
}
|
|
726
836
|
}
|
|
727
837
|
return [];
|
|
728
838
|
}
|
|
729
839
|
};
|
|
730
|
-
ProfileResourceTreeDataSource = ( __decorate([
|
|
731
|
-
( __param(0, IEditorProgressService))
|
|
732
|
-
], ProfileResourceTreeDataSource));
|
|
840
|
+
ProfileResourceTreeDataSource = ( __decorate([( __param(0, IEditorProgressService))], ProfileResourceTreeDataSource));
|
|
733
841
|
class AbstractProfileResourceTreeRenderer extends Disposable {
|
|
734
842
|
getResourceTypeTitle(resourceType) {
|
|
735
843
|
switch (resourceType) {
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
844
|
+
case ProfileResourceType.Settings:
|
|
845
|
+
return localize(13327, "Settings");
|
|
846
|
+
case ProfileResourceType.Keybindings:
|
|
847
|
+
return localize(13328, "Keyboard Shortcuts");
|
|
848
|
+
case ProfileResourceType.Snippets:
|
|
849
|
+
return localize(13329, "Snippets");
|
|
850
|
+
case ProfileResourceType.Tasks:
|
|
851
|
+
return localize(13330, "Tasks");
|
|
852
|
+
case ProfileResourceType.Mcp:
|
|
853
|
+
return localize(13331, "MCP Servers");
|
|
854
|
+
case ProfileResourceType.Extensions:
|
|
855
|
+
return localize(13332, "Extensions");
|
|
748
856
|
}
|
|
749
|
-
return
|
|
857
|
+
return "";
|
|
750
858
|
}
|
|
751
859
|
disposeElement(element, index, templateData) {
|
|
752
860
|
templateData.elementDisposables.clear();
|
|
@@ -756,7 +864,13 @@ class AbstractProfileResourceTreeRenderer extends Disposable {
|
|
|
756
864
|
}
|
|
757
865
|
}
|
|
758
866
|
class ProfilePropertyRenderer extends AbstractProfileResourceTreeRenderer {
|
|
759
|
-
renderElement(
|
|
867
|
+
renderElement(
|
|
868
|
+
{
|
|
869
|
+
element
|
|
870
|
+
},
|
|
871
|
+
index,
|
|
872
|
+
templateData
|
|
873
|
+
) {
|
|
760
874
|
templateData.elementDisposables.clear();
|
|
761
875
|
templateData.element = element;
|
|
762
876
|
}
|
|
@@ -766,25 +880,25 @@ let ProfileNameRenderer = class ProfileNameRenderer extends ProfilePropertyRende
|
|
|
766
880
|
super();
|
|
767
881
|
this.userDataProfilesService = userDataProfilesService;
|
|
768
882
|
this.contextViewService = contextViewService;
|
|
769
|
-
this.templateId =
|
|
883
|
+
this.templateId = "name";
|
|
770
884
|
}
|
|
771
885
|
renderTemplate(parent) {
|
|
772
886
|
const disposables = ( new DisposableStore());
|
|
773
887
|
const elementDisposables = disposables.add(( new DisposableStore()));
|
|
774
888
|
let profileElement;
|
|
775
|
-
const nameContainer = append(parent, $(
|
|
776
|
-
append(nameContainer, $(
|
|
889
|
+
const nameContainer = append(parent, $(".profile-row-container"));
|
|
890
|
+
append(nameContainer, $(".profile-label-element", undefined, ( localize(13333, "Name"))));
|
|
777
891
|
const nameInput = disposables.add(( new InputBox(nameContainer, this.contextViewService, {
|
|
778
892
|
inputBoxStyles: getInputBoxStyle({
|
|
779
893
|
inputBorder: settingsTextInputBorder
|
|
780
894
|
}),
|
|
781
|
-
ariaLabel: ( localize(
|
|
782
|
-
placeholder: ( localize(
|
|
895
|
+
ariaLabel: ( localize(13334, "Profile Name")),
|
|
896
|
+
placeholder: ( localize(13334, "Profile Name")),
|
|
783
897
|
validationOptions: {
|
|
784
|
-
validation:
|
|
898
|
+
validation: value => {
|
|
785
899
|
if (!value) {
|
|
786
900
|
return {
|
|
787
|
-
content: ( localize(
|
|
901
|
+
content: ( localize(13335, "Profile name is required and must be a non-empty value.")),
|
|
788
902
|
type: MessageType.WARNING
|
|
789
903
|
};
|
|
790
904
|
}
|
|
@@ -798,7 +912,7 @@ let ProfileNameRenderer = class ProfileNameRenderer extends ProfilePropertyRende
|
|
|
798
912
|
value = value.trim();
|
|
799
913
|
if (initialName !== value && ( this.userDataProfilesService.profiles.some(p => !p.isTransient && p.name === value))) {
|
|
800
914
|
return {
|
|
801
|
-
content: ( localize(
|
|
915
|
+
content: ( localize(13336, "Profile with name {0} already exists.", value)),
|
|
802
916
|
type: MessageType.WARNING
|
|
803
917
|
};
|
|
804
918
|
}
|
|
@@ -817,21 +931,19 @@ let ProfileNameRenderer = class ProfileNameRenderer extends ProfilePropertyRende
|
|
|
817
931
|
nameInput.value = profileElement.root.name;
|
|
818
932
|
}
|
|
819
933
|
}));
|
|
820
|
-
const renderName =
|
|
934
|
+
const renderName = profileElement => {
|
|
821
935
|
nameInput.value = profileElement.root.name;
|
|
822
936
|
nameInput.validate();
|
|
823
|
-
const
|
|
824
|
-
if (profileElement.root.disabled ||
|
|
937
|
+
const isSystemProfile = profileElement.root instanceof UserDataProfileElement && (profileElement.root.profile.isDefault);
|
|
938
|
+
if (profileElement.root.disabled || isSystemProfile) {
|
|
825
939
|
nameInput.disable();
|
|
826
|
-
}
|
|
827
|
-
else {
|
|
940
|
+
} else {
|
|
828
941
|
nameInput.enable();
|
|
829
942
|
}
|
|
830
|
-
if (
|
|
831
|
-
nameInput.setTooltip(( localize(
|
|
832
|
-
}
|
|
833
|
-
|
|
834
|
-
nameInput.setTooltip(( localize(12972, "Profile Name")));
|
|
943
|
+
if (isSystemProfile) {
|
|
944
|
+
nameInput.setTooltip(( localize(13337, "Name cannot be changed for the built in profiles")));
|
|
945
|
+
} else {
|
|
946
|
+
nameInput.setTooltip(( localize(13334, "Profile Name")));
|
|
835
947
|
}
|
|
836
948
|
};
|
|
837
949
|
return {
|
|
@@ -852,28 +964,32 @@ let ProfileNameRenderer = class ProfileNameRenderer extends ProfilePropertyRende
|
|
|
852
964
|
};
|
|
853
965
|
}
|
|
854
966
|
};
|
|
855
|
-
ProfileNameRenderer = ( __decorate([
|
|
856
|
-
( __param(0, IUserDataProfilesService)),
|
|
857
|
-
( __param(1, IContextViewService))
|
|
858
|
-
], ProfileNameRenderer));
|
|
967
|
+
ProfileNameRenderer = ( __decorate([( __param(0, IUserDataProfilesService)), ( __param(1, IContextViewService))], ProfileNameRenderer));
|
|
859
968
|
let ProfileIconRenderer = class ProfileIconRenderer extends ProfilePropertyRenderer {
|
|
860
969
|
constructor(instantiationService, hoverService) {
|
|
861
970
|
super();
|
|
862
971
|
this.instantiationService = instantiationService;
|
|
863
972
|
this.hoverService = hoverService;
|
|
864
|
-
this.templateId =
|
|
865
|
-
this.hoverDelegate = getDefaultHoverDelegate(
|
|
973
|
+
this.templateId = "icon";
|
|
974
|
+
this.hoverDelegate = getDefaultHoverDelegate("element");
|
|
866
975
|
}
|
|
867
976
|
renderTemplate(parent) {
|
|
868
977
|
const disposables = ( new DisposableStore());
|
|
869
978
|
const elementDisposables = disposables.add(( new DisposableStore()));
|
|
870
979
|
let profileElement;
|
|
871
|
-
const iconContainer = append(parent, $(
|
|
872
|
-
append(iconContainer, $(
|
|
873
|
-
const iconValueContainer = append(iconContainer, $(
|
|
874
|
-
const iconElement = append(iconValueContainer, $(`${ThemeIcon.asCSSSelector(DEFAULT_ICON)}`, {
|
|
875
|
-
|
|
876
|
-
|
|
980
|
+
const iconContainer = append(parent, $(".profile-row-container"));
|
|
981
|
+
append(iconContainer, $(".profile-label-element", undefined, ( localize(13338, "Icon"))));
|
|
982
|
+
const iconValueContainer = append(iconContainer, $(".profile-icon-container"));
|
|
983
|
+
const iconElement = append(iconValueContainer, $(`${ThemeIcon.asCSSSelector(DEFAULT_ICON)}`, {
|
|
984
|
+
"tabindex": "0",
|
|
985
|
+
"role": "button",
|
|
986
|
+
"aria-label": ( localize(13339, "Profile Icon"))
|
|
987
|
+
}));
|
|
988
|
+
const iconHover = disposables.add(this.hoverService.setupManagedHover(this.hoverDelegate, iconElement, ""));
|
|
989
|
+
const iconSelectBox = disposables.add(this.instantiationService.createInstance(WorkbenchIconSelectBox, {
|
|
990
|
+
icons: ICONS,
|
|
991
|
+
inputBoxStyles: defaultInputBoxStyles
|
|
992
|
+
}));
|
|
877
993
|
let hoverWidget;
|
|
878
994
|
const showIconSelectBox = () => {
|
|
879
995
|
if (profileElement?.root instanceof UserDataProfileElement && profileElement.root.profile.isDefault) {
|
|
@@ -890,21 +1006,21 @@ let ProfileIconRenderer = class ProfileIconRenderer extends ProfilePropertyRende
|
|
|
890
1006
|
content: iconSelectBox.domNode,
|
|
891
1007
|
target: iconElement,
|
|
892
1008
|
position: {
|
|
893
|
-
hoverPosition: HoverPosition.BELOW
|
|
1009
|
+
hoverPosition: HoverPosition.BELOW
|
|
894
1010
|
},
|
|
895
1011
|
persistence: {
|
|
896
|
-
sticky: true
|
|
1012
|
+
sticky: true
|
|
897
1013
|
},
|
|
898
1014
|
appearance: {
|
|
899
|
-
showPointer: true
|
|
900
|
-
}
|
|
1015
|
+
showPointer: true
|
|
1016
|
+
}
|
|
901
1017
|
}, true);
|
|
902
1018
|
if (hoverWidget) {
|
|
903
1019
|
iconSelectBox.layout(( new Dimension(486, 292)));
|
|
904
1020
|
iconSelectBox.focus();
|
|
905
1021
|
}
|
|
906
1022
|
};
|
|
907
|
-
disposables.add(addDisposableListener(iconElement, EventType.CLICK,
|
|
1023
|
+
disposables.add(addDisposableListener(iconElement, EventType.CLICK, e => {
|
|
908
1024
|
EventHelper.stop(e, true);
|
|
909
1025
|
showIconSelectBox();
|
|
910
1026
|
}));
|
|
@@ -930,20 +1046,21 @@ let ProfileIconRenderer = class ProfileIconRenderer extends ProfilePropertyRende
|
|
|
930
1046
|
profileElement.root.icon = selectedIcon.id;
|
|
931
1047
|
}
|
|
932
1048
|
}));
|
|
933
|
-
append(
|
|
934
|
-
|
|
1049
|
+
append(
|
|
1050
|
+
iconValueContainer,
|
|
1051
|
+
$(".profile-description-element", undefined, ( localize(13340, "Profile icon to be shown in the activity bar")))
|
|
1052
|
+
);
|
|
1053
|
+
const renderIcon = profileElement => {
|
|
935
1054
|
if (profileElement?.root instanceof UserDataProfileElement && profileElement.root.profile.isDefault) {
|
|
936
|
-
iconValueContainer.classList.add(
|
|
937
|
-
iconHover.update(( localize(
|
|
938
|
-
}
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
iconValueContainer.classList.remove('disabled');
|
|
1055
|
+
iconValueContainer.classList.add("disabled");
|
|
1056
|
+
iconHover.update(( localize(13341, "Icon cannot be changed for the default profile")));
|
|
1057
|
+
} else {
|
|
1058
|
+
iconHover.update(( localize(13342, "Click to change icon")));
|
|
1059
|
+
iconValueContainer.classList.remove("disabled");
|
|
942
1060
|
}
|
|
943
1061
|
if (profileElement.root.icon) {
|
|
944
1062
|
iconElement.className = ThemeIcon.asClassName(ThemeIcon.fromId(profileElement.root.icon));
|
|
945
|
-
}
|
|
946
|
-
else {
|
|
1063
|
+
} else {
|
|
947
1064
|
iconElement.className = ThemeIcon.asClassName(ThemeIcon.fromId(DEFAULT_ICON.id));
|
|
948
1065
|
}
|
|
949
1066
|
};
|
|
@@ -962,27 +1079,30 @@ let ProfileIconRenderer = class ProfileIconRenderer extends ProfilePropertyRende
|
|
|
962
1079
|
};
|
|
963
1080
|
}
|
|
964
1081
|
};
|
|
965
|
-
ProfileIconRenderer = ( __decorate([
|
|
966
|
-
( __param(0, IInstantiationService)),
|
|
967
|
-
( __param(1, IHoverService))
|
|
968
|
-
], ProfileIconRenderer));
|
|
1082
|
+
ProfileIconRenderer = ( __decorate([( __param(0, IInstantiationService)), ( __param(1, IHoverService))], ProfileIconRenderer));
|
|
969
1083
|
let UseForCurrentWindowPropertyRenderer = class UseForCurrentWindowPropertyRenderer extends ProfilePropertyRenderer {
|
|
970
1084
|
constructor(userDataProfileService) {
|
|
971
1085
|
super();
|
|
972
1086
|
this.userDataProfileService = userDataProfileService;
|
|
973
|
-
this.templateId =
|
|
1087
|
+
this.templateId = "useForCurrent";
|
|
974
1088
|
}
|
|
975
1089
|
renderTemplate(parent) {
|
|
976
1090
|
const disposables = ( new DisposableStore());
|
|
977
1091
|
const elementDisposables = disposables.add(( new DisposableStore()));
|
|
978
1092
|
let profileElement;
|
|
979
|
-
const useForCurrentWindowContainer = append(parent, $(
|
|
980
|
-
append(
|
|
981
|
-
|
|
982
|
-
|
|
1093
|
+
const useForCurrentWindowContainer = append(parent, $(".profile-row-container"));
|
|
1094
|
+
append(
|
|
1095
|
+
useForCurrentWindowContainer,
|
|
1096
|
+
$(".profile-label-element", undefined, ( localize(13343, "Use for Current Window")))
|
|
1097
|
+
);
|
|
1098
|
+
const useForCurrentWindowValueContainer = append(useForCurrentWindowContainer, $(".profile-use-for-current-container"));
|
|
1099
|
+
const useForCurrentWindowTitle = ( localize(13344, "Use this profile for the current window"));
|
|
983
1100
|
const useForCurrentWindowCheckbox = disposables.add(( new Checkbox(useForCurrentWindowTitle, false, defaultCheckboxStyles)));
|
|
984
1101
|
append(useForCurrentWindowValueContainer, useForCurrentWindowCheckbox.domNode);
|
|
985
|
-
const useForCurrentWindowLabel = append(
|
|
1102
|
+
const useForCurrentWindowLabel = append(
|
|
1103
|
+
useForCurrentWindowValueContainer,
|
|
1104
|
+
$(".profile-description-element", undefined, useForCurrentWindowTitle)
|
|
1105
|
+
);
|
|
986
1106
|
disposables.add(useForCurrentWindowCheckbox.onChange(() => {
|
|
987
1107
|
if (profileElement?.root instanceof UserDataProfileElement) {
|
|
988
1108
|
profileElement.root.toggleCurrentWindowProfile();
|
|
@@ -993,12 +1113,11 @@ let UseForCurrentWindowPropertyRenderer = class UseForCurrentWindowPropertyRende
|
|
|
993
1113
|
profileElement.root.toggleCurrentWindowProfile();
|
|
994
1114
|
}
|
|
995
1115
|
}));
|
|
996
|
-
const renderUseCurrentProfile =
|
|
1116
|
+
const renderUseCurrentProfile = profileElement => {
|
|
997
1117
|
useForCurrentWindowCheckbox.checked = profileElement.root instanceof UserDataProfileElement && this.userDataProfileService.currentProfile.id === profileElement.root.profile.id;
|
|
998
1118
|
if (useForCurrentWindowCheckbox.checked && this.userDataProfileService.currentProfile.isDefault) {
|
|
999
1119
|
useForCurrentWindowCheckbox.disable();
|
|
1000
|
-
}
|
|
1001
|
-
else {
|
|
1120
|
+
} else {
|
|
1002
1121
|
useForCurrentWindowCheckbox.enable();
|
|
1003
1122
|
}
|
|
1004
1123
|
};
|
|
@@ -1016,25 +1135,29 @@ let UseForCurrentWindowPropertyRenderer = class UseForCurrentWindowPropertyRende
|
|
|
1016
1135
|
};
|
|
1017
1136
|
}
|
|
1018
1137
|
};
|
|
1019
|
-
UseForCurrentWindowPropertyRenderer = ( __decorate([
|
|
1020
|
-
( __param(0, IUserDataProfileService))
|
|
1021
|
-
], UseForCurrentWindowPropertyRenderer));
|
|
1138
|
+
UseForCurrentWindowPropertyRenderer = ( __decorate([( __param(0, IUserDataProfileService))], UseForCurrentWindowPropertyRenderer));
|
|
1022
1139
|
class UseAsDefaultProfileRenderer extends ProfilePropertyRenderer {
|
|
1023
1140
|
constructor() {
|
|
1024
1141
|
super(...arguments);
|
|
1025
|
-
this.templateId =
|
|
1142
|
+
this.templateId = "useAsDefault";
|
|
1026
1143
|
}
|
|
1027
1144
|
renderTemplate(parent) {
|
|
1028
1145
|
const disposables = ( new DisposableStore());
|
|
1029
1146
|
const elementDisposables = disposables.add(( new DisposableStore()));
|
|
1030
1147
|
let profileElement;
|
|
1031
|
-
const useAsDefaultProfileContainer = append(parent, $(
|
|
1032
|
-
append(
|
|
1033
|
-
|
|
1034
|
-
|
|
1148
|
+
const useAsDefaultProfileContainer = append(parent, $(".profile-row-container"));
|
|
1149
|
+
append(
|
|
1150
|
+
useAsDefaultProfileContainer,
|
|
1151
|
+
$(".profile-label-element", undefined, ( localize(13345, "Use for New Windows")))
|
|
1152
|
+
);
|
|
1153
|
+
const useAsDefaultProfileValueContainer = append(useAsDefaultProfileContainer, $(".profile-use-as-default-container"));
|
|
1154
|
+
const useAsDefaultProfileTitle = ( localize(13346, "Use this profile as the default for new windows"));
|
|
1035
1155
|
const useAsDefaultProfileCheckbox = disposables.add(( new Checkbox(useAsDefaultProfileTitle, false, defaultCheckboxStyles)));
|
|
1036
1156
|
append(useAsDefaultProfileValueContainer, useAsDefaultProfileCheckbox.domNode);
|
|
1037
|
-
const useAsDefaultProfileLabel = append(
|
|
1157
|
+
const useAsDefaultProfileLabel = append(
|
|
1158
|
+
useAsDefaultProfileValueContainer,
|
|
1159
|
+
$(".profile-description-element", undefined, useAsDefaultProfileTitle)
|
|
1160
|
+
);
|
|
1038
1161
|
disposables.add(useAsDefaultProfileCheckbox.onChange(() => {
|
|
1039
1162
|
if (profileElement?.root instanceof UserDataProfileElement) {
|
|
1040
1163
|
profileElement.root.toggleNewWindowProfile();
|
|
@@ -1045,7 +1168,7 @@ class UseAsDefaultProfileRenderer extends ProfilePropertyRenderer {
|
|
|
1045
1168
|
profileElement.root.toggleNewWindowProfile();
|
|
1046
1169
|
}
|
|
1047
1170
|
}));
|
|
1048
|
-
const renderUseAsDefault =
|
|
1171
|
+
const renderUseAsDefault = profileElement => {
|
|
1049
1172
|
useAsDefaultProfileCheckbox.checked = profileElement.root instanceof UserDataProfileElement && profileElement.root.isNewWindowProfile;
|
|
1050
1173
|
};
|
|
1051
1174
|
return {
|
|
@@ -1064,33 +1187,41 @@ class UseAsDefaultProfileRenderer extends ProfilePropertyRenderer {
|
|
|
1064
1187
|
}
|
|
1065
1188
|
}
|
|
1066
1189
|
let CopyFromProfileRenderer = class CopyFromProfileRenderer extends ProfilePropertyRenderer {
|
|
1067
|
-
constructor(
|
|
1190
|
+
constructor(
|
|
1191
|
+
userDataProfilesService,
|
|
1192
|
+
instantiationService,
|
|
1193
|
+
uriIdentityService,
|
|
1194
|
+
contextViewService
|
|
1195
|
+
) {
|
|
1068
1196
|
super();
|
|
1069
1197
|
this.userDataProfilesService = userDataProfilesService;
|
|
1070
1198
|
this.instantiationService = instantiationService;
|
|
1071
1199
|
this.uriIdentityService = uriIdentityService;
|
|
1072
1200
|
this.contextViewService = contextViewService;
|
|
1073
|
-
this.templateId =
|
|
1201
|
+
this.templateId = "copyFrom";
|
|
1074
1202
|
this.templates = [];
|
|
1075
1203
|
}
|
|
1076
1204
|
renderTemplate(parent) {
|
|
1077
1205
|
const disposables = ( new DisposableStore());
|
|
1078
1206
|
const elementDisposables = disposables.add(( new DisposableStore()));
|
|
1079
1207
|
let profileElement;
|
|
1080
|
-
const copyFromContainer = append(parent, $(
|
|
1081
|
-
append(copyFromContainer, $(
|
|
1082
|
-
append(
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1208
|
+
const copyFromContainer = append(parent, $(".profile-row-container.profile-copy-from-container"));
|
|
1209
|
+
append(copyFromContainer, $(".profile-label-element", undefined, ( localize(13347, "Copy from"))));
|
|
1210
|
+
append(
|
|
1211
|
+
copyFromContainer,
|
|
1212
|
+
$(".profile-description-element", undefined, ( localize(13348, "Select the profile source from which you want to copy contents")))
|
|
1213
|
+
);
|
|
1214
|
+
const copyFromSelectBox = disposables.add(
|
|
1215
|
+
this.instantiationService.createInstance(SelectBox, [], 0, this.contextViewService, defaultSelectBoxStyles, {
|
|
1216
|
+
useCustomDrawn: true,
|
|
1217
|
+
ariaLabel: ( localize(13349, "Copy profile from"))
|
|
1218
|
+
})
|
|
1219
|
+
);
|
|
1220
|
+
copyFromSelectBox.render(append(copyFromContainer, $(".profile-select-container")));
|
|
1088
1221
|
const render = (profileElement, copyFromOptions) => {
|
|
1089
1222
|
copyFromSelectBox.setOptions(copyFromOptions);
|
|
1090
1223
|
const id = profileElement.copyFrom instanceof URI ? ( profileElement.copyFrom.toString()) : profileElement.copyFrom?.id;
|
|
1091
|
-
const index = id
|
|
1092
|
-
? copyFromOptions.findIndex(option => option.id === id)
|
|
1093
|
-
: 0;
|
|
1224
|
+
const index = id ? copyFromOptions.findIndex(option => option.id === id) : 0;
|
|
1094
1225
|
copyFromSelectBox.select(index);
|
|
1095
1226
|
};
|
|
1096
1227
|
const that = this;
|
|
@@ -1125,40 +1256,55 @@ let CopyFromProfileRenderer = class CopyFromProfileRenderer extends ProfilePrope
|
|
|
1125
1256
|
}
|
|
1126
1257
|
getCopyFromOptions(profileElement) {
|
|
1127
1258
|
const copyFromOptions = [];
|
|
1128
|
-
copyFromOptions.push({
|
|
1259
|
+
copyFromOptions.push({
|
|
1260
|
+
text: ( localize(13350, "None"))
|
|
1261
|
+
});
|
|
1129
1262
|
for (const [copyFromTemplate, name] of profileElement.copyFromTemplates) {
|
|
1130
1263
|
if (!( this.templates.some(template => this.uriIdentityService.extUri.isEqual(( URI.parse(template.url)), copyFromTemplate)))) {
|
|
1131
|
-
copyFromOptions.push({
|
|
1264
|
+
copyFromOptions.push({
|
|
1265
|
+
text: `${name} (${basename(copyFromTemplate)})`,
|
|
1266
|
+
id: ( copyFromTemplate.toString()),
|
|
1267
|
+
source: copyFromTemplate
|
|
1268
|
+
});
|
|
1132
1269
|
}
|
|
1133
1270
|
}
|
|
1134
1271
|
if (this.templates.length) {
|
|
1135
|
-
copyFromOptions.push({
|
|
1272
|
+
copyFromOptions.push({
|
|
1273
|
+
...SeparatorSelectOption,
|
|
1274
|
+
decoratorRight: ( localize(13351, "Profile Templates"))
|
|
1275
|
+
});
|
|
1136
1276
|
for (const template of this.templates) {
|
|
1137
|
-
copyFromOptions.push({
|
|
1277
|
+
copyFromOptions.push({
|
|
1278
|
+
text: template.name,
|
|
1279
|
+
id: template.url,
|
|
1280
|
+
source: ( URI.parse(template.url))
|
|
1281
|
+
});
|
|
1138
1282
|
}
|
|
1139
1283
|
}
|
|
1140
|
-
copyFromOptions.push({
|
|
1284
|
+
copyFromOptions.push({
|
|
1285
|
+
...SeparatorSelectOption,
|
|
1286
|
+
decoratorRight: ( localize(13352, "Existing Profiles"))
|
|
1287
|
+
});
|
|
1141
1288
|
for (const profile of this.userDataProfilesService.profiles) {
|
|
1142
1289
|
if (!profile.isTransient) {
|
|
1143
|
-
copyFromOptions.push({
|
|
1290
|
+
copyFromOptions.push({
|
|
1291
|
+
text: profile.name,
|
|
1292
|
+
id: profile.id,
|
|
1293
|
+
source: profile
|
|
1294
|
+
});
|
|
1144
1295
|
}
|
|
1145
1296
|
}
|
|
1146
1297
|
return copyFromOptions;
|
|
1147
1298
|
}
|
|
1148
1299
|
};
|
|
1149
|
-
CopyFromProfileRenderer = ( __decorate([
|
|
1150
|
-
( __param(0, IUserDataProfilesService)),
|
|
1151
|
-
( __param(1, IInstantiationService)),
|
|
1152
|
-
( __param(2, IUriIdentityService)),
|
|
1153
|
-
( __param(3, IContextViewService))
|
|
1154
|
-
], CopyFromProfileRenderer));
|
|
1300
|
+
CopyFromProfileRenderer = ( __decorate([( __param(0, IUserDataProfilesService)), ( __param(1, IInstantiationService)), ( __param(2, IUriIdentityService)), ( __param(3, IContextViewService))], CopyFromProfileRenderer));
|
|
1155
1301
|
let ContentsProfileRenderer = class ContentsProfileRenderer extends ProfilePropertyRenderer {
|
|
1156
1302
|
constructor(userDataProfilesService, contextMenuService, instantiationService) {
|
|
1157
1303
|
super();
|
|
1158
1304
|
this.userDataProfilesService = userDataProfilesService;
|
|
1159
1305
|
this.contextMenuService = contextMenuService;
|
|
1160
1306
|
this.instantiationService = instantiationService;
|
|
1161
|
-
this.templateId =
|
|
1307
|
+
this.templateId = "contents";
|
|
1162
1308
|
this._onDidChangeContentHeight = this._register(( new Emitter()));
|
|
1163
1309
|
this.onDidChangeContentHeight = this._onDidChangeContentHeight.event;
|
|
1164
1310
|
this._onDidChangeSelection = this._register(( new Emitter()));
|
|
@@ -1168,48 +1314,56 @@ let ContentsProfileRenderer = class ContentsProfileRenderer extends ProfilePrope
|
|
|
1168
1314
|
const disposables = ( new DisposableStore());
|
|
1169
1315
|
const elementDisposables = disposables.add(( new DisposableStore()));
|
|
1170
1316
|
let profileElement;
|
|
1171
|
-
const configureRowContainer = append(parent, $(
|
|
1172
|
-
append(
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
append(
|
|
1317
|
+
const configureRowContainer = append(parent, $(".profile-row-container"));
|
|
1318
|
+
append(
|
|
1319
|
+
configureRowContainer,
|
|
1320
|
+
$(".profile-label-element", undefined, ( localize(13353, "Contents")))
|
|
1321
|
+
);
|
|
1322
|
+
const contentsDescriptionElement = append(configureRowContainer, $(".profile-description-element"));
|
|
1323
|
+
const contentsTreeHeader = append(configureRowContainer, $(".profile-content-tree-header"));
|
|
1324
|
+
const optionsLabel = $(".options-header", undefined, $("span", undefined, ( localize(13354, "Source"))));
|
|
1325
|
+
append(contentsTreeHeader, $(""), $("", undefined, ( localize(13353, "Contents"))), optionsLabel, $(""));
|
|
1177
1326
|
const delegate = ( new ProfileContentTreeElementDelegate());
|
|
1178
|
-
const profilesContentTree = this.profilesContentTree = disposables.add(
|
|
1179
|
-
this.instantiationService.createInstance(
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1327
|
+
const profilesContentTree = this.profilesContentTree = disposables.add(
|
|
1328
|
+
this.instantiationService.createInstance(WorkbenchAsyncDataTree, "ProfileEditor-ContentsTree", append(
|
|
1329
|
+
configureRowContainer,
|
|
1330
|
+
$(".profile-content-tree.file-icon-themable-tree.show-file-icons")
|
|
1331
|
+
), delegate, [
|
|
1332
|
+
this.instantiationService.createInstance(ExistingProfileResourceTreeRenderer),
|
|
1333
|
+
this.instantiationService.createInstance(NewProfileResourceTreeRenderer),
|
|
1334
|
+
this.instantiationService.createInstance(ProfileResourceChildTreeItemRenderer)
|
|
1335
|
+
], this.instantiationService.createInstance(ProfileResourceTreeDataSource), {
|
|
1336
|
+
multipleSelectionSupport: false,
|
|
1337
|
+
horizontalScrolling: false,
|
|
1338
|
+
accessibilityProvider: {
|
|
1339
|
+
getAriaLabel(element) {
|
|
1340
|
+
if ((element?.element).resourceType) {
|
|
1341
|
+
return (element?.element).resourceType;
|
|
1342
|
+
}
|
|
1343
|
+
if ((element?.element).label) {
|
|
1344
|
+
return (element?.element).label;
|
|
1345
|
+
}
|
|
1346
|
+
return "";
|
|
1347
|
+
},
|
|
1348
|
+
getWidgetAriaLabel() {
|
|
1349
|
+
return "";
|
|
1192
1350
|
}
|
|
1193
|
-
return '';
|
|
1194
1351
|
},
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
if (element?.element.handle) {
|
|
1202
|
-
return element.element.handle;
|
|
1352
|
+
identityProvider: {
|
|
1353
|
+
getId(element) {
|
|
1354
|
+
if (element?.element.handle) {
|
|
1355
|
+
return element.element.handle;
|
|
1356
|
+
}
|
|
1357
|
+
return "";
|
|
1203
1358
|
}
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
}));
|
|
1359
|
+
},
|
|
1360
|
+
expandOnlyOnTwistieClick: true,
|
|
1361
|
+
renderIndentGuides: RenderIndentGuides.None,
|
|
1362
|
+
enableStickyScroll: false,
|
|
1363
|
+
openOnSingleClick: false,
|
|
1364
|
+
alwaysConsumeMouseWheel: false
|
|
1365
|
+
})
|
|
1366
|
+
);
|
|
1213
1367
|
this.profilesContentTree.style(listStyles);
|
|
1214
1368
|
disposables.add(toDisposable(() => this.profilesContentTree = undefined));
|
|
1215
1369
|
disposables.add(this.profilesContentTree.onDidChangeContentHeight(height => {
|
|
@@ -1220,10 +1374,13 @@ let ContentsProfileRenderer = class ContentsProfileRenderer extends ProfilePrope
|
|
|
1220
1374
|
}));
|
|
1221
1375
|
disposables.add(this.profilesContentTree.onDidChangeSelection((e => {
|
|
1222
1376
|
if (profileElement) {
|
|
1223
|
-
this._onDidChangeSelection.fire({
|
|
1377
|
+
this._onDidChangeSelection.fire({
|
|
1378
|
+
element: profileElement,
|
|
1379
|
+
selected: !!e.elements.length
|
|
1380
|
+
});
|
|
1224
1381
|
}
|
|
1225
1382
|
})));
|
|
1226
|
-
disposables.add(this.profilesContentTree.onDidOpen(async
|
|
1383
|
+
disposables.add(this.profilesContentTree.onDidOpen(async e => {
|
|
1227
1384
|
if (!e.browserEvent) {
|
|
1228
1385
|
return;
|
|
1229
1386
|
}
|
|
@@ -1231,7 +1388,7 @@ let ContentsProfileRenderer = class ContentsProfileRenderer extends ProfilePrope
|
|
|
1231
1388
|
await e.element.element.openAction.run();
|
|
1232
1389
|
}
|
|
1233
1390
|
}));
|
|
1234
|
-
disposables.add(this.profilesContentTree.onContextMenu(async
|
|
1391
|
+
disposables.add(this.profilesContentTree.onContextMenu(async e => {
|
|
1235
1392
|
if (!e.element?.element.actions?.contextMenu?.length) {
|
|
1236
1393
|
return;
|
|
1237
1394
|
}
|
|
@@ -1241,34 +1398,31 @@ let ContentsProfileRenderer = class ContentsProfileRenderer extends ProfilePrope
|
|
|
1241
1398
|
getActionsContext: () => e.element
|
|
1242
1399
|
});
|
|
1243
1400
|
}));
|
|
1244
|
-
const updateDescription =
|
|
1401
|
+
const updateDescription = element => {
|
|
1245
1402
|
clearNode(contentsDescriptionElement);
|
|
1246
1403
|
const markdown = ( new MarkdownString());
|
|
1247
1404
|
if (element.root instanceof UserDataProfileElement && element.root.profile.isDefault) {
|
|
1248
|
-
markdown.appendMarkdown(( localize(
|
|
1249
|
-
}
|
|
1250
|
-
|
|
1251
|
-
markdown.appendMarkdown(( localize(12994, "Configure source of contents for this profile\n")));
|
|
1405
|
+
markdown.appendMarkdown(( localize(13355, "Browse contents of this profile\n")));
|
|
1406
|
+
} else {
|
|
1407
|
+
markdown.appendMarkdown(( localize(13356, "Configure source of contents for this profile\n")));
|
|
1252
1408
|
if (element.root instanceof NewProfileElement) {
|
|
1253
1409
|
const copyFromName = element.root.getCopyFromName();
|
|
1254
|
-
const optionName = copyFromName === this.userDataProfilesService.defaultProfile.name
|
|
1255
|
-
? ( localize(12995, "{0} (Copy)", copyFromName))
|
|
1256
|
-
: copyFromName;
|
|
1410
|
+
const optionName = copyFromName === this.userDataProfilesService.defaultProfile.name ? ( localize(13357, "{0} (Copy)", copyFromName)) : copyFromName;
|
|
1257
1411
|
if (optionName) {
|
|
1258
|
-
markdown
|
|
1259
|
-
|
|
1260
|
-
12996,
|
|
1412
|
+
markdown.appendMarkdown(( localize(
|
|
1413
|
+
13358,
|
|
1261
1414
|
"- *{0}:* Copy contents from the {1} profile\n",
|
|
1262
1415
|
optionName,
|
|
1263
1416
|
copyFromName
|
|
1264
1417
|
)));
|
|
1265
1418
|
}
|
|
1266
|
-
markdown
|
|
1267
|
-
.appendMarkdown(( localize(12997, "- *Default:* Use contents from the Default profile\n")))
|
|
1268
|
-
.appendMarkdown(( localize(12998, "- *None:* Create empty contents\n")));
|
|
1419
|
+
markdown.appendMarkdown(( localize(13359, "- *Default:* Use contents from the Default profile\n"))).appendMarkdown(( localize(13360, "- *None:* Create empty contents\n")));
|
|
1269
1420
|
}
|
|
1270
1421
|
}
|
|
1271
|
-
append(
|
|
1422
|
+
append(
|
|
1423
|
+
contentsDescriptionElement,
|
|
1424
|
+
elementDisposables.add(renderMarkdown(markdown)).element
|
|
1425
|
+
);
|
|
1272
1426
|
};
|
|
1273
1427
|
const that = this;
|
|
1274
1428
|
return {
|
|
@@ -1276,10 +1430,9 @@ let ContentsProfileRenderer = class ContentsProfileRenderer extends ProfilePrope
|
|
|
1276
1430
|
profileElement = element;
|
|
1277
1431
|
updateDescription(element);
|
|
1278
1432
|
if (element.root instanceof NewProfileElement) {
|
|
1279
|
-
contentsTreeHeader.classList.remove(
|
|
1280
|
-
}
|
|
1281
|
-
|
|
1282
|
-
contentsTreeHeader.classList.toggle('default-profile', element.root.profile.isDefault);
|
|
1433
|
+
contentsTreeHeader.classList.remove("default-profile");
|
|
1434
|
+
} else if (element.root instanceof UserDataProfileElement) {
|
|
1435
|
+
contentsTreeHeader.classList.toggle("default-profile", element.root.profile.isDefault);
|
|
1283
1436
|
}
|
|
1284
1437
|
profilesContentTree.setInput(profileElement.root);
|
|
1285
1438
|
elementDisposables.add(profileElement.root.onDidChange(e => {
|
|
@@ -1303,11 +1456,7 @@ let ContentsProfileRenderer = class ContentsProfileRenderer extends ProfilePrope
|
|
|
1303
1456
|
}
|
|
1304
1457
|
}
|
|
1305
1458
|
};
|
|
1306
|
-
ContentsProfileRenderer = ( __decorate([
|
|
1307
|
-
( __param(0, IUserDataProfilesService)),
|
|
1308
|
-
( __param(1, IContextMenuService)),
|
|
1309
|
-
( __param(2, IInstantiationService))
|
|
1310
|
-
], ContentsProfileRenderer));
|
|
1459
|
+
ContentsProfileRenderer = ( __decorate([( __param(0, IUserDataProfilesService)), ( __param(1, IContextMenuService)), ( __param(2, IInstantiationService))], ContentsProfileRenderer));
|
|
1311
1460
|
let ProfileWorkspacesRenderer = class ProfileWorkspacesRenderer extends ProfilePropertyRenderer {
|
|
1312
1461
|
constructor(labelService, uriIdentityService, fileDialogService, instantiationService) {
|
|
1313
1462
|
super();
|
|
@@ -1315,7 +1464,7 @@ let ProfileWorkspacesRenderer = class ProfileWorkspacesRenderer extends ProfileP
|
|
|
1315
1464
|
this.uriIdentityService = uriIdentityService;
|
|
1316
1465
|
this.fileDialogService = fileDialogService;
|
|
1317
1466
|
this.instantiationService = instantiationService;
|
|
1318
|
-
this.templateId =
|
|
1467
|
+
this.templateId = "workspaces";
|
|
1319
1468
|
this._onDidChangeContentHeight = this._register(( new Emitter()));
|
|
1320
1469
|
this.onDidChangeContentHeight = this._onDidChangeContentHeight.event;
|
|
1321
1470
|
this._onDidChangeSelection = this._register(( new Emitter()));
|
|
@@ -1325,97 +1474,114 @@ let ProfileWorkspacesRenderer = class ProfileWorkspacesRenderer extends ProfileP
|
|
|
1325
1474
|
const disposables = ( new DisposableStore());
|
|
1326
1475
|
const elementDisposables = disposables.add(( new DisposableStore()));
|
|
1327
1476
|
let profileElement;
|
|
1328
|
-
const profileWorkspacesRowContainer = append(parent, $(
|
|
1329
|
-
append(
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1477
|
+
const profileWorkspacesRowContainer = append(parent, $(".profile-row-container"));
|
|
1478
|
+
append(
|
|
1479
|
+
profileWorkspacesRowContainer,
|
|
1480
|
+
$(".profile-label-element", undefined, ( localize(13361, "Folders & Workspaces")))
|
|
1481
|
+
);
|
|
1482
|
+
const profileWorkspacesDescriptionElement = append(profileWorkspacesRowContainer, $(".profile-description-element"));
|
|
1483
|
+
const workspacesTableContainer = append(profileWorkspacesRowContainer, $(".profile-associations-table"));
|
|
1484
|
+
const table = this.workspacesTable = disposables.add(this.instantiationService.createInstance(
|
|
1485
|
+
WorkbenchTable,
|
|
1486
|
+
"ProfileEditor-AssociationsTable",
|
|
1487
|
+
workspacesTableContainer,
|
|
1488
|
+
new class {
|
|
1489
|
+
constructor() {
|
|
1490
|
+
this.headerRowHeight = 30;
|
|
1491
|
+
}
|
|
1492
|
+
getHeight() {
|
|
1493
|
+
return 24;
|
|
1494
|
+
}
|
|
1495
|
+
}(),
|
|
1496
|
+
[{
|
|
1497
|
+
label: "",
|
|
1498
|
+
tooltip: "",
|
|
1341
1499
|
weight: 1,
|
|
1342
1500
|
minimumWidth: 30,
|
|
1343
1501
|
maximumWidth: 30,
|
|
1344
1502
|
templateId: WorkspaceUriEmptyColumnRenderer.TEMPLATE_ID,
|
|
1345
|
-
project(row) {
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1503
|
+
project(row) {
|
|
1504
|
+
return row;
|
|
1505
|
+
}
|
|
1506
|
+
}, {
|
|
1507
|
+
label: ( localize(13362, "Host")),
|
|
1508
|
+
tooltip: "",
|
|
1350
1509
|
weight: 2,
|
|
1351
1510
|
templateId: WorkspaceUriHostColumnRenderer.TEMPLATE_ID,
|
|
1352
|
-
project(row) {
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1511
|
+
project(row) {
|
|
1512
|
+
return row;
|
|
1513
|
+
}
|
|
1514
|
+
}, {
|
|
1515
|
+
label: ( localize(13363, "Path")),
|
|
1516
|
+
tooltip: "",
|
|
1357
1517
|
weight: 7,
|
|
1358
1518
|
templateId: WorkspaceUriPathColumnRenderer.TEMPLATE_ID,
|
|
1359
|
-
project(row) {
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1519
|
+
project(row) {
|
|
1520
|
+
return row;
|
|
1521
|
+
}
|
|
1522
|
+
}, {
|
|
1523
|
+
label: "",
|
|
1524
|
+
tooltip: "",
|
|
1364
1525
|
weight: 1,
|
|
1365
1526
|
minimumWidth: 84,
|
|
1366
1527
|
maximumWidth: 84,
|
|
1367
1528
|
templateId: WorkspaceUriActionsColumnRenderer.TEMPLATE_ID,
|
|
1368
|
-
project(row) {
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
this.instantiationService.createInstance(WorkspaceUriHostColumnRenderer),
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
return localize(
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
)
|
|
1392
|
-
},
|
|
1393
|
-
getWidgetAriaLabel: () => ( localize(13004, "Trusted Folders & Workspaces"))
|
|
1394
|
-
},
|
|
1395
|
-
identityProvider: {
|
|
1396
|
-
getId(element) {
|
|
1397
|
-
return ( element.workspace.toString());
|
|
1529
|
+
project(row) {
|
|
1530
|
+
return row;
|
|
1531
|
+
}
|
|
1532
|
+
}],
|
|
1533
|
+
[( new WorkspaceUriEmptyColumnRenderer()), this.instantiationService.createInstance(WorkspaceUriHostColumnRenderer), this.instantiationService.createInstance(WorkspaceUriPathColumnRenderer), this.instantiationService.createInstance(WorkspaceUriActionsColumnRenderer)],
|
|
1534
|
+
{
|
|
1535
|
+
horizontalScrolling: false,
|
|
1536
|
+
alwaysConsumeMouseWheel: false,
|
|
1537
|
+
openOnSingleClick: false,
|
|
1538
|
+
multipleSelectionSupport: false,
|
|
1539
|
+
accessibilityProvider: {
|
|
1540
|
+
getAriaLabel: item => {
|
|
1541
|
+
const hostLabel = getHostLabel(this.labelService, item.workspace);
|
|
1542
|
+
if (hostLabel === undefined || hostLabel.length === 0) {
|
|
1543
|
+
return localize(13364, "{0}, trusted", this.labelService.getUriLabel(item.workspace));
|
|
1544
|
+
}
|
|
1545
|
+
return localize(
|
|
1546
|
+
13365,
|
|
1547
|
+
"{0} on {1}, trusted",
|
|
1548
|
+
this.labelService.getUriLabel(item.workspace),
|
|
1549
|
+
hostLabel
|
|
1550
|
+
);
|
|
1551
|
+
},
|
|
1552
|
+
getWidgetAriaLabel: () => ( localize(13366, "Trusted Folders & Workspaces"))
|
|
1398
1553
|
},
|
|
1554
|
+
identityProvider: {
|
|
1555
|
+
getId(element) {
|
|
1556
|
+
return ( element.workspace.toString());
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1399
1559
|
}
|
|
1400
|
-
|
|
1560
|
+
));
|
|
1401
1561
|
this.workspacesTable.style(listStyles);
|
|
1402
1562
|
disposables.add(toDisposable(() => this.workspacesTable = undefined));
|
|
1403
1563
|
disposables.add(this.workspacesTable.onDidChangeSelection((e => {
|
|
1404
1564
|
if (profileElement) {
|
|
1405
|
-
this._onDidChangeSelection.fire({
|
|
1565
|
+
this._onDidChangeSelection.fire({
|
|
1566
|
+
element: profileElement,
|
|
1567
|
+
selected: !!e.elements.length
|
|
1568
|
+
});
|
|
1406
1569
|
}
|
|
1407
1570
|
})));
|
|
1408
|
-
const addButtonBarElement = append(profileWorkspacesRowContainer, $(
|
|
1571
|
+
const addButtonBarElement = append(profileWorkspacesRowContainer, $(".profile-workspaces-button-container"));
|
|
1409
1572
|
const buttonBar = disposables.add(( new ButtonBar(addButtonBarElement)));
|
|
1410
|
-
const addButton = this._register(buttonBar.addButton({
|
|
1411
|
-
|
|
1573
|
+
const addButton = this._register(buttonBar.addButton({
|
|
1574
|
+
title: ( localize(13367, "Add Folder")),
|
|
1575
|
+
...defaultButtonStyles
|
|
1576
|
+
}));
|
|
1577
|
+
addButton.label = ( localize(13367, "Add Folder"));
|
|
1412
1578
|
disposables.add(addButton.onDidClick(async () => {
|
|
1413
1579
|
const uris = await this.fileDialogService.showOpenDialog({
|
|
1414
1580
|
canSelectFiles: false,
|
|
1415
1581
|
canSelectFolders: true,
|
|
1416
1582
|
canSelectMany: true,
|
|
1417
|
-
openLabel: ( localize(
|
|
1418
|
-
title: ( localize(
|
|
1583
|
+
openLabel: ( localize(13368, "Add Folder")),
|
|
1584
|
+
title: ( localize(13369, "Select Folders To Add"))
|
|
1419
1585
|
});
|
|
1420
1586
|
if (uris) {
|
|
1421
1587
|
if (profileElement?.root instanceof UserDataProfileElement) {
|
|
@@ -1430,16 +1596,16 @@ let ProfileWorkspacesRenderer = class ProfileWorkspacesRenderer extends ProfileP
|
|
|
1430
1596
|
}));
|
|
1431
1597
|
const updateTable = () => {
|
|
1432
1598
|
if (profileElement?.root instanceof UserDataProfileElement && profileElement.root.workspaces?.length) {
|
|
1433
|
-
profileWorkspacesDescriptionElement.textContent = ( localize(
|
|
1434
|
-
workspacesTableContainer.classList.remove(
|
|
1435
|
-
table.splice(0, table.length, ( profileElement.root.workspaces
|
|
1436
|
-
|
|
1437
|
-
|
|
1599
|
+
profileWorkspacesDescriptionElement.textContent = ( localize(13370, "Following folders and workspaces are using this profile"));
|
|
1600
|
+
workspacesTableContainer.classList.remove("hide");
|
|
1601
|
+
table.splice(0, table.length, ( profileElement.root.workspaces.map(workspace => ({
|
|
1602
|
+
workspace,
|
|
1603
|
+
profileElement: profileElement.root
|
|
1604
|
+
}))).sort((a, b) => this.uriIdentityService.extUri.compare(a.workspace, b.workspace)));
|
|
1438
1605
|
this.layout();
|
|
1439
|
-
}
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
workspacesTableContainer.classList.add('hide');
|
|
1606
|
+
} else {
|
|
1607
|
+
profileWorkspacesDescriptionElement.textContent = ( localize(13371, "No folders or workspaces are using this profile"));
|
|
1608
|
+
workspacesTableContainer.classList.add("hide");
|
|
1443
1609
|
}
|
|
1444
1610
|
};
|
|
1445
1611
|
const that = this;
|
|
@@ -1472,15 +1638,14 @@ let ProfileWorkspacesRenderer = class ProfileWorkspacesRenderer extends ProfileP
|
|
|
1472
1638
|
}
|
|
1473
1639
|
}
|
|
1474
1640
|
};
|
|
1475
|
-
ProfileWorkspacesRenderer = ( __decorate([
|
|
1476
|
-
( __param(0, ILabelService)),
|
|
1477
|
-
( __param(1, IUriIdentityService)),
|
|
1478
|
-
( __param(2, IFileDialogService)),
|
|
1479
|
-
( __param(3, IInstantiationService))
|
|
1480
|
-
], ProfileWorkspacesRenderer));
|
|
1641
|
+
ProfileWorkspacesRenderer = ( __decorate([( __param(0, ILabelService)), ( __param(1, IUriIdentityService)), ( __param(2, IFileDialogService)), ( __param(3, IInstantiationService))], ProfileWorkspacesRenderer));
|
|
1481
1642
|
let ExistingProfileResourceTreeRenderer = class ExistingProfileResourceTreeRenderer extends AbstractProfileResourceTreeRenderer {
|
|
1482
|
-
static {
|
|
1483
|
-
|
|
1643
|
+
static {
|
|
1644
|
+
ExistingProfileResourceTreeRenderer_1 = this;
|
|
1645
|
+
}
|
|
1646
|
+
static {
|
|
1647
|
+
this.TEMPLATE_ID = "ExistingProfileResourceTemplate";
|
|
1648
|
+
}
|
|
1484
1649
|
constructor(instantiationService) {
|
|
1485
1650
|
super();
|
|
1486
1651
|
this.instantiationService = instantiationService;
|
|
@@ -1488,54 +1653,76 @@ let ExistingProfileResourceTreeRenderer = class ExistingProfileResourceTreeRende
|
|
|
1488
1653
|
}
|
|
1489
1654
|
renderTemplate(parent) {
|
|
1490
1655
|
const disposables = ( new DisposableStore());
|
|
1491
|
-
const container = append(
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
const
|
|
1496
|
-
const
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1656
|
+
const container = append(
|
|
1657
|
+
parent,
|
|
1658
|
+
$(".profile-tree-item-container.existing-profile-resource-type-container")
|
|
1659
|
+
);
|
|
1660
|
+
const label = append(container, $(".profile-resource-type-label"));
|
|
1661
|
+
const radio = disposables.add(( new Radio({
|
|
1662
|
+
items: []
|
|
1663
|
+
})));
|
|
1664
|
+
append(append(container, $(".profile-resource-options-container")), radio.domNode);
|
|
1665
|
+
const actionsContainer = append(container, $(".profile-resource-actions-container"));
|
|
1666
|
+
const actionBar = disposables.add(
|
|
1667
|
+
this.instantiationService.createInstance(WorkbenchToolBar, actionsContainer, {
|
|
1668
|
+
hoverDelegate: disposables.add(createInstantHoverDelegate()),
|
|
1669
|
+
highlightToggledItems: true
|
|
1670
|
+
})
|
|
1671
|
+
);
|
|
1672
|
+
return {
|
|
1673
|
+
label,
|
|
1674
|
+
radio,
|
|
1675
|
+
actionBar,
|
|
1676
|
+
disposables,
|
|
1677
|
+
elementDisposables: disposables.add(( new DisposableStore()))
|
|
1678
|
+
};
|
|
1501
1679
|
}
|
|
1502
|
-
renderElement(
|
|
1680
|
+
renderElement(
|
|
1681
|
+
{
|
|
1682
|
+
element: profileResourceTreeElement
|
|
1683
|
+
},
|
|
1684
|
+
index,
|
|
1685
|
+
templateData
|
|
1686
|
+
) {
|
|
1503
1687
|
templateData.elementDisposables.clear();
|
|
1504
|
-
const {
|
|
1688
|
+
const {
|
|
1689
|
+
element,
|
|
1690
|
+
root
|
|
1691
|
+
} = profileResourceTreeElement;
|
|
1505
1692
|
if (!(root instanceof UserDataProfileElement)) {
|
|
1506
1693
|
throw ( new Error(
|
|
1507
|
-
|
|
1694
|
+
"ExistingProfileResourceTreeRenderer can only render existing profile element"
|
|
1508
1695
|
));
|
|
1509
1696
|
}
|
|
1510
1697
|
if (isString(element) || !isProfileResourceTypeElement(element)) {
|
|
1511
|
-
throw ( new Error(
|
|
1698
|
+
throw ( new Error("Invalid profile resource element"));
|
|
1512
1699
|
}
|
|
1513
1700
|
const updateRadioItems = () => {
|
|
1514
1701
|
templateData.radio.setItems([{
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
}]);
|
|
1702
|
+
text: ( localize(13372, "Default")),
|
|
1703
|
+
tooltip: ( localize(13373, "Use {0} from the Default profile", resourceTypeTitle)),
|
|
1704
|
+
isActive: root.getFlag(element.resourceType)
|
|
1705
|
+
}, {
|
|
1706
|
+
text: root.name,
|
|
1707
|
+
tooltip: ( localize(13374, "Use {0} from the {1} profile", resourceTypeTitle, root.name)),
|
|
1708
|
+
isActive: !root.getFlag(element.resourceType)
|
|
1709
|
+
}]);
|
|
1524
1710
|
};
|
|
1525
1711
|
const resourceTypeTitle = this.getResourceTypeTitle(element.resourceType);
|
|
1526
1712
|
templateData.label.textContent = resourceTypeTitle;
|
|
1527
1713
|
if (root instanceof UserDataProfileElement && root.profile.isDefault) {
|
|
1528
|
-
templateData.radio.domNode.classList.add(
|
|
1529
|
-
}
|
|
1530
|
-
|
|
1531
|
-
templateData.radio.domNode.classList.remove('hide');
|
|
1714
|
+
templateData.radio.domNode.classList.add("hide");
|
|
1715
|
+
} else {
|
|
1716
|
+
templateData.radio.domNode.classList.remove("hide");
|
|
1532
1717
|
updateRadioItems();
|
|
1533
1718
|
templateData.elementDisposables.add(root.onDidChange(e => {
|
|
1534
1719
|
if (e.name) {
|
|
1535
1720
|
updateRadioItems();
|
|
1536
1721
|
}
|
|
1537
1722
|
}));
|
|
1538
|
-
templateData.elementDisposables.add(
|
|
1723
|
+
templateData.elementDisposables.add(
|
|
1724
|
+
templateData.radio.onDidSelect(index => root.setFlag(element.resourceType, index === 0))
|
|
1725
|
+
);
|
|
1539
1726
|
}
|
|
1540
1727
|
const actions = [];
|
|
1541
1728
|
if (element.openAction) {
|
|
@@ -1547,12 +1734,14 @@ let ExistingProfileResourceTreeRenderer = class ExistingProfileResourceTreeRende
|
|
|
1547
1734
|
templateData.actionBar.setActions(actions);
|
|
1548
1735
|
}
|
|
1549
1736
|
};
|
|
1550
|
-
ExistingProfileResourceTreeRenderer = ExistingProfileResourceTreeRenderer_1 = ( __decorate([
|
|
1551
|
-
( __param(0, IInstantiationService))
|
|
1552
|
-
], ExistingProfileResourceTreeRenderer));
|
|
1737
|
+
ExistingProfileResourceTreeRenderer = ExistingProfileResourceTreeRenderer_1 = ( __decorate([( __param(0, IInstantiationService))], ExistingProfileResourceTreeRenderer));
|
|
1553
1738
|
let NewProfileResourceTreeRenderer = class NewProfileResourceTreeRenderer extends AbstractProfileResourceTreeRenderer {
|
|
1554
|
-
static {
|
|
1555
|
-
|
|
1739
|
+
static {
|
|
1740
|
+
NewProfileResourceTreeRenderer_1 = this;
|
|
1741
|
+
}
|
|
1742
|
+
static {
|
|
1743
|
+
this.TEMPLATE_ID = "NewProfileResourceTemplate";
|
|
1744
|
+
}
|
|
1556
1745
|
constructor(userDataProfilesService, instantiationService) {
|
|
1557
1746
|
super();
|
|
1558
1747
|
this.userDataProfilesService = userDataProfilesService;
|
|
@@ -1561,53 +1750,70 @@ let NewProfileResourceTreeRenderer = class NewProfileResourceTreeRenderer extend
|
|
|
1561
1750
|
}
|
|
1562
1751
|
renderTemplate(parent) {
|
|
1563
1752
|
const disposables = ( new DisposableStore());
|
|
1564
|
-
const container = append(
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
append(
|
|
1569
|
-
const
|
|
1570
|
-
const
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1753
|
+
const container = append(
|
|
1754
|
+
parent,
|
|
1755
|
+
$(".profile-tree-item-container.new-profile-resource-type-container")
|
|
1756
|
+
);
|
|
1757
|
+
const labelContainer = append(container, $(".profile-resource-type-label-container"));
|
|
1758
|
+
const label = append(labelContainer, $("span.profile-resource-type-label"));
|
|
1759
|
+
const radio = disposables.add(( new Radio({
|
|
1760
|
+
items: []
|
|
1761
|
+
})));
|
|
1762
|
+
append(append(container, $(".profile-resource-options-container")), radio.domNode);
|
|
1763
|
+
const actionsContainer = append(container, $(".profile-resource-actions-container"));
|
|
1764
|
+
const actionBar = disposables.add(
|
|
1765
|
+
this.instantiationService.createInstance(WorkbenchToolBar, actionsContainer, {
|
|
1766
|
+
hoverDelegate: disposables.add(createInstantHoverDelegate()),
|
|
1767
|
+
highlightToggledItems: true
|
|
1768
|
+
})
|
|
1769
|
+
);
|
|
1770
|
+
return {
|
|
1771
|
+
label,
|
|
1772
|
+
radio,
|
|
1773
|
+
actionBar,
|
|
1774
|
+
disposables,
|
|
1775
|
+
elementDisposables: disposables.add(( new DisposableStore()))
|
|
1776
|
+
};
|
|
1575
1777
|
}
|
|
1576
|
-
renderElement(
|
|
1778
|
+
renderElement(
|
|
1779
|
+
{
|
|
1780
|
+
element: profileResourceTreeElement
|
|
1781
|
+
},
|
|
1782
|
+
index,
|
|
1783
|
+
templateData
|
|
1784
|
+
) {
|
|
1577
1785
|
templateData.elementDisposables.clear();
|
|
1578
|
-
const {
|
|
1786
|
+
const {
|
|
1787
|
+
element,
|
|
1788
|
+
root
|
|
1789
|
+
} = profileResourceTreeElement;
|
|
1579
1790
|
if (!(root instanceof NewProfileElement)) {
|
|
1580
|
-
throw ( new Error(
|
|
1791
|
+
throw ( new Error("NewProfileResourceTreeRenderer can only render new profile element"));
|
|
1581
1792
|
}
|
|
1582
1793
|
if (isString(element) || !isProfileResourceTypeElement(element)) {
|
|
1583
|
-
throw ( new Error(
|
|
1794
|
+
throw ( new Error("Invalid profile resource element"));
|
|
1584
1795
|
}
|
|
1585
1796
|
const resourceTypeTitle = this.getResourceTypeTitle(element.resourceType);
|
|
1586
1797
|
templateData.label.textContent = resourceTypeTitle;
|
|
1587
1798
|
const renderRadioItems = () => {
|
|
1588
1799
|
const options = [{
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
}];
|
|
1800
|
+
text: ( localize(13372, "Default")),
|
|
1801
|
+
tooltip: ( localize(13373, "Use {0} from the Default profile", resourceTypeTitle))
|
|
1802
|
+
}, {
|
|
1803
|
+
text: ( localize(13375, "None")),
|
|
1804
|
+
tooltip: ( localize(13376, "Create empty {0}", resourceTypeTitle))
|
|
1805
|
+
}];
|
|
1596
1806
|
const copyFromName = root.getCopyFromName();
|
|
1597
|
-
const name = copyFromName === this.userDataProfilesService.defaultProfile.name
|
|
1598
|
-
? ( localize(12995, "{0} (Copy)", copyFromName))
|
|
1599
|
-
: copyFromName;
|
|
1807
|
+
const name = copyFromName === this.userDataProfilesService.defaultProfile.name ? ( localize(13357, "{0} (Copy)", copyFromName)) : copyFromName;
|
|
1600
1808
|
if (root.copyFrom && name) {
|
|
1601
|
-
templateData.radio.setItems([
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
}
|
|
1610
|
-
else {
|
|
1809
|
+
templateData.radio.setItems([{
|
|
1810
|
+
text: name,
|
|
1811
|
+
tooltip: name ? ( localize(13377, "Copy {0} from the {1} profile", resourceTypeTitle, name)) : ( localize(13378, "Copy"))
|
|
1812
|
+
}, ...options]);
|
|
1813
|
+
templateData.radio.setActiveItem(
|
|
1814
|
+
root.getCopyFlag(element.resourceType) ? 0 : root.getFlag(element.resourceType) ? 1 : 2
|
|
1815
|
+
);
|
|
1816
|
+
} else {
|
|
1611
1817
|
templateData.radio.setItems(options);
|
|
1612
1818
|
templateData.radio.setActiveItem(root.getFlag(element.resourceType) ? 0 : 1);
|
|
1613
1819
|
}
|
|
@@ -1617,8 +1823,7 @@ let NewProfileResourceTreeRenderer = class NewProfileResourceTreeRenderer extend
|
|
|
1617
1823
|
root.setFlag(element.resourceType, index === 1);
|
|
1618
1824
|
root.setCopyFlag(element.resourceType, index === 0);
|
|
1619
1825
|
}));
|
|
1620
|
-
}
|
|
1621
|
-
else {
|
|
1826
|
+
} else {
|
|
1622
1827
|
templateData.elementDisposables.add(templateData.radio.onDidSelect(index => {
|
|
1623
1828
|
root.setFlag(element.resourceType, index === 0);
|
|
1624
1829
|
}));
|
|
@@ -1643,51 +1848,71 @@ let NewProfileResourceTreeRenderer = class NewProfileResourceTreeRenderer extend
|
|
|
1643
1848
|
templateData.actionBar.setActions(actions);
|
|
1644
1849
|
}
|
|
1645
1850
|
};
|
|
1646
|
-
NewProfileResourceTreeRenderer = NewProfileResourceTreeRenderer_1 = ( __decorate([
|
|
1647
|
-
( __param(0, IUserDataProfilesService)),
|
|
1648
|
-
( __param(1, IInstantiationService))
|
|
1649
|
-
], NewProfileResourceTreeRenderer));
|
|
1851
|
+
NewProfileResourceTreeRenderer = NewProfileResourceTreeRenderer_1 = ( __decorate([( __param(0, IUserDataProfilesService)), ( __param(1, IInstantiationService))], NewProfileResourceTreeRenderer));
|
|
1650
1852
|
let ProfileResourceChildTreeItemRenderer = class ProfileResourceChildTreeItemRenderer extends AbstractProfileResourceTreeRenderer {
|
|
1651
|
-
static {
|
|
1652
|
-
|
|
1853
|
+
static {
|
|
1854
|
+
ProfileResourceChildTreeItemRenderer_1 = this;
|
|
1855
|
+
}
|
|
1856
|
+
static {
|
|
1857
|
+
this.TEMPLATE_ID = "ProfileResourceChildTreeItemTemplate";
|
|
1858
|
+
}
|
|
1653
1859
|
constructor(instantiationService) {
|
|
1654
1860
|
super();
|
|
1655
1861
|
this.instantiationService = instantiationService;
|
|
1656
1862
|
this.templateId = ProfileResourceChildTreeItemRenderer_1.TEMPLATE_ID;
|
|
1657
1863
|
this.labels = instantiationService.createInstance(ResourceLabels, DEFAULT_LABELS_CONTAINER);
|
|
1658
|
-
this.hoverDelegate = this._register(
|
|
1864
|
+
this.hoverDelegate = this._register(
|
|
1865
|
+
instantiationService.createInstance(WorkbenchHoverDelegate, "mouse", undefined, {})
|
|
1866
|
+
);
|
|
1659
1867
|
}
|
|
1660
1868
|
renderTemplate(parent) {
|
|
1661
1869
|
const disposables = ( new DisposableStore());
|
|
1662
|
-
const container = append(parent, $(
|
|
1663
|
-
const checkbox = disposables.add(( new Checkbox(
|
|
1870
|
+
const container = append(parent, $(".profile-tree-item-container.profile-resource-child-container"));
|
|
1871
|
+
const checkbox = disposables.add(( new Checkbox("", false, defaultCheckboxStyles)));
|
|
1664
1872
|
append(container, checkbox.domNode);
|
|
1665
|
-
const resourceLabel = disposables.add(this.labels.create(container, {
|
|
1666
|
-
|
|
1667
|
-
const actionBar = disposables.add(this.instantiationService.createInstance(WorkbenchToolBar, actionsContainer, {
|
|
1668
|
-
hoverDelegate: disposables.add(createInstantHoverDelegate()),
|
|
1669
|
-
highlightToggledItems: true
|
|
1873
|
+
const resourceLabel = disposables.add(this.labels.create(container, {
|
|
1874
|
+
hoverDelegate: this.hoverDelegate
|
|
1670
1875
|
}));
|
|
1671
|
-
|
|
1876
|
+
const actionsContainer = append(container, $(".profile-resource-actions-container"));
|
|
1877
|
+
const actionBar = disposables.add(
|
|
1878
|
+
this.instantiationService.createInstance(WorkbenchToolBar, actionsContainer, {
|
|
1879
|
+
hoverDelegate: disposables.add(createInstantHoverDelegate()),
|
|
1880
|
+
highlightToggledItems: true
|
|
1881
|
+
})
|
|
1882
|
+
);
|
|
1883
|
+
return {
|
|
1884
|
+
checkbox,
|
|
1885
|
+
resourceLabel,
|
|
1886
|
+
actionBar,
|
|
1887
|
+
disposables,
|
|
1888
|
+
elementDisposables: disposables.add(( new DisposableStore()))
|
|
1889
|
+
};
|
|
1672
1890
|
}
|
|
1673
|
-
renderElement(
|
|
1891
|
+
renderElement(
|
|
1892
|
+
{
|
|
1893
|
+
element: profileResourceTreeElement
|
|
1894
|
+
},
|
|
1895
|
+
index,
|
|
1896
|
+
templateData
|
|
1897
|
+
) {
|
|
1674
1898
|
templateData.elementDisposables.clear();
|
|
1675
|
-
const {
|
|
1899
|
+
const {
|
|
1900
|
+
element
|
|
1901
|
+
} = profileResourceTreeElement;
|
|
1676
1902
|
if (isString(element) || !isProfileResourceChildElement(element)) {
|
|
1677
|
-
throw ( new Error(
|
|
1903
|
+
throw ( new Error("Invalid profile resource element"));
|
|
1678
1904
|
}
|
|
1679
1905
|
if (element.checkbox) {
|
|
1680
|
-
templateData.checkbox.domNode.setAttribute(
|
|
1681
|
-
templateData.checkbox.domNode.classList.remove(
|
|
1906
|
+
templateData.checkbox.domNode.setAttribute("tabindex", "0");
|
|
1907
|
+
templateData.checkbox.domNode.classList.remove("hide");
|
|
1682
1908
|
templateData.checkbox.checked = element.checkbox.isChecked;
|
|
1683
|
-
templateData.checkbox.domNode.ariaLabel = element.checkbox.accessibilityInformation?.label ??
|
|
1909
|
+
templateData.checkbox.domNode.ariaLabel = element.checkbox.accessibilityInformation?.label ?? "";
|
|
1684
1910
|
if (element.checkbox.accessibilityInformation?.role) {
|
|
1685
1911
|
templateData.checkbox.domNode.role = element.checkbox.accessibilityInformation.role;
|
|
1686
1912
|
}
|
|
1687
|
-
}
|
|
1688
|
-
|
|
1689
|
-
templateData.checkbox.domNode.
|
|
1690
|
-
templateData.checkbox.domNode.classList.add('hide');
|
|
1913
|
+
} else {
|
|
1914
|
+
templateData.checkbox.domNode.removeAttribute("tabindex");
|
|
1915
|
+
templateData.checkbox.domNode.classList.add("hide");
|
|
1691
1916
|
}
|
|
1692
1917
|
templateData.resourceLabel.setResource({
|
|
1693
1918
|
name: element.resource ? basename(element.resource) : element.label,
|
|
@@ -1696,7 +1921,7 @@ let ProfileResourceChildTreeItemRenderer = class ProfileResourceChildTreeItemRen
|
|
|
1696
1921
|
}, {
|
|
1697
1922
|
forceLabel: true,
|
|
1698
1923
|
icon: element.icon,
|
|
1699
|
-
hideIcon: !element.resource && !element.icon
|
|
1924
|
+
hideIcon: !element.resource && !element.icon
|
|
1700
1925
|
});
|
|
1701
1926
|
const actions = [];
|
|
1702
1927
|
if (element.openAction) {
|
|
@@ -1708,25 +1933,27 @@ let ProfileResourceChildTreeItemRenderer = class ProfileResourceChildTreeItemRen
|
|
|
1708
1933
|
templateData.actionBar.setActions(actions);
|
|
1709
1934
|
}
|
|
1710
1935
|
};
|
|
1711
|
-
ProfileResourceChildTreeItemRenderer = ProfileResourceChildTreeItemRenderer_1 = ( __decorate([
|
|
1712
|
-
( __param(0, IInstantiationService))
|
|
1713
|
-
], ProfileResourceChildTreeItemRenderer));
|
|
1936
|
+
ProfileResourceChildTreeItemRenderer = ProfileResourceChildTreeItemRenderer_1 = ( __decorate([( __param(0, IInstantiationService))], ProfileResourceChildTreeItemRenderer));
|
|
1714
1937
|
class WorkspaceUriEmptyColumnRenderer {
|
|
1715
1938
|
constructor() {
|
|
1716
1939
|
this.templateId = WorkspaceUriEmptyColumnRenderer.TEMPLATE_ID;
|
|
1717
1940
|
}
|
|
1718
|
-
static {
|
|
1941
|
+
static {
|
|
1942
|
+
this.TEMPLATE_ID = "empty";
|
|
1943
|
+
}
|
|
1719
1944
|
renderTemplate(container) {
|
|
1720
1945
|
return {};
|
|
1721
1946
|
}
|
|
1722
|
-
renderElement(item, index, templateData) {
|
|
1723
|
-
}
|
|
1724
|
-
disposeTemplate() {
|
|
1725
|
-
}
|
|
1947
|
+
renderElement(item, index, templateData) {}
|
|
1948
|
+
disposeTemplate() {}
|
|
1726
1949
|
}
|
|
1727
1950
|
let WorkspaceUriHostColumnRenderer = class WorkspaceUriHostColumnRenderer {
|
|
1728
|
-
static {
|
|
1729
|
-
|
|
1951
|
+
static {
|
|
1952
|
+
WorkspaceUriHostColumnRenderer_1 = this;
|
|
1953
|
+
}
|
|
1954
|
+
static {
|
|
1955
|
+
this.TEMPLATE_ID = "host";
|
|
1956
|
+
}
|
|
1730
1957
|
constructor(uriIdentityService, labelService) {
|
|
1731
1958
|
this.uriIdentityService = uriIdentityService;
|
|
1732
1959
|
this.labelService = labelService;
|
|
@@ -1735,9 +1962,9 @@ let WorkspaceUriHostColumnRenderer = class WorkspaceUriHostColumnRenderer {
|
|
|
1735
1962
|
renderTemplate(container) {
|
|
1736
1963
|
const disposables = ( new DisposableStore());
|
|
1737
1964
|
const renderDisposables = disposables.add(( new DisposableStore()));
|
|
1738
|
-
const element = container.appendChild($(
|
|
1739
|
-
const hostContainer = element.appendChild($(
|
|
1740
|
-
const buttonBarContainer = element.appendChild($(
|
|
1965
|
+
const element = container.appendChild($(".host"));
|
|
1966
|
+
const hostContainer = element.appendChild($("div.host-label"));
|
|
1967
|
+
const buttonBarContainer = element.appendChild($("div.button-bar"));
|
|
1741
1968
|
return {
|
|
1742
1969
|
element,
|
|
1743
1970
|
hostContainer,
|
|
@@ -1748,34 +1975,42 @@ let WorkspaceUriHostColumnRenderer = class WorkspaceUriHostColumnRenderer {
|
|
|
1748
1975
|
}
|
|
1749
1976
|
renderElement(item, index, templateData) {
|
|
1750
1977
|
templateData.renderDisposables.clear();
|
|
1751
|
-
templateData.renderDisposables.add({
|
|
1978
|
+
templateData.renderDisposables.add({
|
|
1979
|
+
dispose: () => {
|
|
1980
|
+
clearNode(templateData.buttonBarContainer);
|
|
1981
|
+
}
|
|
1982
|
+
});
|
|
1752
1983
|
templateData.hostContainer.innerText = getHostLabel(this.labelService, item.workspace);
|
|
1753
|
-
templateData.element.classList.toggle(
|
|
1754
|
-
|
|
1755
|
-
|
|
1984
|
+
templateData.element.classList.toggle(
|
|
1985
|
+
"current-workspace",
|
|
1986
|
+
this.uriIdentityService.extUri.isEqual(item.workspace, item.profileElement.getCurrentWorkspace())
|
|
1987
|
+
);
|
|
1988
|
+
templateData.hostContainer.style.display = "";
|
|
1989
|
+
templateData.buttonBarContainer.style.display = "none";
|
|
1756
1990
|
}
|
|
1757
1991
|
disposeTemplate(templateData) {
|
|
1758
1992
|
templateData.disposables.dispose();
|
|
1759
1993
|
}
|
|
1760
1994
|
};
|
|
1761
|
-
WorkspaceUriHostColumnRenderer = WorkspaceUriHostColumnRenderer_1 = ( __decorate([
|
|
1762
|
-
( __param(0, IUriIdentityService)),
|
|
1763
|
-
( __param(1, ILabelService))
|
|
1764
|
-
], WorkspaceUriHostColumnRenderer));
|
|
1995
|
+
WorkspaceUriHostColumnRenderer = WorkspaceUriHostColumnRenderer_1 = ( __decorate([( __param(0, IUriIdentityService)), ( __param(1, ILabelService))], WorkspaceUriHostColumnRenderer));
|
|
1765
1996
|
let WorkspaceUriPathColumnRenderer = class WorkspaceUriPathColumnRenderer {
|
|
1766
|
-
static {
|
|
1767
|
-
|
|
1997
|
+
static {
|
|
1998
|
+
WorkspaceUriPathColumnRenderer_1 = this;
|
|
1999
|
+
}
|
|
2000
|
+
static {
|
|
2001
|
+
this.TEMPLATE_ID = "path";
|
|
2002
|
+
}
|
|
1768
2003
|
constructor(uriIdentityService, hoverService) {
|
|
1769
2004
|
this.uriIdentityService = uriIdentityService;
|
|
1770
2005
|
this.hoverService = hoverService;
|
|
1771
2006
|
this.templateId = WorkspaceUriPathColumnRenderer_1.TEMPLATE_ID;
|
|
1772
|
-
this.hoverDelegate = getDefaultHoverDelegate(
|
|
2007
|
+
this.hoverDelegate = getDefaultHoverDelegate("mouse");
|
|
1773
2008
|
}
|
|
1774
2009
|
renderTemplate(container) {
|
|
1775
2010
|
const disposables = ( new DisposableStore());
|
|
1776
|
-
const element = container.appendChild($(
|
|
1777
|
-
const pathLabel = element.appendChild($(
|
|
1778
|
-
const pathHover = disposables.add(this.hoverService.setupManagedHover(this.hoverDelegate, pathLabel,
|
|
2011
|
+
const element = container.appendChild($(".path"));
|
|
2012
|
+
const pathLabel = element.appendChild($("div.path-label"));
|
|
2013
|
+
const pathHover = disposables.add(this.hoverService.setupManagedHover(this.hoverDelegate, pathLabel, ""));
|
|
1779
2014
|
const renderDisposables = disposables.add(( new DisposableStore()));
|
|
1780
2015
|
return {
|
|
1781
2016
|
element,
|
|
@@ -1789,7 +2024,10 @@ let WorkspaceUriPathColumnRenderer = class WorkspaceUriPathColumnRenderer {
|
|
|
1789
2024
|
templateData.renderDisposables.clear();
|
|
1790
2025
|
const stringValue = this.formatPath(item.workspace);
|
|
1791
2026
|
templateData.pathLabel.innerText = stringValue;
|
|
1792
|
-
templateData.element.classList.toggle(
|
|
2027
|
+
templateData.element.classList.toggle(
|
|
2028
|
+
"current-workspace",
|
|
2029
|
+
this.uriIdentityService.extUri.isEqual(item.workspace, item.profileElement.getCurrentWorkspace())
|
|
2030
|
+
);
|
|
1793
2031
|
templateData.pathHover.update(stringValue);
|
|
1794
2032
|
}
|
|
1795
2033
|
disposeTemplate(templateData) {
|
|
@@ -1810,103 +2048,118 @@ let WorkspaceUriPathColumnRenderer = class WorkspaceUriPathColumnRenderer {
|
|
|
1810
2048
|
return uri.path;
|
|
1811
2049
|
}
|
|
1812
2050
|
};
|
|
1813
|
-
WorkspaceUriPathColumnRenderer = WorkspaceUriPathColumnRenderer_1 = ( __decorate([
|
|
1814
|
-
( __param(0, IUriIdentityService)),
|
|
1815
|
-
( __param(1, IHoverService))
|
|
1816
|
-
], WorkspaceUriPathColumnRenderer));
|
|
2051
|
+
WorkspaceUriPathColumnRenderer = WorkspaceUriPathColumnRenderer_1 = ( __decorate([( __param(0, IUriIdentityService)), ( __param(1, IHoverService))], WorkspaceUriPathColumnRenderer));
|
|
1817
2052
|
let ChangeProfileAction = class ChangeProfileAction {
|
|
1818
|
-
constructor(item, userDataProfilesService) {
|
|
2053
|
+
constructor(item, userDataProfilesService, uriIdentityService, environmentService) {
|
|
1819
2054
|
this.item = item;
|
|
1820
2055
|
this.userDataProfilesService = userDataProfilesService;
|
|
1821
|
-
this.id =
|
|
1822
|
-
this.label =
|
|
2056
|
+
this.id = "changeProfile";
|
|
2057
|
+
this.label = "Change Profile";
|
|
1823
2058
|
this.class = ThemeIcon.asClassName(editIcon);
|
|
1824
|
-
this.
|
|
1825
|
-
this.tooltip = ( localize(13017, "Change Profile"));
|
|
2059
|
+
this.tooltip = ( localize(13379, "Change Profile"));
|
|
1826
2060
|
this.checked = false;
|
|
2061
|
+
this.enabled = !uriIdentityService.extUri.isEqual(item.workspace, environmentService.agentSessionsWorkspace);
|
|
1827
2062
|
}
|
|
1828
|
-
run() {
|
|
2063
|
+
run() {}
|
|
1829
2064
|
getSwitchProfileActions() {
|
|
1830
|
-
return ( this.userDataProfilesService.profiles
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
.map(profile => ({
|
|
2065
|
+
return ( this.userDataProfilesService.profiles.filter(profile => !profile.isTransient).sort(
|
|
2066
|
+
(a, b) => a.isDefault ? -1 : b.isDefault ? 1 : a.name.localeCompare(b.name)
|
|
2067
|
+
).map(profile => ({
|
|
1834
2068
|
id: `switchProfileTo${profile.id}`,
|
|
1835
2069
|
label: profile.name,
|
|
1836
2070
|
class: undefined,
|
|
1837
2071
|
enabled: true,
|
|
1838
2072
|
checked: profile.id === this.item.profileElement.profile.id,
|
|
1839
|
-
tooltip:
|
|
2073
|
+
tooltip: "",
|
|
1840
2074
|
run: () => {
|
|
1841
2075
|
if (profile.id === this.item.profileElement.profile.id) {
|
|
1842
2076
|
return;
|
|
1843
2077
|
}
|
|
1844
|
-
this.userDataProfilesService.updateProfile(profile, {
|
|
2078
|
+
this.userDataProfilesService.updateProfile(profile, {
|
|
2079
|
+
workspaces: [...(profile.workspaces ?? []), this.item.workspace]
|
|
2080
|
+
});
|
|
1845
2081
|
}
|
|
1846
2082
|
})));
|
|
1847
2083
|
}
|
|
1848
2084
|
};
|
|
1849
|
-
ChangeProfileAction = ( __decorate([
|
|
1850
|
-
( __param(1, IUserDataProfilesService))
|
|
1851
|
-
], ChangeProfileAction));
|
|
2085
|
+
ChangeProfileAction = ( __decorate([( __param(1, IUserDataProfilesService)), ( __param(2, IUriIdentityService)), ( __param(3, IEnvironmentService))], ChangeProfileAction));
|
|
1852
2086
|
let WorkspaceUriActionsColumnRenderer = class WorkspaceUriActionsColumnRenderer {
|
|
1853
|
-
static {
|
|
1854
|
-
|
|
1855
|
-
|
|
2087
|
+
static {
|
|
2088
|
+
WorkspaceUriActionsColumnRenderer_1 = this;
|
|
2089
|
+
}
|
|
2090
|
+
static {
|
|
2091
|
+
this.TEMPLATE_ID = "actions";
|
|
2092
|
+
}
|
|
2093
|
+
constructor(
|
|
2094
|
+
userDataProfilesService,
|
|
2095
|
+
userDataProfileManagementService,
|
|
2096
|
+
contextMenuService,
|
|
2097
|
+
uriIdentityService,
|
|
2098
|
+
environmentService
|
|
2099
|
+
) {
|
|
1856
2100
|
this.userDataProfilesService = userDataProfilesService;
|
|
1857
2101
|
this.userDataProfileManagementService = userDataProfileManagementService;
|
|
1858
2102
|
this.contextMenuService = contextMenuService;
|
|
1859
2103
|
this.uriIdentityService = uriIdentityService;
|
|
2104
|
+
this.environmentService = environmentService;
|
|
1860
2105
|
this.templateId = WorkspaceUriActionsColumnRenderer_1.TEMPLATE_ID;
|
|
1861
2106
|
}
|
|
1862
2107
|
renderTemplate(container) {
|
|
1863
2108
|
const disposables = ( new DisposableStore());
|
|
1864
|
-
const element = container.appendChild($(
|
|
2109
|
+
const element = container.appendChild($(".profile-workspaces-actions-container"));
|
|
1865
2110
|
const hoverDelegate = disposables.add(createInstantHoverDelegate());
|
|
1866
2111
|
const actionBar = disposables.add(( new ActionBar(element, {
|
|
1867
2112
|
hoverDelegate,
|
|
1868
|
-
actionViewItemProvider:
|
|
2113
|
+
actionViewItemProvider: action => {
|
|
1869
2114
|
if (action instanceof ChangeProfileAction) {
|
|
1870
|
-
return ( new DropdownMenuActionViewItem(
|
|
1871
|
-
action
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
hoverDelegate,
|
|
1877
|
-
}
|
|
1878
|
-
));
|
|
2115
|
+
return ( new DropdownMenuActionViewItem(action, {
|
|
2116
|
+
getActions: () => action.getSwitchProfileActions()
|
|
2117
|
+
}, this.contextMenuService, {
|
|
2118
|
+
classNames: action.class,
|
|
2119
|
+
hoverDelegate
|
|
2120
|
+
}));
|
|
1879
2121
|
}
|
|
1880
2122
|
return undefined;
|
|
1881
2123
|
}
|
|
1882
2124
|
})));
|
|
1883
|
-
return {
|
|
2125
|
+
return {
|
|
2126
|
+
actionBar,
|
|
2127
|
+
disposables
|
|
2128
|
+
};
|
|
1884
2129
|
}
|
|
1885
2130
|
renderElement(item, index, templateData) {
|
|
1886
2131
|
templateData.actionBar.clear();
|
|
1887
2132
|
const actions = [];
|
|
1888
2133
|
actions.push(this.createOpenAction(item));
|
|
1889
|
-
actions.push(( new ChangeProfileAction(
|
|
2134
|
+
actions.push(( new ChangeProfileAction(
|
|
2135
|
+
item,
|
|
2136
|
+
this.userDataProfilesService,
|
|
2137
|
+
this.uriIdentityService,
|
|
2138
|
+
this.environmentService
|
|
2139
|
+
)));
|
|
1890
2140
|
actions.push(this.createDeleteAction(item));
|
|
1891
|
-
templateData.actionBar.push(actions, {
|
|
2141
|
+
templateData.actionBar.push(actions, {
|
|
2142
|
+
icon: true
|
|
2143
|
+
});
|
|
1892
2144
|
}
|
|
1893
2145
|
createOpenAction(item) {
|
|
1894
2146
|
return {
|
|
1895
|
-
label:
|
|
2147
|
+
label: "",
|
|
1896
2148
|
class: ThemeIcon.asClassName(Codicon.window),
|
|
1897
2149
|
enabled: !this.uriIdentityService.extUri.isEqual(item.workspace, item.profileElement.getCurrentWorkspace()),
|
|
1898
|
-
id:
|
|
1899
|
-
tooltip: ( localize(
|
|
2150
|
+
id: "openWorkspace",
|
|
2151
|
+
tooltip: ( localize(13380, "Open in New Window")),
|
|
1900
2152
|
run: () => item.profileElement.openWorkspace(item.workspace)
|
|
1901
2153
|
};
|
|
1902
2154
|
}
|
|
1903
2155
|
createDeleteAction(item) {
|
|
2156
|
+
const isAgentSessionsWorkspace = this.uriIdentityService.extUri.isEqual(item.workspace, this.environmentService.agentSessionsWorkspace);
|
|
1904
2157
|
return {
|
|
1905
|
-
label:
|
|
2158
|
+
label: "",
|
|
1906
2159
|
class: ThemeIcon.asClassName(removeIcon),
|
|
1907
|
-
enabled: this.userDataProfileManagementService.getDefaultProfileToUse().id !== item.profileElement.profile.id,
|
|
1908
|
-
id:
|
|
1909
|
-
tooltip: ( localize(
|
|
2160
|
+
enabled: this.userDataProfileManagementService.getDefaultProfileToUse().id !== item.profileElement.profile.id && !isAgentSessionsWorkspace,
|
|
2161
|
+
id: "deleteTrustedUri",
|
|
2162
|
+
tooltip: ( localize(13381, "Delete Path")),
|
|
1910
2163
|
run: () => item.profileElement.updateWorkspaces([], [item.workspace])
|
|
1911
2164
|
};
|
|
1912
2165
|
}
|
|
@@ -1914,19 +2167,20 @@ let WorkspaceUriActionsColumnRenderer = class WorkspaceUriActionsColumnRenderer
|
|
|
1914
2167
|
templateData.disposables.dispose();
|
|
1915
2168
|
}
|
|
1916
2169
|
};
|
|
1917
|
-
WorkspaceUriActionsColumnRenderer = WorkspaceUriActionsColumnRenderer_1 = ( __decorate([
|
|
1918
|
-
( __param(0, IUserDataProfilesService)),
|
|
1919
|
-
( __param(1, IUserDataProfileManagementService)),
|
|
1920
|
-
( __param(2, IContextMenuService)),
|
|
1921
|
-
( __param(3, IUriIdentityService))
|
|
1922
|
-
], WorkspaceUriActionsColumnRenderer));
|
|
2170
|
+
WorkspaceUriActionsColumnRenderer = WorkspaceUriActionsColumnRenderer_1 = ( __decorate([( __param(0, IUserDataProfilesService)), ( __param(1, IUserDataProfileManagementService)), ( __param(2, IContextMenuService)), ( __param(3, IUriIdentityService)), ( __param(4, IEnvironmentService))], WorkspaceUriActionsColumnRenderer));
|
|
1923
2171
|
function getHostLabel(labelService, workspaceUri) {
|
|
1924
|
-
return workspaceUri.authority ? labelService.getHostLabel(workspaceUri.scheme, workspaceUri.authority) : ( localize(
|
|
2172
|
+
return workspaceUri.authority ? labelService.getHostLabel(workspaceUri.scheme, workspaceUri.authority) : ( localize(13382, "Local"));
|
|
1925
2173
|
}
|
|
1926
2174
|
let UserDataProfilesEditorInput = class UserDataProfilesEditorInput extends EditorInput {
|
|
1927
|
-
static {
|
|
1928
|
-
|
|
1929
|
-
|
|
2175
|
+
static {
|
|
2176
|
+
UserDataProfilesEditorInput_1 = this;
|
|
2177
|
+
}
|
|
2178
|
+
static {
|
|
2179
|
+
this.ID = "workbench.input.userDataProfiles";
|
|
2180
|
+
}
|
|
2181
|
+
get dirty() {
|
|
2182
|
+
return this._dirty;
|
|
2183
|
+
}
|
|
1930
2184
|
set dirty(dirty) {
|
|
1931
2185
|
if (this._dirty !== dirty) {
|
|
1932
2186
|
this._dirty = dirty;
|
|
@@ -1941,9 +2195,15 @@ let UserDataProfilesEditorInput = class UserDataProfilesEditorInput extends Edit
|
|
|
1941
2195
|
this.model = UserDataProfilesEditorModel.getInstance(this.instantiationService);
|
|
1942
2196
|
this._register(this.model.onDidChange(e => this.dirty = ( this.model.profiles.some(profile => profile instanceof NewProfileElement))));
|
|
1943
2197
|
}
|
|
1944
|
-
get typeId() {
|
|
1945
|
-
|
|
1946
|
-
|
|
2198
|
+
get typeId() {
|
|
2199
|
+
return UserDataProfilesEditorInput_1.ID;
|
|
2200
|
+
}
|
|
2201
|
+
getName() {
|
|
2202
|
+
return localize(13383, "Profiles");
|
|
2203
|
+
}
|
|
2204
|
+
getIcon() {
|
|
2205
|
+
return defaultUserDataProfileIcon;
|
|
2206
|
+
}
|
|
1947
2207
|
async resolve() {
|
|
1948
2208
|
await this.model.resolve();
|
|
1949
2209
|
return this.model;
|
|
@@ -1958,7 +2218,9 @@ let UserDataProfilesEditorInput = class UserDataProfilesEditorInput extends Edit
|
|
|
1958
2218
|
async revert() {
|
|
1959
2219
|
this.model.revert();
|
|
1960
2220
|
}
|
|
1961
|
-
matches(otherInput) {
|
|
2221
|
+
matches(otherInput) {
|
|
2222
|
+
return otherInput instanceof UserDataProfilesEditorInput_1;
|
|
2223
|
+
}
|
|
1962
2224
|
dispose() {
|
|
1963
2225
|
for (const profile of this.model.profiles) {
|
|
1964
2226
|
if (profile instanceof UserDataProfileElement) {
|
|
@@ -1968,13 +2230,17 @@ let UserDataProfilesEditorInput = class UserDataProfilesEditorInput extends Edit
|
|
|
1968
2230
|
super.dispose();
|
|
1969
2231
|
}
|
|
1970
2232
|
};
|
|
1971
|
-
UserDataProfilesEditorInput = UserDataProfilesEditorInput_1 = ( __decorate([
|
|
1972
|
-
( __param(0, IInstantiationService))
|
|
1973
|
-
], UserDataProfilesEditorInput));
|
|
2233
|
+
UserDataProfilesEditorInput = UserDataProfilesEditorInput_1 = ( __decorate([( __param(0, IInstantiationService))], UserDataProfilesEditorInput));
|
|
1974
2234
|
class UserDataProfilesEditorInputSerializer {
|
|
1975
|
-
canSerialize(editorInput) {
|
|
1976
|
-
|
|
1977
|
-
|
|
2235
|
+
canSerialize(editorInput) {
|
|
2236
|
+
return true;
|
|
2237
|
+
}
|
|
2238
|
+
serialize(editorInput) {
|
|
2239
|
+
return "";
|
|
2240
|
+
}
|
|
2241
|
+
deserialize(instantiationService) {
|
|
2242
|
+
return instantiationService.createInstance(UserDataProfilesEditorInput);
|
|
2243
|
+
}
|
|
1978
2244
|
}
|
|
1979
2245
|
|
|
1980
2246
|
export { UserDataProfilesEditor, UserDataProfilesEditorInput, UserDataProfilesEditorInputSerializer, profilesSashBorder };
|