@codingame/monaco-vscode-api 2.1.3 → 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 +10 -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/editor.js +3 -1
- 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,298 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { localizeWithPath, localize2WithPath } from '../../../../nls.js';
|
|
3
|
+
import { CallHierarchyProviderRegistry, CallHierarchyModel } from '../common/callHierarchy.js';
|
|
4
|
+
import { CancellationTokenSource } from '../../../../base/common/cancellation.js';
|
|
5
|
+
import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';
|
|
6
|
+
import { CallHierarchyTreePeekWidget } from './callHierarchyPeek.js';
|
|
7
|
+
import { Event } from '../../../../base/common/event.js';
|
|
8
|
+
import { registerEditorContribution, EditorAction2 } from '../../../../editor/browser/editorExtensions.js';
|
|
9
|
+
import { RawContextKey, IContextKeyService, ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js';
|
|
10
|
+
import { DisposableStore } from '../../../../base/common/lifecycle.js';
|
|
11
|
+
import { EditorContextKeys } from '../../../../editor/common/editorContextKeys.js';
|
|
12
|
+
import { PeekContext } from '../../../../editor/contrib/peekView/browser/peekView.js';
|
|
13
|
+
import { IStorageService } from '../../../../platform/storage/common/storage.js';
|
|
14
|
+
import { ICodeEditorService } from '../../../../editor/browser/services/codeEditorService.js';
|
|
15
|
+
import { Range } from '../../../../editor/common/core/range.js';
|
|
16
|
+
import { registerAction2, MenuId } from '../../../../platform/actions/common/actions.js';
|
|
17
|
+
import { Codicon } from '../../../../base/common/codicons.js';
|
|
18
|
+
import { registerIcon } from '../../../../platform/theme/common/iconRegistry.js';
|
|
19
|
+
import { isCancellationError } from '../../../../base/common/errors.js';
|
|
20
|
+
var CallHierarchyController_1;
|
|
21
|
+
const _ctxHasCallHierarchyProvider = ( new RawContextKey('editorHasCallHierarchyProvider', false, ( localizeWithPath(
|
|
22
|
+
'vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution',
|
|
23
|
+
'editorHasCallHierarchyProvider',
|
|
24
|
+
'Whether a call hierarchy provider is available'
|
|
25
|
+
))));
|
|
26
|
+
const _ctxCallHierarchyVisible = ( new RawContextKey('callHierarchyVisible', false, ( localizeWithPath(
|
|
27
|
+
'vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution',
|
|
28
|
+
'callHierarchyVisible',
|
|
29
|
+
'Whether call hierarchy peek is currently showing'
|
|
30
|
+
))));
|
|
31
|
+
const _ctxCallHierarchyDirection = ( new RawContextKey(
|
|
32
|
+
'callHierarchyDirection',
|
|
33
|
+
undefined,
|
|
34
|
+
{ type: 'string', description: ( localizeWithPath(
|
|
35
|
+
'vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution',
|
|
36
|
+
'callHierarchyDirection',
|
|
37
|
+
'Whether call hierarchy shows incoming or outgoing calls'
|
|
38
|
+
)) }
|
|
39
|
+
));
|
|
40
|
+
function sanitizedDirection(candidate) {
|
|
41
|
+
return candidate === "outgoingCalls" || candidate === "incomingCalls"
|
|
42
|
+
? candidate
|
|
43
|
+
: "incomingCalls" ;
|
|
44
|
+
}
|
|
45
|
+
let CallHierarchyController = class CallHierarchyController {
|
|
46
|
+
static { CallHierarchyController_1 = this; }
|
|
47
|
+
static { this.Id = 'callHierarchy'; }
|
|
48
|
+
static get(editor) {
|
|
49
|
+
return editor.getContribution(CallHierarchyController_1.Id);
|
|
50
|
+
}
|
|
51
|
+
static { this._StorageDirection = 'callHierarchy/defaultDirection'; }
|
|
52
|
+
constructor(_editor, _contextKeyService, _storageService, _editorService, _instantiationService) {
|
|
53
|
+
this._editor = _editor;
|
|
54
|
+
this._contextKeyService = _contextKeyService;
|
|
55
|
+
this._storageService = _storageService;
|
|
56
|
+
this._editorService = _editorService;
|
|
57
|
+
this._instantiationService = _instantiationService;
|
|
58
|
+
this._dispoables = ( new DisposableStore());
|
|
59
|
+
this._sessionDisposables = ( new DisposableStore());
|
|
60
|
+
this._ctxIsVisible = _ctxCallHierarchyVisible.bindTo(this._contextKeyService);
|
|
61
|
+
this._ctxHasProvider = _ctxHasCallHierarchyProvider.bindTo(this._contextKeyService);
|
|
62
|
+
this._ctxDirection = _ctxCallHierarchyDirection.bindTo(this._contextKeyService);
|
|
63
|
+
this._dispoables.add(Event.any(_editor.onDidChangeModel, _editor.onDidChangeModelLanguage, CallHierarchyProviderRegistry.onDidChange)(() => {
|
|
64
|
+
this._ctxHasProvider.set(_editor.hasModel() && ( CallHierarchyProviderRegistry.has(_editor.getModel())));
|
|
65
|
+
}));
|
|
66
|
+
this._dispoables.add(this._sessionDisposables);
|
|
67
|
+
}
|
|
68
|
+
dispose() {
|
|
69
|
+
this._ctxHasProvider.reset();
|
|
70
|
+
this._ctxIsVisible.reset();
|
|
71
|
+
this._dispoables.dispose();
|
|
72
|
+
}
|
|
73
|
+
async startCallHierarchyFromEditor() {
|
|
74
|
+
this._sessionDisposables.clear();
|
|
75
|
+
if (!this._editor.hasModel()) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const document = this._editor.getModel();
|
|
79
|
+
const position = this._editor.getPosition();
|
|
80
|
+
if (!( CallHierarchyProviderRegistry.has(document))) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
const cts = ( new CancellationTokenSource());
|
|
84
|
+
const model = CallHierarchyModel.create(document, position, cts.token);
|
|
85
|
+
const direction = sanitizedDirection(this._storageService.get(CallHierarchyController_1._StorageDirection, 0 , "incomingCalls" ));
|
|
86
|
+
this._showCallHierarchyWidget(position, direction, model, cts);
|
|
87
|
+
}
|
|
88
|
+
async startCallHierarchyFromCallHierarchy() {
|
|
89
|
+
if (!this._widget) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const model = this._widget.getModel();
|
|
93
|
+
const call = this._widget.getFocused();
|
|
94
|
+
if (!call || !model) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
const newEditor = await this._editorService.openCodeEditor({ resource: call.item.uri }, this._editor);
|
|
98
|
+
if (!newEditor) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const newModel = model.fork(call.item);
|
|
102
|
+
this._sessionDisposables.clear();
|
|
103
|
+
CallHierarchyController_1.get(newEditor)?._showCallHierarchyWidget(Range.lift(newModel.root.selectionRange).getStartPosition(), this._widget.direction, Promise.resolve(newModel), ( new CancellationTokenSource()));
|
|
104
|
+
}
|
|
105
|
+
_showCallHierarchyWidget(position, direction, model, cts) {
|
|
106
|
+
this._ctxIsVisible.set(true);
|
|
107
|
+
this._ctxDirection.set(direction);
|
|
108
|
+
Event.any(this._editor.onDidChangeModel, this._editor.onDidChangeModelLanguage)(this.endCallHierarchy, this, this._sessionDisposables);
|
|
109
|
+
this._widget = this._instantiationService.createInstance(CallHierarchyTreePeekWidget, this._editor, position, direction);
|
|
110
|
+
this._widget.showLoading();
|
|
111
|
+
this._sessionDisposables.add(this._widget.onDidClose(() => {
|
|
112
|
+
this.endCallHierarchy();
|
|
113
|
+
this._storageService.store(CallHierarchyController_1._StorageDirection, this._widget.direction, 0 , 0 );
|
|
114
|
+
}));
|
|
115
|
+
this._sessionDisposables.add({ dispose() { cts.dispose(true); } });
|
|
116
|
+
this._sessionDisposables.add(this._widget);
|
|
117
|
+
model.then(model => {
|
|
118
|
+
if (cts.token.isCancellationRequested) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
if (model) {
|
|
122
|
+
this._sessionDisposables.add(model);
|
|
123
|
+
this._widget.showModel(model);
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
this._widget.showMessage(( localizeWithPath(
|
|
127
|
+
'vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution',
|
|
128
|
+
'no.item',
|
|
129
|
+
"No results"
|
|
130
|
+
)));
|
|
131
|
+
}
|
|
132
|
+
}).catch(err => {
|
|
133
|
+
if (isCancellationError(err)) {
|
|
134
|
+
this.endCallHierarchy();
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
this._widget.showMessage(( localizeWithPath(
|
|
138
|
+
'vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution',
|
|
139
|
+
'error',
|
|
140
|
+
"Failed to show call hierarchy"
|
|
141
|
+
)));
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
showOutgoingCalls() {
|
|
145
|
+
this._widget?.updateDirection("outgoingCalls" );
|
|
146
|
+
this._ctxDirection.set("outgoingCalls" );
|
|
147
|
+
}
|
|
148
|
+
showIncomingCalls() {
|
|
149
|
+
this._widget?.updateDirection("incomingCalls" );
|
|
150
|
+
this._ctxDirection.set("incomingCalls" );
|
|
151
|
+
}
|
|
152
|
+
endCallHierarchy() {
|
|
153
|
+
this._sessionDisposables.clear();
|
|
154
|
+
this._ctxIsVisible.set(false);
|
|
155
|
+
this._editor.focus();
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
CallHierarchyController = CallHierarchyController_1 = ( __decorate([
|
|
159
|
+
( __param(1, IContextKeyService)),
|
|
160
|
+
( __param(2, IStorageService)),
|
|
161
|
+
( __param(3, ICodeEditorService)),
|
|
162
|
+
( __param(4, IInstantiationService))
|
|
163
|
+
], CallHierarchyController));
|
|
164
|
+
registerEditorContribution(CallHierarchyController.Id, CallHierarchyController, 0 );
|
|
165
|
+
registerAction2(class PeekCallHierarchyAction extends EditorAction2 {
|
|
166
|
+
constructor() {
|
|
167
|
+
super({
|
|
168
|
+
id: 'editor.showCallHierarchy',
|
|
169
|
+
title: ( localize2WithPath(
|
|
170
|
+
'vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution',
|
|
171
|
+
'title',
|
|
172
|
+
'Peek Call Hierarchy'
|
|
173
|
+
)),
|
|
174
|
+
menu: {
|
|
175
|
+
id: MenuId.EditorContextPeek,
|
|
176
|
+
group: 'navigation',
|
|
177
|
+
order: 1000,
|
|
178
|
+
when: ( ContextKeyExpr.and(_ctxHasCallHierarchyProvider, PeekContext.notInPeekEditor)),
|
|
179
|
+
},
|
|
180
|
+
keybinding: {
|
|
181
|
+
when: EditorContextKeys.editorTextFocus,
|
|
182
|
+
weight: 200 ,
|
|
183
|
+
primary: 1024 + 512 + 38
|
|
184
|
+
},
|
|
185
|
+
precondition: ( ContextKeyExpr.and(_ctxHasCallHierarchyProvider, PeekContext.notInPeekEditor)),
|
|
186
|
+
f1: true
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
async runEditorCommand(_accessor, editor) {
|
|
190
|
+
return CallHierarchyController.get(editor)?.startCallHierarchyFromEditor();
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
registerAction2(class extends EditorAction2 {
|
|
194
|
+
constructor() {
|
|
195
|
+
super({
|
|
196
|
+
id: 'editor.showIncomingCalls',
|
|
197
|
+
title: ( localize2WithPath(
|
|
198
|
+
'vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution',
|
|
199
|
+
'title.incoming',
|
|
200
|
+
'Show Incoming Calls'
|
|
201
|
+
)),
|
|
202
|
+
icon: registerIcon('callhierarchy-incoming', Codicon.callIncoming, ( localizeWithPath(
|
|
203
|
+
'vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution',
|
|
204
|
+
'showIncomingCallsIcons',
|
|
205
|
+
'Icon for incoming calls in the call hierarchy view.'
|
|
206
|
+
))),
|
|
207
|
+
precondition: ( ContextKeyExpr.and(_ctxCallHierarchyVisible, ( _ctxCallHierarchyDirection.isEqualTo("outgoingCalls" )))),
|
|
208
|
+
keybinding: {
|
|
209
|
+
weight: 200 ,
|
|
210
|
+
primary: 1024 + 512 + 38 ,
|
|
211
|
+
},
|
|
212
|
+
menu: {
|
|
213
|
+
id: CallHierarchyTreePeekWidget.TitleMenu,
|
|
214
|
+
when: ( _ctxCallHierarchyDirection.isEqualTo("outgoingCalls" )),
|
|
215
|
+
order: 1,
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
runEditorCommand(_accessor, editor) {
|
|
220
|
+
return CallHierarchyController.get(editor)?.showIncomingCalls();
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
registerAction2(class extends EditorAction2 {
|
|
224
|
+
constructor() {
|
|
225
|
+
super({
|
|
226
|
+
id: 'editor.showOutgoingCalls',
|
|
227
|
+
title: ( localize2WithPath(
|
|
228
|
+
'vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution',
|
|
229
|
+
'title.outgoing',
|
|
230
|
+
'Show Outgoing Calls'
|
|
231
|
+
)),
|
|
232
|
+
icon: registerIcon('callhierarchy-outgoing', Codicon.callOutgoing, ( localizeWithPath(
|
|
233
|
+
'vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution',
|
|
234
|
+
'showOutgoingCallsIcon',
|
|
235
|
+
'Icon for outgoing calls in the call hierarchy view.'
|
|
236
|
+
))),
|
|
237
|
+
precondition: ( ContextKeyExpr.and(_ctxCallHierarchyVisible, ( _ctxCallHierarchyDirection.isEqualTo("incomingCalls" )))),
|
|
238
|
+
keybinding: {
|
|
239
|
+
weight: 200 ,
|
|
240
|
+
primary: 1024 + 512 + 38 ,
|
|
241
|
+
},
|
|
242
|
+
menu: {
|
|
243
|
+
id: CallHierarchyTreePeekWidget.TitleMenu,
|
|
244
|
+
when: ( _ctxCallHierarchyDirection.isEqualTo("incomingCalls" )),
|
|
245
|
+
order: 1
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
runEditorCommand(_accessor, editor) {
|
|
250
|
+
return CallHierarchyController.get(editor)?.showOutgoingCalls();
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
registerAction2(class extends EditorAction2 {
|
|
254
|
+
constructor() {
|
|
255
|
+
super({
|
|
256
|
+
id: 'editor.refocusCallHierarchy',
|
|
257
|
+
title: ( localize2WithPath(
|
|
258
|
+
'vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution',
|
|
259
|
+
'title.refocus',
|
|
260
|
+
'Refocus Call Hierarchy'
|
|
261
|
+
)),
|
|
262
|
+
precondition: _ctxCallHierarchyVisible,
|
|
263
|
+
keybinding: {
|
|
264
|
+
weight: 200 ,
|
|
265
|
+
primary: 1024 + 3
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
async runEditorCommand(_accessor, editor) {
|
|
270
|
+
return CallHierarchyController.get(editor)?.startCallHierarchyFromCallHierarchy();
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
registerAction2(class extends EditorAction2 {
|
|
274
|
+
constructor() {
|
|
275
|
+
super({
|
|
276
|
+
id: 'editor.closeCallHierarchy',
|
|
277
|
+
title: ( localizeWithPath(
|
|
278
|
+
'vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution',
|
|
279
|
+
'close',
|
|
280
|
+
'Close'
|
|
281
|
+
)),
|
|
282
|
+
icon: Codicon.close,
|
|
283
|
+
precondition: _ctxCallHierarchyVisible,
|
|
284
|
+
keybinding: {
|
|
285
|
+
weight: 200 + 10,
|
|
286
|
+
primary: 9 ,
|
|
287
|
+
when: ContextKeyExpr.not('config.editor.stablePeek')
|
|
288
|
+
},
|
|
289
|
+
menu: {
|
|
290
|
+
id: CallHierarchyTreePeekWidget.TitleMenu,
|
|
291
|
+
order: 1000
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
runEditorCommand(_accessor, editor) {
|
|
296
|
+
return CallHierarchyController.get(editor)?.endCallHierarchy();
|
|
297
|
+
}
|
|
298
|
+
});
|
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import './media/callHierarchy.css.js';
|
|
3
|
+
import { PeekViewWidget, peekViewBorder, peekViewTitleBackground, peekViewTitleForeground, peekViewTitleInfoForeground, peekViewResultsBackground, peekViewEditorMatchHighlight, IPeekViewService } from '../../../../editor/contrib/peekView/browser/peekView.js';
|
|
4
|
+
import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';
|
|
5
|
+
import { WorkbenchAsyncDataTree } from '../../../../platform/list/browser/listService.js';
|
|
6
|
+
import { VirtualDelegate, CallRenderer, DataSource, Sorter, AccessibilityProvider, IdentityProvider } from './callHierarchyTree.js';
|
|
7
|
+
import { localizeWithPath } from '../../../../nls.js';
|
|
8
|
+
import { Range } from '../../../../editor/common/core/range.js';
|
|
9
|
+
import { SplitView, Sizing } from '../../../../base/browser/ui/splitview/splitview.js';
|
|
10
|
+
import { Dimension, isKeyboardEvent } from '../../../../base/browser/dom.js';
|
|
11
|
+
import { Event } from '../../../../base/common/event.js';
|
|
12
|
+
import { IEditorService } from '../../../services/editor/common/editorService.js';
|
|
13
|
+
import { EmbeddedCodeEditorWidget } from '../../../../editor/browser/widget/embeddedCodeEditorWidget.js';
|
|
14
|
+
import { ITextModelService } from '../../../../editor/common/services/resolverService.js';
|
|
15
|
+
import { DisposableStore, toDisposable } from '../../../../base/common/lifecycle.js';
|
|
16
|
+
import { OverviewRulerLane } from '../../../../editor/common/model.js';
|
|
17
|
+
import { themeColorFromId, IThemeService } from '../../../../platform/theme/common/themeService.js';
|
|
18
|
+
import { IStorageService } from '../../../../platform/storage/common/storage.js';
|
|
19
|
+
import { Color } from '../../../../base/common/color.js';
|
|
20
|
+
import { TreeMouseEventTarget } from '../../../../base/browser/ui/tree/tree.js';
|
|
21
|
+
import { MenuId, IMenuService } from '../../../../platform/actions/common/actions.js';
|
|
22
|
+
import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';
|
|
23
|
+
import { createAndFillInActionBarActions } from '../../../../platform/actions/browser/menuEntryActionViewItem.js';
|
|
24
|
+
var CallHierarchyTreePeekWidget_1;
|
|
25
|
+
class LayoutInfo {
|
|
26
|
+
static store(info, storageService) {
|
|
27
|
+
storageService.store('callHierarchyPeekLayout', JSON.stringify(info), 0 , 1 );
|
|
28
|
+
}
|
|
29
|
+
static retrieve(storageService) {
|
|
30
|
+
const value = storageService.get('callHierarchyPeekLayout', 0 , '{}');
|
|
31
|
+
const defaultInfo = { ratio: 0.7, height: 17 };
|
|
32
|
+
try {
|
|
33
|
+
return { ...defaultInfo, ...JSON.parse(value) };
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
return defaultInfo;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
constructor(ratio, height) {
|
|
40
|
+
this.ratio = ratio;
|
|
41
|
+
this.height = height;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
class CallHierarchyTree extends WorkbenchAsyncDataTree {
|
|
45
|
+
}
|
|
46
|
+
let CallHierarchyTreePeekWidget = class CallHierarchyTreePeekWidget extends PeekViewWidget {
|
|
47
|
+
static { CallHierarchyTreePeekWidget_1 = this; }
|
|
48
|
+
static { this.TitleMenu = ( new MenuId('callhierarchy/title')); }
|
|
49
|
+
constructor(editor, _where, _direction, themeService, _peekViewService, _editorService, _textModelService, _storageService, _menuService, _contextKeyService, _instantiationService) {
|
|
50
|
+
super(editor, { showFrame: true, showArrow: true, isResizeable: true, isAccessible: true }, _instantiationService);
|
|
51
|
+
this._where = _where;
|
|
52
|
+
this._direction = _direction;
|
|
53
|
+
this._peekViewService = _peekViewService;
|
|
54
|
+
this._editorService = _editorService;
|
|
55
|
+
this._textModelService = _textModelService;
|
|
56
|
+
this._storageService = _storageService;
|
|
57
|
+
this._menuService = _menuService;
|
|
58
|
+
this._contextKeyService = _contextKeyService;
|
|
59
|
+
this._instantiationService = _instantiationService;
|
|
60
|
+
this._treeViewStates = ( new Map());
|
|
61
|
+
this._previewDisposable = ( new DisposableStore());
|
|
62
|
+
this.create();
|
|
63
|
+
this._peekViewService.addExclusiveWidget(editor, this);
|
|
64
|
+
this._applyTheme(themeService.getColorTheme());
|
|
65
|
+
this._disposables.add(themeService.onDidColorThemeChange(this._applyTheme, this));
|
|
66
|
+
this._disposables.add(this._previewDisposable);
|
|
67
|
+
}
|
|
68
|
+
dispose() {
|
|
69
|
+
LayoutInfo.store(this._layoutInfo, this._storageService);
|
|
70
|
+
this._splitView.dispose();
|
|
71
|
+
this._tree.dispose();
|
|
72
|
+
this._editor.dispose();
|
|
73
|
+
super.dispose();
|
|
74
|
+
}
|
|
75
|
+
get direction() {
|
|
76
|
+
return this._direction;
|
|
77
|
+
}
|
|
78
|
+
_applyTheme(theme) {
|
|
79
|
+
const borderColor = theme.getColor(peekViewBorder) || Color.transparent;
|
|
80
|
+
this.style({
|
|
81
|
+
arrowColor: borderColor,
|
|
82
|
+
frameColor: borderColor,
|
|
83
|
+
headerBackgroundColor: theme.getColor(peekViewTitleBackground) || Color.transparent,
|
|
84
|
+
primaryHeadingColor: theme.getColor(peekViewTitleForeground),
|
|
85
|
+
secondaryHeadingColor: theme.getColor(peekViewTitleInfoForeground)
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
_fillHead(container) {
|
|
89
|
+
super._fillHead(container, true);
|
|
90
|
+
const menu = this._menuService.createMenu(CallHierarchyTreePeekWidget_1.TitleMenu, this._contextKeyService);
|
|
91
|
+
const updateToolbar = () => {
|
|
92
|
+
const actions = [];
|
|
93
|
+
createAndFillInActionBarActions(menu, undefined, actions);
|
|
94
|
+
this._actionbarWidget.clear();
|
|
95
|
+
this._actionbarWidget.push(actions, { label: false, icon: true });
|
|
96
|
+
};
|
|
97
|
+
this._disposables.add(menu);
|
|
98
|
+
this._disposables.add(menu.onDidChange(updateToolbar));
|
|
99
|
+
updateToolbar();
|
|
100
|
+
}
|
|
101
|
+
_fillBody(parent) {
|
|
102
|
+
this._layoutInfo = LayoutInfo.retrieve(this._storageService);
|
|
103
|
+
this._dim = ( new Dimension(0, 0));
|
|
104
|
+
this._parent = parent;
|
|
105
|
+
parent.classList.add('call-hierarchy');
|
|
106
|
+
const message = document.createElement('div');
|
|
107
|
+
message.classList.add('message');
|
|
108
|
+
parent.appendChild(message);
|
|
109
|
+
this._message = message;
|
|
110
|
+
this._message.tabIndex = 0;
|
|
111
|
+
const container = document.createElement('div');
|
|
112
|
+
container.classList.add('results');
|
|
113
|
+
parent.appendChild(container);
|
|
114
|
+
this._splitView = ( new SplitView(container, { orientation: 1 }));
|
|
115
|
+
const editorContainer = document.createElement('div');
|
|
116
|
+
editorContainer.classList.add('editor');
|
|
117
|
+
container.appendChild(editorContainer);
|
|
118
|
+
const editorOptions = {
|
|
119
|
+
scrollBeyondLastLine: false,
|
|
120
|
+
scrollbar: {
|
|
121
|
+
verticalScrollbarSize: 14,
|
|
122
|
+
horizontal: 'auto',
|
|
123
|
+
useShadows: true,
|
|
124
|
+
verticalHasArrows: false,
|
|
125
|
+
horizontalHasArrows: false,
|
|
126
|
+
alwaysConsumeMouseWheel: false
|
|
127
|
+
},
|
|
128
|
+
overviewRulerLanes: 2,
|
|
129
|
+
fixedOverflowWidgets: true,
|
|
130
|
+
minimap: {
|
|
131
|
+
enabled: false
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
this._editor = this._instantiationService.createInstance(EmbeddedCodeEditorWidget, editorContainer, editorOptions, {}, this.editor);
|
|
135
|
+
const treeContainer = document.createElement('div');
|
|
136
|
+
treeContainer.classList.add('tree');
|
|
137
|
+
container.appendChild(treeContainer);
|
|
138
|
+
const options = {
|
|
139
|
+
sorter: new Sorter(),
|
|
140
|
+
accessibilityProvider: new AccessibilityProvider(() => this._direction),
|
|
141
|
+
identityProvider: new IdentityProvider(() => this._direction),
|
|
142
|
+
expandOnlyOnTwistieClick: true,
|
|
143
|
+
overrideStyles: {
|
|
144
|
+
listBackground: peekViewResultsBackground
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
this._tree = this._instantiationService.createInstance(CallHierarchyTree, 'CallHierarchyPeek', treeContainer, new VirtualDelegate(), [this._instantiationService.createInstance(CallRenderer)], this._instantiationService.createInstance(DataSource, () => this._direction), options);
|
|
148
|
+
this._splitView.addView({
|
|
149
|
+
onDidChange: Event.None,
|
|
150
|
+
element: editorContainer,
|
|
151
|
+
minimumSize: 200,
|
|
152
|
+
maximumSize: Number.MAX_VALUE,
|
|
153
|
+
layout: (width) => {
|
|
154
|
+
if (this._dim.height) {
|
|
155
|
+
this._editor.layout({ height: this._dim.height, width });
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}, Sizing.Distribute);
|
|
159
|
+
this._splitView.addView({
|
|
160
|
+
onDidChange: Event.None,
|
|
161
|
+
element: treeContainer,
|
|
162
|
+
minimumSize: 100,
|
|
163
|
+
maximumSize: Number.MAX_VALUE,
|
|
164
|
+
layout: (width) => {
|
|
165
|
+
if (this._dim.height) {
|
|
166
|
+
this._tree.layout(this._dim.height, width);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}, Sizing.Distribute);
|
|
170
|
+
this._disposables.add(this._splitView.onDidSashChange(() => {
|
|
171
|
+
if (this._dim.width) {
|
|
172
|
+
this._layoutInfo.ratio = this._splitView.getViewSize(0) / this._dim.width;
|
|
173
|
+
}
|
|
174
|
+
}));
|
|
175
|
+
this._disposables.add(this._tree.onDidChangeFocus(this._updatePreview, this));
|
|
176
|
+
this._disposables.add(this._editor.onMouseDown(e => {
|
|
177
|
+
const { event, target } = e;
|
|
178
|
+
if (event.detail !== 2) {
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
const [focus] = this._tree.getFocus();
|
|
182
|
+
if (!focus) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
this.dispose();
|
|
186
|
+
this._editorService.openEditor({
|
|
187
|
+
resource: focus.item.uri,
|
|
188
|
+
options: { selection: target.range }
|
|
189
|
+
});
|
|
190
|
+
}));
|
|
191
|
+
this._disposables.add(this._tree.onMouseDblClick(e => {
|
|
192
|
+
if (e.target === TreeMouseEventTarget.Twistie) {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
if (e.element) {
|
|
196
|
+
this.dispose();
|
|
197
|
+
this._editorService.openEditor({
|
|
198
|
+
resource: e.element.item.uri,
|
|
199
|
+
options: { selection: e.element.item.selectionRange, pinned: true }
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
}));
|
|
203
|
+
this._disposables.add(this._tree.onDidChangeSelection(e => {
|
|
204
|
+
const [element] = e.elements;
|
|
205
|
+
if (element && isKeyboardEvent(e.browserEvent)) {
|
|
206
|
+
this.dispose();
|
|
207
|
+
this._editorService.openEditor({
|
|
208
|
+
resource: element.item.uri,
|
|
209
|
+
options: { selection: element.item.selectionRange, pinned: true }
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
}));
|
|
213
|
+
}
|
|
214
|
+
async _updatePreview() {
|
|
215
|
+
const [element] = this._tree.getFocus();
|
|
216
|
+
if (!element) {
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
this._previewDisposable.clear();
|
|
220
|
+
const options = {
|
|
221
|
+
description: 'call-hierarchy-decoration',
|
|
222
|
+
stickiness: 1 ,
|
|
223
|
+
className: 'call-decoration',
|
|
224
|
+
overviewRuler: {
|
|
225
|
+
color: themeColorFromId(peekViewEditorMatchHighlight),
|
|
226
|
+
position: OverviewRulerLane.Center
|
|
227
|
+
},
|
|
228
|
+
};
|
|
229
|
+
let previewUri;
|
|
230
|
+
if (this._direction === "outgoingCalls" ) {
|
|
231
|
+
previewUri = element.parent ? element.parent.item.uri : element.model.root.uri;
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
previewUri = element.item.uri;
|
|
235
|
+
}
|
|
236
|
+
const value = await this._textModelService.createModelReference(previewUri);
|
|
237
|
+
this._editor.setModel(value.object.textEditorModel);
|
|
238
|
+
const decorations = [];
|
|
239
|
+
let fullRange;
|
|
240
|
+
let locations = element.locations;
|
|
241
|
+
if (!locations) {
|
|
242
|
+
locations = [{ uri: element.item.uri, range: element.item.selectionRange }];
|
|
243
|
+
}
|
|
244
|
+
for (const loc of locations) {
|
|
245
|
+
if (( loc.uri.toString()) === ( previewUri.toString())) {
|
|
246
|
+
decorations.push({ range: loc.range, options });
|
|
247
|
+
fullRange = !fullRange ? loc.range : Range.plusRange(loc.range, fullRange);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
if (fullRange) {
|
|
251
|
+
this._editor.revealRangeInCenter(fullRange, 1 );
|
|
252
|
+
const decorationsCollection = this._editor.createDecorationsCollection(decorations);
|
|
253
|
+
this._previewDisposable.add(toDisposable(() => decorationsCollection.clear()));
|
|
254
|
+
}
|
|
255
|
+
this._previewDisposable.add(value);
|
|
256
|
+
const title = this._direction === "outgoingCalls"
|
|
257
|
+
? ( localizeWithPath(
|
|
258
|
+
'vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek',
|
|
259
|
+
'callFrom',
|
|
260
|
+
"Calls from '{0}'",
|
|
261
|
+
element.model.root.name
|
|
262
|
+
))
|
|
263
|
+
: ( localizeWithPath(
|
|
264
|
+
'vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek',
|
|
265
|
+
'callsTo',
|
|
266
|
+
"Callers of '{0}'",
|
|
267
|
+
element.model.root.name
|
|
268
|
+
));
|
|
269
|
+
this.setTitle(title);
|
|
270
|
+
}
|
|
271
|
+
showLoading() {
|
|
272
|
+
this._parent.dataset['state'] = "loading" ;
|
|
273
|
+
this.setTitle(( localizeWithPath(
|
|
274
|
+
'vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek',
|
|
275
|
+
'title.loading',
|
|
276
|
+
"Loading..."
|
|
277
|
+
)));
|
|
278
|
+
this._show();
|
|
279
|
+
}
|
|
280
|
+
showMessage(message) {
|
|
281
|
+
this._parent.dataset['state'] = "message" ;
|
|
282
|
+
this.setTitle('');
|
|
283
|
+
this.setMetaTitle('');
|
|
284
|
+
this._message.innerText = message;
|
|
285
|
+
this._show();
|
|
286
|
+
this._message.focus();
|
|
287
|
+
}
|
|
288
|
+
async showModel(model) {
|
|
289
|
+
this._show();
|
|
290
|
+
const viewState = this._treeViewStates.get(this._direction);
|
|
291
|
+
await this._tree.setInput(model, viewState);
|
|
292
|
+
const root = this._tree.getNode(model).children[0];
|
|
293
|
+
await this._tree.expand(root.element);
|
|
294
|
+
if (root.children.length === 0) {
|
|
295
|
+
this.showMessage(this._direction === "outgoingCalls"
|
|
296
|
+
? ( localizeWithPath(
|
|
297
|
+
'vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek',
|
|
298
|
+
'empt.callsFrom',
|
|
299
|
+
"No calls from '{0}'",
|
|
300
|
+
model.root.name
|
|
301
|
+
))
|
|
302
|
+
: ( localizeWithPath(
|
|
303
|
+
'vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek',
|
|
304
|
+
'empt.callsTo',
|
|
305
|
+
"No callers of '{0}'",
|
|
306
|
+
model.root.name
|
|
307
|
+
)));
|
|
308
|
+
}
|
|
309
|
+
else {
|
|
310
|
+
this._parent.dataset['state'] = "data" ;
|
|
311
|
+
if (!viewState || this._tree.getFocus().length === 0) {
|
|
312
|
+
this._tree.setFocus([root.children[0].element]);
|
|
313
|
+
}
|
|
314
|
+
this._tree.domFocus();
|
|
315
|
+
this._updatePreview();
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
getModel() {
|
|
319
|
+
return this._tree.getInput();
|
|
320
|
+
}
|
|
321
|
+
getFocused() {
|
|
322
|
+
return this._tree.getFocus()[0];
|
|
323
|
+
}
|
|
324
|
+
async updateDirection(newDirection) {
|
|
325
|
+
const model = this._tree.getInput();
|
|
326
|
+
if (model && newDirection !== this._direction) {
|
|
327
|
+
this._treeViewStates.set(this._direction, this._tree.getViewState());
|
|
328
|
+
this._direction = newDirection;
|
|
329
|
+
await this.showModel(model);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
_show() {
|
|
333
|
+
if (!this._isShowing) {
|
|
334
|
+
this.editor.revealLineInCenterIfOutsideViewport(this._where.lineNumber, 0 );
|
|
335
|
+
super.show(Range.fromPositions(this._where), this._layoutInfo.height);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
_onWidth(width) {
|
|
339
|
+
if (this._dim) {
|
|
340
|
+
this._doLayoutBody(this._dim.height, width);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
_doLayoutBody(height, width) {
|
|
344
|
+
if (this._dim.height !== height || this._dim.width !== width) {
|
|
345
|
+
super._doLayoutBody(height, width);
|
|
346
|
+
this._dim = ( new Dimension(width, height));
|
|
347
|
+
this._layoutInfo.height = this._viewZone ? this._viewZone.heightInLines : this._layoutInfo.height;
|
|
348
|
+
this._splitView.layout(width);
|
|
349
|
+
this._splitView.resizeView(0, width * this._layoutInfo.ratio);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
};
|
|
353
|
+
CallHierarchyTreePeekWidget = CallHierarchyTreePeekWidget_1 = ( __decorate([
|
|
354
|
+
( __param(3, IThemeService)),
|
|
355
|
+
( __param(4, IPeekViewService)),
|
|
356
|
+
( __param(5, IEditorService)),
|
|
357
|
+
( __param(6, ITextModelService)),
|
|
358
|
+
( __param(7, IStorageService)),
|
|
359
|
+
( __param(8, IMenuService)),
|
|
360
|
+
( __param(9, IContextKeyService)),
|
|
361
|
+
( __param(10, IInstantiationService))
|
|
362
|
+
], CallHierarchyTreePeekWidget));
|
|
363
|
+
export { CallHierarchyTreePeekWidget };
|