@codingame/monaco-vscode-api 2.1.4 → 2.2.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/contributions.js +1 -0
- package/extensions.d.ts +6 -3
- package/extensions.js +18 -7
- package/lifecycle.js +11 -3
- package/missing-services.js +55 -10
- package/monaco.js +7 -3
- package/package.json +8 -8
- package/service-override/tools/views.d.ts +98 -0
- package/service-override/tools/views.js +249 -0
- package/services.d.ts +4 -2
- package/services.js +11 -9
- package/vscode/src/vs/base/browser/deviceAccess.js +60 -0
- package/vscode/src/vs/base/browser/dom.js +18 -1
- package/vscode/src/vs/base/browser/ui/centered/centeredViewLayout.js +178 -0
- package/vscode/src/vs/base/browser/ui/grid/grid.js +492 -0
- package/vscode/src/vs/base/browser/ui/grid/gridview.css.js +4 -0
- package/vscode/src/vs/base/browser/ui/grid/gridview.d.ts +1 -0
- package/vscode/src/vs/base/browser/ui/grid/gridview.js +1109 -0
- package/vscode/src/vs/base/browser/ui/sash/sash.js +9 -1
- package/vscode/src/vs/base/browser/ui/splitview/splitview.d.ts +348 -1
- package/vscode/src/vs/base/common/async.js +46 -2
- package/vscode/src/vs/base/common/codicons.d.ts +579 -0
- package/vscode/src/vs/base/common/event.js +11 -2
- package/vscode/src/vs/base/common/keybindingParser.js +87 -0
- package/vscode/src/vs/base/common/network.js +1 -2
- package/vscode/src/vs/base/common/observableInternal/utils.js +1 -1
- package/vscode/src/vs/base/common/platform.js +2 -1
- package/vscode/src/vs/base/common/scrollable.d.ts +28 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/colors.js +17 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/diffEditorItemTemplate.js +214 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/multiDiffEditorViewModel.js +84 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/multiDiffEditorWidget.js +54 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/multiDiffEditorWidgetImpl.js +324 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/objectPool.js +46 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/style.css.js +4 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/utils.js +11 -0
- package/vscode/src/vs/platform/keyboardLayout/common/keyboardLayout.js +61 -1
- package/vscode/src/vs/platform/languagePacks/common/localizedStrings.js +10 -0
- package/vscode/src/vs/platform/log/browser/log.js +24 -0
- package/vscode/src/vs/platform/product/common/product.js +1 -2
- package/vscode/src/vs/platform/userDataSync/common/abstractSynchronizer.js +772 -0
- package/vscode/src/vs/platform/userDataSync/common/userDataSyncStoreService.js +551 -0
- package/vscode/src/vs/platform/webview/common/mimeTypes.js +22 -0
- package/vscode/src/vs/platform/webview/common/webviewPortMapping.js +62 -0
- package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +788 -0
- package/vscode/src/vs/workbench/browser/actions/listCommands.js +763 -0
- package/vscode/src/vs/workbench/browser/layout.d.ts +26 -0
- package/vscode/src/vs/workbench/browser/media/style.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.js +610 -0
- package/vscode/src/vs/workbench/browser/parts/activitybar/media/activityaction.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/activitybar/media/activitybarpart.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.js +148 -0
- package/vscode/src/vs/workbench/browser/parts/auxiliarybar/media/auxiliaryBarPart.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/compositeBar.js +603 -0
- package/vscode/src/vs/workbench/browser/parts/compositePart.js +333 -0
- package/vscode/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.js +221 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +1406 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +184 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorDropTarget.js +509 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorPane.d.ts +112 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorPart.js +1018 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorParts.js +389 -0
- package/vscode/src/vs/workbench/browser/parts/editor/media/editordroptarget.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/media/compositepart.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/media/paneCompositePart.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/media/notificationsActions.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/media/notificationsCenter.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/media/notificationsList.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/media/notificationsToasts.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsActions.js +213 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsAlerts.js +73 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsCenter.js +307 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsList.js +226 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsStatus.js +218 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsToasts.js +433 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsViewer.js +436 -0
- package/vscode/src/vs/workbench/browser/parts/paneCompositeBar.js +643 -0
- package/vscode/src/vs/workbench/browser/parts/paneCompositePart.js +377 -0
- package/vscode/src/vs/workbench/browser/parts/paneCompositePartService.js +66 -0
- package/vscode/src/vs/workbench/browser/parts/panel/panelPart.js +144 -0
- package/vscode/src/vs/workbench/browser/parts/sidebar/media/sidebarpart.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.js +220 -0
- package/vscode/src/vs/workbench/browser/window.js +239 -5
- package/vscode/src/vs/workbench/common/configuration.js +11 -1
- package/vscode/src/vs/workbench/common/theme.js +3 -3
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +298 -0
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.js +363 -0
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.js +133 -0
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/media/callHierarchy.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentGlyphWidget.js +90 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentMenus.js +43 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentService.js +317 -2
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadRangeDecorator.js +107 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +395 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/comments.js +3 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +1277 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsFilterOptions.js +17 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsModel.js +123 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +342 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsView.js +451 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsViewActions.js +176 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/media/panel.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/comments/common/commentModel.js +35 -0
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditor.contribution.js +16 -0
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.js +143 -0
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditors.js +212 -0
- package/vscode/src/vs/workbench/contrib/customEditor/browser/media/customEditor.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/customEditor/common/contributedCustomEditors.js +76 -0
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditorModelManager.js +61 -0
- package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.js +117 -0
- package/vscode/src/vs/workbench/contrib/editSessions/common/editSessions.js +62 -0
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/externalUriOpener.contribution.js +5 -0
- package/vscode/src/vs/workbench/contrib/files/browser/editors/binaryFileEditor.js +77 -0
- package/vscode/src/vs/workbench/contrib/files/browser/editors/fileEditorHandler.js +72 -0
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditor.js +254 -0
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditorTracker.js +97 -0
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.js +442 -0
- package/vscode/src/vs/workbench/contrib/files/browser/explorerService.js +430 -0
- package/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.js +784 -0
- package/vscode/src/vs/workbench/contrib/files/browser/fileCommands.js +487 -0
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution.js +521 -0
- package/vscode/src/vs/workbench/contrib/files/browser/workspaceWatcher.js +150 -0
- package/vscode/src/vs/workbench/contrib/files/common/dirtyFilesIndicator.js +61 -0
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveDocumentService.js +25 -1
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveEditorInput.js +178 -0
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveHistoryService.js +49 -0
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.js +408 -0
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/media/languageStatus.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/limitIndicator/browser/limitIndicator.contribution.js +145 -0
- package/vscode/src/vs/workbench/contrib/mappedEdits/common/mappedEdits.contribution.js +22 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.js +691 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/devCommands.js +238 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.js +76 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorSerializer.js +40 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/colors.js +69 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/conflictActions.js +346 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editorGutter.js +96 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.js +144 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.js +103 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.js +399 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.js +195 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/fixedZoneWidget.js +39 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/lineAlignment.js +126 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/media/mergeEditor.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.js +611 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/scrollSynchronizer.js +156 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.js +262 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewZones.js +171 -0
- package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/multiDiffSourceResolverService.js +41 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +317 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/notebookVisibleCellObserver.js +56 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +315 -0
- package/vscode/src/vs/workbench/contrib/preferences/browser/keyboardLayoutPicker.js +193 -0
- package/vscode/src/vs/workbench/contrib/preferences/common/preferences.js +2 -1
- package/vscode/src/vs/workbench/contrib/sash/browser/sash.contribution.js +37 -0
- package/vscode/src/vs/workbench/contrib/sash/browser/sash.js +39 -0
- package/vscode/src/vs/workbench/contrib/speech/common/speechService.js +138 -2
- package/vscode/src/vs/workbench/contrib/tags/browser/workspaceTagsService.js +12 -0
- package/vscode/src/vs/workbench/contrib/tags/common/workspaceTags.js +3 -0
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/media/typeHierarchy.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +281 -0
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.js +358 -0
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree.js +131 -0
- package/vscode/src/vs/workbench/contrib/update/common/update.js +2 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/overlayWebview.js +288 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/resourceLoading.js +94 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/themeing.js +86 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/webview.contribution.js +77 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +646 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewFindWidget.js +63 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewService.js +57 -0
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.js +140 -0
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewEditorInputSerializer.js +119 -0
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +67 -0
- package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewPane.js +233 -0
- package/vscode/src/vs/workbench/services/activity/browser/activityService.js +143 -0
- package/vscode/src/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.js +0 -3
- package/vscode/src/vs/workbench/services/driver/browser/driver.js +184 -0
- package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +668 -0
- package/vscode/src/vs/workbench/services/history/browser/historyService.js +1482 -0
- package/vscode/src/vs/workbench/services/layout/browser/layoutService.js +17 -1
- package/vscode/src/vs/workbench/services/lifecycle/common/lifecycle.js +8 -1
- package/vscode/src/vs/workbench/services/progress/browser/media/progressService.css.js +4 -0
- package/vscode/src/vs/workbench/services/progress/browser/progressService.js +521 -0
- package/vscode/src/vs/workbench/services/textMate/common/TMGrammars.js +102 -0
- package/vscode/src/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.js +296 -0
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorHandler.js +99 -0
- package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +711 -0
- package/vscode/src/vs/workbench/services/views/common/viewContainerModel.js +596 -0
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { Event } from '../../../../base/common/event.js';
|
|
3
|
+
import { IWorkspaceContextService } from '../../../../platform/workspace/common/workspace.js';
|
|
4
|
+
import { DisposableStore } from '../../../../base/common/lifecycle.js';
|
|
5
|
+
import { ExplorerModel, ExplorerItem } from '../common/explorerModel.js';
|
|
6
|
+
import { IFileService } from '../../../../platform/files/common/files.js';
|
|
7
|
+
import { dirname, basename } from '../../../../base/common/resources.js';
|
|
8
|
+
import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';
|
|
9
|
+
import { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js';
|
|
10
|
+
import { IEditorService } from '../../../services/editor/common/editorService.js';
|
|
11
|
+
import { IUriIdentityService } from '../../../../platform/uriIdentity/common/uriIdentity.js';
|
|
12
|
+
import { IBulkEditService } from '../../../../editor/browser/services/bulkEditService.js';
|
|
13
|
+
import { UndoRedoSource } from '../../../../platform/undoRedo/common/undoRedo.js';
|
|
14
|
+
import { IProgressService } from '../../../../platform/progress/common/progress.js';
|
|
15
|
+
import { CancellationTokenSource } from '../../../../base/common/cancellation.js';
|
|
16
|
+
import { RunOnceScheduler } from '../../../../base/common/async.js';
|
|
17
|
+
import { IHostService } from '../../../services/host/browser/host.js';
|
|
18
|
+
import { ResourceGlobMatcher } from '../../../common/resources.js';
|
|
19
|
+
import { IFilesConfigurationService } from '../../../services/filesConfiguration/common/filesConfigurationService.js';
|
|
20
|
+
import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js';
|
|
21
|
+
var ExplorerService_1;
|
|
22
|
+
const UNDO_REDO_SOURCE = ( new UndoRedoSource());
|
|
23
|
+
let ExplorerService = class ExplorerService {
|
|
24
|
+
static { ExplorerService_1 = this; }
|
|
25
|
+
static { this.EXPLORER_FILE_CHANGES_REACT_DELAY = 500; }
|
|
26
|
+
constructor(fileService, configurationService, contextService, clipboardService, editorService, uriIdentityService, bulkEditService, progressService, hostService, filesConfigurationService, telemetryService) {
|
|
27
|
+
this.fileService = fileService;
|
|
28
|
+
this.configurationService = configurationService;
|
|
29
|
+
this.contextService = contextService;
|
|
30
|
+
this.clipboardService = clipboardService;
|
|
31
|
+
this.editorService = editorService;
|
|
32
|
+
this.uriIdentityService = uriIdentityService;
|
|
33
|
+
this.bulkEditService = bulkEditService;
|
|
34
|
+
this.progressService = progressService;
|
|
35
|
+
this.filesConfigurationService = filesConfigurationService;
|
|
36
|
+
this.telemetryService = telemetryService;
|
|
37
|
+
this.disposables = ( new DisposableStore());
|
|
38
|
+
this.fileChangeEvents = [];
|
|
39
|
+
this.config = this.configurationService.getValue('explorer');
|
|
40
|
+
this.model = ( new ExplorerModel(
|
|
41
|
+
this.contextService,
|
|
42
|
+
this.uriIdentityService,
|
|
43
|
+
this.fileService,
|
|
44
|
+
this.configurationService,
|
|
45
|
+
this.filesConfigurationService
|
|
46
|
+
));
|
|
47
|
+
this.disposables.add(this.model);
|
|
48
|
+
this.disposables.add(this.fileService.onDidRunOperation(e => this.onDidRunOperation(e)));
|
|
49
|
+
this.onFileChangesScheduler = ( new RunOnceScheduler(async () => {
|
|
50
|
+
const events = this.fileChangeEvents;
|
|
51
|
+
this.fileChangeEvents = [];
|
|
52
|
+
const types = [2 ];
|
|
53
|
+
if (this.config.sortOrder === "modified" ) {
|
|
54
|
+
types.push(0 );
|
|
55
|
+
}
|
|
56
|
+
let shouldRefresh = false;
|
|
57
|
+
this.roots.forEach(r => {
|
|
58
|
+
if (this.view && !shouldRefresh) {
|
|
59
|
+
shouldRefresh = doesFileEventAffect(r, this.view, events, types);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
events.forEach(e => {
|
|
63
|
+
if (!shouldRefresh) {
|
|
64
|
+
for (const resource of e.rawAdded) {
|
|
65
|
+
const parent = this.model.findClosest(dirname(resource));
|
|
66
|
+
if (parent && !parent.getChild(basename(resource))) {
|
|
67
|
+
shouldRefresh = true;
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
if (shouldRefresh) {
|
|
74
|
+
await this.refresh(false);
|
|
75
|
+
}
|
|
76
|
+
}, ExplorerService_1.EXPLORER_FILE_CHANGES_REACT_DELAY));
|
|
77
|
+
this.disposables.add(this.fileService.onDidFilesChange(e => {
|
|
78
|
+
this.fileChangeEvents.push(e);
|
|
79
|
+
if (this.editable) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (!this.onFileChangesScheduler.isScheduled()) {
|
|
83
|
+
this.onFileChangesScheduler.schedule();
|
|
84
|
+
}
|
|
85
|
+
}));
|
|
86
|
+
this.disposables.add(this.configurationService.onDidChangeConfiguration(e => this.onConfigurationUpdated(e)));
|
|
87
|
+
this.disposables.add(Event.any(this.fileService.onDidChangeFileSystemProviderRegistrations, this.fileService.onDidChangeFileSystemProviderCapabilities)(async (e) => {
|
|
88
|
+
let affected = false;
|
|
89
|
+
this.model.roots.forEach(r => {
|
|
90
|
+
if (r.resource.scheme === e.scheme) {
|
|
91
|
+
affected = true;
|
|
92
|
+
r.forgetChildren();
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
if (affected) {
|
|
96
|
+
if (this.view) {
|
|
97
|
+
await this.view.setTreeInput();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}));
|
|
101
|
+
this.disposables.add(this.model.onDidChangeRoots(() => {
|
|
102
|
+
this.view?.setTreeInput();
|
|
103
|
+
}));
|
|
104
|
+
this.disposables.add(hostService.onDidChangeFocus(hasFocus => {
|
|
105
|
+
if (hasFocus) {
|
|
106
|
+
this.refresh(false);
|
|
107
|
+
}
|
|
108
|
+
}));
|
|
109
|
+
this.revealExcludeMatcher = ( new ResourceGlobMatcher(
|
|
110
|
+
(uri) => getRevealExcludes(configurationService.getValue({ resource: uri })),
|
|
111
|
+
(event) => event.affectsConfiguration('explorer.autoRevealExclude'),
|
|
112
|
+
contextService,
|
|
113
|
+
configurationService
|
|
114
|
+
));
|
|
115
|
+
this.disposables.add(this.revealExcludeMatcher);
|
|
116
|
+
}
|
|
117
|
+
get roots() {
|
|
118
|
+
return this.model.roots;
|
|
119
|
+
}
|
|
120
|
+
get sortOrderConfiguration() {
|
|
121
|
+
return {
|
|
122
|
+
sortOrder: this.config.sortOrder,
|
|
123
|
+
lexicographicOptions: this.config.sortOrderLexicographicOptions,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
registerView(contextProvider) {
|
|
127
|
+
this.view = contextProvider;
|
|
128
|
+
}
|
|
129
|
+
getContext(respectMultiSelection, ignoreNestedChildren = false) {
|
|
130
|
+
if (!this.view) {
|
|
131
|
+
return [];
|
|
132
|
+
}
|
|
133
|
+
const items = ( new Set(this.view.getContext(respectMultiSelection)));
|
|
134
|
+
items.forEach(item => {
|
|
135
|
+
try {
|
|
136
|
+
if (respectMultiSelection && !ignoreNestedChildren && this.view?.isItemCollapsed(item) && item.nestedChildren) {
|
|
137
|
+
for (const child of item.nestedChildren) {
|
|
138
|
+
items.add(child);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
catch {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
return [...items];
|
|
147
|
+
}
|
|
148
|
+
async applyBulkEdit(edit, options) {
|
|
149
|
+
const cancellationTokenSource = ( new CancellationTokenSource());
|
|
150
|
+
const promise = this.progressService.withProgress({
|
|
151
|
+
location: options.progressLocation || 10 ,
|
|
152
|
+
title: options.progressLabel,
|
|
153
|
+
cancellable: edit.length > 1,
|
|
154
|
+
delay: 500,
|
|
155
|
+
}, async (progress) => {
|
|
156
|
+
await this.bulkEditService.apply(edit, {
|
|
157
|
+
undoRedoSource: UNDO_REDO_SOURCE,
|
|
158
|
+
label: options.undoLabel,
|
|
159
|
+
code: 'undoredo.explorerOperation',
|
|
160
|
+
progress,
|
|
161
|
+
token: cancellationTokenSource.token,
|
|
162
|
+
confirmBeforeUndo: options.confirmBeforeUndo
|
|
163
|
+
});
|
|
164
|
+
}, () => cancellationTokenSource.cancel());
|
|
165
|
+
await this.progressService.withProgress({ location: 1 , delay: 500 }, () => promise);
|
|
166
|
+
cancellationTokenSource.dispose();
|
|
167
|
+
}
|
|
168
|
+
hasViewFocus() {
|
|
169
|
+
return !!this.view && this.view.hasFocus();
|
|
170
|
+
}
|
|
171
|
+
findClosest(resource) {
|
|
172
|
+
return this.model.findClosest(resource);
|
|
173
|
+
}
|
|
174
|
+
findClosestRoot(resource) {
|
|
175
|
+
const parentRoots = this.model.roots.filter(r => this.uriIdentityService.extUri.isEqualOrParent(resource, r.resource))
|
|
176
|
+
.sort((first, second) => second.resource.path.length - first.resource.path.length);
|
|
177
|
+
return parentRoots.length ? parentRoots[0] : null;
|
|
178
|
+
}
|
|
179
|
+
async setEditable(stat, data) {
|
|
180
|
+
if (!this.view) {
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
if (!data) {
|
|
184
|
+
this.editable = undefined;
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
this.editable = { stat, data };
|
|
188
|
+
}
|
|
189
|
+
const isEditing = this.isEditable(stat);
|
|
190
|
+
try {
|
|
191
|
+
await this.view.setEditable(stat, isEditing);
|
|
192
|
+
}
|
|
193
|
+
catch {
|
|
194
|
+
const parent = stat.parent;
|
|
195
|
+
const errorData = {
|
|
196
|
+
parentIsDirectory: parent?.isDirectory,
|
|
197
|
+
isDirectory: stat.isDirectory,
|
|
198
|
+
isReadonly: !!stat.isReadonly,
|
|
199
|
+
parentIsReadonly: !!parent?.isReadonly,
|
|
200
|
+
parentIsExcluded: parent?.isExcluded,
|
|
201
|
+
isExcluded: stat.isExcluded,
|
|
202
|
+
parentIsRoot: parent?.isRoot,
|
|
203
|
+
isRoot: stat.isRoot,
|
|
204
|
+
parentHasNests: parent?.hasNests,
|
|
205
|
+
hasNests: stat.hasNests,
|
|
206
|
+
};
|
|
207
|
+
this.telemetryService.publicLogError2('explorerView.setEditableError', errorData);
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
if (!this.editable && this.fileChangeEvents.length && !this.onFileChangesScheduler.isScheduled()) {
|
|
211
|
+
this.onFileChangesScheduler.schedule();
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
async setToCopy(items, cut) {
|
|
215
|
+
const previouslyCutItems = this.cutItems;
|
|
216
|
+
this.cutItems = cut ? items : undefined;
|
|
217
|
+
await this.clipboardService.writeResources(( items.map(s => s.resource)));
|
|
218
|
+
this.view?.itemsCopied(items, cut, previouslyCutItems);
|
|
219
|
+
}
|
|
220
|
+
isCut(item) {
|
|
221
|
+
return !!this.cutItems && ( this.cutItems.some(i => this.uriIdentityService.extUri.isEqual(i.resource, item.resource)));
|
|
222
|
+
}
|
|
223
|
+
getEditable() {
|
|
224
|
+
return this.editable;
|
|
225
|
+
}
|
|
226
|
+
getEditableData(stat) {
|
|
227
|
+
return this.editable && this.editable.stat === stat ? this.editable.data : undefined;
|
|
228
|
+
}
|
|
229
|
+
isEditable(stat) {
|
|
230
|
+
return !!this.editable && (this.editable.stat === stat || !stat);
|
|
231
|
+
}
|
|
232
|
+
async select(resource, reveal) {
|
|
233
|
+
if (!this.view) {
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
const ignoreRevealExcludes = reveal === 'force';
|
|
237
|
+
const fileStat = this.findClosest(resource);
|
|
238
|
+
if (fileStat) {
|
|
239
|
+
if (!this.shouldAutoRevealItem(fileStat, ignoreRevealExcludes)) {
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
await this.view.selectResource(fileStat.resource, reveal);
|
|
243
|
+
return Promise.resolve(undefined);
|
|
244
|
+
}
|
|
245
|
+
const options = { resolveTo: [resource], resolveMetadata: this.config.sortOrder === "modified" };
|
|
246
|
+
const root = this.findClosestRoot(resource);
|
|
247
|
+
if (!root) {
|
|
248
|
+
return undefined;
|
|
249
|
+
}
|
|
250
|
+
try {
|
|
251
|
+
const stat = await this.fileService.resolve(root.resource, options);
|
|
252
|
+
const modelStat = ExplorerItem.create(this.fileService, this.configurationService, this.filesConfigurationService, stat, undefined, options.resolveTo);
|
|
253
|
+
ExplorerItem.mergeLocalWithDisk(modelStat, root);
|
|
254
|
+
const item = root.find(resource);
|
|
255
|
+
await this.view.refresh(true, root);
|
|
256
|
+
if (item && !this.shouldAutoRevealItem(item, ignoreRevealExcludes)) {
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
await this.view.selectResource(item ? item.resource : undefined, reveal);
|
|
260
|
+
}
|
|
261
|
+
catch (error) {
|
|
262
|
+
root.error = error;
|
|
263
|
+
await this.view.refresh(false, root);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
async refresh(reveal = true) {
|
|
267
|
+
this.model.roots.forEach(r => r.forgetChildren());
|
|
268
|
+
if (this.view) {
|
|
269
|
+
await this.view.refresh(true);
|
|
270
|
+
const resource = this.editorService.activeEditor?.resource;
|
|
271
|
+
const autoReveal = this.configurationService.getValue().explorer.autoReveal;
|
|
272
|
+
if (reveal && resource && autoReveal) {
|
|
273
|
+
this.select(resource, autoReveal);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
async onDidRunOperation(e) {
|
|
278
|
+
const shouldDeepRefresh = this.config.fileNesting.enabled;
|
|
279
|
+
if (e.isOperation(0 ) || e.isOperation(3 )) {
|
|
280
|
+
const addedElement = e.target;
|
|
281
|
+
const parentResource = dirname(addedElement.resource);
|
|
282
|
+
const parents = this.model.findAll(parentResource);
|
|
283
|
+
if (parents.length) {
|
|
284
|
+
await Promise.all(( parents.map(async (p) => {
|
|
285
|
+
const resolveMetadata = this.config.sortOrder === `modified`;
|
|
286
|
+
if (!p.isDirectoryResolved) {
|
|
287
|
+
const stat = await this.fileService.resolve(p.resource, { resolveMetadata });
|
|
288
|
+
if (stat) {
|
|
289
|
+
const modelStat = ExplorerItem.create(this.fileService, this.configurationService, this.filesConfigurationService, stat, p.parent);
|
|
290
|
+
ExplorerItem.mergeLocalWithDisk(modelStat, p);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
const childElement = ExplorerItem.create(this.fileService, this.configurationService, this.filesConfigurationService, addedElement, p.parent);
|
|
294
|
+
p.removeChild(childElement);
|
|
295
|
+
p.addChild(childElement);
|
|
296
|
+
await this.view?.refresh(shouldDeepRefresh, p);
|
|
297
|
+
})));
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
else if (e.isOperation(2 )) {
|
|
301
|
+
const oldResource = e.resource;
|
|
302
|
+
const newElement = e.target;
|
|
303
|
+
const oldParentResource = dirname(oldResource);
|
|
304
|
+
const newParentResource = dirname(newElement.resource);
|
|
305
|
+
const modelElements = this.model.findAll(oldResource);
|
|
306
|
+
const sameParentMove = modelElements.every(e => !e.nestedParent) && this.uriIdentityService.extUri.isEqual(oldParentResource, newParentResource);
|
|
307
|
+
if (sameParentMove) {
|
|
308
|
+
await Promise.all(( modelElements.map(async (modelElement) => {
|
|
309
|
+
modelElement.rename(newElement);
|
|
310
|
+
await this.view?.refresh(shouldDeepRefresh, modelElement.parent);
|
|
311
|
+
})));
|
|
312
|
+
}
|
|
313
|
+
else {
|
|
314
|
+
const newParents = this.model.findAll(newParentResource);
|
|
315
|
+
if (newParents.length && modelElements.length) {
|
|
316
|
+
await Promise.all(( modelElements.map(async (modelElement, index) => {
|
|
317
|
+
const oldParent = modelElement.parent;
|
|
318
|
+
const oldNestedParent = modelElement.nestedParent;
|
|
319
|
+
modelElement.move(newParents[index]);
|
|
320
|
+
if (oldNestedParent) {
|
|
321
|
+
await this.view?.refresh(false, oldNestedParent);
|
|
322
|
+
}
|
|
323
|
+
await this.view?.refresh(false, oldParent);
|
|
324
|
+
await this.view?.refresh(shouldDeepRefresh, newParents[index]);
|
|
325
|
+
})));
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
else if (e.isOperation(1 )) {
|
|
330
|
+
const modelElements = this.model.findAll(e.resource);
|
|
331
|
+
await Promise.all(( modelElements.map(async (modelElement) => {
|
|
332
|
+
if (modelElement.parent) {
|
|
333
|
+
const parent = modelElement.parent;
|
|
334
|
+
parent.removeChild(modelElement);
|
|
335
|
+
this.view?.focusNext();
|
|
336
|
+
const oldNestedParent = modelElement.nestedParent;
|
|
337
|
+
if (oldNestedParent) {
|
|
338
|
+
oldNestedParent.removeChild(modelElement);
|
|
339
|
+
await this.view?.refresh(false, oldNestedParent);
|
|
340
|
+
}
|
|
341
|
+
await this.view?.refresh(shouldDeepRefresh, parent);
|
|
342
|
+
if (this.view?.getFocus().length === 0) {
|
|
343
|
+
this.view?.focusLast();
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
})));
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
shouldAutoRevealItem(item, ignore) {
|
|
350
|
+
if (item === undefined || ignore) {
|
|
351
|
+
return true;
|
|
352
|
+
}
|
|
353
|
+
if (this.revealExcludeMatcher.matches(item.resource, name => !!(item.parent && item.parent.getChild(name)))) {
|
|
354
|
+
return false;
|
|
355
|
+
}
|
|
356
|
+
const root = item.root;
|
|
357
|
+
let currentItem = item.parent;
|
|
358
|
+
while (currentItem !== root) {
|
|
359
|
+
if (currentItem === undefined) {
|
|
360
|
+
return true;
|
|
361
|
+
}
|
|
362
|
+
if (this.revealExcludeMatcher.matches(currentItem.resource)) {
|
|
363
|
+
return false;
|
|
364
|
+
}
|
|
365
|
+
currentItem = currentItem.parent;
|
|
366
|
+
}
|
|
367
|
+
return true;
|
|
368
|
+
}
|
|
369
|
+
async onConfigurationUpdated(event) {
|
|
370
|
+
if (!event.affectsConfiguration('explorer')) {
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
let shouldRefresh = false;
|
|
374
|
+
if (event.affectsConfiguration('explorer.fileNesting')) {
|
|
375
|
+
shouldRefresh = true;
|
|
376
|
+
}
|
|
377
|
+
const configuration = this.configurationService.getValue();
|
|
378
|
+
const configSortOrder = configuration?.explorer?.sortOrder || "default" ;
|
|
379
|
+
if (this.config.sortOrder !== configSortOrder) {
|
|
380
|
+
shouldRefresh = this.config.sortOrder !== undefined;
|
|
381
|
+
}
|
|
382
|
+
const configLexicographicOptions = configuration?.explorer?.sortOrderLexicographicOptions || "default" ;
|
|
383
|
+
if (this.config.sortOrderLexicographicOptions !== configLexicographicOptions) {
|
|
384
|
+
shouldRefresh = shouldRefresh || this.config.sortOrderLexicographicOptions !== undefined;
|
|
385
|
+
}
|
|
386
|
+
this.config = configuration.explorer;
|
|
387
|
+
if (shouldRefresh) {
|
|
388
|
+
await this.refresh();
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
dispose() {
|
|
392
|
+
this.disposables.dispose();
|
|
393
|
+
}
|
|
394
|
+
};
|
|
395
|
+
ExplorerService = ExplorerService_1 = ( __decorate([
|
|
396
|
+
( __param(0, IFileService)),
|
|
397
|
+
( __param(1, IConfigurationService)),
|
|
398
|
+
( __param(2, IWorkspaceContextService)),
|
|
399
|
+
( __param(3, IClipboardService)),
|
|
400
|
+
( __param(4, IEditorService)),
|
|
401
|
+
( __param(5, IUriIdentityService)),
|
|
402
|
+
( __param(6, IBulkEditService)),
|
|
403
|
+
( __param(7, IProgressService)),
|
|
404
|
+
( __param(8, IHostService)),
|
|
405
|
+
( __param(9, IFilesConfigurationService)),
|
|
406
|
+
( __param(10, ITelemetryService))
|
|
407
|
+
], ExplorerService));
|
|
408
|
+
function doesFileEventAffect(item, view, events, types) {
|
|
409
|
+
for (const [_name, child] of item.children) {
|
|
410
|
+
if (view.isItemVisible(child)) {
|
|
411
|
+
if (( events.some(e => e.contains(child.resource, ...types)))) {
|
|
412
|
+
return true;
|
|
413
|
+
}
|
|
414
|
+
if (child.isDirectory && child.isDirectoryResolved) {
|
|
415
|
+
if (doesFileEventAffect(child, view, events, types)) {
|
|
416
|
+
return true;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
return false;
|
|
422
|
+
}
|
|
423
|
+
function getRevealExcludes(configuration) {
|
|
424
|
+
const revealExcludes = configuration && configuration.explorer && configuration.explorer.autoRevealExclude;
|
|
425
|
+
if (!revealExcludes) {
|
|
426
|
+
return {};
|
|
427
|
+
}
|
|
428
|
+
return revealExcludes;
|
|
429
|
+
}
|
|
430
|
+
export { ExplorerService, UNDO_REDO_SOURCE };
|