@codingame/monaco-vscode-views-service-override 2.0.3 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +11 -11
- package/tools/editor.js +14 -0
- package/views.js +12 -5
- package/vscode/src/vs/base/common/codicons.d.ts +5 -0
- package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +2 -2
- package/vscode/src/vs/workbench/browser/actions/listCommands.js +160 -4
- package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.js +14 -19
- package/vscode/src/vs/workbench/browser/parts/auxiliarybar/media/auxiliaryBarPart.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.js +59 -21
- package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +77 -45
- package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +23 -1
- package/vscode/src/vs/workbench/browser/parts/editor/editorPart.js +77 -45
- package/vscode/src/vs/workbench/browser/parts/editor/editorParts.js +131 -5
- package/vscode/src/vs/workbench/browser/parts/media/paneCompositePart.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/paneCompositeBar.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/paneCompositePart.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/sidebar/media/sidebarpart.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.d.ts +1 -3
- package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.js +8 -16
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +13 -13
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditor.js +8 -3
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditorTracker.js +1 -1
- package/vscode/src/vs/workbench/contrib/files/browser/explorerService.js +4 -0
- package/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/files/browser/fileCommands.js +3 -4
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/files/browser/workspaceWatcher.js +1 -1
- package/vscode/src/vs/workbench/contrib/files/common/dirtyFilesIndicator.js +1 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.js +17 -16
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/devCommands.js +4 -4
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.js +1 -1
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +13 -13
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +2 -2
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewPane.js +2 -1
- package/vscode/src/vs/workbench/services/activity/browser/activityService.js +1 -0
- package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +18 -4
- package/vscode/src/vs/workbench/services/history/browser/historyService.js +2 -2
- package/vscode/src/vs/workbench/services/progress/browser/progressService.js +15 -4
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorHandler.js +2 -2
- package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +6 -2
- package/vscode/src/vs/base/browser/ui/breadcrumbs/breadcrumbsWidget.css.js +0 -6
- package/vscode/src/vs/base/browser/ui/breadcrumbs/breadcrumbsWidget.js +0 -290
- package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsControl.js +0 -801
- package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsModel.js +0 -142
- package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsPicker.js +0 -412
- package/vscode/src/vs/workbench/browser/parts/editor/editorGroupView.js +0 -1315
- package/vscode/src/vs/workbench/browser/parts/editor/editorGroupWatermark.js +0 -186
- package/vscode/src/vs/workbench/browser/parts/editor/editorPanes.js +0 -346
- package/vscode/src/vs/workbench/browser/parts/editor/editorTitleControl.js +0 -154
- package/vscode/src/vs/workbench/browser/parts/editor/media/breadcrumbscontrol.css.js +0 -6
- package/vscode/src/vs/workbench/browser/parts/editor/media/editorgroupview.css.js +0 -6
- package/vscode/src/vs/workbench/browser/parts/editor/media/editortitlecontrol.css.js +0 -6
- package/vscode/src/vs/workbench/browser/parts/editor/media/multieditortabscontrol.css.js +0 -6
- package/vscode/src/vs/workbench/browser/parts/editor/media/singleeditortabscontrol.css.js +0 -6
- package/vscode/src/vs/workbench/browser/parts/editor/multiEditorTabsControl.js +0 -1623
- package/vscode/src/vs/workbench/browser/parts/editor/multiRowEditorTabsControl.js +0 -152
- package/vscode/src/vs/workbench/browser/parts/editor/noEditorTabsControl.js +0 -54
- package/vscode/src/vs/workbench/browser/parts/editor/singleEditorTabsControl.js +0 -259
- package/vscode/src/vs/workbench/common/editor/filteredEditorGroupModel.js +0 -109
- package/vscode/src/vs/workbench/services/hover/browser/hoverService.js +0 -195
- package/vscode/src/vs/workbench/services/hover/browser/hoverWidget.js +0 -528
- package/vscode/src/vs/workbench/services/hover/browser/media/hover.css.js +0 -6
|
@@ -1,801 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { append, trackFocus, getWindow, getDomNodePagePosition, $ } from 'vscode/vscode/vs/base/browser/dom';
|
|
3
|
-
import { StandardMouseEvent } from 'vscode/vscode/vs/base/browser/mouseEvent';
|
|
4
|
-
import { BreadcrumbsWidget, BreadcrumbsItem } from '../../../../base/browser/ui/breadcrumbs/breadcrumbsWidget.js';
|
|
5
|
-
import { tail } from 'vscode/vscode/vs/base/common/arrays';
|
|
6
|
-
import { timeout } from 'vscode/vscode/vs/base/common/async';
|
|
7
|
-
import { DisposableStore, MutableDisposable, toDisposable, combinedDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
8
|
-
import { extUri } from 'vscode/vscode/vs/base/common/resources';
|
|
9
|
-
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
10
|
-
import './media/breadcrumbscontrol.css.js';
|
|
11
|
-
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
12
|
-
import { registerAction2, Action2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
13
|
-
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
14
|
-
import { RawContextKey, ContextKeyExpr, IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
15
|
-
import { IContextViewService } from 'vscode/vscode/vs/platform/contextview/browser/contextView';
|
|
16
|
-
import { FileKind, IFileService } from 'vscode/vscode/vs/platform/files/common/files';
|
|
17
|
-
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
18
|
-
import { KeybindingsRegistry } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
|
|
19
|
-
import { WorkbenchListFocusContextKey, IListService, WorkbenchDataTree, WorkbenchAsyncDataTree } from 'vscode/vscode/vs/platform/list/browser/listService';
|
|
20
|
-
import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput';
|
|
21
|
-
import { ResourceLabels, DEFAULT_LABELS_CONTAINER } from 'vscode/vscode/vs/workbench/browser/labels';
|
|
22
|
-
import { BreadcrumbsConfig, IBreadcrumbsService } from 'vscode/vscode/vs/workbench/browser/parts/editor/breadcrumbs';
|
|
23
|
-
import { BreadcrumbsModel, OutlineElement2, FileElement } from './breadcrumbsModel.js';
|
|
24
|
-
import { BreadcrumbsFilePicker, BreadcrumbsOutlinePicker } from './breadcrumbsPicker.js';
|
|
25
|
-
import { EditorResourceAccessor, SideBySideEditor } from 'vscode/vscode/vs/workbench/common/editor';
|
|
26
|
-
import { SIDE_GROUP, ACTIVE_GROUP, IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
27
|
-
import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService';
|
|
28
|
-
import { PixelRatio } from 'vscode/vscode/vs/base/browser/browser';
|
|
29
|
-
import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label';
|
|
30
|
-
import { Categories } from 'vscode/vscode/vs/platform/action/common/actionCommonCategories';
|
|
31
|
-
import { registerIcon } from 'vscode/vscode/vs/platform/theme/common/iconRegistry';
|
|
32
|
-
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
33
|
-
import { defaultBreadcrumbsWidgetStyles } from 'vscode/vscode/vs/platform/theme/browser/defaultStyles';
|
|
34
|
-
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
35
|
-
|
|
36
|
-
var BreadcrumbsControl_1;
|
|
37
|
-
class OutlineItem extends BreadcrumbsItem {
|
|
38
|
-
constructor(model, element, options) {
|
|
39
|
-
super();
|
|
40
|
-
this.model = model;
|
|
41
|
-
this.element = element;
|
|
42
|
-
this.options = options;
|
|
43
|
-
this._disposables = ( new DisposableStore());
|
|
44
|
-
}
|
|
45
|
-
dispose() {
|
|
46
|
-
this._disposables.dispose();
|
|
47
|
-
}
|
|
48
|
-
equals(other) {
|
|
49
|
-
if (!(other instanceof OutlineItem)) {
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
return this.element.element === other.element.element &&
|
|
53
|
-
this.options.showFileIcons === other.options.showFileIcons &&
|
|
54
|
-
this.options.showSymbolIcons === other.options.showSymbolIcons;
|
|
55
|
-
}
|
|
56
|
-
render(container) {
|
|
57
|
-
const { element, outline } = this.element;
|
|
58
|
-
if (element === outline) {
|
|
59
|
-
const element = $('span', undefined, '…');
|
|
60
|
-
container.appendChild(element);
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
const templateId = outline.config.delegate.getTemplateId(element);
|
|
64
|
-
const renderer = outline.config.renderers.find(renderer => renderer.templateId === templateId);
|
|
65
|
-
if (!renderer) {
|
|
66
|
-
container.innerText = '<<NO RENDERER>>';
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
const template = renderer.renderTemplate(container);
|
|
70
|
-
renderer.renderElement({
|
|
71
|
-
element,
|
|
72
|
-
children: [],
|
|
73
|
-
depth: 0,
|
|
74
|
-
visibleChildrenCount: 0,
|
|
75
|
-
visibleChildIndex: 0,
|
|
76
|
-
collapsible: false,
|
|
77
|
-
collapsed: false,
|
|
78
|
-
visible: true,
|
|
79
|
-
filterData: undefined
|
|
80
|
-
}, 0, template, undefined);
|
|
81
|
-
this._disposables.add(toDisposable(() => { renderer.disposeTemplate(template); }));
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
class FileItem extends BreadcrumbsItem {
|
|
85
|
-
constructor(model, element, options, _labels) {
|
|
86
|
-
super();
|
|
87
|
-
this.model = model;
|
|
88
|
-
this.element = element;
|
|
89
|
-
this.options = options;
|
|
90
|
-
this._labels = _labels;
|
|
91
|
-
this._disposables = ( new DisposableStore());
|
|
92
|
-
}
|
|
93
|
-
dispose() {
|
|
94
|
-
this._disposables.dispose();
|
|
95
|
-
}
|
|
96
|
-
equals(other) {
|
|
97
|
-
if (!(other instanceof FileItem)) {
|
|
98
|
-
return false;
|
|
99
|
-
}
|
|
100
|
-
return (extUri.isEqual(this.element.uri, other.element.uri) &&
|
|
101
|
-
this.options.showFileIcons === other.options.showFileIcons &&
|
|
102
|
-
this.options.showSymbolIcons === other.options.showSymbolIcons);
|
|
103
|
-
}
|
|
104
|
-
render(container) {
|
|
105
|
-
const label = this._labels.create(container);
|
|
106
|
-
label.setFile(this.element.uri, {
|
|
107
|
-
hidePath: true,
|
|
108
|
-
hideIcon: this.element.kind === FileKind.FOLDER || !this.options.showFileIcons,
|
|
109
|
-
fileKind: this.element.kind,
|
|
110
|
-
fileDecorations: { colors: this.options.showDecorationColors, badges: false },
|
|
111
|
-
});
|
|
112
|
-
container.classList.add(FileKind[this.element.kind].toLowerCase());
|
|
113
|
-
this._disposables.add(label);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
const separatorIcon = registerIcon('breadcrumb-separator', Codicon.chevronRight, ( localizeWithPath(
|
|
117
|
-
'vs/workbench/browser/parts/editor/breadcrumbsControl',
|
|
118
|
-
'separatorIcon',
|
|
119
|
-
'Icon for the separator in the breadcrumbs.'
|
|
120
|
-
)));
|
|
121
|
-
let BreadcrumbsControl = class BreadcrumbsControl {
|
|
122
|
-
static { BreadcrumbsControl_1 = this; }
|
|
123
|
-
static { this.HEIGHT = 22; }
|
|
124
|
-
static { this.SCROLLBAR_SIZES = {
|
|
125
|
-
default: 3,
|
|
126
|
-
large: 8
|
|
127
|
-
}; }
|
|
128
|
-
static { this.Payload_Reveal = {}; }
|
|
129
|
-
static { this.Payload_RevealAside = {}; }
|
|
130
|
-
static { this.Payload_Pick = {}; }
|
|
131
|
-
static { this.CK_BreadcrumbsPossible = ( new RawContextKey('breadcrumbsPossible', false, ( localizeWithPath(
|
|
132
|
-
'vs/workbench/browser/parts/editor/breadcrumbsControl',
|
|
133
|
-
'breadcrumbsPossible',
|
|
134
|
-
"Whether the editor can show breadcrumbs"
|
|
135
|
-
)))); }
|
|
136
|
-
static { this.CK_BreadcrumbsVisible = ( new RawContextKey('breadcrumbsVisible', false, ( localizeWithPath(
|
|
137
|
-
'vs/workbench/browser/parts/editor/breadcrumbsControl',
|
|
138
|
-
'breadcrumbsVisible',
|
|
139
|
-
"Whether breadcrumbs are currently visible"
|
|
140
|
-
)))); }
|
|
141
|
-
static { this.CK_BreadcrumbsActive = ( new RawContextKey('breadcrumbsActive', false, ( localizeWithPath(
|
|
142
|
-
'vs/workbench/browser/parts/editor/breadcrumbsControl',
|
|
143
|
-
'breadcrumbsActive',
|
|
144
|
-
"Whether breadcrumbs have focus"
|
|
145
|
-
)))); }
|
|
146
|
-
get onDidVisibilityChange() { return this._onDidVisibilityChange.event; }
|
|
147
|
-
constructor(container, _options, _editorGroup, _contextKeyService, _contextViewService, _instantiationService, _quickInputService, _fileService, _editorService, _labelService, configurationService, breadcrumbsService) {
|
|
148
|
-
this._options = _options;
|
|
149
|
-
this._editorGroup = _editorGroup;
|
|
150
|
-
this._contextKeyService = _contextKeyService;
|
|
151
|
-
this._contextViewService = _contextViewService;
|
|
152
|
-
this._instantiationService = _instantiationService;
|
|
153
|
-
this._quickInputService = _quickInputService;
|
|
154
|
-
this._fileService = _fileService;
|
|
155
|
-
this._editorService = _editorService;
|
|
156
|
-
this._labelService = _labelService;
|
|
157
|
-
this._disposables = ( new DisposableStore());
|
|
158
|
-
this._breadcrumbsDisposables = ( new DisposableStore());
|
|
159
|
-
this._model = ( new MutableDisposable());
|
|
160
|
-
this._breadcrumbsPickerShowing = false;
|
|
161
|
-
this._onDidVisibilityChange = this._disposables.add(( new Emitter()));
|
|
162
|
-
this.domNode = document.createElement('div');
|
|
163
|
-
this.domNode.classList.add('breadcrumbs-control');
|
|
164
|
-
append(container, this.domNode);
|
|
165
|
-
this._cfUseQuickPick = BreadcrumbsConfig.UseQuickPick.bindTo(configurationService);
|
|
166
|
-
this._cfShowIcons = BreadcrumbsConfig.Icons.bindTo(configurationService);
|
|
167
|
-
this._cfTitleScrollbarSizing = BreadcrumbsConfig.TitleScrollbarSizing.bindTo(configurationService);
|
|
168
|
-
this._labels = this._instantiationService.createInstance(ResourceLabels, DEFAULT_LABELS_CONTAINER);
|
|
169
|
-
const sizing = this._cfTitleScrollbarSizing.getValue() ?? 'default';
|
|
170
|
-
const styles = _options.widgetStyles ?? defaultBreadcrumbsWidgetStyles;
|
|
171
|
-
this._widget = ( new BreadcrumbsWidget(
|
|
172
|
-
this.domNode,
|
|
173
|
-
BreadcrumbsControl_1.SCROLLBAR_SIZES[sizing],
|
|
174
|
-
separatorIcon,
|
|
175
|
-
styles
|
|
176
|
-
));
|
|
177
|
-
this._widget.onDidSelectItem(this._onSelectEvent, this, this._disposables);
|
|
178
|
-
this._widget.onDidFocusItem(this._onFocusEvent, this, this._disposables);
|
|
179
|
-
this._widget.onDidChangeFocus(this._updateCkBreadcrumbsActive, this, this._disposables);
|
|
180
|
-
this._ckBreadcrumbsPossible = BreadcrumbsControl_1.CK_BreadcrumbsPossible.bindTo(this._contextKeyService);
|
|
181
|
-
this._ckBreadcrumbsVisible = BreadcrumbsControl_1.CK_BreadcrumbsVisible.bindTo(this._contextKeyService);
|
|
182
|
-
this._ckBreadcrumbsActive = BreadcrumbsControl_1.CK_BreadcrumbsActive.bindTo(this._contextKeyService);
|
|
183
|
-
this._disposables.add(breadcrumbsService.register(this._editorGroup.id, this._widget));
|
|
184
|
-
this.hide();
|
|
185
|
-
}
|
|
186
|
-
dispose() {
|
|
187
|
-
this._disposables.dispose();
|
|
188
|
-
this._breadcrumbsDisposables.dispose();
|
|
189
|
-
this._ckBreadcrumbsPossible.reset();
|
|
190
|
-
this._ckBreadcrumbsVisible.reset();
|
|
191
|
-
this._ckBreadcrumbsActive.reset();
|
|
192
|
-
this._cfUseQuickPick.dispose();
|
|
193
|
-
this._cfShowIcons.dispose();
|
|
194
|
-
this._widget.dispose();
|
|
195
|
-
this._labels.dispose();
|
|
196
|
-
this.domNode.remove();
|
|
197
|
-
}
|
|
198
|
-
get model() {
|
|
199
|
-
return this._model.value;
|
|
200
|
-
}
|
|
201
|
-
layout(dim) {
|
|
202
|
-
this._widget.layout(dim);
|
|
203
|
-
}
|
|
204
|
-
isHidden() {
|
|
205
|
-
return this.domNode.classList.contains('hidden');
|
|
206
|
-
}
|
|
207
|
-
hide() {
|
|
208
|
-
const wasHidden = this.isHidden();
|
|
209
|
-
this._breadcrumbsDisposables.clear();
|
|
210
|
-
this._ckBreadcrumbsVisible.set(false);
|
|
211
|
-
this.domNode.classList.toggle('hidden', true);
|
|
212
|
-
if (!wasHidden) {
|
|
213
|
-
this._onDidVisibilityChange.fire();
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
show() {
|
|
217
|
-
const wasHidden = this.isHidden();
|
|
218
|
-
this._ckBreadcrumbsVisible.set(true);
|
|
219
|
-
this.domNode.classList.toggle('hidden', false);
|
|
220
|
-
if (wasHidden) {
|
|
221
|
-
this._onDidVisibilityChange.fire();
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
revealLast() {
|
|
225
|
-
this._widget.revealLast();
|
|
226
|
-
}
|
|
227
|
-
update() {
|
|
228
|
-
this._breadcrumbsDisposables.clear();
|
|
229
|
-
const uri = EditorResourceAccessor.getCanonicalUri(this._editorGroup.activeEditor, { supportSideBySide: SideBySideEditor.PRIMARY });
|
|
230
|
-
const wasHidden = this.isHidden();
|
|
231
|
-
if (!uri || !this._fileService.hasProvider(uri)) {
|
|
232
|
-
this._ckBreadcrumbsPossible.set(false);
|
|
233
|
-
if (!wasHidden) {
|
|
234
|
-
this.hide();
|
|
235
|
-
return true;
|
|
236
|
-
}
|
|
237
|
-
else {
|
|
238
|
-
return false;
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
const fileInfoUri = EditorResourceAccessor.getOriginalUri(this._editorGroup.activeEditor, { supportSideBySide: SideBySideEditor.PRIMARY });
|
|
242
|
-
this.show();
|
|
243
|
-
this._ckBreadcrumbsPossible.set(true);
|
|
244
|
-
const model = this._instantiationService.createInstance(BreadcrumbsModel, fileInfoUri ?? uri, this._editorGroup.activeEditorPane);
|
|
245
|
-
this._model.value = model;
|
|
246
|
-
this.domNode.classList.toggle('backslash-path', this._labelService.getSeparator(uri.scheme, uri.authority) === '\\');
|
|
247
|
-
const updateBreadcrumbs = () => {
|
|
248
|
-
this.domNode.classList.toggle('relative-path', model.isRelative());
|
|
249
|
-
const showIcons = this._cfShowIcons.getValue();
|
|
250
|
-
const options = {
|
|
251
|
-
...this._options,
|
|
252
|
-
showFileIcons: this._options.showFileIcons && showIcons,
|
|
253
|
-
showSymbolIcons: this._options.showSymbolIcons && showIcons
|
|
254
|
-
};
|
|
255
|
-
const items = ( model.getElements().map(element => element instanceof FileElement ? ( new FileItem(model, element, options, this._labels)) : ( new OutlineItem(model, element, options))));
|
|
256
|
-
if (items.length === 0) {
|
|
257
|
-
this._widget.setEnabled(false);
|
|
258
|
-
this._widget.setItems([new (class extends BreadcrumbsItem {
|
|
259
|
-
render(container) {
|
|
260
|
-
container.innerText = ( localizeWithPath(
|
|
261
|
-
'vs/workbench/browser/parts/editor/breadcrumbsControl',
|
|
262
|
-
'empty',
|
|
263
|
-
"no elements"
|
|
264
|
-
));
|
|
265
|
-
}
|
|
266
|
-
equals(other) {
|
|
267
|
-
return other === this;
|
|
268
|
-
}
|
|
269
|
-
})]);
|
|
270
|
-
}
|
|
271
|
-
else {
|
|
272
|
-
this._widget.setEnabled(true);
|
|
273
|
-
this._widget.setItems(items);
|
|
274
|
-
this._widget.reveal(items[items.length - 1]);
|
|
275
|
-
}
|
|
276
|
-
};
|
|
277
|
-
const listener = model.onDidUpdate(updateBreadcrumbs);
|
|
278
|
-
const configListener = this._cfShowIcons.onDidChange(updateBreadcrumbs);
|
|
279
|
-
updateBreadcrumbs();
|
|
280
|
-
this._breadcrumbsDisposables.clear();
|
|
281
|
-
this._breadcrumbsDisposables.add(listener);
|
|
282
|
-
this._breadcrumbsDisposables.add(toDisposable(() => this._model.clear()));
|
|
283
|
-
this._breadcrumbsDisposables.add(configListener);
|
|
284
|
-
this._breadcrumbsDisposables.add(toDisposable(() => this._widget.setItems([])));
|
|
285
|
-
const updateScrollbarSizing = () => {
|
|
286
|
-
const sizing = this._cfTitleScrollbarSizing.getValue() ?? 'default';
|
|
287
|
-
this._widget.setHorizontalScrollbarSize(BreadcrumbsControl_1.SCROLLBAR_SIZES[sizing]);
|
|
288
|
-
};
|
|
289
|
-
updateScrollbarSizing();
|
|
290
|
-
const updateScrollbarSizeListener = this._cfTitleScrollbarSizing.onDidChange(updateScrollbarSizing);
|
|
291
|
-
this._breadcrumbsDisposables.add(updateScrollbarSizeListener);
|
|
292
|
-
this._breadcrumbsDisposables.add({
|
|
293
|
-
dispose: () => {
|
|
294
|
-
if (this._breadcrumbsPickerShowing) {
|
|
295
|
-
this._contextViewService.hideContextView({ source: this });
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
});
|
|
299
|
-
return wasHidden !== this.isHidden();
|
|
300
|
-
}
|
|
301
|
-
_onFocusEvent(event) {
|
|
302
|
-
if (event.item && this._breadcrumbsPickerShowing) {
|
|
303
|
-
this._breadcrumbsPickerIgnoreOnceItem = undefined;
|
|
304
|
-
this._widget.setSelection(event.item);
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
_onSelectEvent(event) {
|
|
308
|
-
if (!event.item) {
|
|
309
|
-
return;
|
|
310
|
-
}
|
|
311
|
-
if (event.item === this._breadcrumbsPickerIgnoreOnceItem) {
|
|
312
|
-
this._breadcrumbsPickerIgnoreOnceItem = undefined;
|
|
313
|
-
this._widget.setFocused(undefined);
|
|
314
|
-
this._widget.setSelection(undefined);
|
|
315
|
-
return;
|
|
316
|
-
}
|
|
317
|
-
const { element } = event.item;
|
|
318
|
-
this._editorGroup.focus();
|
|
319
|
-
const group = this._getEditorGroup(event.payload);
|
|
320
|
-
if (group !== undefined) {
|
|
321
|
-
this._widget.setFocused(undefined);
|
|
322
|
-
this._widget.setSelection(undefined);
|
|
323
|
-
this._revealInEditor(event, element, group);
|
|
324
|
-
return;
|
|
325
|
-
}
|
|
326
|
-
if (this._cfUseQuickPick.getValue()) {
|
|
327
|
-
this._widget.setFocused(undefined);
|
|
328
|
-
this._widget.setSelection(undefined);
|
|
329
|
-
this._quickInputService.quickAccess.show(element instanceof OutlineElement2 ? '@' : '');
|
|
330
|
-
return;
|
|
331
|
-
}
|
|
332
|
-
let picker;
|
|
333
|
-
let pickerAnchor;
|
|
334
|
-
this._contextViewService.showContextView({
|
|
335
|
-
render: (parent) => {
|
|
336
|
-
if (event.item instanceof FileItem) {
|
|
337
|
-
picker = this._instantiationService.createInstance(BreadcrumbsFilePicker, parent, event.item.model.resource);
|
|
338
|
-
}
|
|
339
|
-
else if (event.item instanceof OutlineItem) {
|
|
340
|
-
picker = this._instantiationService.createInstance(BreadcrumbsOutlinePicker, parent, event.item.model.resource);
|
|
341
|
-
}
|
|
342
|
-
const selectListener = picker.onWillPickElement(() => this._contextViewService.hideContextView({ source: this, didPick: true }));
|
|
343
|
-
const zoomListener = PixelRatio.onDidChange(() => this._contextViewService.hideContextView({ source: this }));
|
|
344
|
-
const focusTracker = trackFocus(parent);
|
|
345
|
-
const blurListener = focusTracker.onDidBlur(() => {
|
|
346
|
-
this._breadcrumbsPickerIgnoreOnceItem = this._widget.isDOMFocused() ? event.item : undefined;
|
|
347
|
-
this._contextViewService.hideContextView({ source: this });
|
|
348
|
-
});
|
|
349
|
-
this._breadcrumbsPickerShowing = true;
|
|
350
|
-
this._updateCkBreadcrumbsActive();
|
|
351
|
-
return combinedDisposable(picker, selectListener, zoomListener, focusTracker, blurListener);
|
|
352
|
-
},
|
|
353
|
-
getAnchor: () => {
|
|
354
|
-
if (!pickerAnchor) {
|
|
355
|
-
const window = getWindow(this.domNode);
|
|
356
|
-
const maxInnerWidth = window.innerWidth - 8 ;
|
|
357
|
-
let maxHeight = Math.min(window.innerHeight * 0.7, 300);
|
|
358
|
-
const pickerWidth = Math.min(maxInnerWidth, Math.max(240, maxInnerWidth / 4.17));
|
|
359
|
-
const pickerArrowSize = 8;
|
|
360
|
-
let pickerArrowOffset;
|
|
361
|
-
const data = getDomNodePagePosition(event.node.firstChild);
|
|
362
|
-
const y = data.top + data.height + pickerArrowSize;
|
|
363
|
-
if (y + maxHeight >= window.innerHeight) {
|
|
364
|
-
maxHeight = window.innerHeight - y - 30 ;
|
|
365
|
-
}
|
|
366
|
-
let x = data.left;
|
|
367
|
-
if (x + pickerWidth >= maxInnerWidth) {
|
|
368
|
-
x = maxInnerWidth - pickerWidth;
|
|
369
|
-
}
|
|
370
|
-
if (event.payload instanceof StandardMouseEvent) {
|
|
371
|
-
const maxPickerArrowOffset = pickerWidth - 2 * pickerArrowSize;
|
|
372
|
-
pickerArrowOffset = event.payload.posx - x;
|
|
373
|
-
if (pickerArrowOffset > maxPickerArrowOffset) {
|
|
374
|
-
x = Math.min(maxInnerWidth - pickerWidth, x + pickerArrowOffset - maxPickerArrowOffset);
|
|
375
|
-
pickerArrowOffset = maxPickerArrowOffset;
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
else {
|
|
379
|
-
pickerArrowOffset = (data.left + (data.width * 0.3)) - x;
|
|
380
|
-
}
|
|
381
|
-
picker.show(element, maxHeight, pickerWidth, pickerArrowSize, Math.max(0, pickerArrowOffset));
|
|
382
|
-
pickerAnchor = { x, y };
|
|
383
|
-
}
|
|
384
|
-
return pickerAnchor;
|
|
385
|
-
},
|
|
386
|
-
onHide: (data) => {
|
|
387
|
-
if (!data?.didPick) {
|
|
388
|
-
picker.restoreViewState();
|
|
389
|
-
}
|
|
390
|
-
this._breadcrumbsPickerShowing = false;
|
|
391
|
-
this._updateCkBreadcrumbsActive();
|
|
392
|
-
if (data?.source === this) {
|
|
393
|
-
this._widget.setFocused(undefined);
|
|
394
|
-
this._widget.setSelection(undefined);
|
|
395
|
-
}
|
|
396
|
-
picker.dispose();
|
|
397
|
-
}
|
|
398
|
-
});
|
|
399
|
-
}
|
|
400
|
-
_updateCkBreadcrumbsActive() {
|
|
401
|
-
const value = this._widget.isDOMFocused() || this._breadcrumbsPickerShowing;
|
|
402
|
-
this._ckBreadcrumbsActive.set(value);
|
|
403
|
-
}
|
|
404
|
-
async _revealInEditor(event, element, group, pinned = false) {
|
|
405
|
-
if (element instanceof FileElement) {
|
|
406
|
-
if (element.kind === FileKind.FILE) {
|
|
407
|
-
await this._editorService.openEditor({ resource: element.uri, options: { pinned } }, group);
|
|
408
|
-
}
|
|
409
|
-
else {
|
|
410
|
-
const items = this._widget.getItems();
|
|
411
|
-
const idx = items.indexOf(event.item);
|
|
412
|
-
this._widget.setFocused(items[idx + 1]);
|
|
413
|
-
this._widget.setSelection(items[idx + 1], BreadcrumbsControl_1.Payload_Pick);
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
else {
|
|
417
|
-
element.outline.reveal(element, { pinned }, group === SIDE_GROUP);
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
_getEditorGroup(data) {
|
|
421
|
-
if (data === BreadcrumbsControl_1.Payload_RevealAside) {
|
|
422
|
-
return SIDE_GROUP;
|
|
423
|
-
}
|
|
424
|
-
else if (data === BreadcrumbsControl_1.Payload_Reveal) {
|
|
425
|
-
return ACTIVE_GROUP;
|
|
426
|
-
}
|
|
427
|
-
else {
|
|
428
|
-
return undefined;
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
};
|
|
432
|
-
BreadcrumbsControl = BreadcrumbsControl_1 = ( __decorate([
|
|
433
|
-
( __param(3, IContextKeyService)),
|
|
434
|
-
( __param(4, IContextViewService)),
|
|
435
|
-
( __param(5, IInstantiationService)),
|
|
436
|
-
( __param(6, IQuickInputService)),
|
|
437
|
-
( __param(7, IFileService)),
|
|
438
|
-
( __param(8, IEditorService)),
|
|
439
|
-
( __param(9, ILabelService)),
|
|
440
|
-
( __param(10, IConfigurationService)),
|
|
441
|
-
( __param(11, IBreadcrumbsService))
|
|
442
|
-
], BreadcrumbsControl));
|
|
443
|
-
let BreadcrumbsControlFactory = class BreadcrumbsControlFactory {
|
|
444
|
-
get control() { return this._control; }
|
|
445
|
-
get onDidEnablementChange() { return this._onDidEnablementChange.event; }
|
|
446
|
-
get onDidVisibilityChange() { return this._onDidVisibilityChange.event; }
|
|
447
|
-
constructor(_container, _editorGroup, _options, configurationService, _instantiationService, fileService) {
|
|
448
|
-
this._container = _container;
|
|
449
|
-
this._editorGroup = _editorGroup;
|
|
450
|
-
this._options = _options;
|
|
451
|
-
this._instantiationService = _instantiationService;
|
|
452
|
-
this._disposables = ( new DisposableStore());
|
|
453
|
-
this._controlDisposables = ( new DisposableStore());
|
|
454
|
-
this._onDidEnablementChange = this._disposables.add(( new Emitter()));
|
|
455
|
-
this._onDidVisibilityChange = this._disposables.add(( new Emitter()));
|
|
456
|
-
const config = this._disposables.add(BreadcrumbsConfig.IsEnabled.bindTo(configurationService));
|
|
457
|
-
this._disposables.add(config.onDidChange(() => {
|
|
458
|
-
const value = config.getValue();
|
|
459
|
-
if (!value && this._control) {
|
|
460
|
-
this._controlDisposables.clear();
|
|
461
|
-
this._control = undefined;
|
|
462
|
-
this._onDidEnablementChange.fire();
|
|
463
|
-
}
|
|
464
|
-
else if (value && !this._control) {
|
|
465
|
-
this._control = this.createControl();
|
|
466
|
-
this._control.update();
|
|
467
|
-
this._onDidEnablementChange.fire();
|
|
468
|
-
}
|
|
469
|
-
}));
|
|
470
|
-
if (config.getValue()) {
|
|
471
|
-
this._control = this.createControl();
|
|
472
|
-
}
|
|
473
|
-
this._disposables.add(fileService.onDidChangeFileSystemProviderRegistrations(e => {
|
|
474
|
-
if (this._control?.model && this._control.model.resource.scheme !== e.scheme) {
|
|
475
|
-
return;
|
|
476
|
-
}
|
|
477
|
-
if (this._control?.update()) {
|
|
478
|
-
this._onDidEnablementChange.fire();
|
|
479
|
-
}
|
|
480
|
-
}));
|
|
481
|
-
}
|
|
482
|
-
createControl() {
|
|
483
|
-
const control = this._controlDisposables.add(this._instantiationService.createInstance(BreadcrumbsControl, this._container, this._options, this._editorGroup));
|
|
484
|
-
this._controlDisposables.add(control.onDidVisibilityChange(() => this._onDidVisibilityChange.fire()));
|
|
485
|
-
return control;
|
|
486
|
-
}
|
|
487
|
-
dispose() {
|
|
488
|
-
this._disposables.dispose();
|
|
489
|
-
this._controlDisposables.dispose();
|
|
490
|
-
}
|
|
491
|
-
};
|
|
492
|
-
BreadcrumbsControlFactory = ( __decorate([
|
|
493
|
-
( __param(3, IConfigurationService)),
|
|
494
|
-
( __param(4, IInstantiationService)),
|
|
495
|
-
( __param(5, IFileService))
|
|
496
|
-
], BreadcrumbsControlFactory));
|
|
497
|
-
registerAction2(class ToggleBreadcrumb extends Action2 {
|
|
498
|
-
constructor() {
|
|
499
|
-
super({
|
|
500
|
-
id: 'breadcrumbs.toggle',
|
|
501
|
-
title: {
|
|
502
|
-
value: ( localizeWithPath(
|
|
503
|
-
'vs/workbench/browser/parts/editor/breadcrumbsControl',
|
|
504
|
-
'cmd.toggle',
|
|
505
|
-
"Toggle Breadcrumbs"
|
|
506
|
-
)),
|
|
507
|
-
mnemonicTitle: ( localizeWithPath(
|
|
508
|
-
'vs/workbench/browser/parts/editor/breadcrumbsControl',
|
|
509
|
-
{ key: 'miBreadcrumbs', comment: ['&& denotes a mnemonic'] },
|
|
510
|
-
"Toggle &&Breadcrumbs"
|
|
511
|
-
)),
|
|
512
|
-
original: 'Toggle Breadcrumbs',
|
|
513
|
-
},
|
|
514
|
-
category: Categories.View,
|
|
515
|
-
toggled: {
|
|
516
|
-
condition: ( ContextKeyExpr.equals('config.breadcrumbs.enabled', true)),
|
|
517
|
-
title: ( localizeWithPath(
|
|
518
|
-
'vs/workbench/browser/parts/editor/breadcrumbsControl',
|
|
519
|
-
'cmd.toggle2',
|
|
520
|
-
"Breadcrumbs"
|
|
521
|
-
)),
|
|
522
|
-
mnemonicTitle: ( localizeWithPath(
|
|
523
|
-
'vs/workbench/browser/parts/editor/breadcrumbsControl',
|
|
524
|
-
{ key: 'miBreadcrumbs2', comment: ['&& denotes a mnemonic'] },
|
|
525
|
-
"&&Breadcrumbs"
|
|
526
|
-
))
|
|
527
|
-
},
|
|
528
|
-
menu: [
|
|
529
|
-
{ id: MenuId.CommandPalette },
|
|
530
|
-
{ id: MenuId.MenubarAppearanceMenu, group: '4_editor', order: 2 },
|
|
531
|
-
{ id: MenuId.NotebookToolbar, group: 'notebookLayout', order: 2 },
|
|
532
|
-
{ id: MenuId.StickyScrollContext }
|
|
533
|
-
]
|
|
534
|
-
});
|
|
535
|
-
}
|
|
536
|
-
run(accessor) {
|
|
537
|
-
const config = accessor.get(IConfigurationService);
|
|
538
|
-
const value = BreadcrumbsConfig.IsEnabled.bindTo(config).getValue();
|
|
539
|
-
BreadcrumbsConfig.IsEnabled.bindTo(config).updateValue(!value);
|
|
540
|
-
}
|
|
541
|
-
});
|
|
542
|
-
function focusAndSelectHandler(accessor, select) {
|
|
543
|
-
const groups = accessor.get(IEditorGroupsService);
|
|
544
|
-
const breadcrumbs = accessor.get(IBreadcrumbsService);
|
|
545
|
-
const widget = breadcrumbs.getWidget(groups.activeGroup.id);
|
|
546
|
-
if (widget) {
|
|
547
|
-
const item = tail(widget.getItems());
|
|
548
|
-
widget.setFocused(item);
|
|
549
|
-
if (select) {
|
|
550
|
-
widget.setSelection(item, BreadcrumbsControl.Payload_Pick);
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
registerAction2(class FocusAndSelectBreadcrumbs extends Action2 {
|
|
555
|
-
constructor() {
|
|
556
|
-
super({
|
|
557
|
-
id: 'breadcrumbs.focusAndSelect',
|
|
558
|
-
title: {
|
|
559
|
-
value: ( localizeWithPath(
|
|
560
|
-
'vs/workbench/browser/parts/editor/breadcrumbsControl',
|
|
561
|
-
'cmd.focusAndSelect',
|
|
562
|
-
"Focus and Select Breadcrumbs"
|
|
563
|
-
)),
|
|
564
|
-
original: 'Focus and Select Breadcrumbs'
|
|
565
|
-
},
|
|
566
|
-
precondition: BreadcrumbsControl.CK_BreadcrumbsVisible,
|
|
567
|
-
keybinding: {
|
|
568
|
-
weight: 200 ,
|
|
569
|
-
primary: 2048 | 1024 | 89 ,
|
|
570
|
-
when: BreadcrumbsControl.CK_BreadcrumbsPossible,
|
|
571
|
-
},
|
|
572
|
-
f1: true
|
|
573
|
-
});
|
|
574
|
-
}
|
|
575
|
-
run(accessor, ...args) {
|
|
576
|
-
focusAndSelectHandler(accessor, true);
|
|
577
|
-
}
|
|
578
|
-
});
|
|
579
|
-
registerAction2(class FocusBreadcrumbs extends Action2 {
|
|
580
|
-
constructor() {
|
|
581
|
-
super({
|
|
582
|
-
id: 'breadcrumbs.focus',
|
|
583
|
-
title: {
|
|
584
|
-
value: ( localizeWithPath(
|
|
585
|
-
'vs/workbench/browser/parts/editor/breadcrumbsControl',
|
|
586
|
-
'cmd.focus',
|
|
587
|
-
"Focus Breadcrumbs"
|
|
588
|
-
)),
|
|
589
|
-
original: 'Focus Breadcrumbs'
|
|
590
|
-
},
|
|
591
|
-
precondition: BreadcrumbsControl.CK_BreadcrumbsVisible,
|
|
592
|
-
keybinding: {
|
|
593
|
-
weight: 200 ,
|
|
594
|
-
primary: 2048 | 1024 | 85 ,
|
|
595
|
-
when: BreadcrumbsControl.CK_BreadcrumbsPossible,
|
|
596
|
-
},
|
|
597
|
-
f1: true
|
|
598
|
-
});
|
|
599
|
-
}
|
|
600
|
-
run(accessor, ...args) {
|
|
601
|
-
focusAndSelectHandler(accessor, false);
|
|
602
|
-
}
|
|
603
|
-
});
|
|
604
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
605
|
-
id: 'breadcrumbs.toggleToOn',
|
|
606
|
-
weight: 200 ,
|
|
607
|
-
primary: 2048 | 1024 | 89 ,
|
|
608
|
-
when: ContextKeyExpr.not('config.breadcrumbs.enabled'),
|
|
609
|
-
handler: async (accessor) => {
|
|
610
|
-
const instant = accessor.get(IInstantiationService);
|
|
611
|
-
const config = accessor.get(IConfigurationService);
|
|
612
|
-
const isEnabled = BreadcrumbsConfig.IsEnabled.bindTo(config);
|
|
613
|
-
if (!isEnabled.getValue()) {
|
|
614
|
-
await isEnabled.updateValue(true);
|
|
615
|
-
await timeout(50);
|
|
616
|
-
}
|
|
617
|
-
return instant.invokeFunction(focusAndSelectHandler, true);
|
|
618
|
-
}
|
|
619
|
-
});
|
|
620
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
621
|
-
id: 'breadcrumbs.focusNext',
|
|
622
|
-
weight: 200 ,
|
|
623
|
-
primary: 17 ,
|
|
624
|
-
secondary: [2048 | 17 ],
|
|
625
|
-
mac: {
|
|
626
|
-
primary: 17 ,
|
|
627
|
-
secondary: [512 | 17 ],
|
|
628
|
-
},
|
|
629
|
-
when: ( ContextKeyExpr.and(
|
|
630
|
-
BreadcrumbsControl.CK_BreadcrumbsVisible,
|
|
631
|
-
BreadcrumbsControl.CK_BreadcrumbsActive
|
|
632
|
-
)),
|
|
633
|
-
handler(accessor) {
|
|
634
|
-
const groups = accessor.get(IEditorGroupsService);
|
|
635
|
-
const breadcrumbs = accessor.get(IBreadcrumbsService);
|
|
636
|
-
const widget = breadcrumbs.getWidget(groups.activeGroup.id);
|
|
637
|
-
if (!widget) {
|
|
638
|
-
return;
|
|
639
|
-
}
|
|
640
|
-
widget.focusNext();
|
|
641
|
-
}
|
|
642
|
-
});
|
|
643
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
644
|
-
id: 'breadcrumbs.focusPrevious',
|
|
645
|
-
weight: 200 ,
|
|
646
|
-
primary: 15 ,
|
|
647
|
-
secondary: [2048 | 15 ],
|
|
648
|
-
mac: {
|
|
649
|
-
primary: 15 ,
|
|
650
|
-
secondary: [512 | 15 ],
|
|
651
|
-
},
|
|
652
|
-
when: ( ContextKeyExpr.and(
|
|
653
|
-
BreadcrumbsControl.CK_BreadcrumbsVisible,
|
|
654
|
-
BreadcrumbsControl.CK_BreadcrumbsActive
|
|
655
|
-
)),
|
|
656
|
-
handler(accessor) {
|
|
657
|
-
const groups = accessor.get(IEditorGroupsService);
|
|
658
|
-
const breadcrumbs = accessor.get(IBreadcrumbsService);
|
|
659
|
-
const widget = breadcrumbs.getWidget(groups.activeGroup.id);
|
|
660
|
-
if (!widget) {
|
|
661
|
-
return;
|
|
662
|
-
}
|
|
663
|
-
widget.focusPrev();
|
|
664
|
-
}
|
|
665
|
-
});
|
|
666
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
667
|
-
id: 'breadcrumbs.focusNextWithPicker',
|
|
668
|
-
weight: 200 + 1,
|
|
669
|
-
primary: 2048 | 17 ,
|
|
670
|
-
mac: {
|
|
671
|
-
primary: 512 | 17 ,
|
|
672
|
-
},
|
|
673
|
-
when: ( ContextKeyExpr.and(
|
|
674
|
-
BreadcrumbsControl.CK_BreadcrumbsVisible,
|
|
675
|
-
BreadcrumbsControl.CK_BreadcrumbsActive,
|
|
676
|
-
WorkbenchListFocusContextKey
|
|
677
|
-
)),
|
|
678
|
-
handler(accessor) {
|
|
679
|
-
const groups = accessor.get(IEditorGroupsService);
|
|
680
|
-
const breadcrumbs = accessor.get(IBreadcrumbsService);
|
|
681
|
-
const widget = breadcrumbs.getWidget(groups.activeGroup.id);
|
|
682
|
-
if (!widget) {
|
|
683
|
-
return;
|
|
684
|
-
}
|
|
685
|
-
widget.focusNext();
|
|
686
|
-
}
|
|
687
|
-
});
|
|
688
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
689
|
-
id: 'breadcrumbs.focusPreviousWithPicker',
|
|
690
|
-
weight: 200 + 1,
|
|
691
|
-
primary: 2048 | 15 ,
|
|
692
|
-
mac: {
|
|
693
|
-
primary: 512 | 15 ,
|
|
694
|
-
},
|
|
695
|
-
when: ( ContextKeyExpr.and(
|
|
696
|
-
BreadcrumbsControl.CK_BreadcrumbsVisible,
|
|
697
|
-
BreadcrumbsControl.CK_BreadcrumbsActive,
|
|
698
|
-
WorkbenchListFocusContextKey
|
|
699
|
-
)),
|
|
700
|
-
handler(accessor) {
|
|
701
|
-
const groups = accessor.get(IEditorGroupsService);
|
|
702
|
-
const breadcrumbs = accessor.get(IBreadcrumbsService);
|
|
703
|
-
const widget = breadcrumbs.getWidget(groups.activeGroup.id);
|
|
704
|
-
if (!widget) {
|
|
705
|
-
return;
|
|
706
|
-
}
|
|
707
|
-
widget.focusPrev();
|
|
708
|
-
}
|
|
709
|
-
});
|
|
710
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
711
|
-
id: 'breadcrumbs.selectFocused',
|
|
712
|
-
weight: 200 ,
|
|
713
|
-
primary: 3 ,
|
|
714
|
-
secondary: [18 ],
|
|
715
|
-
when: ( ContextKeyExpr.and(
|
|
716
|
-
BreadcrumbsControl.CK_BreadcrumbsVisible,
|
|
717
|
-
BreadcrumbsControl.CK_BreadcrumbsActive
|
|
718
|
-
)),
|
|
719
|
-
handler(accessor) {
|
|
720
|
-
const groups = accessor.get(IEditorGroupsService);
|
|
721
|
-
const breadcrumbs = accessor.get(IBreadcrumbsService);
|
|
722
|
-
const widget = breadcrumbs.getWidget(groups.activeGroup.id);
|
|
723
|
-
if (!widget) {
|
|
724
|
-
return;
|
|
725
|
-
}
|
|
726
|
-
widget.setSelection(widget.getFocused(), BreadcrumbsControl.Payload_Pick);
|
|
727
|
-
}
|
|
728
|
-
});
|
|
729
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
730
|
-
id: 'breadcrumbs.revealFocused',
|
|
731
|
-
weight: 200 ,
|
|
732
|
-
primary: 10 ,
|
|
733
|
-
secondary: [2048 | 3 ],
|
|
734
|
-
when: ( ContextKeyExpr.and(
|
|
735
|
-
BreadcrumbsControl.CK_BreadcrumbsVisible,
|
|
736
|
-
BreadcrumbsControl.CK_BreadcrumbsActive
|
|
737
|
-
)),
|
|
738
|
-
handler(accessor) {
|
|
739
|
-
const groups = accessor.get(IEditorGroupsService);
|
|
740
|
-
const breadcrumbs = accessor.get(IBreadcrumbsService);
|
|
741
|
-
const widget = breadcrumbs.getWidget(groups.activeGroup.id);
|
|
742
|
-
if (!widget) {
|
|
743
|
-
return;
|
|
744
|
-
}
|
|
745
|
-
widget.setSelection(widget.getFocused(), BreadcrumbsControl.Payload_Reveal);
|
|
746
|
-
}
|
|
747
|
-
});
|
|
748
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
749
|
-
id: 'breadcrumbs.selectEditor',
|
|
750
|
-
weight: 200 + 1,
|
|
751
|
-
primary: 9 ,
|
|
752
|
-
when: ( ContextKeyExpr.and(
|
|
753
|
-
BreadcrumbsControl.CK_BreadcrumbsVisible,
|
|
754
|
-
BreadcrumbsControl.CK_BreadcrumbsActive
|
|
755
|
-
)),
|
|
756
|
-
handler(accessor) {
|
|
757
|
-
const groups = accessor.get(IEditorGroupsService);
|
|
758
|
-
const breadcrumbs = accessor.get(IBreadcrumbsService);
|
|
759
|
-
const widget = breadcrumbs.getWidget(groups.activeGroup.id);
|
|
760
|
-
if (!widget) {
|
|
761
|
-
return;
|
|
762
|
-
}
|
|
763
|
-
widget.setFocused(undefined);
|
|
764
|
-
widget.setSelection(undefined);
|
|
765
|
-
groups.activeGroup.activeEditorPane?.focus();
|
|
766
|
-
}
|
|
767
|
-
});
|
|
768
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
769
|
-
id: 'breadcrumbs.revealFocusedFromTreeAside',
|
|
770
|
-
weight: 200 ,
|
|
771
|
-
primary: 2048 | 3 ,
|
|
772
|
-
when: ( ContextKeyExpr.and(
|
|
773
|
-
BreadcrumbsControl.CK_BreadcrumbsVisible,
|
|
774
|
-
BreadcrumbsControl.CK_BreadcrumbsActive,
|
|
775
|
-
WorkbenchListFocusContextKey
|
|
776
|
-
)),
|
|
777
|
-
handler(accessor) {
|
|
778
|
-
const editors = accessor.get(IEditorService);
|
|
779
|
-
const lists = accessor.get(IListService);
|
|
780
|
-
const tree = lists.lastFocusedList;
|
|
781
|
-
if (!(tree instanceof WorkbenchDataTree) && !(tree instanceof WorkbenchAsyncDataTree)) {
|
|
782
|
-
return;
|
|
783
|
-
}
|
|
784
|
-
const element = tree.getFocus()[0];
|
|
785
|
-
if (URI.isUri(element?.resource)) {
|
|
786
|
-
return editors.openEditor({
|
|
787
|
-
resource: element.resource,
|
|
788
|
-
options: { pinned: true }
|
|
789
|
-
}, SIDE_GROUP);
|
|
790
|
-
}
|
|
791
|
-
const input = tree.getInput();
|
|
792
|
-
if (input && typeof input.outlineKind === 'string') {
|
|
793
|
-
return input.reveal(element, {
|
|
794
|
-
pinned: true,
|
|
795
|
-
preserveFocus: false
|
|
796
|
-
}, true);
|
|
797
|
-
}
|
|
798
|
-
}
|
|
799
|
-
});
|
|
800
|
-
|
|
801
|
-
export { BreadcrumbsControl, BreadcrumbsControlFactory };
|