@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,222 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import './media/sidebarpart.css.js';
|
|
3
|
-
import { IWorkbenchLayoutService } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService';
|
|
4
|
-
import { ActiveViewletContext, SidebarFocusContext } from 'vscode/vscode/vs/workbench/common/contextkeys';
|
|
5
|
-
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
6
|
-
import { IContextMenuService } from 'vscode/vscode/vs/platform/contextview/browser/contextView';
|
|
7
|
-
import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding';
|
|
8
|
-
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
9
|
-
import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService';
|
|
10
|
-
import { contrastBorder } from 'vscode/vscode/vs/platform/theme/common/colorRegistry';
|
|
11
|
-
import { SIDE_BAR_BORDER, SIDE_BAR_TITLE_FOREGROUND, SIDE_BAR_BACKGROUND, SIDE_BAR_FOREGROUND, SIDE_BAR_DRAG_AND_DROP_BACKGROUND, ACTIVITY_BAR_TOP_ACTIVE_BORDER, ACTIVITY_BAR_TOP_FOREGROUND, ACTIVITY_BAR_TOP_INACTIVE_FOREGROUND, ACTIVITY_BAR_BADGE_BACKGROUND, ACTIVITY_BAR_BADGE_FOREGROUND, ACTIVITY_BAR_TOP_DRAG_AND_DROP_BORDER } from 'vscode/vscode/vs/workbench/common/theme';
|
|
12
|
-
import { INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification';
|
|
13
|
-
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
14
|
-
import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
|
|
15
|
-
import { assertIsDefined } from 'vscode/vscode/vs/base/common/types';
|
|
16
|
-
import { IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views';
|
|
17
|
-
import { AbstractPaneCompositePart } from '../paneCompositePart.js';
|
|
18
|
-
import { ActivitybarPart, ActivityBarCompositeBar } from '../activitybar/activitybarPart.js';
|
|
19
|
-
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
20
|
-
import { registerAction2, Action2, IMenuService } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
21
|
-
import { Separator } from 'vscode/vscode/vs/base/common/actions';
|
|
22
|
-
import { ToggleActivityBarVisibilityActionId } from 'vscode/vscode/vs/workbench/browser/actions/layoutActions';
|
|
23
|
-
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
24
|
-
|
|
25
|
-
var SidebarPart_1;
|
|
26
|
-
let SidebarPart = class SidebarPart extends AbstractPaneCompositePart {
|
|
27
|
-
static { SidebarPart_1 = this; }
|
|
28
|
-
static { this.activeViewletSettingsKey = 'workbench.sidebar.activeviewletid'; }
|
|
29
|
-
get preferredWidth() {
|
|
30
|
-
const viewlet = this.getActivePaneComposite();
|
|
31
|
-
if (!viewlet) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
const width = viewlet.getOptimalWidth();
|
|
35
|
-
if (typeof width !== 'number') {
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
return Math.max(width, 300);
|
|
39
|
-
}
|
|
40
|
-
constructor(notificationService, storageService, contextMenuService, layoutService, keybindingService, instantiationService, themeService, viewDescriptorService, contextKeyService, extensionService, configurationService, menuService) {
|
|
41
|
-
super("workbench.parts.sidebar" , { hasTitle: true, borderWidth: () => (this.getColor(SIDE_BAR_BORDER) || this.getColor(contrastBorder)) ? 1 : 0 }, SidebarPart_1.activeViewletSettingsKey, ActiveViewletContext.bindTo(contextKeyService), SidebarFocusContext.bindTo(contextKeyService), 'sideBar', 'viewlet', SIDE_BAR_TITLE_FOREGROUND, notificationService, storageService, contextMenuService, layoutService, keybindingService, instantiationService, themeService, viewDescriptorService, contextKeyService, extensionService, menuService);
|
|
42
|
-
this.configurationService = configurationService;
|
|
43
|
-
this.minimumWidth = 170;
|
|
44
|
-
this.maximumWidth = Number.POSITIVE_INFINITY;
|
|
45
|
-
this.minimumHeight = 0;
|
|
46
|
-
this.maximumHeight = Number.POSITIVE_INFINITY;
|
|
47
|
-
this.priority = 1 ;
|
|
48
|
-
this.acitivityBarPart = this._register(instantiationService.createInstance(ActivitybarPart, this));
|
|
49
|
-
this.rememberActivityBarVisiblePosition();
|
|
50
|
-
this._register(configurationService.onDidChangeConfiguration(e => {
|
|
51
|
-
if (e.affectsConfiguration("workbench.activityBar.location" )) {
|
|
52
|
-
this.onDidChangeActivityBarLocation();
|
|
53
|
-
}
|
|
54
|
-
}));
|
|
55
|
-
this.registerActions();
|
|
56
|
-
}
|
|
57
|
-
onDidChangeActivityBarLocation() {
|
|
58
|
-
this.updateTitleArea();
|
|
59
|
-
const id = this.getActiveComposite()?.getId();
|
|
60
|
-
if (id) {
|
|
61
|
-
this.onTitleAreaUpdate(id);
|
|
62
|
-
}
|
|
63
|
-
this.updateActivityBarVisiblity();
|
|
64
|
-
this.rememberActivityBarVisiblePosition();
|
|
65
|
-
}
|
|
66
|
-
updateStyles() {
|
|
67
|
-
super.updateStyles();
|
|
68
|
-
const container = assertIsDefined(this.getContainer());
|
|
69
|
-
container.style.backgroundColor = this.getColor(SIDE_BAR_BACKGROUND) || '';
|
|
70
|
-
container.style.color = this.getColor(SIDE_BAR_FOREGROUND) || '';
|
|
71
|
-
const borderColor = this.getColor(SIDE_BAR_BORDER) || this.getColor(contrastBorder);
|
|
72
|
-
const isPositionLeft = this.layoutService.getSideBarPosition() === 0 ;
|
|
73
|
-
container.style.borderRightWidth = borderColor && isPositionLeft ? '1px' : '';
|
|
74
|
-
container.style.borderRightStyle = borderColor && isPositionLeft ? 'solid' : '';
|
|
75
|
-
container.style.borderRightColor = isPositionLeft ? borderColor || '' : '';
|
|
76
|
-
container.style.borderLeftWidth = borderColor && !isPositionLeft ? '1px' : '';
|
|
77
|
-
container.style.borderLeftStyle = borderColor && !isPositionLeft ? 'solid' : '';
|
|
78
|
-
container.style.borderLeftColor = !isPositionLeft ? borderColor || '' : '';
|
|
79
|
-
container.style.outlineColor = this.getColor(SIDE_BAR_DRAG_AND_DROP_BACKGROUND) ?? '';
|
|
80
|
-
}
|
|
81
|
-
layout(width, height, top, left) {
|
|
82
|
-
if (!this.layoutService.isVisible("workbench.parts.sidebar" )) {
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
super.layout(width, height, top, left);
|
|
86
|
-
}
|
|
87
|
-
getTitleAreaDropDownAnchorAlignment() {
|
|
88
|
-
return this.layoutService.getSideBarPosition() === 0 ? 0 : 1 ;
|
|
89
|
-
}
|
|
90
|
-
createCompisteBar() {
|
|
91
|
-
return this.instantiationService.createInstance(ActivityBarCompositeBar, this.getCompositeBarOptions(), this.partId, this, false);
|
|
92
|
-
}
|
|
93
|
-
getCompositeBarOptions() {
|
|
94
|
-
return {
|
|
95
|
-
partContainerClass: 'sidebar',
|
|
96
|
-
pinnedViewContainersKey: ActivitybarPart.pinnedViewContainersKey,
|
|
97
|
-
placeholderViewContainersKey: ActivitybarPart.placeholderViewContainersKey,
|
|
98
|
-
viewContainersWorkspaceStateKey: ActivitybarPart.viewContainersWorkspaceStateKey,
|
|
99
|
-
icon: true,
|
|
100
|
-
orientation: 0 ,
|
|
101
|
-
recomputeSizes: true,
|
|
102
|
-
activityHoverOptions: {
|
|
103
|
-
position: () => 2 ,
|
|
104
|
-
},
|
|
105
|
-
fillExtraContextMenuActions: actions => {
|
|
106
|
-
const viewsSubmenuAction = this.getViewsSubmenuAction();
|
|
107
|
-
if (viewsSubmenuAction) {
|
|
108
|
-
actions.push(( new Separator()));
|
|
109
|
-
actions.push(viewsSubmenuAction);
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
compositeSize: 0,
|
|
113
|
-
iconSize: 16,
|
|
114
|
-
overflowActionSize: 44,
|
|
115
|
-
colors: theme => ({
|
|
116
|
-
activeBackgroundColor: theme.getColor(SIDE_BAR_BACKGROUND),
|
|
117
|
-
inactiveBackgroundColor: theme.getColor(SIDE_BAR_BACKGROUND),
|
|
118
|
-
activeBorderBottomColor: theme.getColor(ACTIVITY_BAR_TOP_ACTIVE_BORDER),
|
|
119
|
-
activeForegroundColor: theme.getColor(ACTIVITY_BAR_TOP_FOREGROUND),
|
|
120
|
-
inactiveForegroundColor: theme.getColor(ACTIVITY_BAR_TOP_INACTIVE_FOREGROUND),
|
|
121
|
-
badgeBackground: theme.getColor(ACTIVITY_BAR_BADGE_BACKGROUND),
|
|
122
|
-
badgeForeground: theme.getColor(ACTIVITY_BAR_BADGE_FOREGROUND),
|
|
123
|
-
dragAndDropBorder: theme.getColor(ACTIVITY_BAR_TOP_DRAG_AND_DROP_BORDER)
|
|
124
|
-
}),
|
|
125
|
-
compact: true
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
shouldShowCompositeBar() {
|
|
129
|
-
return this.configurationService.getValue("workbench.activityBar.location" ) === "top" ;
|
|
130
|
-
}
|
|
131
|
-
shouldShowActivityBar() {
|
|
132
|
-
if (this.shouldShowCompositeBar()) {
|
|
133
|
-
return false;
|
|
134
|
-
}
|
|
135
|
-
return this.configurationService.getValue("workbench.activityBar.location" ) !== "hidden" ;
|
|
136
|
-
}
|
|
137
|
-
rememberActivityBarVisiblePosition() {
|
|
138
|
-
const activityBarPosition = this.configurationService.getValue("workbench.activityBar.location" );
|
|
139
|
-
if (activityBarPosition !== "hidden" ) {
|
|
140
|
-
this.storageService.store("workbench.activityBar.location" , activityBarPosition, 0 , 0 );
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
getRememberedActivityBarVisiblePosition() {
|
|
144
|
-
const activityBarPosition = this.storageService.get("workbench.activityBar.location" , 0 );
|
|
145
|
-
switch (activityBarPosition) {
|
|
146
|
-
case "side" : return "side" ;
|
|
147
|
-
default: return "top" ;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
updateActivityBarVisiblity() {
|
|
151
|
-
if (this.shouldShowActivityBar()) {
|
|
152
|
-
this.acitivityBarPart.show();
|
|
153
|
-
}
|
|
154
|
-
else {
|
|
155
|
-
this.acitivityBarPart.hide();
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
getPinnedPaneCompositeIds() {
|
|
159
|
-
return this.shouldShowCompositeBar() ? super.getPinnedPaneCompositeIds() : this.acitivityBarPart.getPinnedPaneCompositeIds();
|
|
160
|
-
}
|
|
161
|
-
getVisiblePaneCompositeIds() {
|
|
162
|
-
return this.shouldShowCompositeBar() ? super.getVisiblePaneCompositeIds() : this.acitivityBarPart.getVisiblePaneCompositeIds();
|
|
163
|
-
}
|
|
164
|
-
async focusActivityBar() {
|
|
165
|
-
if (this.configurationService.getValue("workbench.activityBar.location" ) === "hidden" ) {
|
|
166
|
-
await this.configurationService.updateValue("workbench.activityBar.location" , this.getRememberedActivityBarVisiblePosition());
|
|
167
|
-
this.onDidChangeActivityBarLocation();
|
|
168
|
-
}
|
|
169
|
-
if (this.shouldShowCompositeBar()) {
|
|
170
|
-
this.focusComositeBar();
|
|
171
|
-
}
|
|
172
|
-
else {
|
|
173
|
-
if (!this.layoutService.isVisible("workbench.parts.activitybar" )) {
|
|
174
|
-
this.layoutService.setPartHidden(false, "workbench.parts.activitybar" );
|
|
175
|
-
}
|
|
176
|
-
this.acitivityBarPart.show(true);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
registerActions() {
|
|
180
|
-
const that = this;
|
|
181
|
-
this._register(registerAction2(class extends Action2 {
|
|
182
|
-
constructor() {
|
|
183
|
-
super({
|
|
184
|
-
id: ToggleActivityBarVisibilityActionId,
|
|
185
|
-
title: {
|
|
186
|
-
value: ( localizeWithPath(
|
|
187
|
-
'vs/workbench/browser/parts/sidebar/sidebarPart',
|
|
188
|
-
'toggleActivityBar',
|
|
189
|
-
"Toggle Activity Bar Visibility"
|
|
190
|
-
)),
|
|
191
|
-
original: 'Toggle Activity Bar Visibility'
|
|
192
|
-
},
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
run() {
|
|
196
|
-
const value = that.configurationService.getValue("workbench.activityBar.location" ) === "hidden" ? that.getRememberedActivityBarVisiblePosition() : "hidden" ;
|
|
197
|
-
return that.configurationService.updateValue("workbench.activityBar.location" , value);
|
|
198
|
-
}
|
|
199
|
-
}));
|
|
200
|
-
}
|
|
201
|
-
toJSON() {
|
|
202
|
-
return {
|
|
203
|
-
type: "workbench.parts.sidebar"
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
|
-
};
|
|
207
|
-
SidebarPart = SidebarPart_1 = ( __decorate([
|
|
208
|
-
( __param(0, INotificationService)),
|
|
209
|
-
( __param(1, IStorageService)),
|
|
210
|
-
( __param(2, IContextMenuService)),
|
|
211
|
-
( __param(3, IWorkbenchLayoutService)),
|
|
212
|
-
( __param(4, IKeybindingService)),
|
|
213
|
-
( __param(5, IInstantiationService)),
|
|
214
|
-
( __param(6, IThemeService)),
|
|
215
|
-
( __param(7, IViewDescriptorService)),
|
|
216
|
-
( __param(8, IContextKeyService)),
|
|
217
|
-
( __param(9, IExtensionService)),
|
|
218
|
-
( __param(10, IConfigurationService)),
|
|
219
|
-
( __param(11, IMenuService))
|
|
220
|
-
], SidebarPart));
|
|
221
|
-
|
|
222
|
-
export { SidebarPart };
|
|
@@ -1,299 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { localizeWithPath, localize2WithPath } from 'vscode/vscode/vs/nls';
|
|
3
|
-
import { CallHierarchyProviderRegistry, CallHierarchyModel } from 'vscode/vscode/vs/workbench/contrib/callHierarchy/common/callHierarchy';
|
|
4
|
-
import { CancellationTokenSource } from 'vscode/vscode/vs/base/common/cancellation';
|
|
5
|
-
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
6
|
-
import { CallHierarchyTreePeekWidget } from './callHierarchyPeek.js';
|
|
7
|
-
import { Event } from 'vscode/vscode/vs/base/common/event';
|
|
8
|
-
import { registerEditorContribution, EditorAction2 } from 'vscode/vscode/vs/editor/browser/editorExtensions';
|
|
9
|
-
import { RawContextKey, ContextKeyExpr, IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
10
|
-
import { DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
11
|
-
import { EditorContextKeys } from 'vscode/vscode/vs/editor/common/editorContextKeys';
|
|
12
|
-
import { PeekContext } from 'vscode/vscode/vs/editor/contrib/peekView/browser/peekView';
|
|
13
|
-
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
14
|
-
import { ICodeEditorService } from 'vscode/vscode/vs/editor/browser/services/codeEditorService';
|
|
15
|
-
import { Range } from 'vscode/vscode/vs/editor/common/core/range';
|
|
16
|
-
import { registerAction2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
17
|
-
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
18
|
-
import { registerIcon } from 'vscode/vscode/vs/platform/theme/common/iconRegistry';
|
|
19
|
-
import { isCancellationError } from 'vscode/vscode/vs/base/common/errors';
|
|
20
|
-
|
|
21
|
-
var CallHierarchyController_1;
|
|
22
|
-
const _ctxHasCallHierarchyProvider = ( new RawContextKey('editorHasCallHierarchyProvider', false, ( localizeWithPath(
|
|
23
|
-
'vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution',
|
|
24
|
-
'editorHasCallHierarchyProvider',
|
|
25
|
-
'Whether a call hierarchy provider is available'
|
|
26
|
-
))));
|
|
27
|
-
const _ctxCallHierarchyVisible = ( new RawContextKey('callHierarchyVisible', false, ( localizeWithPath(
|
|
28
|
-
'vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution',
|
|
29
|
-
'callHierarchyVisible',
|
|
30
|
-
'Whether call hierarchy peek is currently showing'
|
|
31
|
-
))));
|
|
32
|
-
const _ctxCallHierarchyDirection = ( new RawContextKey(
|
|
33
|
-
'callHierarchyDirection',
|
|
34
|
-
undefined,
|
|
35
|
-
{ type: 'string', description: ( localizeWithPath(
|
|
36
|
-
'vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution',
|
|
37
|
-
'callHierarchyDirection',
|
|
38
|
-
'Whether call hierarchy shows incoming or outgoing calls'
|
|
39
|
-
)) }
|
|
40
|
-
));
|
|
41
|
-
function sanitizedDirection(candidate) {
|
|
42
|
-
return candidate === "outgoingCalls" || candidate === "incomingCalls"
|
|
43
|
-
? candidate
|
|
44
|
-
: "incomingCalls" ;
|
|
45
|
-
}
|
|
46
|
-
let CallHierarchyController = class CallHierarchyController {
|
|
47
|
-
static { CallHierarchyController_1 = this; }
|
|
48
|
-
static { this.Id = 'callHierarchy'; }
|
|
49
|
-
static get(editor) {
|
|
50
|
-
return editor.getContribution(CallHierarchyController_1.Id);
|
|
51
|
-
}
|
|
52
|
-
static { this._StorageDirection = 'callHierarchy/defaultDirection'; }
|
|
53
|
-
constructor(_editor, _contextKeyService, _storageService, _editorService, _instantiationService) {
|
|
54
|
-
this._editor = _editor;
|
|
55
|
-
this._contextKeyService = _contextKeyService;
|
|
56
|
-
this._storageService = _storageService;
|
|
57
|
-
this._editorService = _editorService;
|
|
58
|
-
this._instantiationService = _instantiationService;
|
|
59
|
-
this._dispoables = ( new DisposableStore());
|
|
60
|
-
this._sessionDisposables = ( new DisposableStore());
|
|
61
|
-
this._ctxIsVisible = _ctxCallHierarchyVisible.bindTo(this._contextKeyService);
|
|
62
|
-
this._ctxHasProvider = _ctxHasCallHierarchyProvider.bindTo(this._contextKeyService);
|
|
63
|
-
this._ctxDirection = _ctxCallHierarchyDirection.bindTo(this._contextKeyService);
|
|
64
|
-
this._dispoables.add(Event.any(_editor.onDidChangeModel, _editor.onDidChangeModelLanguage, CallHierarchyProviderRegistry.onDidChange)(() => {
|
|
65
|
-
this._ctxHasProvider.set(_editor.hasModel() && ( CallHierarchyProviderRegistry.has(_editor.getModel())));
|
|
66
|
-
}));
|
|
67
|
-
this._dispoables.add(this._sessionDisposables);
|
|
68
|
-
}
|
|
69
|
-
dispose() {
|
|
70
|
-
this._ctxHasProvider.reset();
|
|
71
|
-
this._ctxIsVisible.reset();
|
|
72
|
-
this._dispoables.dispose();
|
|
73
|
-
}
|
|
74
|
-
async startCallHierarchyFromEditor() {
|
|
75
|
-
this._sessionDisposables.clear();
|
|
76
|
-
if (!this._editor.hasModel()) {
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
const document = this._editor.getModel();
|
|
80
|
-
const position = this._editor.getPosition();
|
|
81
|
-
if (!( CallHierarchyProviderRegistry.has(document))) {
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
const cts = ( new CancellationTokenSource());
|
|
85
|
-
const model = CallHierarchyModel.create(document, position, cts.token);
|
|
86
|
-
const direction = sanitizedDirection(this._storageService.get(CallHierarchyController_1._StorageDirection, 0 , "incomingCalls" ));
|
|
87
|
-
this._showCallHierarchyWidget(position, direction, model, cts);
|
|
88
|
-
}
|
|
89
|
-
async startCallHierarchyFromCallHierarchy() {
|
|
90
|
-
if (!this._widget) {
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
const model = this._widget.getModel();
|
|
94
|
-
const call = this._widget.getFocused();
|
|
95
|
-
if (!call || !model) {
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
const newEditor = await this._editorService.openCodeEditor({ resource: call.item.uri }, this._editor);
|
|
99
|
-
if (!newEditor) {
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
const newModel = model.fork(call.item);
|
|
103
|
-
this._sessionDisposables.clear();
|
|
104
|
-
CallHierarchyController_1.get(newEditor)?._showCallHierarchyWidget(Range.lift(newModel.root.selectionRange).getStartPosition(), this._widget.direction, Promise.resolve(newModel), ( new CancellationTokenSource()));
|
|
105
|
-
}
|
|
106
|
-
_showCallHierarchyWidget(position, direction, model, cts) {
|
|
107
|
-
this._ctxIsVisible.set(true);
|
|
108
|
-
this._ctxDirection.set(direction);
|
|
109
|
-
Event.any(this._editor.onDidChangeModel, this._editor.onDidChangeModelLanguage)(this.endCallHierarchy, this, this._sessionDisposables);
|
|
110
|
-
this._widget = this._instantiationService.createInstance(CallHierarchyTreePeekWidget, this._editor, position, direction);
|
|
111
|
-
this._widget.showLoading();
|
|
112
|
-
this._sessionDisposables.add(this._widget.onDidClose(() => {
|
|
113
|
-
this.endCallHierarchy();
|
|
114
|
-
this._storageService.store(CallHierarchyController_1._StorageDirection, this._widget.direction, 0 , 0 );
|
|
115
|
-
}));
|
|
116
|
-
this._sessionDisposables.add({ dispose() { cts.dispose(true); } });
|
|
117
|
-
this._sessionDisposables.add(this._widget);
|
|
118
|
-
model.then(model => {
|
|
119
|
-
if (cts.token.isCancellationRequested) {
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
if (model) {
|
|
123
|
-
this._sessionDisposables.add(model);
|
|
124
|
-
this._widget.showModel(model);
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
this._widget.showMessage(( localizeWithPath(
|
|
128
|
-
'vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution',
|
|
129
|
-
'no.item',
|
|
130
|
-
"No results"
|
|
131
|
-
)));
|
|
132
|
-
}
|
|
133
|
-
}).catch(err => {
|
|
134
|
-
if (isCancellationError(err)) {
|
|
135
|
-
this.endCallHierarchy();
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
this._widget.showMessage(( localizeWithPath(
|
|
139
|
-
'vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution',
|
|
140
|
-
'error',
|
|
141
|
-
"Failed to show call hierarchy"
|
|
142
|
-
)));
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
showOutgoingCalls() {
|
|
146
|
-
this._widget?.updateDirection("outgoingCalls" );
|
|
147
|
-
this._ctxDirection.set("outgoingCalls" );
|
|
148
|
-
}
|
|
149
|
-
showIncomingCalls() {
|
|
150
|
-
this._widget?.updateDirection("incomingCalls" );
|
|
151
|
-
this._ctxDirection.set("incomingCalls" );
|
|
152
|
-
}
|
|
153
|
-
endCallHierarchy() {
|
|
154
|
-
this._sessionDisposables.clear();
|
|
155
|
-
this._ctxIsVisible.set(false);
|
|
156
|
-
this._editor.focus();
|
|
157
|
-
}
|
|
158
|
-
};
|
|
159
|
-
CallHierarchyController = CallHierarchyController_1 = ( __decorate([
|
|
160
|
-
( __param(1, IContextKeyService)),
|
|
161
|
-
( __param(2, IStorageService)),
|
|
162
|
-
( __param(3, ICodeEditorService)),
|
|
163
|
-
( __param(4, IInstantiationService))
|
|
164
|
-
], CallHierarchyController));
|
|
165
|
-
registerEditorContribution(CallHierarchyController.Id, CallHierarchyController, 0 );
|
|
166
|
-
registerAction2(class PeekCallHierarchyAction extends EditorAction2 {
|
|
167
|
-
constructor() {
|
|
168
|
-
super({
|
|
169
|
-
id: 'editor.showCallHierarchy',
|
|
170
|
-
title: ( localize2WithPath(
|
|
171
|
-
'vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution',
|
|
172
|
-
'title',
|
|
173
|
-
'Peek Call Hierarchy'
|
|
174
|
-
)),
|
|
175
|
-
menu: {
|
|
176
|
-
id: MenuId.EditorContextPeek,
|
|
177
|
-
group: 'navigation',
|
|
178
|
-
order: 1000,
|
|
179
|
-
when: ( ContextKeyExpr.and(_ctxHasCallHierarchyProvider, PeekContext.notInPeekEditor)),
|
|
180
|
-
},
|
|
181
|
-
keybinding: {
|
|
182
|
-
when: EditorContextKeys.editorTextFocus,
|
|
183
|
-
weight: 200 ,
|
|
184
|
-
primary: 1024 + 512 + 38
|
|
185
|
-
},
|
|
186
|
-
precondition: ( ContextKeyExpr.and(_ctxHasCallHierarchyProvider, PeekContext.notInPeekEditor)),
|
|
187
|
-
f1: true
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
async runEditorCommand(_accessor, editor) {
|
|
191
|
-
return CallHierarchyController.get(editor)?.startCallHierarchyFromEditor();
|
|
192
|
-
}
|
|
193
|
-
});
|
|
194
|
-
registerAction2(class extends EditorAction2 {
|
|
195
|
-
constructor() {
|
|
196
|
-
super({
|
|
197
|
-
id: 'editor.showIncomingCalls',
|
|
198
|
-
title: ( localize2WithPath(
|
|
199
|
-
'vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution',
|
|
200
|
-
'title.incoming',
|
|
201
|
-
'Show Incoming Calls'
|
|
202
|
-
)),
|
|
203
|
-
icon: registerIcon('callhierarchy-incoming', Codicon.callIncoming, ( localizeWithPath(
|
|
204
|
-
'vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution',
|
|
205
|
-
'showIncomingCallsIcons',
|
|
206
|
-
'Icon for incoming calls in the call hierarchy view.'
|
|
207
|
-
))),
|
|
208
|
-
precondition: ( ContextKeyExpr.and(_ctxCallHierarchyVisible, ( _ctxCallHierarchyDirection.isEqualTo("outgoingCalls" )))),
|
|
209
|
-
keybinding: {
|
|
210
|
-
weight: 200 ,
|
|
211
|
-
primary: 1024 + 512 + 38 ,
|
|
212
|
-
},
|
|
213
|
-
menu: {
|
|
214
|
-
id: CallHierarchyTreePeekWidget.TitleMenu,
|
|
215
|
-
when: ( _ctxCallHierarchyDirection.isEqualTo("outgoingCalls" )),
|
|
216
|
-
order: 1,
|
|
217
|
-
}
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
runEditorCommand(_accessor, editor) {
|
|
221
|
-
return CallHierarchyController.get(editor)?.showIncomingCalls();
|
|
222
|
-
}
|
|
223
|
-
});
|
|
224
|
-
registerAction2(class extends EditorAction2 {
|
|
225
|
-
constructor() {
|
|
226
|
-
super({
|
|
227
|
-
id: 'editor.showOutgoingCalls',
|
|
228
|
-
title: ( localize2WithPath(
|
|
229
|
-
'vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution',
|
|
230
|
-
'title.outgoing',
|
|
231
|
-
'Show Outgoing Calls'
|
|
232
|
-
)),
|
|
233
|
-
icon: registerIcon('callhierarchy-outgoing', Codicon.callOutgoing, ( localizeWithPath(
|
|
234
|
-
'vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution',
|
|
235
|
-
'showOutgoingCallsIcon',
|
|
236
|
-
'Icon for outgoing calls in the call hierarchy view.'
|
|
237
|
-
))),
|
|
238
|
-
precondition: ( ContextKeyExpr.and(_ctxCallHierarchyVisible, ( _ctxCallHierarchyDirection.isEqualTo("incomingCalls" )))),
|
|
239
|
-
keybinding: {
|
|
240
|
-
weight: 200 ,
|
|
241
|
-
primary: 1024 + 512 + 38 ,
|
|
242
|
-
},
|
|
243
|
-
menu: {
|
|
244
|
-
id: CallHierarchyTreePeekWidget.TitleMenu,
|
|
245
|
-
when: ( _ctxCallHierarchyDirection.isEqualTo("incomingCalls" )),
|
|
246
|
-
order: 1
|
|
247
|
-
}
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
runEditorCommand(_accessor, editor) {
|
|
251
|
-
return CallHierarchyController.get(editor)?.showOutgoingCalls();
|
|
252
|
-
}
|
|
253
|
-
});
|
|
254
|
-
registerAction2(class extends EditorAction2 {
|
|
255
|
-
constructor() {
|
|
256
|
-
super({
|
|
257
|
-
id: 'editor.refocusCallHierarchy',
|
|
258
|
-
title: ( localize2WithPath(
|
|
259
|
-
'vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution',
|
|
260
|
-
'title.refocus',
|
|
261
|
-
'Refocus Call Hierarchy'
|
|
262
|
-
)),
|
|
263
|
-
precondition: _ctxCallHierarchyVisible,
|
|
264
|
-
keybinding: {
|
|
265
|
-
weight: 200 ,
|
|
266
|
-
primary: 1024 + 3
|
|
267
|
-
}
|
|
268
|
-
});
|
|
269
|
-
}
|
|
270
|
-
async runEditorCommand(_accessor, editor) {
|
|
271
|
-
return CallHierarchyController.get(editor)?.startCallHierarchyFromCallHierarchy();
|
|
272
|
-
}
|
|
273
|
-
});
|
|
274
|
-
registerAction2(class extends EditorAction2 {
|
|
275
|
-
constructor() {
|
|
276
|
-
super({
|
|
277
|
-
id: 'editor.closeCallHierarchy',
|
|
278
|
-
title: ( localizeWithPath(
|
|
279
|
-
'vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution',
|
|
280
|
-
'close',
|
|
281
|
-
'Close'
|
|
282
|
-
)),
|
|
283
|
-
icon: Codicon.close,
|
|
284
|
-
precondition: _ctxCallHierarchyVisible,
|
|
285
|
-
keybinding: {
|
|
286
|
-
weight: 200 + 10,
|
|
287
|
-
primary: 9 ,
|
|
288
|
-
when: ContextKeyExpr.not('config.editor.stablePeek')
|
|
289
|
-
},
|
|
290
|
-
menu: {
|
|
291
|
-
id: CallHierarchyTreePeekWidget.TitleMenu,
|
|
292
|
-
order: 1000
|
|
293
|
-
}
|
|
294
|
-
});
|
|
295
|
-
}
|
|
296
|
-
runEditorCommand(_accessor, editor) {
|
|
297
|
-
return CallHierarchyController.get(editor)?.endCallHierarchy();
|
|
298
|
-
}
|
|
299
|
-
});
|