@codingame/monaco-vscode-user-data-profile-service-override 9.0.3 → 10.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/_virtual/semver.js +5 -0
- package/package.json +2 -2
- package/userDataProfile.js +10 -5
- package/vscode/src/vs/platform/userDataProfile/common/userDataProfileStorageService.js +10 -8
- package/vscode/src/vs/platform/userDataSync/common/extensionsMerge.js +1 -1
- package/vscode/src/vs/platform/userDataSync/common/extensionsSync.js +20 -20
- package/vscode/src/vs/platform/userDataSync/common/globalStateSync.js +25 -26
- package/vscode/src/vs/platform/userDataSync/common/keybindingsSync.js +27 -28
- package/vscode/src/vs/platform/userDataSync/common/settingsSync.js +21 -24
- package/vscode/src/vs/platform/userDataSync/common/snippetsSync.js +40 -40
- package/vscode/src/vs/platform/userDataSync/common/tasksSync.js +14 -14
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/media/userDataProfilesEditor.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.contribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.js +26 -24
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfileActions.js +3 -3
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditor.js +577 -138
- package/vscode/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditorModel.js +242 -103
- package/vscode/src/vs/workbench/services/userData/browser/userDataInit.js +1 -2
- package/vscode/src/vs/workbench/services/userDataProfile/browser/extensionsResource.js +11 -11
- package/vscode/src/vs/workbench/services/userDataProfile/browser/globalStateResource.js +9 -11
- package/vscode/src/vs/workbench/services/userDataProfile/browser/keybindingsResource.js +5 -6
- package/vscode/src/vs/workbench/services/userDataProfile/browser/settingsResource.js +7 -8
- package/vscode/src/vs/workbench/services/userDataProfile/browser/snippetsResource.js +5 -6
- package/vscode/src/vs/workbench/services/userDataProfile/browser/tasksResource.js +5 -6
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileImportExportService.js +44 -46
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileInit.js +7 -9
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.js +75 -34
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileStorageService.js +3 -4
- package/vscode/src/vs/workbench/services/userDataSync/browser/userDataSyncInit.js +13 -15
- package/vscode/src/vs/workbench/services/userDataSync/common/userDataSyncUtil.js +0 -1
|
@@ -10,14 +10,13 @@ import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/c
|
|
|
10
10
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
|
|
11
11
|
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
12
12
|
import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService.service';
|
|
13
|
-
import { ProfileResourceType } from 'vscode/vscode/vs/platform/userDataProfile/common/userDataProfile';
|
|
14
13
|
import { IUserDataProfilesService } from 'vscode/vscode/vs/platform/userDataProfile/common/userDataProfile.service';
|
|
15
14
|
import { EditorPane } from 'vscode/vscode/vs/workbench/browser/parts/editor/editorPane';
|
|
16
15
|
import { EditorInput } from 'vscode/vscode/vs/workbench/common/editor/editorInput';
|
|
17
16
|
import { PROFILE_FILTER, defaultUserDataProfileIcon } from 'vscode/vscode/vs/workbench/services/userDataProfile/common/userDataProfile';
|
|
18
17
|
import { IUserDataProfileService } from 'vscode/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.service';
|
|
19
18
|
import { SplitView, Sizing } from 'vscode/vscode/vs/base/browser/ui/splitview/splitview';
|
|
20
|
-
import { ButtonWithDropdown, Button } from 'vscode/vscode/vs/base/browser/ui/button/button';
|
|
19
|
+
import { ButtonWithDropdown, Button, ButtonBar } from 'vscode/vscode/vs/base/browser/ui/button/button';
|
|
21
20
|
import { getListStyles, defaultButtonStyles, getInputBoxStyle, defaultInputBoxStyles, defaultCheckboxStyles, defaultSelectBoxStyles } from 'vscode/vscode/vs/platform/theme/browser/defaultStyles';
|
|
22
21
|
import { registerColor } from 'vscode/vscode/vs/platform/theme/common/colorUtils';
|
|
23
22
|
import { foreground } from 'vscode/vscode/vs/platform/theme/common/colors/baseColors';
|
|
@@ -31,18 +30,16 @@ import 'vscode/vscode/vs/platform/theme/common/colors/miscColors';
|
|
|
31
30
|
import 'vscode/vscode/vs/platform/theme/common/colors/quickpickColors';
|
|
32
31
|
import 'vscode/vscode/vs/platform/theme/common/colors/searchColors';
|
|
33
32
|
import { PANEL_BORDER } from 'vscode/vscode/vs/workbench/common/theme';
|
|
34
|
-
import { WorkbenchList, WorkbenchAsyncDataTree } from 'vscode/vscode/vs/platform/list/browser/listService';
|
|
33
|
+
import { WorkbenchList, WorkbenchAsyncDataTree, WorkbenchTable } from 'vscode/vscode/vs/platform/list/browser/listService';
|
|
35
34
|
import { CachedListVirtualDelegate } from 'vscode/vscode/vs/base/browser/ui/list/list';
|
|
36
35
|
import { DisposableStore, Disposable, MutableDisposable, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
37
|
-
import { InputBox
|
|
36
|
+
import { InputBox } from 'vscode/vscode/vs/base/browser/ui/inputbox/inputBox';
|
|
38
37
|
import { Checkbox } from 'vscode/vscode/vs/base/browser/ui/toggle/toggle';
|
|
39
38
|
import { DEFAULT_ICON, ICONS } from 'vscode/vscode/vs/workbench/services/userDataProfile/common/userDataProfileIcons';
|
|
40
39
|
import { WorkbenchIconSelectBox } from 'vscode/vscode/vs/workbench/services/userDataProfile/browser/iconSelectBox';
|
|
41
40
|
import { StandardKeyboardEvent } from 'vscode/vscode/vs/base/browser/keyboardEvent';
|
|
42
|
-
import { KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
|
|
43
41
|
import { WorkbenchHoverDelegate } from 'vscode/vscode/vs/platform/hover/browser/hover';
|
|
44
42
|
import { IHoverService } from 'vscode/vscode/vs/platform/hover/browser/hover.service';
|
|
45
|
-
import { HoverPosition } from 'vscode/vscode/vs/base/browser/ui/hover/hoverWidget';
|
|
46
43
|
import { SelectBox } from 'vscode/vscode/vs/base/browser/ui/selectBox/selectBox';
|
|
47
44
|
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
48
45
|
import { IEditorProgressService } from 'vscode/vscode/vs/platform/progress/common/progress.service';
|
|
@@ -54,17 +51,25 @@ import { IFileDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dia
|
|
|
54
51
|
import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput.service';
|
|
55
52
|
import { UserDataProfileElement, AbstractUserDataProfileElement, NewProfileElement, isProfileResourceTypeElement, isProfileResourceChildElement, UserDataProfilesEditorModel } from './userDataProfilesEditorModel.js';
|
|
56
53
|
import { WorkbenchToolBar } from 'vscode/vscode/vs/platform/actions/browser/toolbar';
|
|
57
|
-
import { createInstantHoverDelegate } from 'vscode/vscode/vs/base/browser/ui/hover/hoverDelegateFactory';
|
|
54
|
+
import { createInstantHoverDelegate, getDefaultHoverDelegate } from 'vscode/vscode/vs/base/browser/ui/hover/hoverDelegateFactory';
|
|
58
55
|
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
59
56
|
import { Radio } from '../../../../base/browser/ui/radio/radio.js';
|
|
60
57
|
import { MarkdownString } from 'vscode/vscode/vs/base/common/htmlContent';
|
|
61
58
|
import { settingsTextInputBorder } from 'vscode/vscode/vs/workbench/contrib/preferences/common/settingsEditorColorRegistry';
|
|
62
59
|
import { renderMarkdown } from 'vscode/vscode/vs/base/browser/markdownRenderer';
|
|
63
60
|
import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
64
|
-
import {
|
|
61
|
+
import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label.service';
|
|
62
|
+
import { Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
63
|
+
import { posix, win32 } from 'vscode/vscode/vs/base/common/path';
|
|
64
|
+
import { hasDriveLetter } from 'vscode/vscode/vs/base/common/extpath';
|
|
65
|
+
import { normalizeDriveLetter } from 'vscode/vscode/vs/base/common/labels';
|
|
66
|
+
import { ActionBar } from 'vscode/vscode/vs/base/browser/ui/actionbar/actionbar';
|
|
67
|
+
import { registerIcon } from 'vscode/vscode/vs/platform/theme/common/iconRegistry';
|
|
68
|
+
import { DropdownMenuActionViewItem } from 'vscode/vscode/vs/base/browser/ui/dropdown/dropdownActionViewItem';
|
|
65
69
|
|
|
66
|
-
var UserDataProfilesEditor_1, ExistingProfileResourceTreeRenderer_1, NewProfileResourceTreeRenderer_1, ProfileResourceChildTreeItemRenderer_1, UserDataProfilesEditorInput_1;
|
|
67
|
-
const
|
|
70
|
+
var UserDataProfilesEditor_1, ExistingProfileResourceTreeRenderer_1, NewProfileResourceTreeRenderer_1, ProfileResourceChildTreeItemRenderer_1, WorkspaceUriHostColumnRenderer_1, WorkspaceUriPathColumnRenderer_1, WorkspaceUriActionsColumnRenderer_1, UserDataProfilesEditorInput_1;
|
|
71
|
+
const editIcon = registerIcon('profiles-editor-edit-folder', Codicon.edit, ( localize(11064, 'Icon for the edit folder icon in the profiles editor.')));
|
|
72
|
+
const profilesSashBorder = registerColor('profiles.sashBorder', PANEL_BORDER, ( localize(11065, "The color of the Profiles editor splitview sash border.")));
|
|
68
73
|
const listStyles = getListStyles({
|
|
69
74
|
listActiveSelectionBackground: editorBackground,
|
|
70
75
|
listActiveSelectionForeground: foreground,
|
|
@@ -82,6 +87,7 @@ const listStyles = getListStyles({
|
|
|
82
87
|
listInactiveFocusOutline: editorBackground,
|
|
83
88
|
treeIndentGuidesStroke: undefined,
|
|
84
89
|
treeInactiveIndentGuidesStroke: undefined,
|
|
90
|
+
tableOddRowsBackgroundColor: editorBackground,
|
|
85
91
|
});
|
|
86
92
|
let UserDataProfilesEditor = class UserDataProfilesEditor extends EditorPane {
|
|
87
93
|
static { UserDataProfilesEditor_1 = this; }
|
|
@@ -109,7 +115,7 @@ let UserDataProfilesEditor = class UserDataProfilesEditor extends EditorPane {
|
|
|
109
115
|
const contentsContainer = append(contentsView, $('.contents-container'));
|
|
110
116
|
this.profileWidget = this._register(this.instantiationService.createInstance(ProfileWidget, contentsContainer));
|
|
111
117
|
this.splitView = ( (new SplitView(this.container, {
|
|
112
|
-
orientation:
|
|
118
|
+
orientation: 1 ,
|
|
113
119
|
proportionalLayout: true
|
|
114
120
|
})));
|
|
115
121
|
this.renderSidebar(sidebarContainer);
|
|
@@ -159,7 +165,7 @@ let UserDataProfilesEditor = class UserDataProfilesEditor extends EditorPane {
|
|
|
159
165
|
return profileElement?.name ?? '';
|
|
160
166
|
},
|
|
161
167
|
getWidgetAriaLabel() {
|
|
162
|
-
return ( localize(
|
|
168
|
+
return ( localize(11066, "Profiles"));
|
|
163
169
|
}
|
|
164
170
|
},
|
|
165
171
|
openOnSingleClick: true,
|
|
@@ -180,10 +186,10 @@ let UserDataProfilesEditor = class UserDataProfilesEditor extends EditorPane {
|
|
|
180
186
|
getActions: () => {
|
|
181
187
|
const actions = [];
|
|
182
188
|
if (this.templates.length) {
|
|
183
|
-
actions.push(( (new SubmenuAction('from.template', ( localize(
|
|
189
|
+
actions.push(( (new SubmenuAction('from.template', ( localize(11067, "From Template")), this.getCreateFromTemplateActions()))));
|
|
184
190
|
actions.push(( (new Separator())));
|
|
185
191
|
}
|
|
186
|
-
actions.push(( (new Action('importProfile', ( localize(
|
|
192
|
+
actions.push(( (new Action('importProfile', ( localize(11068, "Import Profile...")), undefined, true, () => this.importProfile()))));
|
|
187
193
|
return actions;
|
|
188
194
|
}
|
|
189
195
|
},
|
|
@@ -192,7 +198,7 @@ let UserDataProfilesEditor = class UserDataProfilesEditor extends EditorPane {
|
|
|
192
198
|
supportIcons: true,
|
|
193
199
|
...defaultButtonStyles
|
|
194
200
|
}))));
|
|
195
|
-
button.label = ( localize(
|
|
201
|
+
button.label = ( localize(11069, "New Profile"));
|
|
196
202
|
this._register(button.onDidClick(e => this.createNewProfile()));
|
|
197
203
|
}
|
|
198
204
|
getCreateFromTemplateActions() {
|
|
@@ -239,13 +245,13 @@ let UserDataProfilesEditor = class UserDataProfilesEditor extends EditorPane {
|
|
|
239
245
|
}
|
|
240
246
|
getTreeContextMenuActions() {
|
|
241
247
|
const actions = [];
|
|
242
|
-
actions.push(( (new Action('newProfile', ( localize(
|
|
248
|
+
actions.push(( (new Action('newProfile', ( localize(11069, "New Profile")), undefined, true, () => this.createNewProfile()))));
|
|
243
249
|
const templateActions = this.getCreateFromTemplateActions();
|
|
244
250
|
if (templateActions.length) {
|
|
245
|
-
actions.push(( (new SubmenuAction('from.template', ( localize(
|
|
251
|
+
actions.push(( (new SubmenuAction('from.template', ( localize(11070, "New Profile From Template")), templateActions))));
|
|
246
252
|
}
|
|
247
253
|
actions.push(( (new Separator())));
|
|
248
|
-
actions.push(( (new Action('importProfile', ( localize(
|
|
254
|
+
actions.push(( (new Action('importProfile', ( localize(11068, "Import Profile...")), undefined, true, () => this.importProfile()))));
|
|
249
255
|
return actions;
|
|
250
256
|
}
|
|
251
257
|
async importProfile() {
|
|
@@ -254,13 +260,13 @@ let UserDataProfilesEditor = class UserDataProfilesEditor extends EditorPane {
|
|
|
254
260
|
const updateQuickPickItems = (value) => {
|
|
255
261
|
const quickPickItems = [];
|
|
256
262
|
if (value) {
|
|
257
|
-
quickPickItems.push({ label: quickPick.value, description: ( localize(
|
|
263
|
+
quickPickItems.push({ label: quickPick.value, description: ( localize(11071, "Import from URL")) });
|
|
258
264
|
}
|
|
259
|
-
quickPickItems.push({ label: ( localize(
|
|
265
|
+
quickPickItems.push({ label: ( localize(11072, "Select File...")) });
|
|
260
266
|
quickPick.items = quickPickItems;
|
|
261
267
|
};
|
|
262
|
-
quickPick.title = ( localize(
|
|
263
|
-
quickPick.placeholder = ( localize(
|
|
268
|
+
quickPick.title = ( localize(11073, "Import from Profile Template..."));
|
|
269
|
+
quickPick.placeholder = ( localize(11074, "Provide Profile Template URL"));
|
|
264
270
|
quickPick.ignoreFocusOut = true;
|
|
265
271
|
disposables.add(quickPick.onDidChangeValue(updateQuickPickItems));
|
|
266
272
|
updateQuickPickItems();
|
|
@@ -295,7 +301,7 @@ let UserDataProfilesEditor = class UserDataProfilesEditor extends EditorPane {
|
|
|
295
301
|
canSelectFiles: true,
|
|
296
302
|
canSelectMany: false,
|
|
297
303
|
filters: PROFILE_FILTER,
|
|
298
|
-
title: ( localize(
|
|
304
|
+
title: ( localize(11075, "Select Profile Template File")),
|
|
299
305
|
});
|
|
300
306
|
if (!profileLocation) {
|
|
301
307
|
return null;
|
|
@@ -372,7 +378,7 @@ let ProfileElementRenderer = class ProfileElementRenderer {
|
|
|
372
378
|
const label = append(container, $('.profile-list-item-label'));
|
|
373
379
|
const dirty = append(container, $(`span${ThemeIcon.asCSSSelector(Codicon.circleFilled)}`));
|
|
374
380
|
const description = append(container, $('.profile-list-item-description'));
|
|
375
|
-
append(description, $(`span${ThemeIcon.asCSSSelector(Codicon.check)}`), $('span', undefined, ( localize(
|
|
381
|
+
append(description, $(`span${ThemeIcon.asCSSSelector(Codicon.check)}`), $('span', undefined, ( localize(11076, "Active"))));
|
|
376
382
|
const actionsContainer = append(container, $('.profile-tree-item-actions-container'));
|
|
377
383
|
const actionBar = disposables.add(this.instantiationService.createInstance(WorkbenchToolBar, actionsContainer, {
|
|
378
384
|
hoverDelegate: disposables.add(createInstantHoverDelegate()),
|
|
@@ -387,25 +393,35 @@ let ProfileElementRenderer = class ProfileElementRenderer {
|
|
|
387
393
|
templateData.icon.className = ThemeIcon.asClassName(element.icon ? ThemeIcon.fromId(element.icon) : DEFAULT_ICON);
|
|
388
394
|
templateData.dirty.classList.toggle('hide', !(element instanceof NewProfileElement));
|
|
389
395
|
templateData.description.classList.toggle('hide', !element.active);
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
if (
|
|
396
|
-
|
|
397
|
-
templateData.icon.className = ThemeIcon.asClassName(ThemeIcon.fromId(element.icon));
|
|
398
|
-
}
|
|
399
|
-
else {
|
|
400
|
-
templateData.icon.className = 'hide';
|
|
401
|
-
}
|
|
396
|
+
templateData.elementDisposables.add(element.onDidChange(e => {
|
|
397
|
+
if (e.name) {
|
|
398
|
+
templateData.label.textContent = element.name;
|
|
399
|
+
}
|
|
400
|
+
if (e.icon) {
|
|
401
|
+
if (element.icon) {
|
|
402
|
+
templateData.icon.className = ThemeIcon.asClassName(ThemeIcon.fromId(element.icon));
|
|
402
403
|
}
|
|
403
|
-
|
|
404
|
-
templateData.
|
|
404
|
+
else {
|
|
405
|
+
templateData.icon.className = 'hide';
|
|
405
406
|
}
|
|
406
|
-
}
|
|
407
|
+
}
|
|
408
|
+
if (e.active) {
|
|
409
|
+
templateData.description.classList.toggle('hide', !element.active);
|
|
410
|
+
}
|
|
411
|
+
}));
|
|
412
|
+
const setActions = () => templateData.actionBar.setActions(element.actions[0].filter(a => a.enabled), element.actions[1].filter(a => a.enabled));
|
|
413
|
+
setActions();
|
|
414
|
+
const events = [];
|
|
415
|
+
for (const action of element.actions.flat()) {
|
|
416
|
+
if (action instanceof Action) {
|
|
417
|
+
events.push(action.onDidChange);
|
|
418
|
+
}
|
|
407
419
|
}
|
|
408
|
-
templateData.
|
|
420
|
+
templateData.elementDisposables.add(Event.any(...events)(e => {
|
|
421
|
+
if (e.enabled !== undefined) {
|
|
422
|
+
setActions();
|
|
423
|
+
}
|
|
424
|
+
}));
|
|
409
425
|
}
|
|
410
426
|
disposeElement(element, index, templateData, height) {
|
|
411
427
|
templateData.elementDisposables.clear();
|
|
@@ -428,12 +444,15 @@ let ProfileWidget = class ProfileWidget extends Disposable {
|
|
|
428
444
|
this.editorProgressService = editorProgressService;
|
|
429
445
|
this.instantiationService = instantiationService;
|
|
430
446
|
this._profileElement = this._register(( (new MutableDisposable())));
|
|
447
|
+
this.layoutParticipants = [];
|
|
431
448
|
const header = append(parent, $('.profile-header'));
|
|
432
449
|
const title = append(header, $('.profile-title-container'));
|
|
433
450
|
this.profileTitle = append(title, $(''));
|
|
434
451
|
const body = append(parent, $('.profile-body'));
|
|
435
452
|
const delegate = ( (new ProfileTreeDelegate()));
|
|
436
453
|
const contentsRenderer = this._register(this.instantiationService.createInstance(ContentsProfileRenderer));
|
|
454
|
+
const associationsRenderer = this._register(this.instantiationService.createInstance(ProfileWorkspacesRenderer));
|
|
455
|
+
this.layoutParticipants.push(associationsRenderer);
|
|
437
456
|
this.copyFromProfileRenderer = this._register(this.instantiationService.createInstance(CopyFromProfileRenderer));
|
|
438
457
|
this.profileTreeContainer = append(body, $('.profile-tree'));
|
|
439
458
|
this.profileTree = this._register(this.instantiationService.createInstance((WorkbenchAsyncDataTree), 'ProfileEditor-Tree', this.profileTreeContainer, delegate, [
|
|
@@ -443,6 +462,7 @@ let ProfileWidget = class ProfileWidget extends Disposable {
|
|
|
443
462
|
this._register(this.instantiationService.createInstance(UseAsDefaultProfileRenderer)),
|
|
444
463
|
this.copyFromProfileRenderer,
|
|
445
464
|
contentsRenderer,
|
|
465
|
+
associationsRenderer,
|
|
446
466
|
], this.instantiationService.createInstance(ProfileTreeDataSource), {
|
|
447
467
|
multipleSelectionSupport: false,
|
|
448
468
|
horizontalScrolling: false,
|
|
@@ -469,6 +489,7 @@ let ProfileWidget = class ProfileWidget extends Disposable {
|
|
|
469
489
|
}));
|
|
470
490
|
this.profileTree.style(listStyles);
|
|
471
491
|
this._register(contentsRenderer.onDidChangeContentHeight((e) => this.profileTree.updateElementHeight(e, undefined)));
|
|
492
|
+
this._register(associationsRenderer.onDidChangeContentHeight((e) => this.profileTree.updateElementHeight(e, undefined)));
|
|
472
493
|
this._register(contentsRenderer.onDidChangeSelection((e) => {
|
|
473
494
|
if (e.selected) {
|
|
474
495
|
this.profileTree.setFocus([]);
|
|
@@ -493,6 +514,9 @@ let ProfileWidget = class ProfileWidget extends Disposable {
|
|
|
493
514
|
const height = Math.min(treeContentHeight, dimension.height - (this._profileElement.value?.element instanceof NewProfileElement ? 116 : 54));
|
|
494
515
|
this.profileTreeContainer.style.height = `${height}px`;
|
|
495
516
|
this.profileTree.layout(height, dimension.width);
|
|
517
|
+
for (const participant of this.layoutParticipants) {
|
|
518
|
+
participant.layout();
|
|
519
|
+
}
|
|
496
520
|
}
|
|
497
521
|
render(profileElement) {
|
|
498
522
|
if (this._profileElement.value?.element === profileElement) {
|
|
@@ -577,9 +601,9 @@ class ProfileTreeDelegate extends CachedListVirtualDelegate {
|
|
|
577
601
|
return element;
|
|
578
602
|
}
|
|
579
603
|
hasDynamicHeight({ element }) {
|
|
580
|
-
return element === 'contents';
|
|
604
|
+
return element === 'contents' || element === 'workspaces';
|
|
581
605
|
}
|
|
582
|
-
estimateHeight({ element }) {
|
|
606
|
+
estimateHeight({ element, root }) {
|
|
583
607
|
switch (element) {
|
|
584
608
|
case 'name':
|
|
585
609
|
return 72;
|
|
@@ -591,7 +615,9 @@ class ProfileTreeDelegate extends CachedListVirtualDelegate {
|
|
|
591
615
|
case 'useAsDefault':
|
|
592
616
|
return 68;
|
|
593
617
|
case 'contents':
|
|
594
|
-
return
|
|
618
|
+
return 258;
|
|
619
|
+
case 'workspaces':
|
|
620
|
+
return (root.workspaces ? (root.workspaces.length * 24) + 30 : 0) + 112;
|
|
595
621
|
}
|
|
596
622
|
}
|
|
597
623
|
}
|
|
@@ -609,12 +635,11 @@ class ProfileTreeDataSource {
|
|
|
609
635
|
children.push({ element: 'contents', root: element });
|
|
610
636
|
}
|
|
611
637
|
else if (element instanceof UserDataProfileElement) {
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
children.push({ element: 'icon', root: element });
|
|
615
|
-
}
|
|
638
|
+
children.push({ element: 'name', root: element });
|
|
639
|
+
children.push({ element: 'icon', root: element });
|
|
616
640
|
children.push({ element: 'useAsDefault', root: element });
|
|
617
641
|
children.push({ element: 'contents', root: element });
|
|
642
|
+
children.push({ element: 'workspaces', root: element });
|
|
618
643
|
}
|
|
619
644
|
return children;
|
|
620
645
|
}
|
|
@@ -644,7 +669,7 @@ let ProfileResourceTreeDataSource = class ProfileResourceTreeDataSource {
|
|
|
644
669
|
return true;
|
|
645
670
|
}
|
|
646
671
|
if (element.element.resourceType) {
|
|
647
|
-
if (element.element.resourceType !==
|
|
672
|
+
if (element.element.resourceType !== "extensions" && element.element.resourceType !== "snippets" ) {
|
|
648
673
|
return false;
|
|
649
674
|
}
|
|
650
675
|
if (element.root instanceof NewProfileElement) {
|
|
@@ -694,16 +719,16 @@ ProfileResourceTreeDataSource = ( (__decorate([
|
|
|
694
719
|
class AbstractProfileResourceTreeRenderer extends Disposable {
|
|
695
720
|
getResourceTypeTitle(resourceType) {
|
|
696
721
|
switch (resourceType) {
|
|
697
|
-
case
|
|
698
|
-
return ( localize(
|
|
699
|
-
case
|
|
700
|
-
return ( localize(
|
|
701
|
-
case
|
|
702
|
-
return ( localize(
|
|
703
|
-
case
|
|
704
|
-
return ( localize(
|
|
705
|
-
case
|
|
706
|
-
return ( localize(
|
|
722
|
+
case "settings" :
|
|
723
|
+
return ( localize(11077, "Settings"));
|
|
724
|
+
case "keybindings" :
|
|
725
|
+
return ( localize(11078, "Keyboard Shortcuts"));
|
|
726
|
+
case "snippets" :
|
|
727
|
+
return ( localize(11079, "Snippets"));
|
|
728
|
+
case "tasks" :
|
|
729
|
+
return ( localize(11080, "Tasks"));
|
|
730
|
+
case "extensions" :
|
|
731
|
+
return ( localize(11081, "Extensions"));
|
|
707
732
|
}
|
|
708
733
|
return '';
|
|
709
734
|
}
|
|
@@ -732,19 +757,19 @@ let ProfileNameRenderer = class ProfileNameRenderer extends ProfilePropertyRende
|
|
|
732
757
|
const elementDisposables = disposables.add(( (new DisposableStore())));
|
|
733
758
|
let profileElement;
|
|
734
759
|
const nameContainer = append(parent, $('.profile-row-container'));
|
|
735
|
-
append(nameContainer, $('.profile-label-element', undefined, ( localize(
|
|
760
|
+
append(nameContainer, $('.profile-label-element', undefined, ( localize(11082, "Name"))));
|
|
736
761
|
const nameInput = disposables.add(( (new InputBox(nameContainer, this.contextViewService, {
|
|
737
762
|
inputBoxStyles: getInputBoxStyle({
|
|
738
763
|
inputBorder: settingsTextInputBorder
|
|
739
764
|
}),
|
|
740
|
-
ariaLabel: ( localize(
|
|
741
|
-
placeholder: ( localize(
|
|
765
|
+
ariaLabel: ( localize(11083, "Profile Name")),
|
|
766
|
+
placeholder: ( localize(11083, "Profile Name")),
|
|
742
767
|
validationOptions: {
|
|
743
768
|
validation: (value) => {
|
|
744
769
|
if (!value) {
|
|
745
770
|
return {
|
|
746
|
-
content: ( localize(
|
|
747
|
-
type:
|
|
771
|
+
content: ( localize(11084, "Profile name is required and must be a non-empty value.")),
|
|
772
|
+
type: 2
|
|
748
773
|
};
|
|
749
774
|
}
|
|
750
775
|
if (profileElement?.root.disabled) {
|
|
@@ -757,8 +782,8 @@ let ProfileNameRenderer = class ProfileNameRenderer extends ProfilePropertyRende
|
|
|
757
782
|
value = value.trim();
|
|
758
783
|
if (initialName !== value && ( (this.userDataProfilesService.profiles.some(p => !p.isTransient && p.name === value)))) {
|
|
759
784
|
return {
|
|
760
|
-
content: ( localize(
|
|
761
|
-
type:
|
|
785
|
+
content: ( localize(11085, "Profile with name {0} already exists.", value)),
|
|
786
|
+
type: 2
|
|
762
787
|
};
|
|
763
788
|
}
|
|
764
789
|
return null;
|
|
@@ -779,12 +804,19 @@ let ProfileNameRenderer = class ProfileNameRenderer extends ProfilePropertyRende
|
|
|
779
804
|
const renderName = (profileElement) => {
|
|
780
805
|
nameInput.value = profileElement.root.name;
|
|
781
806
|
nameInput.validate();
|
|
782
|
-
|
|
807
|
+
const isDefaultProfile = profileElement.root instanceof UserDataProfileElement && profileElement.root.profile.isDefault;
|
|
808
|
+
if (profileElement.root.disabled || isDefaultProfile) {
|
|
783
809
|
nameInput.disable();
|
|
784
810
|
}
|
|
785
811
|
else {
|
|
786
812
|
nameInput.enable();
|
|
787
813
|
}
|
|
814
|
+
if (isDefaultProfile) {
|
|
815
|
+
nameInput.setTooltip(( localize(11086, "Name cannot be changed for the default profile")));
|
|
816
|
+
}
|
|
817
|
+
else {
|
|
818
|
+
nameInput.setTooltip(( localize(11083, "Profile Name")));
|
|
819
|
+
}
|
|
788
820
|
};
|
|
789
821
|
return {
|
|
790
822
|
set element(element) {
|
|
@@ -814,15 +846,17 @@ let ProfileIconRenderer = class ProfileIconRenderer extends ProfilePropertyRende
|
|
|
814
846
|
this.instantiationService = instantiationService;
|
|
815
847
|
this.hoverService = hoverService;
|
|
816
848
|
this.templateId = 'icon';
|
|
849
|
+
this.hoverDelegate = getDefaultHoverDelegate('element');
|
|
817
850
|
}
|
|
818
851
|
renderTemplate(parent) {
|
|
819
852
|
const disposables = ( (new DisposableStore()));
|
|
820
853
|
const elementDisposables = disposables.add(( (new DisposableStore())));
|
|
821
854
|
let profileElement;
|
|
822
855
|
const iconContainer = append(parent, $('.profile-row-container'));
|
|
823
|
-
append(iconContainer, $('.profile-label-element', undefined, ( localize(
|
|
856
|
+
append(iconContainer, $('.profile-label-element', undefined, ( localize(11087, "Icon"))));
|
|
824
857
|
const iconValueContainer = append(iconContainer, $('.profile-icon-container'));
|
|
825
|
-
const iconElement = append(iconValueContainer, $(`${ThemeIcon.asCSSSelector(DEFAULT_ICON)}`, { 'tabindex': '0', 'role': 'button', 'aria-label': ( localize(
|
|
858
|
+
const iconElement = append(iconValueContainer, $(`${ThemeIcon.asCSSSelector(DEFAULT_ICON)}`, { 'tabindex': '0', 'role': 'button', 'aria-label': ( localize(11088, "Profile Icon")) }));
|
|
859
|
+
const iconHover = disposables.add(this.hoverService.setupManagedHover(this.hoverDelegate, iconElement, ''));
|
|
826
860
|
const iconSelectBox = disposables.add(this.instantiationService.createInstance(WorkbenchIconSelectBox, { icons: ICONS, inputBoxStyles: defaultInputBoxStyles }));
|
|
827
861
|
let hoverWidget;
|
|
828
862
|
const showIconSelectBox = () => {
|
|
@@ -832,12 +866,15 @@ let ProfileIconRenderer = class ProfileIconRenderer extends ProfilePropertyRende
|
|
|
832
866
|
if (profileElement?.root.disabled) {
|
|
833
867
|
return;
|
|
834
868
|
}
|
|
869
|
+
if (profileElement?.root instanceof UserDataProfileElement && profileElement.root.profile.isDefault) {
|
|
870
|
+
return;
|
|
871
|
+
}
|
|
835
872
|
iconSelectBox.clearInput();
|
|
836
873
|
hoverWidget = this.hoverService.showHover({
|
|
837
874
|
content: iconSelectBox.domNode,
|
|
838
875
|
target: iconElement,
|
|
839
876
|
position: {
|
|
840
|
-
hoverPosition:
|
|
877
|
+
hoverPosition: 2 ,
|
|
841
878
|
},
|
|
842
879
|
persistence: {
|
|
843
880
|
sticky: true,
|
|
@@ -857,14 +894,14 @@ let ProfileIconRenderer = class ProfileIconRenderer extends ProfilePropertyRende
|
|
|
857
894
|
}));
|
|
858
895
|
disposables.add(addDisposableListener(iconElement, EventType.KEY_DOWN, e => {
|
|
859
896
|
const event = ( (new StandardKeyboardEvent(e)));
|
|
860
|
-
if (event.equals(
|
|
897
|
+
if (event.equals(3 ) || event.equals(10 )) {
|
|
861
898
|
EventHelper.stop(event, true);
|
|
862
899
|
showIconSelectBox();
|
|
863
900
|
}
|
|
864
901
|
}));
|
|
865
902
|
disposables.add(addDisposableListener(iconSelectBox.domNode, EventType.KEY_DOWN, e => {
|
|
866
903
|
const event = ( (new StandardKeyboardEvent(e)));
|
|
867
|
-
if (event.equals(
|
|
904
|
+
if (event.equals(9 )) {
|
|
868
905
|
EventHelper.stop(event, true);
|
|
869
906
|
hoverWidget?.dispose();
|
|
870
907
|
iconElement.focus();
|
|
@@ -877,8 +914,16 @@ let ProfileIconRenderer = class ProfileIconRenderer extends ProfilePropertyRende
|
|
|
877
914
|
profileElement.root.icon = selectedIcon.id;
|
|
878
915
|
}
|
|
879
916
|
}));
|
|
880
|
-
append(iconValueContainer, $('.profile-description-element', undefined, ( localize(
|
|
917
|
+
append(iconValueContainer, $('.profile-description-element', undefined, ( localize(11089, "Profile icon to be shown in the activity bar"))));
|
|
881
918
|
const renderIcon = (profileElement) => {
|
|
919
|
+
if (profileElement?.root instanceof UserDataProfileElement && profileElement.root.profile.isDefault) {
|
|
920
|
+
iconValueContainer.classList.add('disabled');
|
|
921
|
+
iconHover.update(( localize(11090, "Icon cannot be changed for the default profile")));
|
|
922
|
+
}
|
|
923
|
+
else {
|
|
924
|
+
iconHover.update(( localize(11091, "Click to change icon")));
|
|
925
|
+
iconValueContainer.classList.remove('disabled');
|
|
926
|
+
}
|
|
882
927
|
if (profileElement.root.icon) {
|
|
883
928
|
iconElement.className = ThemeIcon.asClassName(ThemeIcon.fromId(profileElement.root.icon));
|
|
884
929
|
}
|
|
@@ -916,9 +961,9 @@ let UseForCurrentWindowPropertyRenderer = class UseForCurrentWindowPropertyRende
|
|
|
916
961
|
const elementDisposables = disposables.add(( (new DisposableStore())));
|
|
917
962
|
let profileElement;
|
|
918
963
|
const useForCurrentWindowContainer = append(parent, $('.profile-row-container'));
|
|
919
|
-
append(useForCurrentWindowContainer, $('.profile-label-element', undefined, ( localize(
|
|
964
|
+
append(useForCurrentWindowContainer, $('.profile-label-element', undefined, ( localize(11092, "Use for Current Window"))));
|
|
920
965
|
const useForCurrentWindowValueContainer = append(useForCurrentWindowContainer, $('.profile-use-for-current-container'));
|
|
921
|
-
const useForCurrentWindowTitle = ( localize(
|
|
966
|
+
const useForCurrentWindowTitle = ( localize(11093, "Use this profile for the current window"));
|
|
922
967
|
const useForCurrentWindowCheckbox = disposables.add(( (new Checkbox(useForCurrentWindowTitle, false, defaultCheckboxStyles))));
|
|
923
968
|
append(useForCurrentWindowValueContainer, useForCurrentWindowCheckbox.domNode);
|
|
924
969
|
const useForCurrentWindowLabel = append(useForCurrentWindowValueContainer, $('.profile-description-element', undefined, useForCurrentWindowTitle));
|
|
@@ -968,9 +1013,9 @@ class UseAsDefaultProfileRenderer extends ProfilePropertyRenderer {
|
|
|
968
1013
|
const elementDisposables = disposables.add(( (new DisposableStore())));
|
|
969
1014
|
let profileElement;
|
|
970
1015
|
const useAsDefaultProfileContainer = append(parent, $('.profile-row-container'));
|
|
971
|
-
append(useAsDefaultProfileContainer, $('.profile-label-element', undefined, ( localize(
|
|
1016
|
+
append(useAsDefaultProfileContainer, $('.profile-label-element', undefined, ( localize(11094, "Use for New Windows"))));
|
|
972
1017
|
const useAsDefaultProfileValueContainer = append(useAsDefaultProfileContainer, $('.profile-use-as-default-container'));
|
|
973
|
-
const useAsDefaultProfileTitle = ( localize(
|
|
1018
|
+
const useAsDefaultProfileTitle = ( localize(11095, "Use this profile as the default for new windows"));
|
|
974
1019
|
const useAsDefaultProfileCheckbox = disposables.add(( (new Checkbox(useAsDefaultProfileTitle, false, defaultCheckboxStyles))));
|
|
975
1020
|
append(useAsDefaultProfileValueContainer, useAsDefaultProfileCheckbox.domNode);
|
|
976
1021
|
const useAsDefaultProfileLabel = append(useAsDefaultProfileValueContainer, $('.profile-description-element', undefined, useAsDefaultProfileTitle));
|
|
@@ -1017,11 +1062,11 @@ let CopyFromProfileRenderer = class CopyFromProfileRenderer extends ProfilePrope
|
|
|
1017
1062
|
const elementDisposables = disposables.add(( (new DisposableStore())));
|
|
1018
1063
|
let profileElement;
|
|
1019
1064
|
const copyFromContainer = append(parent, $('.profile-row-container.profile-copy-from-container'));
|
|
1020
|
-
append(copyFromContainer, $('.profile-label-element', undefined, ( localize(
|
|
1021
|
-
append(copyFromContainer, $('.profile-description-element', undefined, ( localize(
|
|
1065
|
+
append(copyFromContainer, $('.profile-label-element', undefined, ( localize(11096, "Copy from"))));
|
|
1066
|
+
append(copyFromContainer, $('.profile-description-element', undefined, ( localize(11097, "Select the profile source from which you want to copy contents"))));
|
|
1022
1067
|
const copyFromSelectBox = disposables.add(this.instantiationService.createInstance(SelectBox, [], 0, this.contextViewService, defaultSelectBoxStyles, {
|
|
1023
1068
|
useCustomDrawn: true,
|
|
1024
|
-
ariaLabel: ( localize(
|
|
1069
|
+
ariaLabel: ( localize(11098, "Copy profile from")),
|
|
1025
1070
|
}));
|
|
1026
1071
|
copyFromSelectBox.render(append(copyFromContainer, $('.profile-select-container')));
|
|
1027
1072
|
const render = (profileElement, copyFromOptions) => {
|
|
@@ -1065,7 +1110,7 @@ let CopyFromProfileRenderer = class CopyFromProfileRenderer extends ProfilePrope
|
|
|
1065
1110
|
getCopyFromOptions(profileElement) {
|
|
1066
1111
|
const separator = { text: '\u2500\u2500\u2500\u2500\u2500\u2500', isDisabled: true };
|
|
1067
1112
|
const copyFromOptions = [];
|
|
1068
|
-
copyFromOptions.push({ text: ( localize(
|
|
1113
|
+
copyFromOptions.push({ text: ( localize(11099, "None")) });
|
|
1069
1114
|
for (const [copyFromTemplate, name] of profileElement.copyFromTemplates) {
|
|
1070
1115
|
if (!( (this.templates.some(
|
|
1071
1116
|
template => this.uriIdentityService.extUri.isEqual(( (URI.parse(template.url))), copyFromTemplate)
|
|
@@ -1074,14 +1119,16 @@ let CopyFromProfileRenderer = class CopyFromProfileRenderer extends ProfilePrope
|
|
|
1074
1119
|
}
|
|
1075
1120
|
}
|
|
1076
1121
|
if (this.templates.length) {
|
|
1077
|
-
copyFromOptions.push({ ...separator, decoratorRight: ( localize(
|
|
1122
|
+
copyFromOptions.push({ ...separator, decoratorRight: ( localize(11100, "Profile Templates")) });
|
|
1078
1123
|
for (const template of this.templates) {
|
|
1079
1124
|
copyFromOptions.push({ text: template.name, id: template.url, source: ( (URI.parse(template.url))) });
|
|
1080
1125
|
}
|
|
1081
1126
|
}
|
|
1082
|
-
copyFromOptions.push({ ...separator, decoratorRight: ( localize(
|
|
1127
|
+
copyFromOptions.push({ ...separator, decoratorRight: ( localize(11101, "Existing Profiles")) });
|
|
1083
1128
|
for (const profile of this.userDataProfilesService.profiles) {
|
|
1084
|
-
|
|
1129
|
+
if (!profile.isTransient) {
|
|
1130
|
+
copyFromOptions.push({ text: profile.name, id: profile.id, source: profile });
|
|
1131
|
+
}
|
|
1085
1132
|
}
|
|
1086
1133
|
return copyFromOptions;
|
|
1087
1134
|
}
|
|
@@ -1093,9 +1140,10 @@ CopyFromProfileRenderer = ( (__decorate([
|
|
|
1093
1140
|
( (__param(3, IContextViewService)))
|
|
1094
1141
|
], CopyFromProfileRenderer)));
|
|
1095
1142
|
let ContentsProfileRenderer = class ContentsProfileRenderer extends ProfilePropertyRenderer {
|
|
1096
|
-
constructor(userDataProfilesService, instantiationService) {
|
|
1143
|
+
constructor(userDataProfilesService, contextMenuService, instantiationService) {
|
|
1097
1144
|
super();
|
|
1098
1145
|
this.userDataProfilesService = userDataProfilesService;
|
|
1146
|
+
this.contextMenuService = contextMenuService;
|
|
1099
1147
|
this.instantiationService = instantiationService;
|
|
1100
1148
|
this.templateId = 'contents';
|
|
1101
1149
|
this._onDidChangeContentHeight = this._register(( (new Emitter())));
|
|
@@ -1108,11 +1156,11 @@ let ContentsProfileRenderer = class ContentsProfileRenderer extends ProfilePrope
|
|
|
1108
1156
|
const elementDisposables = disposables.add(( (new DisposableStore())));
|
|
1109
1157
|
let profileElement;
|
|
1110
1158
|
const configureRowContainer = append(parent, $('.profile-row-container'));
|
|
1111
|
-
append(configureRowContainer, $('.profile-label-element', undefined, ( localize(
|
|
1159
|
+
append(configureRowContainer, $('.profile-label-element', undefined, ( localize(11102, "Contents"))));
|
|
1112
1160
|
const contentsDescriptionElement = append(configureRowContainer, $('.profile-description-element'));
|
|
1113
1161
|
const contentsTreeHeader = append(configureRowContainer, $('.profile-content-tree-header'));
|
|
1114
|
-
const optionsLabel = $('.options-header', undefined, $('span', undefined, ( localize(
|
|
1115
|
-
append(contentsTreeHeader, $(''), $('', undefined, ( localize(
|
|
1162
|
+
const optionsLabel = $('.options-header', undefined, $('span', undefined, ( localize(11103, "Source"))));
|
|
1163
|
+
append(contentsTreeHeader, $(''), $('', undefined, ( localize(11102, "Contents"))), optionsLabel, $(''));
|
|
1116
1164
|
const delegate = ( (new ProfileContentTreeElementDelegate()));
|
|
1117
1165
|
const profilesContentTree = this.profilesContentTree = disposables.add(this.instantiationService.createInstance((WorkbenchAsyncDataTree), 'ProfileEditor-ContentsTree', append(configureRowContainer, $('.profile-content-tree.file-icon-themable-tree.show-file-icons')), delegate, [
|
|
1118
1166
|
this.instantiationService.createInstance(ExistingProfileResourceTreeRenderer),
|
|
@@ -1166,48 +1214,46 @@ let ContentsProfileRenderer = class ContentsProfileRenderer extends ProfilePrope
|
|
|
1166
1214
|
if (!e.browserEvent) {
|
|
1167
1215
|
return;
|
|
1168
1216
|
}
|
|
1169
|
-
if (e.
|
|
1170
|
-
|
|
1217
|
+
if (e.element?.element.openAction) {
|
|
1218
|
+
await e.element.element.openAction.run();
|
|
1171
1219
|
}
|
|
1172
|
-
|
|
1173
|
-
|
|
1220
|
+
}));
|
|
1221
|
+
disposables.add(this.profilesContentTree.onContextMenu(async (e) => {
|
|
1222
|
+
if (!e.element?.element.actions?.contextMenu?.length) {
|
|
1223
|
+
return;
|
|
1174
1224
|
}
|
|
1225
|
+
this.contextMenuService.showContextMenu({
|
|
1226
|
+
getAnchor: () => e.anchor,
|
|
1227
|
+
getActions: () => e.element?.element?.actions?.contextMenu ?? [],
|
|
1228
|
+
getActionsContext: () => e.element
|
|
1229
|
+
});
|
|
1175
1230
|
}));
|
|
1176
1231
|
const updateDescription = (element) => {
|
|
1177
|
-
const defaultHelpInfo = ( localize(11011, "- *Default:* Use contents from the Default profile\n"));
|
|
1178
|
-
const markdown = ( (new MarkdownString()))
|
|
1179
|
-
.appendMarkdown(( localize(11012, "Configure source of contents for this profile\n")));
|
|
1180
1232
|
clearNode(contentsDescriptionElement);
|
|
1233
|
+
const markdown = ( (new MarkdownString()));
|
|
1181
1234
|
if (element.root instanceof UserDataProfileElement && element.root.profile.isDefault) {
|
|
1182
|
-
|
|
1235
|
+
markdown.appendMarkdown(( localize(11104, "Browse contents of this profile\n")));
|
|
1183
1236
|
}
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1237
|
+
else {
|
|
1238
|
+
markdown.appendMarkdown(( localize(11105, "Configure source of contents for this profile\n")));
|
|
1239
|
+
if (element.root instanceof NewProfileElement) {
|
|
1240
|
+
const copyFromName = element.root.getCopyFromName();
|
|
1241
|
+
const optionName = copyFromName === this.userDataProfilesService.defaultProfile.name
|
|
1242
|
+
? ( localize(11106, "{0} (Copy)", copyFromName))
|
|
1243
|
+
: copyFromName;
|
|
1244
|
+
if (optionName) {
|
|
1245
|
+
markdown
|
|
1246
|
+
.appendMarkdown(( localize(
|
|
1247
|
+
11107,
|
|
1248
|
+
"- *{0}:* Copy contents from the {1} profile\n",
|
|
1249
|
+
optionName,
|
|
1250
|
+
copyFromName
|
|
1251
|
+
)));
|
|
1252
|
+
}
|
|
1190
1253
|
markdown
|
|
1191
|
-
.appendMarkdown(( localize(
|
|
1192
|
-
|
|
1193
|
-
"- *{0}:* Copy contents from the {1} profile\n",
|
|
1194
|
-
optionName,
|
|
1195
|
-
copyFromName
|
|
1196
|
-
)));
|
|
1254
|
+
.appendMarkdown(( localize(11108, "- *Default:* Use contents from the Default profile\n")))
|
|
1255
|
+
.appendMarkdown(( localize(11109, "- *None:* Create empty contents\n")));
|
|
1197
1256
|
}
|
|
1198
|
-
markdown
|
|
1199
|
-
.appendMarkdown(defaultHelpInfo)
|
|
1200
|
-
.appendMarkdown(( localize(11015, "- *None:* Create empty contents\n")));
|
|
1201
|
-
}
|
|
1202
|
-
else if (element.root instanceof UserDataProfileElement) {
|
|
1203
|
-
markdown
|
|
1204
|
-
.appendMarkdown(defaultHelpInfo)
|
|
1205
|
-
.appendMarkdown(( localize(
|
|
1206
|
-
11016,
|
|
1207
|
-
"- *{1}:* Use contents from the {0} profile\n",
|
|
1208
|
-
element.root.profile.name,
|
|
1209
|
-
element.root.profile.name
|
|
1210
|
-
)));
|
|
1211
1257
|
}
|
|
1212
1258
|
append(contentsDescriptionElement, elementDisposables.add(renderMarkdown(markdown)).element);
|
|
1213
1259
|
};
|
|
@@ -1224,7 +1270,7 @@ let ContentsProfileRenderer = class ContentsProfileRenderer extends ProfilePrope
|
|
|
1224
1270
|
}
|
|
1225
1271
|
profilesContentTree.setInput(profileElement.root);
|
|
1226
1272
|
elementDisposables.add(profileElement.root.onDidChange(e => {
|
|
1227
|
-
if (e.copyFrom || e.copyFlags || e.flags) {
|
|
1273
|
+
if (e.copyFrom || e.copyFlags || e.flags || e.extensions || e.snippets || e.preview) {
|
|
1228
1274
|
profilesContentTree.updateChildren(element.root);
|
|
1229
1275
|
}
|
|
1230
1276
|
if (e.copyFromInfo) {
|
|
@@ -1246,8 +1292,181 @@ let ContentsProfileRenderer = class ContentsProfileRenderer extends ProfilePrope
|
|
|
1246
1292
|
};
|
|
1247
1293
|
ContentsProfileRenderer = ( (__decorate([
|
|
1248
1294
|
( (__param(0, IUserDataProfilesService))),
|
|
1249
|
-
( (__param(1,
|
|
1295
|
+
( (__param(1, IContextMenuService))),
|
|
1296
|
+
( (__param(2, IInstantiationService)))
|
|
1250
1297
|
], ContentsProfileRenderer)));
|
|
1298
|
+
let ProfileWorkspacesRenderer = class ProfileWorkspacesRenderer extends ProfilePropertyRenderer {
|
|
1299
|
+
constructor(labelService, uriIdentityService, fileDialogService, instantiationService) {
|
|
1300
|
+
super();
|
|
1301
|
+
this.labelService = labelService;
|
|
1302
|
+
this.uriIdentityService = uriIdentityService;
|
|
1303
|
+
this.fileDialogService = fileDialogService;
|
|
1304
|
+
this.instantiationService = instantiationService;
|
|
1305
|
+
this.templateId = 'workspaces';
|
|
1306
|
+
this._onDidChangeContentHeight = this._register(( (new Emitter())));
|
|
1307
|
+
this.onDidChangeContentHeight = this._onDidChangeContentHeight.event;
|
|
1308
|
+
this._onDidChangeSelection = this._register(( (new Emitter())));
|
|
1309
|
+
this.onDidChangeSelection = this._onDidChangeSelection.event;
|
|
1310
|
+
}
|
|
1311
|
+
renderTemplate(parent) {
|
|
1312
|
+
const disposables = ( (new DisposableStore()));
|
|
1313
|
+
const elementDisposables = disposables.add(( (new DisposableStore())));
|
|
1314
|
+
let profileElement;
|
|
1315
|
+
const profileWorkspacesRowContainer = append(parent, $('.profile-row-container'));
|
|
1316
|
+
append(profileWorkspacesRowContainer, $('.profile-label-element', undefined, ( localize(11110, "Folders & Workspaces"))));
|
|
1317
|
+
const profileWorkspacesDescriptionElement = append(profileWorkspacesRowContainer, $('.profile-description-element'));
|
|
1318
|
+
const workspacesTableContainer = append(profileWorkspacesRowContainer, $('.profile-associations-table'));
|
|
1319
|
+
const table = this.workspacesTable = disposables.add(this.instantiationService.createInstance((WorkbenchTable), 'ProfileEditor-AssociationsTable', workspacesTableContainer, new class {
|
|
1320
|
+
constructor() {
|
|
1321
|
+
this.headerRowHeight = 30;
|
|
1322
|
+
}
|
|
1323
|
+
getHeight() { return 24; }
|
|
1324
|
+
}, [
|
|
1325
|
+
{
|
|
1326
|
+
label: '',
|
|
1327
|
+
tooltip: '',
|
|
1328
|
+
weight: 1,
|
|
1329
|
+
minimumWidth: 30,
|
|
1330
|
+
maximumWidth: 30,
|
|
1331
|
+
templateId: WorkspaceUriEmptyColumnRenderer.TEMPLATE_ID,
|
|
1332
|
+
project(row) { return row; },
|
|
1333
|
+
},
|
|
1334
|
+
{
|
|
1335
|
+
label: ( localize(11111, "Host")),
|
|
1336
|
+
tooltip: '',
|
|
1337
|
+
weight: 2,
|
|
1338
|
+
templateId: WorkspaceUriHostColumnRenderer.TEMPLATE_ID,
|
|
1339
|
+
project(row) { return row; },
|
|
1340
|
+
},
|
|
1341
|
+
{
|
|
1342
|
+
label: ( localize(11112, "Path")),
|
|
1343
|
+
tooltip: '',
|
|
1344
|
+
weight: 7,
|
|
1345
|
+
templateId: WorkspaceUriPathColumnRenderer.TEMPLATE_ID,
|
|
1346
|
+
project(row) { return row; }
|
|
1347
|
+
},
|
|
1348
|
+
{
|
|
1349
|
+
label: '',
|
|
1350
|
+
tooltip: '',
|
|
1351
|
+
weight: 1,
|
|
1352
|
+
minimumWidth: 60,
|
|
1353
|
+
maximumWidth: 60,
|
|
1354
|
+
templateId: WorkspaceUriActionsColumnRenderer.TEMPLATE_ID,
|
|
1355
|
+
project(row) { return row; }
|
|
1356
|
+
},
|
|
1357
|
+
], [
|
|
1358
|
+
( (new WorkspaceUriEmptyColumnRenderer())),
|
|
1359
|
+
this.instantiationService.createInstance(WorkspaceUriHostColumnRenderer),
|
|
1360
|
+
this.instantiationService.createInstance(WorkspaceUriPathColumnRenderer),
|
|
1361
|
+
this.instantiationService.createInstance(WorkspaceUriActionsColumnRenderer),
|
|
1362
|
+
], {
|
|
1363
|
+
horizontalScrolling: false,
|
|
1364
|
+
alwaysConsumeMouseWheel: false,
|
|
1365
|
+
openOnSingleClick: false,
|
|
1366
|
+
multipleSelectionSupport: false,
|
|
1367
|
+
accessibilityProvider: {
|
|
1368
|
+
getAriaLabel: (item) => {
|
|
1369
|
+
const hostLabel = getHostLabel(this.labelService, item.workspace);
|
|
1370
|
+
if (hostLabel === undefined || hostLabel.length === 0) {
|
|
1371
|
+
return ( localize(11113, "{0}, trusted", this.labelService.getUriLabel(item.workspace)));
|
|
1372
|
+
}
|
|
1373
|
+
return ( localize(
|
|
1374
|
+
11114,
|
|
1375
|
+
"{0} on {1}, trusted",
|
|
1376
|
+
this.labelService.getUriLabel(item.workspace),
|
|
1377
|
+
hostLabel
|
|
1378
|
+
));
|
|
1379
|
+
},
|
|
1380
|
+
getWidgetAriaLabel: () => ( localize(11115, "Trusted Folders & Workspaces"))
|
|
1381
|
+
},
|
|
1382
|
+
identityProvider: {
|
|
1383
|
+
getId(element) {
|
|
1384
|
+
return (
|
|
1385
|
+
(element.workspace.toString())
|
|
1386
|
+
);
|
|
1387
|
+
},
|
|
1388
|
+
}
|
|
1389
|
+
}));
|
|
1390
|
+
this.workspacesTable.style(listStyles);
|
|
1391
|
+
disposables.add(toDisposable(() => this.workspacesTable = undefined));
|
|
1392
|
+
disposables.add(this.workspacesTable.onDidChangeSelection((e => {
|
|
1393
|
+
if (profileElement) {
|
|
1394
|
+
this._onDidChangeSelection.fire({ element: profileElement, selected: !!e.elements.length });
|
|
1395
|
+
}
|
|
1396
|
+
})));
|
|
1397
|
+
const addButtonBarElement = append(profileWorkspacesRowContainer, $('.profile-workspaces-button-container'));
|
|
1398
|
+
const buttonBar = disposables.add(( (new ButtonBar(addButtonBarElement))));
|
|
1399
|
+
const addButton = this._register(buttonBar.addButton({ title: ( localize(11116, "Add Folder")), ...defaultButtonStyles }));
|
|
1400
|
+
addButton.label = ( localize(11116, "Add Folder"));
|
|
1401
|
+
disposables.add(addButton.onDidClick(async () => {
|
|
1402
|
+
const uris = await this.fileDialogService.showOpenDialog({
|
|
1403
|
+
canSelectFiles: false,
|
|
1404
|
+
canSelectFolders: true,
|
|
1405
|
+
canSelectMany: true,
|
|
1406
|
+
openLabel: ( localize(11117, "Add Folder")),
|
|
1407
|
+
title: ( localize(11118, "Select Folders To Add"))
|
|
1408
|
+
});
|
|
1409
|
+
if (uris) {
|
|
1410
|
+
if (profileElement?.root instanceof UserDataProfileElement) {
|
|
1411
|
+
profileElement.root.updateWorkspaces(uris, []);
|
|
1412
|
+
}
|
|
1413
|
+
}
|
|
1414
|
+
}));
|
|
1415
|
+
disposables.add(table.onDidOpen(item => {
|
|
1416
|
+
if (item?.element) {
|
|
1417
|
+
item.element.profileElement.openWorkspace(item.element.workspace);
|
|
1418
|
+
}
|
|
1419
|
+
}));
|
|
1420
|
+
const updateTable = () => {
|
|
1421
|
+
if (profileElement?.root instanceof UserDataProfileElement && profileElement.root.workspaces?.length) {
|
|
1422
|
+
profileWorkspacesDescriptionElement.textContent = ( localize(11119, "Following folders and workspaces are using this profile"));
|
|
1423
|
+
workspacesTableContainer.classList.remove('hide');
|
|
1424
|
+
table.splice(0, table.length, ( (profileElement.root.workspaces
|
|
1425
|
+
.map(workspace => ({ workspace, profileElement: profileElement.root }))))
|
|
1426
|
+
.sort((a, b) => this.uriIdentityService.extUri.compare(a.workspace, b.workspace)));
|
|
1427
|
+
this.layout();
|
|
1428
|
+
}
|
|
1429
|
+
else {
|
|
1430
|
+
profileWorkspacesDescriptionElement.textContent = ( localize(11120, "No folders or workspaces are using this profile"));
|
|
1431
|
+
workspacesTableContainer.classList.add('hide');
|
|
1432
|
+
}
|
|
1433
|
+
};
|
|
1434
|
+
const that = this;
|
|
1435
|
+
return {
|
|
1436
|
+
set element(element) {
|
|
1437
|
+
profileElement = element;
|
|
1438
|
+
if (element.root instanceof UserDataProfileElement) {
|
|
1439
|
+
updateTable();
|
|
1440
|
+
}
|
|
1441
|
+
elementDisposables.add(profileElement.root.onDidChange(e => {
|
|
1442
|
+
if (profileElement && e.workspaces) {
|
|
1443
|
+
updateTable();
|
|
1444
|
+
that._onDidChangeContentHeight.fire(profileElement);
|
|
1445
|
+
}
|
|
1446
|
+
}));
|
|
1447
|
+
},
|
|
1448
|
+
disposables,
|
|
1449
|
+
elementDisposables: ( (new DisposableStore()))
|
|
1450
|
+
};
|
|
1451
|
+
}
|
|
1452
|
+
layout() {
|
|
1453
|
+
if (this.workspacesTable) {
|
|
1454
|
+
this.workspacesTable.layout((this.workspacesTable.length * 24) + 30, undefined);
|
|
1455
|
+
}
|
|
1456
|
+
}
|
|
1457
|
+
clearSelection() {
|
|
1458
|
+
if (this.workspacesTable) {
|
|
1459
|
+
this.workspacesTable.setSelection([]);
|
|
1460
|
+
this.workspacesTable.setFocus([]);
|
|
1461
|
+
}
|
|
1462
|
+
}
|
|
1463
|
+
};
|
|
1464
|
+
ProfileWorkspacesRenderer = ( (__decorate([
|
|
1465
|
+
( (__param(0, ILabelService))),
|
|
1466
|
+
( (__param(1, IUriIdentityService))),
|
|
1467
|
+
( (__param(2, IFileDialogService))),
|
|
1468
|
+
( (__param(3, IInstantiationService)))
|
|
1469
|
+
], ProfileWorkspacesRenderer)));
|
|
1251
1470
|
let ExistingProfileResourceTreeRenderer = class ExistingProfileResourceTreeRenderer extends AbstractProfileResourceTreeRenderer {
|
|
1252
1471
|
static { ExistingProfileResourceTreeRenderer_1 = this; }
|
|
1253
1472
|
static { this.TEMPLATE_ID = 'ExistingProfileResourceTemplate'; }
|
|
@@ -1282,13 +1501,13 @@ let ExistingProfileResourceTreeRenderer = class ExistingProfileResourceTreeRende
|
|
|
1282
1501
|
}
|
|
1283
1502
|
const updateRadioItems = () => {
|
|
1284
1503
|
templateData.radio.setItems([{
|
|
1285
|
-
text: ( localize(
|
|
1286
|
-
tooltip: ( localize(
|
|
1504
|
+
text: ( localize(11121, "Default")),
|
|
1505
|
+
tooltip: ( localize(11122, "Use {0} from the Default profile", resourceTypeTitle)),
|
|
1287
1506
|
isActive: root.getFlag(element.resourceType)
|
|
1288
1507
|
},
|
|
1289
1508
|
{
|
|
1290
1509
|
text: root.name,
|
|
1291
|
-
tooltip: ( localize(
|
|
1510
|
+
tooltip: ( localize(11123, "Use {0} from the {1} profile", resourceTypeTitle, root.name)),
|
|
1292
1511
|
isActive: !root.getFlag(element.resourceType)
|
|
1293
1512
|
}]);
|
|
1294
1513
|
};
|
|
@@ -1307,7 +1526,14 @@ let ExistingProfileResourceTreeRenderer = class ExistingProfileResourceTreeRende
|
|
|
1307
1526
|
}));
|
|
1308
1527
|
templateData.elementDisposables.add(templateData.radio.onDidSelect((index) => root.setFlag(element.resourceType, index === 0)));
|
|
1309
1528
|
}
|
|
1310
|
-
|
|
1529
|
+
const actions = [];
|
|
1530
|
+
if (element.openAction) {
|
|
1531
|
+
actions.push(element.openAction);
|
|
1532
|
+
}
|
|
1533
|
+
if (element.actions?.primary) {
|
|
1534
|
+
actions.push(...element.actions.primary);
|
|
1535
|
+
}
|
|
1536
|
+
templateData.actionBar.setActions(actions);
|
|
1311
1537
|
}
|
|
1312
1538
|
};
|
|
1313
1539
|
ExistingProfileResourceTreeRenderer = ExistingProfileResourceTreeRenderer_1 = ( (__decorate([
|
|
@@ -1349,22 +1575,22 @@ let NewProfileResourceTreeRenderer = class NewProfileResourceTreeRenderer extend
|
|
|
1349
1575
|
templateData.label.textContent = resourceTypeTitle;
|
|
1350
1576
|
const renderRadioItems = () => {
|
|
1351
1577
|
const options = [{
|
|
1352
|
-
text: ( localize(
|
|
1353
|
-
tooltip: ( localize(
|
|
1578
|
+
text: ( localize(11121, "Default")),
|
|
1579
|
+
tooltip: ( localize(11122, "Use {0} from the Default profile", resourceTypeTitle)),
|
|
1354
1580
|
},
|
|
1355
1581
|
{
|
|
1356
|
-
text: ( localize(
|
|
1357
|
-
tooltip: ( localize(
|
|
1582
|
+
text: ( localize(11124, "None")),
|
|
1583
|
+
tooltip: ( localize(11125, "Create empty {0}", resourceTypeTitle))
|
|
1358
1584
|
}];
|
|
1359
1585
|
const copyFromName = root.getCopyFromName();
|
|
1360
1586
|
const name = copyFromName === this.userDataProfilesService.defaultProfile.name
|
|
1361
|
-
? ( localize(
|
|
1587
|
+
? ( localize(11106, "{0} (Copy)", copyFromName))
|
|
1362
1588
|
: copyFromName;
|
|
1363
1589
|
if (root.copyFrom && name) {
|
|
1364
1590
|
templateData.radio.setItems([
|
|
1365
1591
|
{
|
|
1366
1592
|
text: name,
|
|
1367
|
-
tooltip: name ? ( localize(
|
|
1593
|
+
tooltip: name ? ( localize(11126, "Copy {0} from the {1} profile", resourceTypeTitle, name)) : ( localize(11127, "Copy")),
|
|
1368
1594
|
},
|
|
1369
1595
|
...options
|
|
1370
1596
|
]);
|
|
@@ -1387,16 +1613,23 @@ let NewProfileResourceTreeRenderer = class NewProfileResourceTreeRenderer extend
|
|
|
1387
1613
|
}));
|
|
1388
1614
|
}
|
|
1389
1615
|
renderRadioItems();
|
|
1390
|
-
templateData.radio.setEnabled(!root.disabled);
|
|
1616
|
+
templateData.radio.setEnabled(!root.disabled && !root.previewProfile);
|
|
1391
1617
|
templateData.elementDisposables.add(root.onDidChange(e => {
|
|
1392
|
-
if (e.disabled) {
|
|
1393
|
-
templateData.radio.setEnabled(!root.disabled);
|
|
1618
|
+
if (e.disabled || e.preview) {
|
|
1619
|
+
templateData.radio.setEnabled(!root.disabled && !root.previewProfile);
|
|
1394
1620
|
}
|
|
1395
1621
|
if (e.copyFrom || e.copyFromInfo) {
|
|
1396
1622
|
renderRadioItems();
|
|
1397
1623
|
}
|
|
1398
1624
|
}));
|
|
1399
|
-
|
|
1625
|
+
const actions = [];
|
|
1626
|
+
if (element.openAction) {
|
|
1627
|
+
actions.push(element.openAction);
|
|
1628
|
+
}
|
|
1629
|
+
if (element.actions?.primary) {
|
|
1630
|
+
actions.push(...element.actions.primary);
|
|
1631
|
+
}
|
|
1632
|
+
templateData.actionBar.setActions(actions);
|
|
1400
1633
|
}
|
|
1401
1634
|
};
|
|
1402
1635
|
NewProfileResourceTreeRenderer = NewProfileResourceTreeRenderer_1 = ( (__decorate([
|
|
@@ -1447,18 +1680,224 @@ let ProfileResourceChildTreeItemRenderer = class ProfileResourceChildTreeItemRen
|
|
|
1447
1680
|
}
|
|
1448
1681
|
templateData.resourceLabel.setResource({
|
|
1449
1682
|
name: element.resource ? basename(element.resource) : element.label,
|
|
1683
|
+
description: element.description,
|
|
1450
1684
|
resource: element.resource
|
|
1451
1685
|
}, {
|
|
1452
1686
|
forceLabel: true,
|
|
1453
1687
|
icon: element.icon,
|
|
1454
1688
|
hideIcon: !element.resource && !element.icon,
|
|
1455
1689
|
});
|
|
1456
|
-
|
|
1690
|
+
const actions = [];
|
|
1691
|
+
if (element.openAction) {
|
|
1692
|
+
actions.push(element.openAction);
|
|
1693
|
+
}
|
|
1694
|
+
if (element.actions?.primary) {
|
|
1695
|
+
actions.push(...element.actions.primary);
|
|
1696
|
+
}
|
|
1697
|
+
templateData.actionBar.setActions(actions);
|
|
1457
1698
|
}
|
|
1458
1699
|
};
|
|
1459
1700
|
ProfileResourceChildTreeItemRenderer = ProfileResourceChildTreeItemRenderer_1 = ( (__decorate([
|
|
1460
1701
|
( (__param(0, IInstantiationService)))
|
|
1461
1702
|
], ProfileResourceChildTreeItemRenderer)));
|
|
1703
|
+
class WorkspaceUriEmptyColumnRenderer {
|
|
1704
|
+
constructor() {
|
|
1705
|
+
this.templateId = WorkspaceUriEmptyColumnRenderer.TEMPLATE_ID;
|
|
1706
|
+
}
|
|
1707
|
+
static { this.TEMPLATE_ID = 'empty'; }
|
|
1708
|
+
renderTemplate(container) {
|
|
1709
|
+
return {};
|
|
1710
|
+
}
|
|
1711
|
+
renderElement(item, index, templateData, height) {
|
|
1712
|
+
}
|
|
1713
|
+
disposeTemplate() {
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1716
|
+
let WorkspaceUriHostColumnRenderer = class WorkspaceUriHostColumnRenderer {
|
|
1717
|
+
static { WorkspaceUriHostColumnRenderer_1 = this; }
|
|
1718
|
+
static { this.TEMPLATE_ID = 'host'; }
|
|
1719
|
+
constructor(uriIdentityService, labelService) {
|
|
1720
|
+
this.uriIdentityService = uriIdentityService;
|
|
1721
|
+
this.labelService = labelService;
|
|
1722
|
+
this.templateId = WorkspaceUriHostColumnRenderer_1.TEMPLATE_ID;
|
|
1723
|
+
}
|
|
1724
|
+
renderTemplate(container) {
|
|
1725
|
+
const disposables = ( (new DisposableStore()));
|
|
1726
|
+
const renderDisposables = disposables.add(( (new DisposableStore())));
|
|
1727
|
+
const element = container.appendChild($('.host'));
|
|
1728
|
+
const hostContainer = element.appendChild($('div.host-label'));
|
|
1729
|
+
const buttonBarContainer = element.appendChild($('div.button-bar'));
|
|
1730
|
+
return {
|
|
1731
|
+
element,
|
|
1732
|
+
hostContainer,
|
|
1733
|
+
buttonBarContainer,
|
|
1734
|
+
disposables,
|
|
1735
|
+
renderDisposables
|
|
1736
|
+
};
|
|
1737
|
+
}
|
|
1738
|
+
renderElement(item, index, templateData, height) {
|
|
1739
|
+
templateData.renderDisposables.clear();
|
|
1740
|
+
templateData.renderDisposables.add({ dispose: () => { clearNode(templateData.buttonBarContainer); } });
|
|
1741
|
+
templateData.hostContainer.innerText = getHostLabel(this.labelService, item.workspace);
|
|
1742
|
+
templateData.element.classList.toggle('current-workspace', this.uriIdentityService.extUri.isEqual(item.workspace, item.profileElement.getCurrentWorkspace()));
|
|
1743
|
+
templateData.hostContainer.style.display = '';
|
|
1744
|
+
templateData.buttonBarContainer.style.display = 'none';
|
|
1745
|
+
}
|
|
1746
|
+
disposeTemplate(templateData) {
|
|
1747
|
+
templateData.disposables.dispose();
|
|
1748
|
+
}
|
|
1749
|
+
};
|
|
1750
|
+
WorkspaceUriHostColumnRenderer = WorkspaceUriHostColumnRenderer_1 = ( (__decorate([
|
|
1751
|
+
( (__param(0, IUriIdentityService))),
|
|
1752
|
+
( (__param(1, ILabelService)))
|
|
1753
|
+
], WorkspaceUriHostColumnRenderer)));
|
|
1754
|
+
let WorkspaceUriPathColumnRenderer = class WorkspaceUriPathColumnRenderer {
|
|
1755
|
+
static { WorkspaceUriPathColumnRenderer_1 = this; }
|
|
1756
|
+
static { this.TEMPLATE_ID = 'path'; }
|
|
1757
|
+
constructor(uriIdentityService, hoverService) {
|
|
1758
|
+
this.uriIdentityService = uriIdentityService;
|
|
1759
|
+
this.hoverService = hoverService;
|
|
1760
|
+
this.templateId = WorkspaceUriPathColumnRenderer_1.TEMPLATE_ID;
|
|
1761
|
+
this.hoverDelegate = getDefaultHoverDelegate('mouse');
|
|
1762
|
+
}
|
|
1763
|
+
renderTemplate(container) {
|
|
1764
|
+
const disposables = ( (new DisposableStore()));
|
|
1765
|
+
const element = container.appendChild($('.path'));
|
|
1766
|
+
const pathLabel = element.appendChild($('div.path-label'));
|
|
1767
|
+
const pathHover = disposables.add(this.hoverService.setupManagedHover(this.hoverDelegate, pathLabel, ''));
|
|
1768
|
+
const renderDisposables = disposables.add(( (new DisposableStore())));
|
|
1769
|
+
return {
|
|
1770
|
+
element,
|
|
1771
|
+
pathLabel,
|
|
1772
|
+
pathHover,
|
|
1773
|
+
disposables,
|
|
1774
|
+
renderDisposables
|
|
1775
|
+
};
|
|
1776
|
+
}
|
|
1777
|
+
renderElement(item, index, templateData, height) {
|
|
1778
|
+
templateData.renderDisposables.clear();
|
|
1779
|
+
const stringValue = this.formatPath(item.workspace);
|
|
1780
|
+
templateData.pathLabel.innerText = stringValue;
|
|
1781
|
+
templateData.element.classList.toggle('current-workspace', this.uriIdentityService.extUri.isEqual(item.workspace, item.profileElement.getCurrentWorkspace()));
|
|
1782
|
+
templateData.pathHover.update(stringValue);
|
|
1783
|
+
}
|
|
1784
|
+
disposeTemplate(templateData) {
|
|
1785
|
+
templateData.disposables.dispose();
|
|
1786
|
+
templateData.renderDisposables.dispose();
|
|
1787
|
+
}
|
|
1788
|
+
formatPath(uri) {
|
|
1789
|
+
if (uri.scheme === Schemas.file) {
|
|
1790
|
+
return normalizeDriveLetter(uri.fsPath);
|
|
1791
|
+
}
|
|
1792
|
+
if (uri.path.startsWith(posix.sep)) {
|
|
1793
|
+
const pathWithoutLeadingSeparator = uri.path.substring(1);
|
|
1794
|
+
const isWindowsPath = hasDriveLetter(pathWithoutLeadingSeparator, true);
|
|
1795
|
+
if (isWindowsPath) {
|
|
1796
|
+
return normalizeDriveLetter(win32.normalize(pathWithoutLeadingSeparator), true);
|
|
1797
|
+
}
|
|
1798
|
+
}
|
|
1799
|
+
return uri.path;
|
|
1800
|
+
}
|
|
1801
|
+
};
|
|
1802
|
+
WorkspaceUriPathColumnRenderer = WorkspaceUriPathColumnRenderer_1 = ( (__decorate([
|
|
1803
|
+
( (__param(0, IUriIdentityService))),
|
|
1804
|
+
( (__param(1, IHoverService)))
|
|
1805
|
+
], WorkspaceUriPathColumnRenderer)));
|
|
1806
|
+
let ChangeProfileAction = class ChangeProfileAction extends Action {
|
|
1807
|
+
constructor(item, userDataProfilesService) {
|
|
1808
|
+
super('changeProfile', '', ThemeIcon.asClassName(editIcon));
|
|
1809
|
+
this.item = item;
|
|
1810
|
+
this.userDataProfilesService = userDataProfilesService;
|
|
1811
|
+
this.tooltip = ( localize(11128, "Change Profile"));
|
|
1812
|
+
}
|
|
1813
|
+
getSwitchProfileActions() {
|
|
1814
|
+
return (
|
|
1815
|
+
(this.userDataProfilesService.profiles
|
|
1816
|
+
.filter(profile => !profile.isTransient)
|
|
1817
|
+
.sort((a, b) => a.isDefault ? -1 : b.isDefault ? 1 : a.name.localeCompare(b.name))
|
|
1818
|
+
.map(profile => ({
|
|
1819
|
+
id: `switchProfileTo${profile.id}`,
|
|
1820
|
+
label: profile.name,
|
|
1821
|
+
class: undefined,
|
|
1822
|
+
enabled: true,
|
|
1823
|
+
checked: profile.id === this.item.profileElement.profile.id,
|
|
1824
|
+
tooltip: '',
|
|
1825
|
+
run: () => {
|
|
1826
|
+
if (profile.id === this.item.profileElement.profile.id) {
|
|
1827
|
+
return;
|
|
1828
|
+
}
|
|
1829
|
+
this.userDataProfilesService.updateProfile(profile, { workspaces: [...(profile.workspaces ?? []), this.item.workspace] });
|
|
1830
|
+
}
|
|
1831
|
+
})))
|
|
1832
|
+
);
|
|
1833
|
+
}
|
|
1834
|
+
};
|
|
1835
|
+
ChangeProfileAction = ( (__decorate([
|
|
1836
|
+
( (__param(1, IUserDataProfilesService)))
|
|
1837
|
+
], ChangeProfileAction)));
|
|
1838
|
+
let WorkspaceUriActionsColumnRenderer = class WorkspaceUriActionsColumnRenderer {
|
|
1839
|
+
static { WorkspaceUriActionsColumnRenderer_1 = this; }
|
|
1840
|
+
static { this.TEMPLATE_ID = 'actions'; }
|
|
1841
|
+
constructor(userDataProfilesService, contextMenuService, uriIdentityService) {
|
|
1842
|
+
this.userDataProfilesService = userDataProfilesService;
|
|
1843
|
+
this.contextMenuService = contextMenuService;
|
|
1844
|
+
this.uriIdentityService = uriIdentityService;
|
|
1845
|
+
this.templateId = WorkspaceUriActionsColumnRenderer_1.TEMPLATE_ID;
|
|
1846
|
+
}
|
|
1847
|
+
renderTemplate(container) {
|
|
1848
|
+
const disposables = ( (new DisposableStore()));
|
|
1849
|
+
const element = container.appendChild($('.profile-workspaces-actions-container'));
|
|
1850
|
+
const hoverDelegate = disposables.add(createInstantHoverDelegate());
|
|
1851
|
+
const actionBar = disposables.add(( (new ActionBar(element, {
|
|
1852
|
+
hoverDelegate,
|
|
1853
|
+
actionViewItemProvider: (action) => {
|
|
1854
|
+
if (action instanceof ChangeProfileAction) {
|
|
1855
|
+
return (
|
|
1856
|
+
(new DropdownMenuActionViewItem(
|
|
1857
|
+
action,
|
|
1858
|
+
{ getActions: () => action.getSwitchProfileActions() },
|
|
1859
|
+
this.contextMenuService,
|
|
1860
|
+
{
|
|
1861
|
+
classNames: action.class,
|
|
1862
|
+
hoverDelegate,
|
|
1863
|
+
}
|
|
1864
|
+
))
|
|
1865
|
+
);
|
|
1866
|
+
}
|
|
1867
|
+
return undefined;
|
|
1868
|
+
}
|
|
1869
|
+
}))));
|
|
1870
|
+
return { actionBar, disposables };
|
|
1871
|
+
}
|
|
1872
|
+
renderElement(item, index, templateData, height) {
|
|
1873
|
+
templateData.actionBar.clear();
|
|
1874
|
+
const actions = [];
|
|
1875
|
+
actions.push(this.createOpenAction(item));
|
|
1876
|
+
actions.push(( (new ChangeProfileAction(item, this.userDataProfilesService))));
|
|
1877
|
+
templateData.actionBar.push(actions, { icon: true });
|
|
1878
|
+
}
|
|
1879
|
+
createOpenAction(item) {
|
|
1880
|
+
return {
|
|
1881
|
+
label: '',
|
|
1882
|
+
class: ThemeIcon.asClassName(Codicon.window),
|
|
1883
|
+
enabled: !this.uriIdentityService.extUri.isEqual(item.workspace, item.profileElement.getCurrentWorkspace()),
|
|
1884
|
+
id: 'openWorkspace',
|
|
1885
|
+
tooltip: ( localize(11129, "Open in New Window")),
|
|
1886
|
+
run: () => item.profileElement.openWorkspace(item.workspace)
|
|
1887
|
+
};
|
|
1888
|
+
}
|
|
1889
|
+
disposeTemplate(templateData) {
|
|
1890
|
+
templateData.disposables.dispose();
|
|
1891
|
+
}
|
|
1892
|
+
};
|
|
1893
|
+
WorkspaceUriActionsColumnRenderer = WorkspaceUriActionsColumnRenderer_1 = ( (__decorate([
|
|
1894
|
+
( (__param(0, IUserDataProfilesService))),
|
|
1895
|
+
( (__param(1, IContextMenuService))),
|
|
1896
|
+
( (__param(2, IUriIdentityService)))
|
|
1897
|
+
], WorkspaceUriActionsColumnRenderer)));
|
|
1898
|
+
function getHostLabel(labelService, workspaceUri) {
|
|
1899
|
+
return workspaceUri.authority ? labelService.getHostLabel(workspaceUri.scheme, workspaceUri.authority) : ( localize(11130, "Local"));
|
|
1900
|
+
}
|
|
1462
1901
|
let UserDataProfilesEditorInput = class UserDataProfilesEditorInput extends EditorInput {
|
|
1463
1902
|
static { UserDataProfilesEditorInput_1 = this; }
|
|
1464
1903
|
static { this.ID = 'workbench.input.userDataProfiles'; }
|
|
@@ -1478,7 +1917,7 @@ let UserDataProfilesEditorInput = class UserDataProfilesEditorInput extends Edit
|
|
|
1478
1917
|
this._register(this.model.onDidChange(e => this.dirty = ( (this.model.profiles.some(profile => profile instanceof NewProfileElement)))));
|
|
1479
1918
|
}
|
|
1480
1919
|
get typeId() { return UserDataProfilesEditorInput_1.ID; }
|
|
1481
|
-
getName() { return ( localize(
|
|
1920
|
+
getName() { return ( localize(11131, "Profiles")); }
|
|
1482
1921
|
getIcon() { return defaultUserDataProfileIcon; }
|
|
1483
1922
|
async resolve() {
|
|
1484
1923
|
await this.model.resolve();
|