@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,143 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { IActivityService } from '../common/activity.js';
|
|
3
|
+
import { Disposable, toDisposable } from '../../../../base/common/lifecycle.js';
|
|
4
|
+
import { IViewDescriptorService } from '../../../common/views.js';
|
|
5
|
+
import { ACCOUNTS_ACTIVITY_ID, GLOBAL_ACTIVITY_ID } from '../../../common/activity.js';
|
|
6
|
+
import { Emitter, Event } from '../../../../base/common/event.js';
|
|
7
|
+
import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';
|
|
8
|
+
import { isUndefined } from '../../../../base/common/types.js';
|
|
9
|
+
let ViewContainerActivityByView = class ViewContainerActivityByView extends Disposable {
|
|
10
|
+
constructor(viewId, viewDescriptorService, activityService) {
|
|
11
|
+
super();
|
|
12
|
+
this.viewId = viewId;
|
|
13
|
+
this.viewDescriptorService = viewDescriptorService;
|
|
14
|
+
this.activityService = activityService;
|
|
15
|
+
this.activity = undefined;
|
|
16
|
+
this.activityDisposable = Disposable.None;
|
|
17
|
+
this._register(Event.filter(this.viewDescriptorService.onDidChangeContainer, e => ( e.views.some(view => view.id === viewId)))(() => this.update()));
|
|
18
|
+
this._register(Event.filter(this.viewDescriptorService.onDidChangeLocation, e => ( e.views.some(view => view.id === viewId)))(() => this.update()));
|
|
19
|
+
}
|
|
20
|
+
setActivity(activity) {
|
|
21
|
+
this.activity = activity;
|
|
22
|
+
this.update();
|
|
23
|
+
}
|
|
24
|
+
clearActivity() {
|
|
25
|
+
this.activity = undefined;
|
|
26
|
+
this.update();
|
|
27
|
+
}
|
|
28
|
+
update() {
|
|
29
|
+
this.activityDisposable.dispose();
|
|
30
|
+
const container = this.viewDescriptorService.getViewContainerByViewId(this.viewId);
|
|
31
|
+
if (container && this.activity) {
|
|
32
|
+
this.activityDisposable = this.activityService.showViewContainerActivity(container.id, this.activity);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
dispose() {
|
|
36
|
+
this.activityDisposable.dispose();
|
|
37
|
+
super.dispose();
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
ViewContainerActivityByView = ( __decorate([
|
|
41
|
+
( __param(1, IViewDescriptorService)),
|
|
42
|
+
( __param(2, IActivityService))
|
|
43
|
+
], ViewContainerActivityByView));
|
|
44
|
+
let ActivityService = class ActivityService extends Disposable {
|
|
45
|
+
constructor(viewDescriptorService, instantiationService) {
|
|
46
|
+
super();
|
|
47
|
+
this.viewDescriptorService = viewDescriptorService;
|
|
48
|
+
this.instantiationService = instantiationService;
|
|
49
|
+
this.viewActivities = ( new Map());
|
|
50
|
+
this._onDidChangeActivity = this._register(( new Emitter()));
|
|
51
|
+
this.onDidChangeActivity = this._onDidChangeActivity.event;
|
|
52
|
+
this.viewContainerActivities = ( new Map());
|
|
53
|
+
this.globalActivities = ( new Map());
|
|
54
|
+
}
|
|
55
|
+
showViewContainerActivity(viewContainerId, activity) {
|
|
56
|
+
const viewContainer = this.viewDescriptorService.getViewContainerById(viewContainerId);
|
|
57
|
+
if (viewContainer) {
|
|
58
|
+
let activities = this.viewContainerActivities.get(viewContainerId);
|
|
59
|
+
if (!activities) {
|
|
60
|
+
activities = [];
|
|
61
|
+
this.viewContainerActivities.set(viewContainerId, activities);
|
|
62
|
+
}
|
|
63
|
+
for (let i = 0; i <= activities.length; i++) {
|
|
64
|
+
if (i === activities.length || isUndefined(activity.priority)) {
|
|
65
|
+
activities.push(activity);
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
else if (isUndefined(activities[i].priority) || activities[i].priority <= activity.priority) {
|
|
69
|
+
activities.splice(i, 0, activity);
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
this._onDidChangeActivity.fire(viewContainer);
|
|
74
|
+
return toDisposable(() => {
|
|
75
|
+
activities.splice(activities.indexOf(activity), 1);
|
|
76
|
+
if (activities.length === 0) {
|
|
77
|
+
this.viewContainerActivities.delete(viewContainerId);
|
|
78
|
+
}
|
|
79
|
+
this._onDidChangeActivity.fire(viewContainer);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
return Disposable.None;
|
|
83
|
+
}
|
|
84
|
+
getViewContainerActivities(viewContainerId) {
|
|
85
|
+
const viewContainer = this.viewDescriptorService.getViewContainerById(viewContainerId);
|
|
86
|
+
if (viewContainer) {
|
|
87
|
+
return this.viewContainerActivities.get(viewContainerId) ?? [];
|
|
88
|
+
}
|
|
89
|
+
return [];
|
|
90
|
+
}
|
|
91
|
+
showViewActivity(viewId, activity) {
|
|
92
|
+
let maybeItem = this.viewActivities.get(viewId);
|
|
93
|
+
if (maybeItem) {
|
|
94
|
+
maybeItem.id++;
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
maybeItem = {
|
|
98
|
+
id: 1,
|
|
99
|
+
activity: this.instantiationService.createInstance(ViewContainerActivityByView, viewId)
|
|
100
|
+
};
|
|
101
|
+
this.viewActivities.set(viewId, maybeItem);
|
|
102
|
+
}
|
|
103
|
+
const id = maybeItem.id;
|
|
104
|
+
maybeItem.activity.setActivity(activity);
|
|
105
|
+
const item = maybeItem;
|
|
106
|
+
return toDisposable(() => {
|
|
107
|
+
if (item.id === id) {
|
|
108
|
+
item.activity.dispose();
|
|
109
|
+
this.viewActivities.delete(viewId);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
showAccountsActivity(activity) {
|
|
114
|
+
return this.showActivity(ACCOUNTS_ACTIVITY_ID, activity);
|
|
115
|
+
}
|
|
116
|
+
showGlobalActivity(activity) {
|
|
117
|
+
return this.showActivity(GLOBAL_ACTIVITY_ID, activity);
|
|
118
|
+
}
|
|
119
|
+
getActivity(id) {
|
|
120
|
+
return this.globalActivities.get(id) ?? [];
|
|
121
|
+
}
|
|
122
|
+
showActivity(id, activity) {
|
|
123
|
+
let activities = this.globalActivities.get(id);
|
|
124
|
+
if (!activities) {
|
|
125
|
+
activities = [];
|
|
126
|
+
this.globalActivities.set(id, activities);
|
|
127
|
+
}
|
|
128
|
+
activities.push(activity);
|
|
129
|
+
this._onDidChangeActivity.fire(id);
|
|
130
|
+
return toDisposable(() => {
|
|
131
|
+
activities.splice(activities.indexOf(activity), 1);
|
|
132
|
+
if (activities.length === 0) {
|
|
133
|
+
this.globalActivities.delete(id);
|
|
134
|
+
}
|
|
135
|
+
this._onDidChangeActivity.fire(id);
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
ActivityService = ( __decorate([
|
|
140
|
+
( __param(0, IViewDescriptorService)),
|
|
141
|
+
( __param(1, IInstantiationService))
|
|
142
|
+
], ActivityService));
|
|
143
|
+
export { ActivityService };
|
|
@@ -207,9 +207,6 @@ let BrowserAuxiliaryWindowService = class BrowserAuxiliaryWindowService extends
|
|
|
207
207
|
return { stylesLoaded, container };
|
|
208
208
|
}
|
|
209
209
|
patchMethods(auxiliaryWindow) {
|
|
210
|
-
auxiliaryWindow.document.createElement = function () {
|
|
211
|
-
throw new Error('Not allowed to create elements in child window JavaScript context. Always use the main window so that "xyz instanceof HTMLElement" continues to work.');
|
|
212
|
-
};
|
|
213
210
|
}
|
|
214
211
|
applyMeta(auxiliaryWindow) {
|
|
215
212
|
for (const metaTag of ['meta[charset="utf-8"]', 'meta[http-equiv="Content-Security-Policy"]', 'meta[name="viewport"]', 'meta[name="theme-color"]']) {
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { getTopLeftOffset, getClientArea } from '../../../../base/browser/dom.js';
|
|
3
|
+
import { mainWindow } from '../../../../base/browser/window.js';
|
|
4
|
+
import { coalesce } from '../../../../base/common/arrays.js';
|
|
5
|
+
import { language, locale } from '../../../../base/common/platform.js';
|
|
6
|
+
import { IEnvironmentService } from '../../../../platform/environment/common/environment.js';
|
|
7
|
+
import { IFileService } from '../../../../platform/files/common/files.js';
|
|
8
|
+
import localizedStrings from '../../../../platform/languagePacks/common/localizedStrings.js';
|
|
9
|
+
import { getLogs } from '../../../../platform/log/browser/log.js';
|
|
10
|
+
import { ILogService } from '../../../../platform/log/common/log.js';
|
|
11
|
+
import { Registry } from '../../../../platform/registry/common/platform.js';
|
|
12
|
+
import { Extensions } from '../../../common/contributions.js';
|
|
13
|
+
import { ILifecycleService } from '../../lifecycle/common/lifecycle.js';
|
|
14
|
+
let BrowserWindowDriver = class BrowserWindowDriver {
|
|
15
|
+
constructor(fileService, environmentService, lifecycleService, logService) {
|
|
16
|
+
this.fileService = fileService;
|
|
17
|
+
this.environmentService = environmentService;
|
|
18
|
+
this.lifecycleService = lifecycleService;
|
|
19
|
+
this.logService = logService;
|
|
20
|
+
}
|
|
21
|
+
async getLogs() {
|
|
22
|
+
return getLogs(this.fileService, this.environmentService);
|
|
23
|
+
}
|
|
24
|
+
async whenWorkbenchRestored() {
|
|
25
|
+
this.logService.info('[driver] Waiting for restored lifecycle phase...');
|
|
26
|
+
await this.lifecycleService.when(3 );
|
|
27
|
+
this.logService.info('[driver] Restored lifecycle phase reached. Waiting for contributions...');
|
|
28
|
+
await ( Registry.as(Extensions.Workbench)).whenRestored;
|
|
29
|
+
this.logService.info('[driver] Workbench contributions created.');
|
|
30
|
+
}
|
|
31
|
+
async setValue(selector, text) {
|
|
32
|
+
const element = mainWindow.document.querySelector(selector);
|
|
33
|
+
if (!element) {
|
|
34
|
+
return Promise.reject(( new Error(`Element not found: ${selector}`)));
|
|
35
|
+
}
|
|
36
|
+
const inputElement = element;
|
|
37
|
+
inputElement.value = text;
|
|
38
|
+
const event = ( new Event('input', { bubbles: true, cancelable: true }));
|
|
39
|
+
inputElement.dispatchEvent(event);
|
|
40
|
+
}
|
|
41
|
+
async isActiveElement(selector) {
|
|
42
|
+
const element = mainWindow.document.querySelector(selector);
|
|
43
|
+
if (element !== mainWindow.document.activeElement) {
|
|
44
|
+
const chain = [];
|
|
45
|
+
let el = mainWindow.document.activeElement;
|
|
46
|
+
while (el) {
|
|
47
|
+
const tagName = el.tagName;
|
|
48
|
+
const id = el.id ? `#${el.id}` : '';
|
|
49
|
+
const classes = ( coalesce(( el.className.split(/\s+/g).map(c => c.trim()))).map(c => `.${c}`)).join('');
|
|
50
|
+
chain.unshift(`${tagName}${id}${classes}`);
|
|
51
|
+
el = el.parentElement;
|
|
52
|
+
}
|
|
53
|
+
throw new Error(`Active element not found. Current active element is '${chain.join(' > ')}'. Looking for ${selector}`);
|
|
54
|
+
}
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
async getElements(selector, recursive) {
|
|
58
|
+
const query = mainWindow.document.querySelectorAll(selector);
|
|
59
|
+
const result = [];
|
|
60
|
+
for (let i = 0; i < query.length; i++) {
|
|
61
|
+
const element = query.item(i);
|
|
62
|
+
result.push(this.serializeElement(element, recursive));
|
|
63
|
+
}
|
|
64
|
+
return result;
|
|
65
|
+
}
|
|
66
|
+
serializeElement(element, recursive) {
|
|
67
|
+
const attributes = Object.create(null);
|
|
68
|
+
for (let j = 0; j < element.attributes.length; j++) {
|
|
69
|
+
const attr = element.attributes.item(j);
|
|
70
|
+
if (attr) {
|
|
71
|
+
attributes[attr.name] = attr.value;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
const children = [];
|
|
75
|
+
if (recursive) {
|
|
76
|
+
for (let i = 0; i < element.children.length; i++) {
|
|
77
|
+
const child = element.children.item(i);
|
|
78
|
+
if (child) {
|
|
79
|
+
children.push(this.serializeElement(child, true));
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
const { left, top } = getTopLeftOffset(element);
|
|
84
|
+
return {
|
|
85
|
+
tagName: element.tagName,
|
|
86
|
+
className: element.className,
|
|
87
|
+
textContent: element.textContent || '',
|
|
88
|
+
attributes,
|
|
89
|
+
children,
|
|
90
|
+
left,
|
|
91
|
+
top
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
async getElementXY(selector, xoffset, yoffset) {
|
|
95
|
+
const offset = typeof xoffset === 'number' && typeof yoffset === 'number' ? { x: xoffset, y: yoffset } : undefined;
|
|
96
|
+
return this._getElementXY(selector, offset);
|
|
97
|
+
}
|
|
98
|
+
async typeInEditor(selector, text) {
|
|
99
|
+
const element = mainWindow.document.querySelector(selector);
|
|
100
|
+
if (!element) {
|
|
101
|
+
throw new Error(`Editor not found: ${selector}`);
|
|
102
|
+
}
|
|
103
|
+
const textarea = element;
|
|
104
|
+
const start = textarea.selectionStart;
|
|
105
|
+
const newStart = start + text.length;
|
|
106
|
+
const value = textarea.value;
|
|
107
|
+
const newValue = value.substr(0, start) + text + value.substr(start);
|
|
108
|
+
textarea.value = newValue;
|
|
109
|
+
textarea.setSelectionRange(newStart, newStart);
|
|
110
|
+
const event = ( new Event('input', { 'bubbles': true, 'cancelable': true }));
|
|
111
|
+
textarea.dispatchEvent(event);
|
|
112
|
+
}
|
|
113
|
+
async getTerminalBuffer(selector) {
|
|
114
|
+
const element = mainWindow.document.querySelector(selector);
|
|
115
|
+
if (!element) {
|
|
116
|
+
throw new Error(`Terminal not found: ${selector}`);
|
|
117
|
+
}
|
|
118
|
+
const xterm = element.xterm;
|
|
119
|
+
if (!xterm) {
|
|
120
|
+
throw new Error(`Xterm not found: ${selector}`);
|
|
121
|
+
}
|
|
122
|
+
const lines = [];
|
|
123
|
+
for (let i = 0; i < xterm.buffer.active.length; i++) {
|
|
124
|
+
lines.push(xterm.buffer.active.getLine(i).translateToString(true));
|
|
125
|
+
}
|
|
126
|
+
return lines;
|
|
127
|
+
}
|
|
128
|
+
async writeInTerminal(selector, text) {
|
|
129
|
+
const element = mainWindow.document.querySelector(selector);
|
|
130
|
+
if (!element) {
|
|
131
|
+
throw new Error(`Element not found: ${selector}`);
|
|
132
|
+
}
|
|
133
|
+
const xterm = element.xterm;
|
|
134
|
+
if (!xterm) {
|
|
135
|
+
throw new Error(`Xterm not found: ${selector}`);
|
|
136
|
+
}
|
|
137
|
+
xterm._core.coreService.triggerDataEvent(text);
|
|
138
|
+
}
|
|
139
|
+
getLocaleInfo() {
|
|
140
|
+
return Promise.resolve({
|
|
141
|
+
language: language,
|
|
142
|
+
locale: locale
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
getLocalizedStrings() {
|
|
146
|
+
return Promise.resolve({
|
|
147
|
+
open: localizedStrings.open,
|
|
148
|
+
close: localizedStrings.close,
|
|
149
|
+
find: localizedStrings.find
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
async _getElementXY(selector, offset) {
|
|
153
|
+
const element = mainWindow.document.querySelector(selector);
|
|
154
|
+
if (!element) {
|
|
155
|
+
return Promise.reject(( new Error(`Element not found: ${selector}`)));
|
|
156
|
+
}
|
|
157
|
+
const { left, top } = getTopLeftOffset(element);
|
|
158
|
+
const { width, height } = getClientArea(element);
|
|
159
|
+
let x, y;
|
|
160
|
+
if (offset) {
|
|
161
|
+
x = left + offset.x;
|
|
162
|
+
y = top + offset.y;
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
x = left + (width / 2);
|
|
166
|
+
y = top + (height / 2);
|
|
167
|
+
}
|
|
168
|
+
x = Math.round(x);
|
|
169
|
+
y = Math.round(y);
|
|
170
|
+
return { x, y };
|
|
171
|
+
}
|
|
172
|
+
async exitApplication() {
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
BrowserWindowDriver = ( __decorate([
|
|
176
|
+
( __param(0, IFileService)),
|
|
177
|
+
( __param(1, IEnvironmentService)),
|
|
178
|
+
( __param(2, ILifecycleService)),
|
|
179
|
+
( __param(3, ILogService))
|
|
180
|
+
], BrowserWindowDriver));
|
|
181
|
+
function registerWindowDriver(instantiationService) {
|
|
182
|
+
Object.assign(mainWindow, { driver: instantiationService.createInstance(BrowserWindowDriver) });
|
|
183
|
+
}
|
|
184
|
+
export { BrowserWindowDriver, registerWindowDriver };
|