@codingame/monaco-vscode-views-service-override 2.1.4 → 2.2.0-next.2
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/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,432 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { Event } from 'vscode/vscode/vs/base/common/event';
|
|
3
|
-
import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace';
|
|
4
|
-
import { DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
5
|
-
import { ExplorerModel, ExplorerItem } from 'vscode/vscode/vs/workbench/contrib/files/common/explorerModel';
|
|
6
|
-
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files';
|
|
7
|
-
import { dirname, basename } from 'vscode/vscode/vs/base/common/resources';
|
|
8
|
-
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
9
|
-
import { IClipboardService } from 'vscode/vscode/vs/platform/clipboard/common/clipboardService';
|
|
10
|
-
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
11
|
-
import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity';
|
|
12
|
-
import { IBulkEditService } from 'vscode/vscode/vs/editor/browser/services/bulkEditService';
|
|
13
|
-
import { UndoRedoSource } from 'vscode/vscode/vs/platform/undoRedo/common/undoRedo';
|
|
14
|
-
import { IProgressService } from 'vscode/vscode/vs/platform/progress/common/progress';
|
|
15
|
-
import { CancellationTokenSource } from 'vscode/vscode/vs/base/common/cancellation';
|
|
16
|
-
import { RunOnceScheduler } from 'vscode/vscode/vs/base/common/async';
|
|
17
|
-
import { IHostService } from 'vscode/vscode/vs/workbench/services/host/browser/host';
|
|
18
|
-
import { ResourceGlobMatcher } from 'vscode/vscode/vs/workbench/common/resources';
|
|
19
|
-
import { IFilesConfigurationService } from 'vscode/vscode/vs/workbench/services/filesConfiguration/common/filesConfigurationService';
|
|
20
|
-
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
|
|
21
|
-
|
|
22
|
-
var ExplorerService_1;
|
|
23
|
-
const UNDO_REDO_SOURCE = ( new UndoRedoSource());
|
|
24
|
-
let ExplorerService = class ExplorerService {
|
|
25
|
-
static { ExplorerService_1 = this; }
|
|
26
|
-
static { this.EXPLORER_FILE_CHANGES_REACT_DELAY = 500; }
|
|
27
|
-
constructor(fileService, configurationService, contextService, clipboardService, editorService, uriIdentityService, bulkEditService, progressService, hostService, filesConfigurationService, telemetryService) {
|
|
28
|
-
this.fileService = fileService;
|
|
29
|
-
this.configurationService = configurationService;
|
|
30
|
-
this.contextService = contextService;
|
|
31
|
-
this.clipboardService = clipboardService;
|
|
32
|
-
this.editorService = editorService;
|
|
33
|
-
this.uriIdentityService = uriIdentityService;
|
|
34
|
-
this.bulkEditService = bulkEditService;
|
|
35
|
-
this.progressService = progressService;
|
|
36
|
-
this.filesConfigurationService = filesConfigurationService;
|
|
37
|
-
this.telemetryService = telemetryService;
|
|
38
|
-
this.disposables = ( new DisposableStore());
|
|
39
|
-
this.fileChangeEvents = [];
|
|
40
|
-
this.config = this.configurationService.getValue('explorer');
|
|
41
|
-
this.model = ( new ExplorerModel(
|
|
42
|
-
this.contextService,
|
|
43
|
-
this.uriIdentityService,
|
|
44
|
-
this.fileService,
|
|
45
|
-
this.configurationService,
|
|
46
|
-
this.filesConfigurationService
|
|
47
|
-
));
|
|
48
|
-
this.disposables.add(this.model);
|
|
49
|
-
this.disposables.add(this.fileService.onDidRunOperation(e => this.onDidRunOperation(e)));
|
|
50
|
-
this.onFileChangesScheduler = ( new RunOnceScheduler(async () => {
|
|
51
|
-
const events = this.fileChangeEvents;
|
|
52
|
-
this.fileChangeEvents = [];
|
|
53
|
-
const types = [2 ];
|
|
54
|
-
if (this.config.sortOrder === "modified" ) {
|
|
55
|
-
types.push(0 );
|
|
56
|
-
}
|
|
57
|
-
let shouldRefresh = false;
|
|
58
|
-
this.roots.forEach(r => {
|
|
59
|
-
if (this.view && !shouldRefresh) {
|
|
60
|
-
shouldRefresh = doesFileEventAffect(r, this.view, events, types);
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
events.forEach(e => {
|
|
64
|
-
if (!shouldRefresh) {
|
|
65
|
-
for (const resource of e.rawAdded) {
|
|
66
|
-
const parent = this.model.findClosest(dirname(resource));
|
|
67
|
-
if (parent && !parent.getChild(basename(resource))) {
|
|
68
|
-
shouldRefresh = true;
|
|
69
|
-
break;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
if (shouldRefresh) {
|
|
75
|
-
await this.refresh(false);
|
|
76
|
-
}
|
|
77
|
-
}, ExplorerService_1.EXPLORER_FILE_CHANGES_REACT_DELAY));
|
|
78
|
-
this.disposables.add(this.fileService.onDidFilesChange(e => {
|
|
79
|
-
this.fileChangeEvents.push(e);
|
|
80
|
-
if (this.editable) {
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
if (!this.onFileChangesScheduler.isScheduled()) {
|
|
84
|
-
this.onFileChangesScheduler.schedule();
|
|
85
|
-
}
|
|
86
|
-
}));
|
|
87
|
-
this.disposables.add(this.configurationService.onDidChangeConfiguration(e => this.onConfigurationUpdated(e)));
|
|
88
|
-
this.disposables.add(Event.any(this.fileService.onDidChangeFileSystemProviderRegistrations, this.fileService.onDidChangeFileSystemProviderCapabilities)(async (e) => {
|
|
89
|
-
let affected = false;
|
|
90
|
-
this.model.roots.forEach(r => {
|
|
91
|
-
if (r.resource.scheme === e.scheme) {
|
|
92
|
-
affected = true;
|
|
93
|
-
r.forgetChildren();
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
if (affected) {
|
|
97
|
-
if (this.view) {
|
|
98
|
-
await this.view.setTreeInput();
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}));
|
|
102
|
-
this.disposables.add(this.model.onDidChangeRoots(() => {
|
|
103
|
-
this.view?.setTreeInput();
|
|
104
|
-
}));
|
|
105
|
-
this.disposables.add(hostService.onDidChangeFocus(hasFocus => {
|
|
106
|
-
if (hasFocus) {
|
|
107
|
-
this.refresh(false);
|
|
108
|
-
}
|
|
109
|
-
}));
|
|
110
|
-
this.revealExcludeMatcher = ( new ResourceGlobMatcher(
|
|
111
|
-
(uri) => getRevealExcludes(configurationService.getValue({ resource: uri })),
|
|
112
|
-
(event) => event.affectsConfiguration('explorer.autoRevealExclude'),
|
|
113
|
-
contextService,
|
|
114
|
-
configurationService
|
|
115
|
-
));
|
|
116
|
-
this.disposables.add(this.revealExcludeMatcher);
|
|
117
|
-
}
|
|
118
|
-
get roots() {
|
|
119
|
-
return this.model.roots;
|
|
120
|
-
}
|
|
121
|
-
get sortOrderConfiguration() {
|
|
122
|
-
return {
|
|
123
|
-
sortOrder: this.config.sortOrder,
|
|
124
|
-
lexicographicOptions: this.config.sortOrderLexicographicOptions,
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
registerView(contextProvider) {
|
|
128
|
-
this.view = contextProvider;
|
|
129
|
-
}
|
|
130
|
-
getContext(respectMultiSelection, ignoreNestedChildren = false) {
|
|
131
|
-
if (!this.view) {
|
|
132
|
-
return [];
|
|
133
|
-
}
|
|
134
|
-
const items = ( new Set(this.view.getContext(respectMultiSelection)));
|
|
135
|
-
items.forEach(item => {
|
|
136
|
-
try {
|
|
137
|
-
if (respectMultiSelection && !ignoreNestedChildren && this.view?.isItemCollapsed(item) && item.nestedChildren) {
|
|
138
|
-
for (const child of item.nestedChildren) {
|
|
139
|
-
items.add(child);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
catch {
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
return [...items];
|
|
148
|
-
}
|
|
149
|
-
async applyBulkEdit(edit, options) {
|
|
150
|
-
const cancellationTokenSource = ( new CancellationTokenSource());
|
|
151
|
-
const promise = this.progressService.withProgress({
|
|
152
|
-
location: options.progressLocation || 10 ,
|
|
153
|
-
title: options.progressLabel,
|
|
154
|
-
cancellable: edit.length > 1,
|
|
155
|
-
delay: 500,
|
|
156
|
-
}, async (progress) => {
|
|
157
|
-
await this.bulkEditService.apply(edit, {
|
|
158
|
-
undoRedoSource: UNDO_REDO_SOURCE,
|
|
159
|
-
label: options.undoLabel,
|
|
160
|
-
code: 'undoredo.explorerOperation',
|
|
161
|
-
progress,
|
|
162
|
-
token: cancellationTokenSource.token,
|
|
163
|
-
confirmBeforeUndo: options.confirmBeforeUndo
|
|
164
|
-
});
|
|
165
|
-
}, () => cancellationTokenSource.cancel());
|
|
166
|
-
await this.progressService.withProgress({ location: 1 , delay: 500 }, () => promise);
|
|
167
|
-
cancellationTokenSource.dispose();
|
|
168
|
-
}
|
|
169
|
-
hasViewFocus() {
|
|
170
|
-
return !!this.view && this.view.hasFocus();
|
|
171
|
-
}
|
|
172
|
-
findClosest(resource) {
|
|
173
|
-
return this.model.findClosest(resource);
|
|
174
|
-
}
|
|
175
|
-
findClosestRoot(resource) {
|
|
176
|
-
const parentRoots = this.model.roots.filter(r => this.uriIdentityService.extUri.isEqualOrParent(resource, r.resource))
|
|
177
|
-
.sort((first, second) => second.resource.path.length - first.resource.path.length);
|
|
178
|
-
return parentRoots.length ? parentRoots[0] : null;
|
|
179
|
-
}
|
|
180
|
-
async setEditable(stat, data) {
|
|
181
|
-
if (!this.view) {
|
|
182
|
-
return;
|
|
183
|
-
}
|
|
184
|
-
if (!data) {
|
|
185
|
-
this.editable = undefined;
|
|
186
|
-
}
|
|
187
|
-
else {
|
|
188
|
-
this.editable = { stat, data };
|
|
189
|
-
}
|
|
190
|
-
const isEditing = this.isEditable(stat);
|
|
191
|
-
try {
|
|
192
|
-
await this.view.setEditable(stat, isEditing);
|
|
193
|
-
}
|
|
194
|
-
catch {
|
|
195
|
-
const parent = stat.parent;
|
|
196
|
-
const errorData = {
|
|
197
|
-
parentIsDirectory: parent?.isDirectory,
|
|
198
|
-
isDirectory: stat.isDirectory,
|
|
199
|
-
isReadonly: !!stat.isReadonly,
|
|
200
|
-
parentIsReadonly: !!parent?.isReadonly,
|
|
201
|
-
parentIsExcluded: parent?.isExcluded,
|
|
202
|
-
isExcluded: stat.isExcluded,
|
|
203
|
-
parentIsRoot: parent?.isRoot,
|
|
204
|
-
isRoot: stat.isRoot,
|
|
205
|
-
parentHasNests: parent?.hasNests,
|
|
206
|
-
hasNests: stat.hasNests,
|
|
207
|
-
};
|
|
208
|
-
this.telemetryService.publicLogError2('explorerView.setEditableError', errorData);
|
|
209
|
-
return;
|
|
210
|
-
}
|
|
211
|
-
if (!this.editable && this.fileChangeEvents.length && !this.onFileChangesScheduler.isScheduled()) {
|
|
212
|
-
this.onFileChangesScheduler.schedule();
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
async setToCopy(items, cut) {
|
|
216
|
-
const previouslyCutItems = this.cutItems;
|
|
217
|
-
this.cutItems = cut ? items : undefined;
|
|
218
|
-
await this.clipboardService.writeResources(( items.map(s => s.resource)));
|
|
219
|
-
this.view?.itemsCopied(items, cut, previouslyCutItems);
|
|
220
|
-
}
|
|
221
|
-
isCut(item) {
|
|
222
|
-
return !!this.cutItems && ( this.cutItems.some(i => this.uriIdentityService.extUri.isEqual(i.resource, item.resource)));
|
|
223
|
-
}
|
|
224
|
-
getEditable() {
|
|
225
|
-
return this.editable;
|
|
226
|
-
}
|
|
227
|
-
getEditableData(stat) {
|
|
228
|
-
return this.editable && this.editable.stat === stat ? this.editable.data : undefined;
|
|
229
|
-
}
|
|
230
|
-
isEditable(stat) {
|
|
231
|
-
return !!this.editable && (this.editable.stat === stat || !stat);
|
|
232
|
-
}
|
|
233
|
-
async select(resource, reveal) {
|
|
234
|
-
if (!this.view) {
|
|
235
|
-
return;
|
|
236
|
-
}
|
|
237
|
-
const ignoreRevealExcludes = reveal === 'force';
|
|
238
|
-
const fileStat = this.findClosest(resource);
|
|
239
|
-
if (fileStat) {
|
|
240
|
-
if (!this.shouldAutoRevealItem(fileStat, ignoreRevealExcludes)) {
|
|
241
|
-
return;
|
|
242
|
-
}
|
|
243
|
-
await this.view.selectResource(fileStat.resource, reveal);
|
|
244
|
-
return Promise.resolve(undefined);
|
|
245
|
-
}
|
|
246
|
-
const options = { resolveTo: [resource], resolveMetadata: this.config.sortOrder === "modified" };
|
|
247
|
-
const root = this.findClosestRoot(resource);
|
|
248
|
-
if (!root) {
|
|
249
|
-
return undefined;
|
|
250
|
-
}
|
|
251
|
-
try {
|
|
252
|
-
const stat = await this.fileService.resolve(root.resource, options);
|
|
253
|
-
const modelStat = ExplorerItem.create(this.fileService, this.configurationService, this.filesConfigurationService, stat, undefined, options.resolveTo);
|
|
254
|
-
ExplorerItem.mergeLocalWithDisk(modelStat, root);
|
|
255
|
-
const item = root.find(resource);
|
|
256
|
-
await this.view.refresh(true, root);
|
|
257
|
-
if (item && !this.shouldAutoRevealItem(item, ignoreRevealExcludes)) {
|
|
258
|
-
return;
|
|
259
|
-
}
|
|
260
|
-
await this.view.selectResource(item ? item.resource : undefined, reveal);
|
|
261
|
-
}
|
|
262
|
-
catch (error) {
|
|
263
|
-
root.error = error;
|
|
264
|
-
await this.view.refresh(false, root);
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
async refresh(reveal = true) {
|
|
268
|
-
this.model.roots.forEach(r => r.forgetChildren());
|
|
269
|
-
if (this.view) {
|
|
270
|
-
await this.view.refresh(true);
|
|
271
|
-
const resource = this.editorService.activeEditor?.resource;
|
|
272
|
-
const autoReveal = this.configurationService.getValue().explorer.autoReveal;
|
|
273
|
-
if (reveal && resource && autoReveal) {
|
|
274
|
-
this.select(resource, autoReveal);
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
async onDidRunOperation(e) {
|
|
279
|
-
const shouldDeepRefresh = this.config.fileNesting.enabled;
|
|
280
|
-
if (e.isOperation(0 ) || e.isOperation(3 )) {
|
|
281
|
-
const addedElement = e.target;
|
|
282
|
-
const parentResource = dirname(addedElement.resource);
|
|
283
|
-
const parents = this.model.findAll(parentResource);
|
|
284
|
-
if (parents.length) {
|
|
285
|
-
await Promise.all(( parents.map(async (p) => {
|
|
286
|
-
const resolveMetadata = this.config.sortOrder === `modified`;
|
|
287
|
-
if (!p.isDirectoryResolved) {
|
|
288
|
-
const stat = await this.fileService.resolve(p.resource, { resolveMetadata });
|
|
289
|
-
if (stat) {
|
|
290
|
-
const modelStat = ExplorerItem.create(this.fileService, this.configurationService, this.filesConfigurationService, stat, p.parent);
|
|
291
|
-
ExplorerItem.mergeLocalWithDisk(modelStat, p);
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
const childElement = ExplorerItem.create(this.fileService, this.configurationService, this.filesConfigurationService, addedElement, p.parent);
|
|
295
|
-
p.removeChild(childElement);
|
|
296
|
-
p.addChild(childElement);
|
|
297
|
-
await this.view?.refresh(shouldDeepRefresh, p);
|
|
298
|
-
})));
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
else if (e.isOperation(2 )) {
|
|
302
|
-
const oldResource = e.resource;
|
|
303
|
-
const newElement = e.target;
|
|
304
|
-
const oldParentResource = dirname(oldResource);
|
|
305
|
-
const newParentResource = dirname(newElement.resource);
|
|
306
|
-
const modelElements = this.model.findAll(oldResource);
|
|
307
|
-
const sameParentMove = modelElements.every(e => !e.nestedParent) && this.uriIdentityService.extUri.isEqual(oldParentResource, newParentResource);
|
|
308
|
-
if (sameParentMove) {
|
|
309
|
-
await Promise.all(( modelElements.map(async (modelElement) => {
|
|
310
|
-
modelElement.rename(newElement);
|
|
311
|
-
await this.view?.refresh(shouldDeepRefresh, modelElement.parent);
|
|
312
|
-
})));
|
|
313
|
-
}
|
|
314
|
-
else {
|
|
315
|
-
const newParents = this.model.findAll(newParentResource);
|
|
316
|
-
if (newParents.length && modelElements.length) {
|
|
317
|
-
await Promise.all(( modelElements.map(async (modelElement, index) => {
|
|
318
|
-
const oldParent = modelElement.parent;
|
|
319
|
-
const oldNestedParent = modelElement.nestedParent;
|
|
320
|
-
modelElement.move(newParents[index]);
|
|
321
|
-
if (oldNestedParent) {
|
|
322
|
-
await this.view?.refresh(false, oldNestedParent);
|
|
323
|
-
}
|
|
324
|
-
await this.view?.refresh(false, oldParent);
|
|
325
|
-
await this.view?.refresh(shouldDeepRefresh, newParents[index]);
|
|
326
|
-
})));
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
else if (e.isOperation(1 )) {
|
|
331
|
-
const modelElements = this.model.findAll(e.resource);
|
|
332
|
-
await Promise.all(( modelElements.map(async (modelElement) => {
|
|
333
|
-
if (modelElement.parent) {
|
|
334
|
-
const parent = modelElement.parent;
|
|
335
|
-
parent.removeChild(modelElement);
|
|
336
|
-
this.view?.focusNext();
|
|
337
|
-
const oldNestedParent = modelElement.nestedParent;
|
|
338
|
-
if (oldNestedParent) {
|
|
339
|
-
oldNestedParent.removeChild(modelElement);
|
|
340
|
-
await this.view?.refresh(false, oldNestedParent);
|
|
341
|
-
}
|
|
342
|
-
await this.view?.refresh(shouldDeepRefresh, parent);
|
|
343
|
-
if (this.view?.getFocus().length === 0) {
|
|
344
|
-
this.view?.focusLast();
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
})));
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
shouldAutoRevealItem(item, ignore) {
|
|
351
|
-
if (item === undefined || ignore) {
|
|
352
|
-
return true;
|
|
353
|
-
}
|
|
354
|
-
if (this.revealExcludeMatcher.matches(item.resource, name => !!(item.parent && item.parent.getChild(name)))) {
|
|
355
|
-
return false;
|
|
356
|
-
}
|
|
357
|
-
const root = item.root;
|
|
358
|
-
let currentItem = item.parent;
|
|
359
|
-
while (currentItem !== root) {
|
|
360
|
-
if (currentItem === undefined) {
|
|
361
|
-
return true;
|
|
362
|
-
}
|
|
363
|
-
if (this.revealExcludeMatcher.matches(currentItem.resource)) {
|
|
364
|
-
return false;
|
|
365
|
-
}
|
|
366
|
-
currentItem = currentItem.parent;
|
|
367
|
-
}
|
|
368
|
-
return true;
|
|
369
|
-
}
|
|
370
|
-
async onConfigurationUpdated(event) {
|
|
371
|
-
if (!event.affectsConfiguration('explorer')) {
|
|
372
|
-
return;
|
|
373
|
-
}
|
|
374
|
-
let shouldRefresh = false;
|
|
375
|
-
if (event.affectsConfiguration('explorer.fileNesting')) {
|
|
376
|
-
shouldRefresh = true;
|
|
377
|
-
}
|
|
378
|
-
const configuration = this.configurationService.getValue();
|
|
379
|
-
const configSortOrder = configuration?.explorer?.sortOrder || "default" ;
|
|
380
|
-
if (this.config.sortOrder !== configSortOrder) {
|
|
381
|
-
shouldRefresh = this.config.sortOrder !== undefined;
|
|
382
|
-
}
|
|
383
|
-
const configLexicographicOptions = configuration?.explorer?.sortOrderLexicographicOptions || "default" ;
|
|
384
|
-
if (this.config.sortOrderLexicographicOptions !== configLexicographicOptions) {
|
|
385
|
-
shouldRefresh = shouldRefresh || this.config.sortOrderLexicographicOptions !== undefined;
|
|
386
|
-
}
|
|
387
|
-
this.config = configuration.explorer;
|
|
388
|
-
if (shouldRefresh) {
|
|
389
|
-
await this.refresh();
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
dispose() {
|
|
393
|
-
this.disposables.dispose();
|
|
394
|
-
}
|
|
395
|
-
};
|
|
396
|
-
ExplorerService = ExplorerService_1 = ( __decorate([
|
|
397
|
-
( __param(0, IFileService)),
|
|
398
|
-
( __param(1, IConfigurationService)),
|
|
399
|
-
( __param(2, IWorkspaceContextService)),
|
|
400
|
-
( __param(3, IClipboardService)),
|
|
401
|
-
( __param(4, IEditorService)),
|
|
402
|
-
( __param(5, IUriIdentityService)),
|
|
403
|
-
( __param(6, IBulkEditService)),
|
|
404
|
-
( __param(7, IProgressService)),
|
|
405
|
-
( __param(8, IHostService)),
|
|
406
|
-
( __param(9, IFilesConfigurationService)),
|
|
407
|
-
( __param(10, ITelemetryService))
|
|
408
|
-
], ExplorerService));
|
|
409
|
-
function doesFileEventAffect(item, view, events, types) {
|
|
410
|
-
for (const [_name, child] of item.children) {
|
|
411
|
-
if (view.isItemVisible(child)) {
|
|
412
|
-
if (( events.some(e => e.contains(child.resource, ...types)))) {
|
|
413
|
-
return true;
|
|
414
|
-
}
|
|
415
|
-
if (child.isDirectory && child.isDirectoryResolved) {
|
|
416
|
-
if (doesFileEventAffect(child, view, events, types)) {
|
|
417
|
-
return true;
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
return false;
|
|
423
|
-
}
|
|
424
|
-
function getRevealExcludes(configuration) {
|
|
425
|
-
const revealExcludes = configuration && configuration.explorer && configuration.explorer.autoRevealExclude;
|
|
426
|
-
if (!revealExcludes) {
|
|
427
|
-
return {};
|
|
428
|
-
}
|
|
429
|
-
return revealExcludes;
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
export { ExplorerService, UNDO_REDO_SOURCE };
|