@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,142 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { CancellationTokenSource } from 'vscode/vscode/vs/base/common/cancellation';
|
|
3
|
-
import { onUnexpectedError } from 'vscode/vscode/vs/base/common/errors';
|
|
4
|
-
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
5
|
-
import { DisposableStore, MutableDisposable, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
6
|
-
import { matchesSomeScheme, Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
7
|
-
import { isEqual, dirname } from 'vscode/vscode/vs/base/common/resources';
|
|
8
|
-
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
9
|
-
import { FileKind } from 'vscode/vscode/vs/platform/files/common/files';
|
|
10
|
-
import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace';
|
|
11
|
-
import { BreadcrumbsConfig } from 'vscode/vscode/vs/workbench/browser/parts/editor/breadcrumbs';
|
|
12
|
-
import { IOutlineService } from 'vscode/vscode/vs/workbench/services/outline/browser/outline';
|
|
13
|
-
|
|
14
|
-
class FileElement {
|
|
15
|
-
constructor(uri, kind) {
|
|
16
|
-
this.uri = uri;
|
|
17
|
-
this.kind = kind;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
class OutlineElement2 {
|
|
21
|
-
constructor(element, outline) {
|
|
22
|
-
this.element = element;
|
|
23
|
-
this.outline = outline;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
let BreadcrumbsModel = class BreadcrumbsModel {
|
|
27
|
-
constructor(resource, editor, configurationService, _workspaceService, _outlineService) {
|
|
28
|
-
this.resource = resource;
|
|
29
|
-
this._workspaceService = _workspaceService;
|
|
30
|
-
this._outlineService = _outlineService;
|
|
31
|
-
this._disposables = ( new DisposableStore());
|
|
32
|
-
this._currentOutline = ( new MutableDisposable());
|
|
33
|
-
this._outlineDisposables = ( new DisposableStore());
|
|
34
|
-
this._onDidUpdate = ( new Emitter());
|
|
35
|
-
this.onDidUpdate = this._onDidUpdate.event;
|
|
36
|
-
this._cfgFilePath = BreadcrumbsConfig.FilePath.bindTo(configurationService);
|
|
37
|
-
this._cfgSymbolPath = BreadcrumbsConfig.SymbolPath.bindTo(configurationService);
|
|
38
|
-
this._disposables.add(this._cfgFilePath.onDidChange(_ => this._onDidUpdate.fire(this)));
|
|
39
|
-
this._disposables.add(this._cfgSymbolPath.onDidChange(_ => this._onDidUpdate.fire(this)));
|
|
40
|
-
this._workspaceService.onDidChangeWorkspaceFolders(this._onDidChangeWorkspaceFolders, this, this._disposables);
|
|
41
|
-
this._fileInfo = this._initFilePathInfo(resource);
|
|
42
|
-
if (editor) {
|
|
43
|
-
this._bindToEditor(editor);
|
|
44
|
-
this._disposables.add(_outlineService.onDidChange(() => this._bindToEditor(editor)));
|
|
45
|
-
this._disposables.add(editor.onDidChangeControl(() => this._bindToEditor(editor)));
|
|
46
|
-
}
|
|
47
|
-
this._onDidUpdate.fire(this);
|
|
48
|
-
}
|
|
49
|
-
dispose() {
|
|
50
|
-
this._disposables.dispose();
|
|
51
|
-
this._cfgFilePath.dispose();
|
|
52
|
-
this._cfgSymbolPath.dispose();
|
|
53
|
-
this._currentOutline.dispose();
|
|
54
|
-
this._outlineDisposables.dispose();
|
|
55
|
-
this._onDidUpdate.dispose();
|
|
56
|
-
}
|
|
57
|
-
isRelative() {
|
|
58
|
-
return Boolean(this._fileInfo.folder);
|
|
59
|
-
}
|
|
60
|
-
getElements() {
|
|
61
|
-
let result = [];
|
|
62
|
-
if (this._cfgFilePath.getValue() === 'on') {
|
|
63
|
-
result = result.concat(this._fileInfo.path);
|
|
64
|
-
}
|
|
65
|
-
else if (this._cfgFilePath.getValue() === 'last' && this._fileInfo.path.length > 0) {
|
|
66
|
-
result = result.concat(this._fileInfo.path.slice(-1));
|
|
67
|
-
}
|
|
68
|
-
if (this._cfgSymbolPath.getValue() === 'off') {
|
|
69
|
-
return result;
|
|
70
|
-
}
|
|
71
|
-
if (!this._currentOutline.value) {
|
|
72
|
-
return result;
|
|
73
|
-
}
|
|
74
|
-
const breadcrumbsElements = this._currentOutline.value.config.breadcrumbsDataSource.getBreadcrumbElements();
|
|
75
|
-
for (let i = this._cfgSymbolPath.getValue() === 'last' && breadcrumbsElements.length > 0 ? breadcrumbsElements.length - 1 : 0; i < breadcrumbsElements.length; i++) {
|
|
76
|
-
result.push(( new OutlineElement2(breadcrumbsElements[i], this._currentOutline.value)));
|
|
77
|
-
}
|
|
78
|
-
if (breadcrumbsElements.length === 0 && !this._currentOutline.value.isEmpty) {
|
|
79
|
-
result.push(( new OutlineElement2(this._currentOutline.value, this._currentOutline.value)));
|
|
80
|
-
}
|
|
81
|
-
return result;
|
|
82
|
-
}
|
|
83
|
-
_initFilePathInfo(uri) {
|
|
84
|
-
if (matchesSomeScheme(uri, Schemas.untitled, Schemas.data)) {
|
|
85
|
-
return {
|
|
86
|
-
folder: undefined,
|
|
87
|
-
path: []
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
const info = {
|
|
91
|
-
folder: this._workspaceService.getWorkspaceFolder(uri) ?? undefined,
|
|
92
|
-
path: []
|
|
93
|
-
};
|
|
94
|
-
let uriPrefix = uri;
|
|
95
|
-
while (uriPrefix && uriPrefix.path !== '/') {
|
|
96
|
-
if (info.folder && isEqual(info.folder.uri, uriPrefix)) {
|
|
97
|
-
break;
|
|
98
|
-
}
|
|
99
|
-
info.path.unshift(( new FileElement(uriPrefix, info.path.length === 0 ? FileKind.FILE : FileKind.FOLDER)));
|
|
100
|
-
const prevPathLength = uriPrefix.path.length;
|
|
101
|
-
uriPrefix = dirname(uriPrefix);
|
|
102
|
-
if (uriPrefix.path.length === prevPathLength) {
|
|
103
|
-
break;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
if (info.folder && this._workspaceService.getWorkbenchState() === 3 ) {
|
|
107
|
-
info.path.unshift(( new FileElement(info.folder.uri, FileKind.ROOT_FOLDER)));
|
|
108
|
-
}
|
|
109
|
-
return info;
|
|
110
|
-
}
|
|
111
|
-
_onDidChangeWorkspaceFolders() {
|
|
112
|
-
this._fileInfo = this._initFilePathInfo(this.resource);
|
|
113
|
-
this._onDidUpdate.fire(this);
|
|
114
|
-
}
|
|
115
|
-
_bindToEditor(editor) {
|
|
116
|
-
const newCts = ( new CancellationTokenSource());
|
|
117
|
-
this._currentOutline.clear();
|
|
118
|
-
this._outlineDisposables.clear();
|
|
119
|
-
this._outlineDisposables.add(toDisposable(() => newCts.dispose(true)));
|
|
120
|
-
this._outlineService.createOutline(editor, 2 , newCts.token).then(outline => {
|
|
121
|
-
if (newCts.token.isCancellationRequested) {
|
|
122
|
-
outline?.dispose();
|
|
123
|
-
outline = undefined;
|
|
124
|
-
}
|
|
125
|
-
this._currentOutline.value = outline;
|
|
126
|
-
this._onDidUpdate.fire(this);
|
|
127
|
-
if (outline) {
|
|
128
|
-
this._outlineDisposables.add(outline.onDidChange(() => this._onDidUpdate.fire(this)));
|
|
129
|
-
}
|
|
130
|
-
}).catch(err => {
|
|
131
|
-
this._onDidUpdate.fire(this);
|
|
132
|
-
onUnexpectedError(err);
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
};
|
|
136
|
-
BreadcrumbsModel = ( __decorate([
|
|
137
|
-
( __param(2, IConfigurationService)),
|
|
138
|
-
( __param(3, IWorkspaceContextService)),
|
|
139
|
-
( __param(4, IOutlineService))
|
|
140
|
-
], BreadcrumbsModel));
|
|
141
|
-
|
|
142
|
-
export { BreadcrumbsModel, FileElement, OutlineElement2 };
|
|
@@ -1,412 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { compareFileNames } from 'vscode/vscode/vs/base/common/comparers';
|
|
3
|
-
import { onUnexpectedError } from 'vscode/vscode/vs/base/common/errors';
|
|
4
|
-
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
5
|
-
import { createMatches } from 'vscode/vscode/vs/base/common/filters';
|
|
6
|
-
import { parse } from 'vscode/vscode/vs/base/common/glob';
|
|
7
|
-
import { Disposable, DisposableStore, MutableDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
8
|
-
import { relative, posix } from 'vscode/vscode/vs/base/common/path';
|
|
9
|
-
import { dirname, isEqual, basename } from 'vscode/vscode/vs/base/common/resources';
|
|
10
|
-
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
11
|
-
import './media/breadcrumbscontrol.css.js';
|
|
12
|
-
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
13
|
-
import { FileKind, IFileService } from 'vscode/vscode/vs/platform/files/common/files';
|
|
14
|
-
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
15
|
-
import { WorkbenchAsyncDataTree, WorkbenchDataTree } from 'vscode/vscode/vs/platform/list/browser/listService';
|
|
16
|
-
import { breadcrumbsPickerBackground, widgetShadow, widgetBorder } from 'vscode/vscode/vs/platform/theme/common/colorRegistry';
|
|
17
|
-
import { isWorkspaceFolder, isWorkspace, IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace';
|
|
18
|
-
import { ResourceLabels, DEFAULT_LABELS_CONTAINER } from 'vscode/vscode/vs/workbench/browser/labels';
|
|
19
|
-
import { BreadcrumbsConfig } from 'vscode/vscode/vs/workbench/browser/parts/editor/breadcrumbs';
|
|
20
|
-
import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService';
|
|
21
|
-
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
22
|
-
import { SIDE_GROUP, IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
23
|
-
import { ITextResourceConfigurationService } from 'vscode/vscode/vs/editor/common/services/textResourceConfiguration';
|
|
24
|
-
|
|
25
|
-
let BreadcrumbsPicker = class BreadcrumbsPicker {
|
|
26
|
-
constructor(parent, resource, _instantiationService, _themeService, _configurationService) {
|
|
27
|
-
this.resource = resource;
|
|
28
|
-
this._instantiationService = _instantiationService;
|
|
29
|
-
this._themeService = _themeService;
|
|
30
|
-
this._configurationService = _configurationService;
|
|
31
|
-
this._disposables = ( new DisposableStore());
|
|
32
|
-
this._fakeEvent = ( new UIEvent('fakeEvent'));
|
|
33
|
-
this._onWillPickElement = ( new Emitter());
|
|
34
|
-
this.onWillPickElement = this._onWillPickElement.event;
|
|
35
|
-
this._previewDispoables = ( new MutableDisposable());
|
|
36
|
-
this._domNode = document.createElement('div');
|
|
37
|
-
this._domNode.className = 'monaco-breadcrumbs-picker show-file-icons';
|
|
38
|
-
parent.appendChild(this._domNode);
|
|
39
|
-
}
|
|
40
|
-
dispose() {
|
|
41
|
-
this._disposables.dispose();
|
|
42
|
-
this._previewDispoables.dispose();
|
|
43
|
-
this._onWillPickElement.dispose();
|
|
44
|
-
this._domNode.remove();
|
|
45
|
-
setTimeout(() => this._tree.dispose(), 0);
|
|
46
|
-
}
|
|
47
|
-
async show(input, maxHeight, width, arrowSize, arrowOffset) {
|
|
48
|
-
const theme = this._themeService.getColorTheme();
|
|
49
|
-
const color = theme.getColor(breadcrumbsPickerBackground);
|
|
50
|
-
this._arrow = document.createElement('div');
|
|
51
|
-
this._arrow.className = 'arrow';
|
|
52
|
-
this._arrow.style.borderColor = `transparent transparent ${color ? ( color.toString()) : ''}`;
|
|
53
|
-
this._domNode.appendChild(this._arrow);
|
|
54
|
-
this._treeContainer = document.createElement('div');
|
|
55
|
-
this._treeContainer.style.background = color ? ( color.toString()) : '';
|
|
56
|
-
this._treeContainer.style.paddingTop = '2px';
|
|
57
|
-
this._treeContainer.style.borderRadius = '3px';
|
|
58
|
-
this._treeContainer.style.boxShadow = `0 0 8px 2px ${this._themeService.getColorTheme().getColor(widgetShadow)}`;
|
|
59
|
-
this._treeContainer.style.border = `1px solid ${this._themeService.getColorTheme().getColor(widgetBorder)}`;
|
|
60
|
-
this._domNode.appendChild(this._treeContainer);
|
|
61
|
-
this._layoutInfo = { maxHeight, width, arrowSize, arrowOffset, inputHeight: 0 };
|
|
62
|
-
this._tree = this._createTree(this._treeContainer, input);
|
|
63
|
-
this._disposables.add(this._tree.onDidOpen(async (e) => {
|
|
64
|
-
const { element, editorOptions, sideBySide } = e;
|
|
65
|
-
const didReveal = await this._revealElement(element, { ...editorOptions, preserveFocus: false }, sideBySide);
|
|
66
|
-
if (!didReveal) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
}));
|
|
70
|
-
this._disposables.add(this._tree.onDidChangeFocus(e => {
|
|
71
|
-
this._previewDispoables.value = this._previewElement(e.elements[0]);
|
|
72
|
-
}));
|
|
73
|
-
this._disposables.add(this._tree.onDidChangeContentHeight(() => {
|
|
74
|
-
this._layout();
|
|
75
|
-
}));
|
|
76
|
-
this._domNode.focus();
|
|
77
|
-
try {
|
|
78
|
-
await this._setInput(input);
|
|
79
|
-
this._layout();
|
|
80
|
-
}
|
|
81
|
-
catch (err) {
|
|
82
|
-
onUnexpectedError(err);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
_layout() {
|
|
86
|
-
const headerHeight = 2 * this._layoutInfo.arrowSize;
|
|
87
|
-
const treeHeight = Math.min(this._layoutInfo.maxHeight - headerHeight, this._tree.contentHeight);
|
|
88
|
-
const totalHeight = treeHeight + headerHeight;
|
|
89
|
-
this._domNode.style.height = `${totalHeight}px`;
|
|
90
|
-
this._domNode.style.width = `${this._layoutInfo.width}px`;
|
|
91
|
-
this._arrow.style.top = `-${2 * this._layoutInfo.arrowSize}px`;
|
|
92
|
-
this._arrow.style.borderWidth = `${this._layoutInfo.arrowSize}px`;
|
|
93
|
-
this._arrow.style.marginLeft = `${this._layoutInfo.arrowOffset}px`;
|
|
94
|
-
this._treeContainer.style.height = `${treeHeight}px`;
|
|
95
|
-
this._treeContainer.style.width = `${this._layoutInfo.width}px`;
|
|
96
|
-
this._tree.layout(treeHeight, this._layoutInfo.width);
|
|
97
|
-
}
|
|
98
|
-
restoreViewState() { }
|
|
99
|
-
};
|
|
100
|
-
BreadcrumbsPicker = ( __decorate([
|
|
101
|
-
( __param(2, IInstantiationService)),
|
|
102
|
-
( __param(3, IThemeService)),
|
|
103
|
-
( __param(4, IConfigurationService))
|
|
104
|
-
], BreadcrumbsPicker));
|
|
105
|
-
class FileVirtualDelegate {
|
|
106
|
-
getHeight(_element) {
|
|
107
|
-
return 22;
|
|
108
|
-
}
|
|
109
|
-
getTemplateId(_element) {
|
|
110
|
-
return 'FileStat';
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
class FileIdentityProvider {
|
|
114
|
-
getId(element) {
|
|
115
|
-
if (URI.isUri(element)) {
|
|
116
|
-
return ( element.toString());
|
|
117
|
-
}
|
|
118
|
-
else if (isWorkspace(element)) {
|
|
119
|
-
return element.id;
|
|
120
|
-
}
|
|
121
|
-
else if (isWorkspaceFolder(element)) {
|
|
122
|
-
return ( element.uri.toString());
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
return ( element.resource.toString());
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
let FileDataSource = class FileDataSource {
|
|
130
|
-
constructor(_fileService) {
|
|
131
|
-
this._fileService = _fileService;
|
|
132
|
-
}
|
|
133
|
-
hasChildren(element) {
|
|
134
|
-
return URI.isUri(element)
|
|
135
|
-
|| isWorkspace(element)
|
|
136
|
-
|| isWorkspaceFolder(element)
|
|
137
|
-
|| element.isDirectory;
|
|
138
|
-
}
|
|
139
|
-
async getChildren(element) {
|
|
140
|
-
if (isWorkspace(element)) {
|
|
141
|
-
return element.folders;
|
|
142
|
-
}
|
|
143
|
-
let uri;
|
|
144
|
-
if (isWorkspaceFolder(element)) {
|
|
145
|
-
uri = element.uri;
|
|
146
|
-
}
|
|
147
|
-
else if (URI.isUri(element)) {
|
|
148
|
-
uri = element;
|
|
149
|
-
}
|
|
150
|
-
else {
|
|
151
|
-
uri = element.resource;
|
|
152
|
-
}
|
|
153
|
-
const stat = await this._fileService.resolve(uri);
|
|
154
|
-
return stat.children ?? [];
|
|
155
|
-
}
|
|
156
|
-
};
|
|
157
|
-
FileDataSource = ( __decorate([
|
|
158
|
-
( __param(0, IFileService))
|
|
159
|
-
], FileDataSource));
|
|
160
|
-
let FileRenderer = class FileRenderer {
|
|
161
|
-
constructor(_labels, _configService) {
|
|
162
|
-
this._labels = _labels;
|
|
163
|
-
this._configService = _configService;
|
|
164
|
-
this.templateId = 'FileStat';
|
|
165
|
-
}
|
|
166
|
-
renderTemplate(container) {
|
|
167
|
-
return this._labels.create(container, { supportHighlights: true });
|
|
168
|
-
}
|
|
169
|
-
renderElement(node, index, templateData) {
|
|
170
|
-
const fileDecorations = this._configService.getValue('explorer.decorations');
|
|
171
|
-
const { element } = node;
|
|
172
|
-
let resource;
|
|
173
|
-
let fileKind;
|
|
174
|
-
if (isWorkspaceFolder(element)) {
|
|
175
|
-
resource = element.uri;
|
|
176
|
-
fileKind = FileKind.ROOT_FOLDER;
|
|
177
|
-
}
|
|
178
|
-
else {
|
|
179
|
-
resource = element.resource;
|
|
180
|
-
fileKind = element.isDirectory ? FileKind.FOLDER : FileKind.FILE;
|
|
181
|
-
}
|
|
182
|
-
templateData.setFile(resource, {
|
|
183
|
-
fileKind,
|
|
184
|
-
hidePath: true,
|
|
185
|
-
fileDecorations: fileDecorations,
|
|
186
|
-
matches: createMatches(node.filterData),
|
|
187
|
-
extraClasses: ['picker-item']
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
disposeTemplate(templateData) {
|
|
191
|
-
templateData.dispose();
|
|
192
|
-
}
|
|
193
|
-
};
|
|
194
|
-
FileRenderer = ( __decorate([
|
|
195
|
-
( __param(1, IConfigurationService))
|
|
196
|
-
], FileRenderer));
|
|
197
|
-
class FileNavigationLabelProvider {
|
|
198
|
-
getKeyboardNavigationLabel(element) {
|
|
199
|
-
return element.name;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
class FileAccessibilityProvider {
|
|
203
|
-
getWidgetAriaLabel() {
|
|
204
|
-
return ( localizeWithPath(
|
|
205
|
-
'vs/workbench/browser/parts/editor/breadcrumbsPicker',
|
|
206
|
-
'breadcrumbs',
|
|
207
|
-
"Breadcrumbs"
|
|
208
|
-
));
|
|
209
|
-
}
|
|
210
|
-
getAriaLabel(element) {
|
|
211
|
-
return element.name;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
let FileFilter = class FileFilter {
|
|
215
|
-
constructor(_workspaceService, configService) {
|
|
216
|
-
this._workspaceService = _workspaceService;
|
|
217
|
-
this._cachedExpressions = ( new Map());
|
|
218
|
-
this._disposables = ( new DisposableStore());
|
|
219
|
-
const config = BreadcrumbsConfig.FileExcludes.bindTo(configService);
|
|
220
|
-
const update = () => {
|
|
221
|
-
_workspaceService.getWorkspace().folders.forEach(folder => {
|
|
222
|
-
const excludesConfig = config.getValue({ resource: folder.uri });
|
|
223
|
-
if (!excludesConfig) {
|
|
224
|
-
return;
|
|
225
|
-
}
|
|
226
|
-
const adjustedConfig = {};
|
|
227
|
-
for (const pattern in excludesConfig) {
|
|
228
|
-
if (typeof excludesConfig[pattern] !== 'boolean') {
|
|
229
|
-
continue;
|
|
230
|
-
}
|
|
231
|
-
const patternAbs = pattern.indexOf('**/') !== 0
|
|
232
|
-
? posix.join(folder.uri.path, pattern)
|
|
233
|
-
: pattern;
|
|
234
|
-
adjustedConfig[patternAbs] = excludesConfig[pattern];
|
|
235
|
-
}
|
|
236
|
-
this._cachedExpressions.set(( folder.uri.toString()), parse(adjustedConfig));
|
|
237
|
-
});
|
|
238
|
-
};
|
|
239
|
-
update();
|
|
240
|
-
this._disposables.add(config);
|
|
241
|
-
this._disposables.add(config.onDidChange(update));
|
|
242
|
-
this._disposables.add(_workspaceService.onDidChangeWorkspaceFolders(update));
|
|
243
|
-
}
|
|
244
|
-
dispose() {
|
|
245
|
-
this._disposables.dispose();
|
|
246
|
-
}
|
|
247
|
-
filter(element, _parentVisibility) {
|
|
248
|
-
if (isWorkspaceFolder(element)) {
|
|
249
|
-
return true;
|
|
250
|
-
}
|
|
251
|
-
const folder = this._workspaceService.getWorkspaceFolder(element.resource);
|
|
252
|
-
if (!folder || !( this._cachedExpressions.has(( folder.uri.toString())))) {
|
|
253
|
-
return true;
|
|
254
|
-
}
|
|
255
|
-
const expression = this._cachedExpressions.get(( folder.uri.toString()));
|
|
256
|
-
return !expression(relative(folder.uri.path, element.resource.path), basename(element.resource));
|
|
257
|
-
}
|
|
258
|
-
};
|
|
259
|
-
FileFilter = ( __decorate([
|
|
260
|
-
( __param(0, IWorkspaceContextService)),
|
|
261
|
-
( __param(1, IConfigurationService))
|
|
262
|
-
], FileFilter));
|
|
263
|
-
class FileSorter {
|
|
264
|
-
compare(a, b) {
|
|
265
|
-
if (isWorkspaceFolder(a) && isWorkspaceFolder(b)) {
|
|
266
|
-
return a.index - b.index;
|
|
267
|
-
}
|
|
268
|
-
if (a.isDirectory === b.isDirectory) {
|
|
269
|
-
return compareFileNames(a.name, b.name);
|
|
270
|
-
}
|
|
271
|
-
else if (a.isDirectory) {
|
|
272
|
-
return -1;
|
|
273
|
-
}
|
|
274
|
-
else {
|
|
275
|
-
return 1;
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
let BreadcrumbsFilePicker = class BreadcrumbsFilePicker extends BreadcrumbsPicker {
|
|
280
|
-
constructor(parent, resource, instantiationService, themeService, configService, _workspaceService, _editorService) {
|
|
281
|
-
super(parent, resource, instantiationService, themeService, configService);
|
|
282
|
-
this._workspaceService = _workspaceService;
|
|
283
|
-
this._editorService = _editorService;
|
|
284
|
-
}
|
|
285
|
-
_createTree(container) {
|
|
286
|
-
this._treeContainer.classList.add('file-icon-themable-tree');
|
|
287
|
-
this._treeContainer.classList.add('show-file-icons');
|
|
288
|
-
const onFileIconThemeChange = (fileIconTheme) => {
|
|
289
|
-
this._treeContainer.classList.toggle('align-icons-and-twisties', fileIconTheme.hasFileIcons && !fileIconTheme.hasFolderIcons);
|
|
290
|
-
this._treeContainer.classList.toggle('hide-arrows', fileIconTheme.hidesExplorerArrows === true);
|
|
291
|
-
};
|
|
292
|
-
this._disposables.add(this._themeService.onDidFileIconThemeChange(onFileIconThemeChange));
|
|
293
|
-
onFileIconThemeChange(this._themeService.getFileIconTheme());
|
|
294
|
-
const labels = this._instantiationService.createInstance(ResourceLabels, DEFAULT_LABELS_CONTAINER );
|
|
295
|
-
this._disposables.add(labels);
|
|
296
|
-
return this._instantiationService.createInstance(WorkbenchAsyncDataTree, 'BreadcrumbsFilePicker', container, ( new FileVirtualDelegate()), [this._instantiationService.createInstance(FileRenderer, labels)], this._instantiationService.createInstance(FileDataSource), {
|
|
297
|
-
multipleSelectionSupport: false,
|
|
298
|
-
sorter: ( new FileSorter()),
|
|
299
|
-
filter: this._instantiationService.createInstance(FileFilter),
|
|
300
|
-
identityProvider: ( new FileIdentityProvider()),
|
|
301
|
-
keyboardNavigationLabelProvider: ( new FileNavigationLabelProvider()),
|
|
302
|
-
accessibilityProvider: this._instantiationService.createInstance(FileAccessibilityProvider),
|
|
303
|
-
showNotFoundMessage: false,
|
|
304
|
-
overrideStyles: {
|
|
305
|
-
listBackground: breadcrumbsPickerBackground
|
|
306
|
-
},
|
|
307
|
-
});
|
|
308
|
-
}
|
|
309
|
-
async _setInput(element) {
|
|
310
|
-
const { uri, kind } = element;
|
|
311
|
-
let input;
|
|
312
|
-
if (kind === FileKind.ROOT_FOLDER) {
|
|
313
|
-
input = this._workspaceService.getWorkspace();
|
|
314
|
-
}
|
|
315
|
-
else {
|
|
316
|
-
input = dirname(uri);
|
|
317
|
-
}
|
|
318
|
-
const tree = this._tree;
|
|
319
|
-
await tree.setInput(input);
|
|
320
|
-
let focusElement;
|
|
321
|
-
for (const { element } of tree.getNode().children) {
|
|
322
|
-
if (isWorkspaceFolder(element) && isEqual(element.uri, uri)) {
|
|
323
|
-
focusElement = element;
|
|
324
|
-
break;
|
|
325
|
-
}
|
|
326
|
-
else if (isEqual(element.resource, uri)) {
|
|
327
|
-
focusElement = element;
|
|
328
|
-
break;
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
if (focusElement) {
|
|
332
|
-
tree.reveal(focusElement, 0.5);
|
|
333
|
-
tree.setFocus([focusElement], this._fakeEvent);
|
|
334
|
-
}
|
|
335
|
-
tree.domFocus();
|
|
336
|
-
}
|
|
337
|
-
_previewElement(_element) {
|
|
338
|
-
return Disposable.None;
|
|
339
|
-
}
|
|
340
|
-
async _revealElement(element, options, sideBySide) {
|
|
341
|
-
if (!isWorkspaceFolder(element) && element.isFile) {
|
|
342
|
-
this._onWillPickElement.fire();
|
|
343
|
-
await this._editorService.openEditor({ resource: element.resource, options }, sideBySide ? SIDE_GROUP : undefined);
|
|
344
|
-
return true;
|
|
345
|
-
}
|
|
346
|
-
return false;
|
|
347
|
-
}
|
|
348
|
-
};
|
|
349
|
-
BreadcrumbsFilePicker = ( __decorate([
|
|
350
|
-
( __param(2, IInstantiationService)),
|
|
351
|
-
( __param(3, IThemeService)),
|
|
352
|
-
( __param(4, IConfigurationService)),
|
|
353
|
-
( __param(5, IWorkspaceContextService)),
|
|
354
|
-
( __param(6, IEditorService))
|
|
355
|
-
], BreadcrumbsFilePicker));
|
|
356
|
-
let OutlineTreeSorter = class OutlineTreeSorter {
|
|
357
|
-
constructor(comparator, uri, configService) {
|
|
358
|
-
this.comparator = comparator;
|
|
359
|
-
this._order = configService.getValue(uri, 'breadcrumbs.symbolSortOrder');
|
|
360
|
-
}
|
|
361
|
-
compare(a, b) {
|
|
362
|
-
if (this._order === 'name') {
|
|
363
|
-
return this.comparator.compareByName(a, b);
|
|
364
|
-
}
|
|
365
|
-
else if (this._order === 'type') {
|
|
366
|
-
return this.comparator.compareByType(a, b);
|
|
367
|
-
}
|
|
368
|
-
else {
|
|
369
|
-
return this.comparator.compareByPosition(a, b);
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
};
|
|
373
|
-
OutlineTreeSorter = ( __decorate([
|
|
374
|
-
( __param(2, ITextResourceConfigurationService))
|
|
375
|
-
], OutlineTreeSorter));
|
|
376
|
-
class BreadcrumbsOutlinePicker extends BreadcrumbsPicker {
|
|
377
|
-
_createTree(container, input) {
|
|
378
|
-
const { config } = input.outline;
|
|
379
|
-
return this._instantiationService.createInstance(WorkbenchDataTree, 'BreadcrumbsOutlinePicker', container, config.delegate, config.renderers, config.treeDataSource, {
|
|
380
|
-
...config.options,
|
|
381
|
-
sorter: this._instantiationService.createInstance(OutlineTreeSorter, config.comparator, undefined),
|
|
382
|
-
collapseByDefault: true,
|
|
383
|
-
expandOnlyOnTwistieClick: true,
|
|
384
|
-
multipleSelectionSupport: false,
|
|
385
|
-
showNotFoundMessage: false
|
|
386
|
-
});
|
|
387
|
-
}
|
|
388
|
-
_setInput(input) {
|
|
389
|
-
const viewState = input.outline.captureViewState();
|
|
390
|
-
this.restoreViewState = () => { viewState.dispose(); };
|
|
391
|
-
const tree = this._tree;
|
|
392
|
-
tree.setInput(input.outline);
|
|
393
|
-
if (input.element !== input.outline) {
|
|
394
|
-
tree.reveal(input.element, 0.5);
|
|
395
|
-
tree.setFocus([input.element], this._fakeEvent);
|
|
396
|
-
}
|
|
397
|
-
tree.domFocus();
|
|
398
|
-
return Promise.resolve();
|
|
399
|
-
}
|
|
400
|
-
_previewElement(element) {
|
|
401
|
-
const outline = this._tree.getInput();
|
|
402
|
-
return outline.preview(element);
|
|
403
|
-
}
|
|
404
|
-
async _revealElement(element, options, sideBySide) {
|
|
405
|
-
this._onWillPickElement.fire();
|
|
406
|
-
const outline = this._tree.getInput();
|
|
407
|
-
await outline.reveal(element, options, sideBySide);
|
|
408
|
-
return true;
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
export { BreadcrumbsFilePicker, BreadcrumbsOutlinePicker, BreadcrumbsPicker, FileSorter };
|