@codingame/monaco-vscode-views-service-override 2.1.3 → 2.2.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +11 -9
- package/index.js +8 -6
- package/package.json +11 -11
- package/tools/editor.js +3 -1
- package/tools/views.d.ts +102 -0
- package/tools/views.js +253 -0
- package/views.d.ts +4 -99
- package/views.js +52 -280
- package/external/rollup-plugin-styles/dist/runtime/inject-css.js +0 -3
- package/vscode/src/vs/base/browser/ui/centered/centeredViewLayout.js +0 -180
- package/vscode/src/vs/base/browser/ui/grid/grid.js +0 -494
- package/vscode/src/vs/base/browser/ui/grid/gridview.css.js +0 -6
- package/vscode/src/vs/base/browser/ui/grid/gridview.js +0 -1112
- package/vscode/src/vs/base/common/codicons.d.ts +0 -579
- package/vscode/src/vs/platform/webview/common/mimeTypes.js +0 -24
- package/vscode/src/vs/platform/webview/common/webviewPortMapping.js +0 -64
- package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +0 -790
- package/vscode/src/vs/workbench/browser/actions/listCommands.js +0 -764
- package/vscode/src/vs/workbench/browser/layout.d.ts +0 -26
- package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.js +0 -612
- package/vscode/src/vs/workbench/browser/parts/activitybar/media/activityaction.css.js +0 -6
- package/vscode/src/vs/workbench/browser/parts/activitybar/media/activitybarpart.css.js +0 -6
- package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.js +0 -150
- package/vscode/src/vs/workbench/browser/parts/auxiliarybar/media/auxiliaryBarPart.css.js +0 -6
- package/vscode/src/vs/workbench/browser/parts/compositeBar.js +0 -605
- package/vscode/src/vs/workbench/browser/parts/compositePart.js +0 -335
- package/vscode/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.js +0 -223
- package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +0 -1407
- package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +0 -186
- package/vscode/src/vs/workbench/browser/parts/editor/editorDropTarget.js +0 -511
- package/vscode/src/vs/workbench/browser/parts/editor/editorPane.d.ts +0 -112
- package/vscode/src/vs/workbench/browser/parts/editor/editorPart.js +0 -1020
- package/vscode/src/vs/workbench/browser/parts/editor/editorParts.js +0 -391
- package/vscode/src/vs/workbench/browser/parts/editor/media/editordroptarget.css.js +0 -6
- package/vscode/src/vs/workbench/browser/parts/media/compositepart.css.js +0 -6
- package/vscode/src/vs/workbench/browser/parts/media/paneCompositePart.css.js +0 -6
- package/vscode/src/vs/workbench/browser/parts/paneCompositeBar.js +0 -645
- package/vscode/src/vs/workbench/browser/parts/paneCompositePart.js +0 -379
- package/vscode/src/vs/workbench/browser/parts/paneCompositePartService.js +0 -68
- package/vscode/src/vs/workbench/browser/parts/panel/panelPart.js +0 -146
- package/vscode/src/vs/workbench/browser/parts/sidebar/media/sidebarpart.css.js +0 -6
- package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.js +0 -222
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +0 -299
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.js +0 -365
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.js +0 -135
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/media/callHierarchy.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditor.contribution.js +0 -17
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.js +0 -145
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditors.js +0 -214
- package/vscode/src/vs/workbench/contrib/customEditor/browser/media/customEditor.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/customEditor/common/contributedCustomEditors.js +0 -78
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditorModelManager.js +0 -63
- package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.js +0 -119
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/externalUriOpener.contribution.js +0 -6
- package/vscode/src/vs/workbench/contrib/files/browser/editors/binaryFileEditor.js +0 -79
- package/vscode/src/vs/workbench/contrib/files/browser/editors/fileEditorHandler.js +0 -74
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditor.js +0 -256
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditorTracker.js +0 -99
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.js +0 -444
- package/vscode/src/vs/workbench/contrib/files/browser/explorerService.js +0 -432
- package/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.js +0 -786
- package/vscode/src/vs/workbench/contrib/files/browser/fileCommands.js +0 -488
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution.js +0 -522
- package/vscode/src/vs/workbench/contrib/files/browser/workspaceWatcher.js +0 -152
- package/vscode/src/vs/workbench/contrib/files/common/dirtyFilesIndicator.js +0 -63
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.js +0 -409
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/media/languageStatus.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.js +0 -693
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/devCommands.js +0 -240
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.js +0 -77
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorSerializer.js +0 -42
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/colors.js +0 -71
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/conflictActions.js +0 -348
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editorGutter.js +0 -98
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.js +0 -146
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.js +0 -105
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.js +0 -401
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.js +0 -197
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/fixedZoneWidget.js +0 -41
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/lineAlignment.js +0 -128
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/media/mergeEditor.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.js +0 -612
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/scrollSynchronizer.js +0 -158
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.js +0 -264
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewZones.js +0 -173
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/media/typeHierarchy.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +0 -282
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.js +0 -360
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree.js +0 -133
- package/vscode/src/vs/workbench/contrib/webview/browser/overlayWebview.js +0 -290
- package/vscode/src/vs/workbench/contrib/webview/browser/resourceLoading.js +0 -96
- package/vscode/src/vs/workbench/contrib/webview/browser/themeing.js +0 -88
- package/vscode/src/vs/workbench/contrib/webview/browser/webview.contribution.js +0 -79
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +0 -648
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewFindWidget.js +0 -65
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewService.js +0 -59
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.js +0 -142
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewEditorInputSerializer.js +0 -121
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +0 -68
- package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewPane.js +0 -235
- package/vscode/src/vs/workbench/services/activity/browser/activityService.js +0 -145
- package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +0 -670
- package/vscode/src/vs/workbench/services/history/browser/historyService.js +0 -1484
- package/vscode/src/vs/workbench/services/progress/browser/media/progressService.css.js +0 -6
- package/vscode/src/vs/workbench/services/progress/browser/progressService.js +0 -523
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorHandler.js +0 -101
- package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +0 -713
- package/vscode/src/vs/workbench/services/views/common/viewContainerModel.js +0 -598
|
@@ -1,764 +0,0 @@
|
|
|
1
|
-
import { KeybindingsRegistry } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
|
|
2
|
-
import { List } from 'vscode/vscode/vs/base/browser/ui/list/listWidget';
|
|
3
|
-
import { WorkbenchListFocusContextKey, IListService, WorkbenchListSupportsMultiSelectContextKey, WorkbenchTreeElementCanCollapse, WorkbenchTreeElementHasParent, WorkbenchTreeStickyScrollFocused, getSelectionKeyboardEvent, WorkbenchTreeElementCanExpand, WorkbenchTreeElementHasChild, WorkbenchListHasSelectionOrFocus, WorkbenchListSelectionNavigation, RawWorkbenchListFocusContextKey, WorkbenchListSupportsFind, WorkbenchTreeFindOpen, WorkbenchListScrollAtTopContextKey, WorkbenchListScrollAtBottomContextKey } from 'vscode/vscode/vs/platform/list/browser/listService';
|
|
4
|
-
import { PagedList } from 'vscode/vscode/vs/base/browser/ui/list/listPaging';
|
|
5
|
-
import { range, equals } from 'vscode/vscode/vs/base/common/arrays';
|
|
6
|
-
import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
7
|
-
import { ObjectTree } from 'vscode/vscode/vs/base/browser/ui/tree/objectTree';
|
|
8
|
-
import { AsyncDataTree } from 'vscode/vscode/vs/base/browser/ui/tree/asyncDataTree';
|
|
9
|
-
import { DataTree } from 'vscode/vscode/vs/base/browser/ui/tree/dataTree';
|
|
10
|
-
import { CommandsRegistry } from 'vscode/vscode/vs/platform/commands/common/commands';
|
|
11
|
-
import { Table } from 'vscode/vscode/vs/base/browser/ui/table/tableWidget';
|
|
12
|
-
import { AbstractTree, TreeFindMode, TreeFindMatchType } from 'vscode/vscode/vs/base/browser/ui/tree/abstractTree';
|
|
13
|
-
import { isActiveElement } from 'vscode/vscode/vs/base/browser/dom';
|
|
14
|
-
import { registerAction2, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
15
|
-
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
16
|
-
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
17
|
-
|
|
18
|
-
function ensureDOMFocus(widget) {
|
|
19
|
-
const element = widget?.getHTMLElement();
|
|
20
|
-
if (element && !isActiveElement(element)) {
|
|
21
|
-
widget?.domFocus();
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
async function updateFocus(widget, updateFocusFn) {
|
|
25
|
-
if (!WorkbenchListSelectionNavigation.getValue(widget.contextKeyService)) {
|
|
26
|
-
return updateFocusFn(widget);
|
|
27
|
-
}
|
|
28
|
-
const focus = widget.getFocus();
|
|
29
|
-
const selection = widget.getSelection();
|
|
30
|
-
await updateFocusFn(widget);
|
|
31
|
-
const newFocus = widget.getFocus();
|
|
32
|
-
if (selection.length > 1 || !equals(focus, selection) || equals(focus, newFocus)) {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
const fakeKeyboardEvent = ( new KeyboardEvent('keydown'));
|
|
36
|
-
widget.setSelection(newFocus, fakeKeyboardEvent);
|
|
37
|
-
}
|
|
38
|
-
async function navigate(widget, updateFocusFn) {
|
|
39
|
-
if (!widget) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
await updateFocus(widget, updateFocusFn);
|
|
43
|
-
const listFocus = widget.getFocus();
|
|
44
|
-
if (listFocus.length) {
|
|
45
|
-
widget.reveal(listFocus[0]);
|
|
46
|
-
}
|
|
47
|
-
widget.setAnchor(listFocus[0]);
|
|
48
|
-
ensureDOMFocus(widget);
|
|
49
|
-
}
|
|
50
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
51
|
-
id: 'list.focusDown',
|
|
52
|
-
weight: 200 ,
|
|
53
|
-
when: WorkbenchListFocusContextKey,
|
|
54
|
-
primary: 18 ,
|
|
55
|
-
mac: {
|
|
56
|
-
primary: 18 ,
|
|
57
|
-
secondary: [256 | 44 ]
|
|
58
|
-
},
|
|
59
|
-
handler: (accessor, arg2) => {
|
|
60
|
-
navigate(accessor.get(IListService).lastFocusedList, async (widget) => {
|
|
61
|
-
const fakeKeyboardEvent = ( new KeyboardEvent('keydown'));
|
|
62
|
-
await widget.focusNext(typeof arg2 === 'number' ? arg2 : 1, false, fakeKeyboardEvent);
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
67
|
-
id: 'list.focusUp',
|
|
68
|
-
weight: 200 ,
|
|
69
|
-
when: WorkbenchListFocusContextKey,
|
|
70
|
-
primary: 16 ,
|
|
71
|
-
mac: {
|
|
72
|
-
primary: 16 ,
|
|
73
|
-
secondary: [256 | 46 ]
|
|
74
|
-
},
|
|
75
|
-
handler: (accessor, arg2) => {
|
|
76
|
-
navigate(accessor.get(IListService).lastFocusedList, async (widget) => {
|
|
77
|
-
const fakeKeyboardEvent = ( new KeyboardEvent('keydown'));
|
|
78
|
-
await widget.focusPrevious(typeof arg2 === 'number' ? arg2 : 1, false, fakeKeyboardEvent);
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
83
|
-
id: 'list.focusAnyDown',
|
|
84
|
-
weight: 200 ,
|
|
85
|
-
when: WorkbenchListFocusContextKey,
|
|
86
|
-
primary: 512 | 18 ,
|
|
87
|
-
mac: {
|
|
88
|
-
primary: 512 | 18 ,
|
|
89
|
-
secondary: [256 | 512 | 44 ]
|
|
90
|
-
},
|
|
91
|
-
handler: (accessor, arg2) => {
|
|
92
|
-
navigate(accessor.get(IListService).lastFocusedList, async (widget) => {
|
|
93
|
-
const fakeKeyboardEvent = ( new KeyboardEvent('keydown', { altKey: true }));
|
|
94
|
-
await widget.focusNext(typeof arg2 === 'number' ? arg2 : 1, false, fakeKeyboardEvent);
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
99
|
-
id: 'list.focusAnyUp',
|
|
100
|
-
weight: 200 ,
|
|
101
|
-
when: WorkbenchListFocusContextKey,
|
|
102
|
-
primary: 512 | 16 ,
|
|
103
|
-
mac: {
|
|
104
|
-
primary: 512 | 16 ,
|
|
105
|
-
secondary: [256 | 512 | 46 ]
|
|
106
|
-
},
|
|
107
|
-
handler: (accessor, arg2) => {
|
|
108
|
-
navigate(accessor.get(IListService).lastFocusedList, async (widget) => {
|
|
109
|
-
const fakeKeyboardEvent = ( new KeyboardEvent('keydown', { altKey: true }));
|
|
110
|
-
await widget.focusPrevious(typeof arg2 === 'number' ? arg2 : 1, false, fakeKeyboardEvent);
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
115
|
-
id: 'list.focusPageDown',
|
|
116
|
-
weight: 200 ,
|
|
117
|
-
when: WorkbenchListFocusContextKey,
|
|
118
|
-
primary: 12 ,
|
|
119
|
-
handler: (accessor) => {
|
|
120
|
-
navigate(accessor.get(IListService).lastFocusedList, async (widget) => {
|
|
121
|
-
const fakeKeyboardEvent = ( new KeyboardEvent('keydown'));
|
|
122
|
-
await widget.focusNextPage(fakeKeyboardEvent);
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
127
|
-
id: 'list.focusPageUp',
|
|
128
|
-
weight: 200 ,
|
|
129
|
-
when: WorkbenchListFocusContextKey,
|
|
130
|
-
primary: 11 ,
|
|
131
|
-
handler: (accessor) => {
|
|
132
|
-
navigate(accessor.get(IListService).lastFocusedList, async (widget) => {
|
|
133
|
-
const fakeKeyboardEvent = ( new KeyboardEvent('keydown'));
|
|
134
|
-
await widget.focusPreviousPage(fakeKeyboardEvent);
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
139
|
-
id: 'list.focusFirst',
|
|
140
|
-
weight: 200 ,
|
|
141
|
-
when: WorkbenchListFocusContextKey,
|
|
142
|
-
primary: 14 ,
|
|
143
|
-
handler: (accessor) => {
|
|
144
|
-
navigate(accessor.get(IListService).lastFocusedList, async (widget) => {
|
|
145
|
-
const fakeKeyboardEvent = ( new KeyboardEvent('keydown'));
|
|
146
|
-
await widget.focusFirst(fakeKeyboardEvent);
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
151
|
-
id: 'list.focusLast',
|
|
152
|
-
weight: 200 ,
|
|
153
|
-
when: WorkbenchListFocusContextKey,
|
|
154
|
-
primary: 13 ,
|
|
155
|
-
handler: (accessor) => {
|
|
156
|
-
navigate(accessor.get(IListService).lastFocusedList, async (widget) => {
|
|
157
|
-
const fakeKeyboardEvent = ( new KeyboardEvent('keydown'));
|
|
158
|
-
await widget.focusLast(fakeKeyboardEvent);
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
});
|
|
162
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
163
|
-
id: 'list.focusAnyFirst',
|
|
164
|
-
weight: 200 ,
|
|
165
|
-
when: WorkbenchListFocusContextKey,
|
|
166
|
-
primary: 512 | 14 ,
|
|
167
|
-
handler: (accessor) => {
|
|
168
|
-
navigate(accessor.get(IListService).lastFocusedList, async (widget) => {
|
|
169
|
-
const fakeKeyboardEvent = ( new KeyboardEvent('keydown', { altKey: true }));
|
|
170
|
-
await widget.focusFirst(fakeKeyboardEvent);
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
175
|
-
id: 'list.focusAnyLast',
|
|
176
|
-
weight: 200 ,
|
|
177
|
-
when: WorkbenchListFocusContextKey,
|
|
178
|
-
primary: 512 | 13 ,
|
|
179
|
-
handler: (accessor) => {
|
|
180
|
-
navigate(accessor.get(IListService).lastFocusedList, async (widget) => {
|
|
181
|
-
const fakeKeyboardEvent = ( new KeyboardEvent('keydown', { altKey: true }));
|
|
182
|
-
await widget.focusLast(fakeKeyboardEvent);
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
function expandMultiSelection(focused, previousFocus) {
|
|
187
|
-
if (focused instanceof List || focused instanceof PagedList || focused instanceof Table) {
|
|
188
|
-
const list = focused;
|
|
189
|
-
const focus = list.getFocus() ? list.getFocus()[0] : undefined;
|
|
190
|
-
const selection = list.getSelection();
|
|
191
|
-
if (selection && typeof focus === 'number' && selection.indexOf(focus) >= 0) {
|
|
192
|
-
list.setSelection(selection.filter(s => s !== previousFocus));
|
|
193
|
-
}
|
|
194
|
-
else {
|
|
195
|
-
if (typeof focus === 'number') {
|
|
196
|
-
list.setSelection(selection.concat(focus));
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
else if (focused instanceof ObjectTree || focused instanceof DataTree || focused instanceof AsyncDataTree) {
|
|
201
|
-
const list = focused;
|
|
202
|
-
const focus = list.getFocus() ? list.getFocus()[0] : undefined;
|
|
203
|
-
if (previousFocus === focus) {
|
|
204
|
-
return;
|
|
205
|
-
}
|
|
206
|
-
const selection = list.getSelection();
|
|
207
|
-
const fakeKeyboardEvent = ( new KeyboardEvent('keydown', { shiftKey: true }));
|
|
208
|
-
if (selection && selection.indexOf(focus) >= 0) {
|
|
209
|
-
list.setSelection(selection.filter(s => s !== previousFocus), fakeKeyboardEvent);
|
|
210
|
-
}
|
|
211
|
-
else {
|
|
212
|
-
list.setSelection(selection.concat(focus), fakeKeyboardEvent);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
function revealFocusedStickyScroll(tree, postRevealAction) {
|
|
217
|
-
const focus = tree.getStickyScrollFocus();
|
|
218
|
-
if (focus.length === 0) {
|
|
219
|
-
throw new Error(`StickyScroll has no focus`);
|
|
220
|
-
}
|
|
221
|
-
if (focus.length > 1) {
|
|
222
|
-
throw new Error(`StickyScroll can only have a single focused item`);
|
|
223
|
-
}
|
|
224
|
-
tree.reveal(focus[0]);
|
|
225
|
-
tree.getHTMLElement().focus();
|
|
226
|
-
tree.setFocus(focus);
|
|
227
|
-
postRevealAction?.(focus[0]);
|
|
228
|
-
}
|
|
229
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
230
|
-
id: 'list.expandSelectionDown',
|
|
231
|
-
weight: 200 ,
|
|
232
|
-
when: ( ContextKeyExpr.and(WorkbenchListFocusContextKey, WorkbenchListSupportsMultiSelectContextKey)),
|
|
233
|
-
primary: 1024 | 18 ,
|
|
234
|
-
handler: (accessor, arg2) => {
|
|
235
|
-
const widget = accessor.get(IListService).lastFocusedList;
|
|
236
|
-
if (!widget) {
|
|
237
|
-
return;
|
|
238
|
-
}
|
|
239
|
-
const previousFocus = widget.getFocus() ? widget.getFocus()[0] : undefined;
|
|
240
|
-
const fakeKeyboardEvent = ( new KeyboardEvent('keydown'));
|
|
241
|
-
widget.focusNext(typeof arg2 === 'number' ? arg2 : 1, false, fakeKeyboardEvent);
|
|
242
|
-
expandMultiSelection(widget, previousFocus);
|
|
243
|
-
const focus = widget.getFocus();
|
|
244
|
-
if (focus.length) {
|
|
245
|
-
widget.reveal(focus[0]);
|
|
246
|
-
}
|
|
247
|
-
ensureDOMFocus(widget);
|
|
248
|
-
}
|
|
249
|
-
});
|
|
250
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
251
|
-
id: 'list.expandSelectionUp',
|
|
252
|
-
weight: 200 ,
|
|
253
|
-
when: ( ContextKeyExpr.and(WorkbenchListFocusContextKey, WorkbenchListSupportsMultiSelectContextKey)),
|
|
254
|
-
primary: 1024 | 16 ,
|
|
255
|
-
handler: (accessor, arg2) => {
|
|
256
|
-
const widget = accessor.get(IListService).lastFocusedList;
|
|
257
|
-
if (!widget) {
|
|
258
|
-
return;
|
|
259
|
-
}
|
|
260
|
-
const previousFocus = widget.getFocus() ? widget.getFocus()[0] : undefined;
|
|
261
|
-
const fakeKeyboardEvent = ( new KeyboardEvent('keydown'));
|
|
262
|
-
widget.focusPrevious(typeof arg2 === 'number' ? arg2 : 1, false, fakeKeyboardEvent);
|
|
263
|
-
expandMultiSelection(widget, previousFocus);
|
|
264
|
-
const focus = widget.getFocus();
|
|
265
|
-
if (focus.length) {
|
|
266
|
-
widget.reveal(focus[0]);
|
|
267
|
-
}
|
|
268
|
-
ensureDOMFocus(widget);
|
|
269
|
-
}
|
|
270
|
-
});
|
|
271
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
272
|
-
id: 'list.collapse',
|
|
273
|
-
weight: 200 ,
|
|
274
|
-
when: ( ContextKeyExpr.and(WorkbenchListFocusContextKey, ( ContextKeyExpr.or(WorkbenchTreeElementCanCollapse, WorkbenchTreeElementHasParent)))),
|
|
275
|
-
primary: 15 ,
|
|
276
|
-
mac: {
|
|
277
|
-
primary: 15 ,
|
|
278
|
-
secondary: [2048 | 16 ]
|
|
279
|
-
},
|
|
280
|
-
handler: (accessor) => {
|
|
281
|
-
const widget = accessor.get(IListService).lastFocusedList;
|
|
282
|
-
if (!widget || !(widget instanceof ObjectTree || widget instanceof DataTree || widget instanceof AsyncDataTree)) {
|
|
283
|
-
return;
|
|
284
|
-
}
|
|
285
|
-
const tree = widget;
|
|
286
|
-
const focusedElements = tree.getFocus();
|
|
287
|
-
if (focusedElements.length === 0) {
|
|
288
|
-
return;
|
|
289
|
-
}
|
|
290
|
-
const focus = focusedElements[0];
|
|
291
|
-
if (!tree.collapse(focus)) {
|
|
292
|
-
const parent = tree.getParentElement(focus);
|
|
293
|
-
if (parent) {
|
|
294
|
-
navigate(widget, widget => {
|
|
295
|
-
const fakeKeyboardEvent = ( new KeyboardEvent('keydown'));
|
|
296
|
-
widget.setFocus([parent], fakeKeyboardEvent);
|
|
297
|
-
});
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
});
|
|
302
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
303
|
-
id: 'list.stickyScroll.collapse',
|
|
304
|
-
weight: 200 + 50,
|
|
305
|
-
when: WorkbenchTreeStickyScrollFocused,
|
|
306
|
-
primary: 15 ,
|
|
307
|
-
mac: {
|
|
308
|
-
primary: 15 ,
|
|
309
|
-
secondary: [2048 | 16 ]
|
|
310
|
-
},
|
|
311
|
-
handler: (accessor) => {
|
|
312
|
-
const widget = accessor.get(IListService).lastFocusedList;
|
|
313
|
-
if (!widget || !(widget instanceof ObjectTree || widget instanceof DataTree || widget instanceof AsyncDataTree)) {
|
|
314
|
-
return;
|
|
315
|
-
}
|
|
316
|
-
revealFocusedStickyScroll(widget, focus => widget.collapse(focus));
|
|
317
|
-
}
|
|
318
|
-
});
|
|
319
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
320
|
-
id: 'list.collapseAll',
|
|
321
|
-
weight: 200 ,
|
|
322
|
-
when: WorkbenchListFocusContextKey,
|
|
323
|
-
primary: 2048 | 15 ,
|
|
324
|
-
mac: {
|
|
325
|
-
primary: 2048 | 15 ,
|
|
326
|
-
secondary: [2048 | 1024 | 16 ]
|
|
327
|
-
},
|
|
328
|
-
handler: (accessor) => {
|
|
329
|
-
const focused = accessor.get(IListService).lastFocusedList;
|
|
330
|
-
if (focused && !(focused instanceof List || focused instanceof PagedList || focused instanceof Table)) {
|
|
331
|
-
focused.collapseAll();
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
});
|
|
335
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
336
|
-
id: 'list.collapseAllToFocus',
|
|
337
|
-
weight: 200 ,
|
|
338
|
-
when: WorkbenchListFocusContextKey,
|
|
339
|
-
handler: accessor => {
|
|
340
|
-
const focused = accessor.get(IListService).lastFocusedList;
|
|
341
|
-
const fakeKeyboardEvent = getSelectionKeyboardEvent('keydown', true);
|
|
342
|
-
if (focused instanceof ObjectTree || focused instanceof DataTree || focused instanceof AsyncDataTree) {
|
|
343
|
-
const tree = focused;
|
|
344
|
-
const focus = tree.getFocus();
|
|
345
|
-
if (focus.length > 0) {
|
|
346
|
-
tree.collapse(focus[0], true);
|
|
347
|
-
}
|
|
348
|
-
tree.setSelection(focus, fakeKeyboardEvent);
|
|
349
|
-
tree.setAnchor(focus[0]);
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
});
|
|
353
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
354
|
-
id: 'list.focusParent',
|
|
355
|
-
weight: 200 ,
|
|
356
|
-
when: WorkbenchListFocusContextKey,
|
|
357
|
-
handler: (accessor) => {
|
|
358
|
-
const widget = accessor.get(IListService).lastFocusedList;
|
|
359
|
-
if (!widget || !(widget instanceof ObjectTree || widget instanceof DataTree || widget instanceof AsyncDataTree)) {
|
|
360
|
-
return;
|
|
361
|
-
}
|
|
362
|
-
const tree = widget;
|
|
363
|
-
const focusedElements = tree.getFocus();
|
|
364
|
-
if (focusedElements.length === 0) {
|
|
365
|
-
return;
|
|
366
|
-
}
|
|
367
|
-
const focus = focusedElements[0];
|
|
368
|
-
const parent = tree.getParentElement(focus);
|
|
369
|
-
if (parent) {
|
|
370
|
-
navigate(widget, widget => {
|
|
371
|
-
const fakeKeyboardEvent = ( new KeyboardEvent('keydown'));
|
|
372
|
-
widget.setFocus([parent], fakeKeyboardEvent);
|
|
373
|
-
});
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
});
|
|
377
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
378
|
-
id: 'list.expand',
|
|
379
|
-
weight: 200 ,
|
|
380
|
-
when: ( ContextKeyExpr.and(WorkbenchListFocusContextKey, ( ContextKeyExpr.or(WorkbenchTreeElementCanExpand, WorkbenchTreeElementHasChild)))),
|
|
381
|
-
primary: 17 ,
|
|
382
|
-
handler: (accessor) => {
|
|
383
|
-
const widget = accessor.get(IListService).lastFocusedList;
|
|
384
|
-
if (!widget) {
|
|
385
|
-
return;
|
|
386
|
-
}
|
|
387
|
-
if (widget instanceof ObjectTree || widget instanceof DataTree) {
|
|
388
|
-
const focusedElements = widget.getFocus();
|
|
389
|
-
if (focusedElements.length === 0) {
|
|
390
|
-
return;
|
|
391
|
-
}
|
|
392
|
-
const focus = focusedElements[0];
|
|
393
|
-
if (!widget.expand(focus)) {
|
|
394
|
-
const child = widget.getFirstElementChild(focus);
|
|
395
|
-
if (child) {
|
|
396
|
-
const node = widget.getNode(child);
|
|
397
|
-
if (node.visible) {
|
|
398
|
-
navigate(widget, widget => {
|
|
399
|
-
const fakeKeyboardEvent = ( new KeyboardEvent('keydown'));
|
|
400
|
-
widget.setFocus([child], fakeKeyboardEvent);
|
|
401
|
-
});
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
else if (widget instanceof AsyncDataTree) {
|
|
407
|
-
const focusedElements = widget.getFocus();
|
|
408
|
-
if (focusedElements.length === 0) {
|
|
409
|
-
return;
|
|
410
|
-
}
|
|
411
|
-
const focus = focusedElements[0];
|
|
412
|
-
widget.expand(focus).then(didExpand => {
|
|
413
|
-
if (focus && !didExpand) {
|
|
414
|
-
const child = widget.getFirstElementChild(focus);
|
|
415
|
-
if (child) {
|
|
416
|
-
const node = widget.getNode(child);
|
|
417
|
-
if (node.visible) {
|
|
418
|
-
navigate(widget, widget => {
|
|
419
|
-
const fakeKeyboardEvent = ( new KeyboardEvent('keydown'));
|
|
420
|
-
widget.setFocus([child], fakeKeyboardEvent);
|
|
421
|
-
});
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
});
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
});
|
|
429
|
-
function selectElement(accessor, retainCurrentFocus) {
|
|
430
|
-
const focused = accessor.get(IListService).lastFocusedList;
|
|
431
|
-
const fakeKeyboardEvent = getSelectionKeyboardEvent('keydown', retainCurrentFocus);
|
|
432
|
-
if (focused instanceof List || focused instanceof PagedList || focused instanceof Table) {
|
|
433
|
-
const list = focused;
|
|
434
|
-
list.setAnchor(list.getFocus()[0]);
|
|
435
|
-
list.setSelection(list.getFocus(), fakeKeyboardEvent);
|
|
436
|
-
}
|
|
437
|
-
else if (focused instanceof ObjectTree || focused instanceof DataTree || focused instanceof AsyncDataTree) {
|
|
438
|
-
const tree = focused;
|
|
439
|
-
const focus = tree.getFocus();
|
|
440
|
-
if (focus.length > 0) {
|
|
441
|
-
let toggleCollapsed = true;
|
|
442
|
-
if (tree.expandOnlyOnTwistieClick === true) {
|
|
443
|
-
toggleCollapsed = false;
|
|
444
|
-
}
|
|
445
|
-
else if (typeof tree.expandOnlyOnTwistieClick !== 'boolean' && tree.expandOnlyOnTwistieClick(focus[0])) {
|
|
446
|
-
toggleCollapsed = false;
|
|
447
|
-
}
|
|
448
|
-
if (toggleCollapsed) {
|
|
449
|
-
tree.toggleCollapsed(focus[0]);
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
tree.setAnchor(focus[0]);
|
|
453
|
-
tree.setSelection(focus, fakeKeyboardEvent);
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
457
|
-
id: 'list.select',
|
|
458
|
-
weight: 200 ,
|
|
459
|
-
when: WorkbenchListFocusContextKey,
|
|
460
|
-
primary: 3 ,
|
|
461
|
-
mac: {
|
|
462
|
-
primary: 3 ,
|
|
463
|
-
secondary: [2048 | 18 ]
|
|
464
|
-
},
|
|
465
|
-
handler: (accessor) => {
|
|
466
|
-
selectElement(accessor, false);
|
|
467
|
-
}
|
|
468
|
-
});
|
|
469
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
470
|
-
id: 'list.stickyScrollselect',
|
|
471
|
-
weight: 200 + 50,
|
|
472
|
-
when: WorkbenchTreeStickyScrollFocused,
|
|
473
|
-
primary: 3 ,
|
|
474
|
-
mac: {
|
|
475
|
-
primary: 3 ,
|
|
476
|
-
secondary: [2048 | 18 ]
|
|
477
|
-
},
|
|
478
|
-
handler: (accessor) => {
|
|
479
|
-
const widget = accessor.get(IListService).lastFocusedList;
|
|
480
|
-
if (!widget || !(widget instanceof ObjectTree || widget instanceof DataTree || widget instanceof AsyncDataTree)) {
|
|
481
|
-
return;
|
|
482
|
-
}
|
|
483
|
-
revealFocusedStickyScroll(widget, focus => widget.setSelection([focus]));
|
|
484
|
-
}
|
|
485
|
-
});
|
|
486
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
487
|
-
id: 'list.selectAndPreserveFocus',
|
|
488
|
-
weight: 200 ,
|
|
489
|
-
when: WorkbenchListFocusContextKey,
|
|
490
|
-
handler: accessor => {
|
|
491
|
-
selectElement(accessor, true);
|
|
492
|
-
}
|
|
493
|
-
});
|
|
494
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
495
|
-
id: 'list.selectAll',
|
|
496
|
-
weight: 200 ,
|
|
497
|
-
when: ( ContextKeyExpr.and(WorkbenchListFocusContextKey, WorkbenchListSupportsMultiSelectContextKey)),
|
|
498
|
-
primary: 2048 | 31 ,
|
|
499
|
-
handler: (accessor) => {
|
|
500
|
-
const focused = accessor.get(IListService).lastFocusedList;
|
|
501
|
-
if (focused instanceof List || focused instanceof PagedList || focused instanceof Table) {
|
|
502
|
-
const list = focused;
|
|
503
|
-
const fakeKeyboardEvent = ( new KeyboardEvent('keydown'));
|
|
504
|
-
list.setSelection(range(list.length), fakeKeyboardEvent);
|
|
505
|
-
}
|
|
506
|
-
else if (focused instanceof ObjectTree || focused instanceof DataTree || focused instanceof AsyncDataTree) {
|
|
507
|
-
const tree = focused;
|
|
508
|
-
const focus = tree.getFocus();
|
|
509
|
-
const selection = tree.getSelection();
|
|
510
|
-
let start = undefined;
|
|
511
|
-
if (focus.length > 0 && (selection.length === 0 || !selection.includes(focus[0]))) {
|
|
512
|
-
start = focus[0];
|
|
513
|
-
}
|
|
514
|
-
if (!start && selection.length > 0) {
|
|
515
|
-
start = selection[0];
|
|
516
|
-
}
|
|
517
|
-
let scope = undefined;
|
|
518
|
-
if (!start) {
|
|
519
|
-
scope = undefined;
|
|
520
|
-
}
|
|
521
|
-
else {
|
|
522
|
-
scope = tree.getParentElement(start);
|
|
523
|
-
}
|
|
524
|
-
const newSelection = [];
|
|
525
|
-
const visit = (node) => {
|
|
526
|
-
for (const child of node.children) {
|
|
527
|
-
if (child.visible) {
|
|
528
|
-
newSelection.push(child.element);
|
|
529
|
-
if (!child.collapsed) {
|
|
530
|
-
visit(child);
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
};
|
|
535
|
-
visit(tree.getNode(scope));
|
|
536
|
-
if (scope && selection.length === newSelection.length) {
|
|
537
|
-
newSelection.unshift(scope);
|
|
538
|
-
}
|
|
539
|
-
const fakeKeyboardEvent = ( new KeyboardEvent('keydown'));
|
|
540
|
-
tree.setSelection(newSelection, fakeKeyboardEvent);
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
});
|
|
544
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
545
|
-
id: 'list.toggleSelection',
|
|
546
|
-
weight: 200 ,
|
|
547
|
-
when: WorkbenchListFocusContextKey,
|
|
548
|
-
primary: 2048 | 1024 | 3 ,
|
|
549
|
-
handler: (accessor) => {
|
|
550
|
-
const widget = accessor.get(IListService).lastFocusedList;
|
|
551
|
-
if (!widget) {
|
|
552
|
-
return;
|
|
553
|
-
}
|
|
554
|
-
const focus = widget.getFocus();
|
|
555
|
-
if (focus.length === 0) {
|
|
556
|
-
return;
|
|
557
|
-
}
|
|
558
|
-
const selection = widget.getSelection();
|
|
559
|
-
const index = selection.indexOf(focus[0]);
|
|
560
|
-
if (index > -1) {
|
|
561
|
-
widget.setSelection([...selection.slice(0, index), ...selection.slice(index + 1)]);
|
|
562
|
-
}
|
|
563
|
-
else {
|
|
564
|
-
widget.setSelection([...selection, focus[0]]);
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
});
|
|
568
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
569
|
-
id: 'list.toggleExpand',
|
|
570
|
-
weight: 200 ,
|
|
571
|
-
when: WorkbenchListFocusContextKey,
|
|
572
|
-
primary: 10 ,
|
|
573
|
-
handler: (accessor) => {
|
|
574
|
-
const focused = accessor.get(IListService).lastFocusedList;
|
|
575
|
-
if (focused instanceof ObjectTree || focused instanceof DataTree || focused instanceof AsyncDataTree) {
|
|
576
|
-
const tree = focused;
|
|
577
|
-
const focus = tree.getFocus();
|
|
578
|
-
if (focus.length > 0 && tree.isCollapsible(focus[0])) {
|
|
579
|
-
tree.toggleCollapsed(focus[0]);
|
|
580
|
-
return;
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
selectElement(accessor, true);
|
|
584
|
-
}
|
|
585
|
-
});
|
|
586
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
587
|
-
id: 'list.stickyScrolltoggleExpand',
|
|
588
|
-
weight: 200 + 50,
|
|
589
|
-
when: WorkbenchTreeStickyScrollFocused,
|
|
590
|
-
primary: 10 ,
|
|
591
|
-
handler: (accessor) => {
|
|
592
|
-
const widget = accessor.get(IListService).lastFocusedList;
|
|
593
|
-
if (!widget || !(widget instanceof ObjectTree || widget instanceof DataTree || widget instanceof AsyncDataTree)) {
|
|
594
|
-
return;
|
|
595
|
-
}
|
|
596
|
-
revealFocusedStickyScroll(widget);
|
|
597
|
-
}
|
|
598
|
-
});
|
|
599
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
600
|
-
id: 'list.clear',
|
|
601
|
-
weight: 200 ,
|
|
602
|
-
when: ( ContextKeyExpr.and(WorkbenchListFocusContextKey, WorkbenchListHasSelectionOrFocus)),
|
|
603
|
-
primary: 9 ,
|
|
604
|
-
handler: (accessor) => {
|
|
605
|
-
const widget = accessor.get(IListService).lastFocusedList;
|
|
606
|
-
if (!widget) {
|
|
607
|
-
return;
|
|
608
|
-
}
|
|
609
|
-
const selection = widget.getSelection();
|
|
610
|
-
const fakeKeyboardEvent = ( new KeyboardEvent('keydown'));
|
|
611
|
-
if (selection.length > 1) {
|
|
612
|
-
const useSelectionNavigation = WorkbenchListSelectionNavigation.getValue(widget.contextKeyService);
|
|
613
|
-
if (useSelectionNavigation) {
|
|
614
|
-
const focus = widget.getFocus();
|
|
615
|
-
widget.setSelection([focus[0]], fakeKeyboardEvent);
|
|
616
|
-
}
|
|
617
|
-
else {
|
|
618
|
-
widget.setSelection([], fakeKeyboardEvent);
|
|
619
|
-
}
|
|
620
|
-
}
|
|
621
|
-
else {
|
|
622
|
-
widget.setSelection([], fakeKeyboardEvent);
|
|
623
|
-
widget.setFocus([], fakeKeyboardEvent);
|
|
624
|
-
}
|
|
625
|
-
widget.setAnchor(undefined);
|
|
626
|
-
}
|
|
627
|
-
});
|
|
628
|
-
CommandsRegistry.registerCommand({
|
|
629
|
-
id: 'list.triggerTypeNavigation',
|
|
630
|
-
handler: (accessor) => {
|
|
631
|
-
const widget = accessor.get(IListService).lastFocusedList;
|
|
632
|
-
widget?.triggerTypeNavigation();
|
|
633
|
-
}
|
|
634
|
-
});
|
|
635
|
-
CommandsRegistry.registerCommand({
|
|
636
|
-
id: 'list.toggleFindMode',
|
|
637
|
-
handler: (accessor) => {
|
|
638
|
-
const widget = accessor.get(IListService).lastFocusedList;
|
|
639
|
-
if (widget instanceof AbstractTree || widget instanceof AsyncDataTree) {
|
|
640
|
-
const tree = widget;
|
|
641
|
-
tree.findMode = tree.findMode === TreeFindMode.Filter ? TreeFindMode.Highlight : TreeFindMode.Filter;
|
|
642
|
-
}
|
|
643
|
-
}
|
|
644
|
-
});
|
|
645
|
-
CommandsRegistry.registerCommand({
|
|
646
|
-
id: 'list.toggleFindMatchType',
|
|
647
|
-
handler: (accessor) => {
|
|
648
|
-
const widget = accessor.get(IListService).lastFocusedList;
|
|
649
|
-
if (widget instanceof AbstractTree || widget instanceof AsyncDataTree) {
|
|
650
|
-
const tree = widget;
|
|
651
|
-
tree.findMatchType = tree.findMatchType === TreeFindMatchType.Contiguous ? TreeFindMatchType.Fuzzy : TreeFindMatchType.Contiguous;
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
});
|
|
655
|
-
CommandsRegistry.registerCommandAlias('list.toggleKeyboardNavigation', 'list.triggerTypeNavigation');
|
|
656
|
-
CommandsRegistry.registerCommandAlias('list.toggleFilterOnType', 'list.toggleFindMode');
|
|
657
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
658
|
-
id: 'list.find',
|
|
659
|
-
weight: 200 ,
|
|
660
|
-
when: ( ContextKeyExpr.and(RawWorkbenchListFocusContextKey, WorkbenchListSupportsFind)),
|
|
661
|
-
primary: 2048 | 36 ,
|
|
662
|
-
secondary: [61 ],
|
|
663
|
-
handler: (accessor) => {
|
|
664
|
-
const widget = accessor.get(IListService).lastFocusedList;
|
|
665
|
-
if (widget instanceof List || widget instanceof PagedList || widget instanceof Table) ;
|
|
666
|
-
else if (widget instanceof AbstractTree || widget instanceof AsyncDataTree) {
|
|
667
|
-
const tree = widget;
|
|
668
|
-
tree.openFind();
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
});
|
|
672
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
673
|
-
id: 'list.closeFind',
|
|
674
|
-
weight: 200 ,
|
|
675
|
-
when: ( ContextKeyExpr.and(RawWorkbenchListFocusContextKey, WorkbenchTreeFindOpen)),
|
|
676
|
-
primary: 9 ,
|
|
677
|
-
handler: (accessor) => {
|
|
678
|
-
const widget = accessor.get(IListService).lastFocusedList;
|
|
679
|
-
if (widget instanceof AbstractTree || widget instanceof AsyncDataTree) {
|
|
680
|
-
const tree = widget;
|
|
681
|
-
tree.closeFind();
|
|
682
|
-
}
|
|
683
|
-
}
|
|
684
|
-
});
|
|
685
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
686
|
-
id: 'list.scrollUp',
|
|
687
|
-
weight: 200 ,
|
|
688
|
-
when: ( ContextKeyExpr.and(WorkbenchListFocusContextKey, WorkbenchListScrollAtTopContextKey?.negate())),
|
|
689
|
-
primary: 2048 | 16 ,
|
|
690
|
-
handler: accessor => {
|
|
691
|
-
const focused = accessor.get(IListService).lastFocusedList;
|
|
692
|
-
if (!focused) {
|
|
693
|
-
return;
|
|
694
|
-
}
|
|
695
|
-
focused.scrollTop -= 10;
|
|
696
|
-
}
|
|
697
|
-
});
|
|
698
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
699
|
-
id: 'list.scrollDown',
|
|
700
|
-
weight: 200 ,
|
|
701
|
-
when: ( ContextKeyExpr.and(
|
|
702
|
-
WorkbenchListFocusContextKey,
|
|
703
|
-
WorkbenchListScrollAtBottomContextKey?.negate()
|
|
704
|
-
)),
|
|
705
|
-
primary: 2048 | 18 ,
|
|
706
|
-
handler: accessor => {
|
|
707
|
-
const focused = accessor.get(IListService).lastFocusedList;
|
|
708
|
-
if (!focused) {
|
|
709
|
-
return;
|
|
710
|
-
}
|
|
711
|
-
focused.scrollTop += 10;
|
|
712
|
-
}
|
|
713
|
-
});
|
|
714
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
715
|
-
id: 'list.scrollLeft',
|
|
716
|
-
weight: 200 ,
|
|
717
|
-
when: WorkbenchListFocusContextKey,
|
|
718
|
-
handler: accessor => {
|
|
719
|
-
const focused = accessor.get(IListService).lastFocusedList;
|
|
720
|
-
if (!focused) {
|
|
721
|
-
return;
|
|
722
|
-
}
|
|
723
|
-
focused.scrollLeft -= 10;
|
|
724
|
-
}
|
|
725
|
-
});
|
|
726
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
727
|
-
id: 'list.scrollRight',
|
|
728
|
-
weight: 200 ,
|
|
729
|
-
when: WorkbenchListFocusContextKey,
|
|
730
|
-
handler: accessor => {
|
|
731
|
-
const focused = accessor.get(IListService).lastFocusedList;
|
|
732
|
-
if (!focused) {
|
|
733
|
-
return;
|
|
734
|
-
}
|
|
735
|
-
focused.scrollLeft += 10;
|
|
736
|
-
}
|
|
737
|
-
});
|
|
738
|
-
registerAction2(class ToggleStickyScroll extends Action2 {
|
|
739
|
-
constructor() {
|
|
740
|
-
super({
|
|
741
|
-
id: 'tree.toggleStickyScroll',
|
|
742
|
-
title: {
|
|
743
|
-
value: ( localizeWithPath(
|
|
744
|
-
'vs/workbench/browser/actions/listCommands',
|
|
745
|
-
'toggleTreeStickyScroll',
|
|
746
|
-
"Toggle Tree Sticky Scroll"
|
|
747
|
-
)),
|
|
748
|
-
mnemonicTitle: ( localizeWithPath(
|
|
749
|
-
'vs/workbench/browser/actions/listCommands',
|
|
750
|
-
{ key: 'mitoggleTreeStickyScroll', comment: ['&& denotes a mnemonic'] },
|
|
751
|
-
"&&Toggle Tree Sticky Scroll"
|
|
752
|
-
)),
|
|
753
|
-
original: 'Toggle Tree Sticky Scroll',
|
|
754
|
-
},
|
|
755
|
-
category: 'View',
|
|
756
|
-
f1: true
|
|
757
|
-
});
|
|
758
|
-
}
|
|
759
|
-
run(accessor) {
|
|
760
|
-
const configurationService = accessor.get(IConfigurationService);
|
|
761
|
-
const newValue = !configurationService.getValue('workbench.tree.enableStickyScroll');
|
|
762
|
-
configurationService.updateValue('workbench.tree.enableStickyScroll', newValue);
|
|
763
|
-
}
|
|
764
|
-
});
|