@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.
Files changed (107) hide show
  1. package/index.d.ts +11 -9
  2. package/index.js +8 -6
  3. package/package.json +11 -11
  4. package/tools/views.d.ts +102 -0
  5. package/tools/views.js +253 -0
  6. package/views.d.ts +4 -99
  7. package/views.js +52 -280
  8. package/external/rollup-plugin-styles/dist/runtime/inject-css.js +0 -3
  9. package/vscode/src/vs/base/browser/ui/centered/centeredViewLayout.js +0 -180
  10. package/vscode/src/vs/base/browser/ui/grid/grid.js +0 -494
  11. package/vscode/src/vs/base/browser/ui/grid/gridview.css.js +0 -6
  12. package/vscode/src/vs/base/browser/ui/grid/gridview.js +0 -1112
  13. package/vscode/src/vs/base/common/codicons.d.ts +0 -579
  14. package/vscode/src/vs/platform/webview/common/mimeTypes.js +0 -24
  15. package/vscode/src/vs/platform/webview/common/webviewPortMapping.js +0 -64
  16. package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +0 -790
  17. package/vscode/src/vs/workbench/browser/actions/listCommands.js +0 -764
  18. package/vscode/src/vs/workbench/browser/layout.d.ts +0 -26
  19. package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.js +0 -612
  20. package/vscode/src/vs/workbench/browser/parts/activitybar/media/activityaction.css.js +0 -6
  21. package/vscode/src/vs/workbench/browser/parts/activitybar/media/activitybarpart.css.js +0 -6
  22. package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.js +0 -150
  23. package/vscode/src/vs/workbench/browser/parts/auxiliarybar/media/auxiliaryBarPart.css.js +0 -6
  24. package/vscode/src/vs/workbench/browser/parts/compositeBar.js +0 -605
  25. package/vscode/src/vs/workbench/browser/parts/compositePart.js +0 -335
  26. package/vscode/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.js +0 -223
  27. package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +0 -1407
  28. package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +0 -186
  29. package/vscode/src/vs/workbench/browser/parts/editor/editorDropTarget.js +0 -511
  30. package/vscode/src/vs/workbench/browser/parts/editor/editorPane.d.ts +0 -112
  31. package/vscode/src/vs/workbench/browser/parts/editor/editorPart.js +0 -1020
  32. package/vscode/src/vs/workbench/browser/parts/editor/editorParts.js +0 -391
  33. package/vscode/src/vs/workbench/browser/parts/editor/media/editordroptarget.css.js +0 -6
  34. package/vscode/src/vs/workbench/browser/parts/media/compositepart.css.js +0 -6
  35. package/vscode/src/vs/workbench/browser/parts/media/paneCompositePart.css.js +0 -6
  36. package/vscode/src/vs/workbench/browser/parts/paneCompositeBar.js +0 -645
  37. package/vscode/src/vs/workbench/browser/parts/paneCompositePart.js +0 -379
  38. package/vscode/src/vs/workbench/browser/parts/paneCompositePartService.js +0 -68
  39. package/vscode/src/vs/workbench/browser/parts/panel/panelPart.js +0 -146
  40. package/vscode/src/vs/workbench/browser/parts/sidebar/media/sidebarpart.css.js +0 -6
  41. package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.js +0 -222
  42. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +0 -299
  43. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.js +0 -365
  44. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.js +0 -135
  45. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/media/callHierarchy.css.js +0 -6
  46. package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditor.contribution.js +0 -17
  47. package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.js +0 -145
  48. package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditors.js +0 -214
  49. package/vscode/src/vs/workbench/contrib/customEditor/browser/media/customEditor.css.js +0 -6
  50. package/vscode/src/vs/workbench/contrib/customEditor/common/contributedCustomEditors.js +0 -78
  51. package/vscode/src/vs/workbench/contrib/customEditor/common/customEditorModelManager.js +0 -63
  52. package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.js +0 -119
  53. package/vscode/src/vs/workbench/contrib/externalUriOpener/common/externalUriOpener.contribution.js +0 -6
  54. package/vscode/src/vs/workbench/contrib/files/browser/editors/binaryFileEditor.js +0 -79
  55. package/vscode/src/vs/workbench/contrib/files/browser/editors/fileEditorHandler.js +0 -74
  56. package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditor.js +0 -256
  57. package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditorTracker.js +0 -99
  58. package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.js +0 -444
  59. package/vscode/src/vs/workbench/contrib/files/browser/explorerService.js +0 -432
  60. package/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.js +0 -786
  61. package/vscode/src/vs/workbench/contrib/files/browser/fileCommands.js +0 -488
  62. package/vscode/src/vs/workbench/contrib/files/browser/files.contribution.js +0 -522
  63. package/vscode/src/vs/workbench/contrib/files/browser/workspaceWatcher.js +0 -152
  64. package/vscode/src/vs/workbench/contrib/files/common/dirtyFilesIndicator.js +0 -63
  65. package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.js +0 -409
  66. package/vscode/src/vs/workbench/contrib/languageStatus/browser/media/languageStatus.css.js +0 -6
  67. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.js +0 -693
  68. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/devCommands.js +0 -240
  69. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.js +0 -77
  70. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorSerializer.js +0 -42
  71. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/colors.js +0 -71
  72. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/conflictActions.js +0 -348
  73. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editorGutter.js +0 -98
  74. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.js +0 -146
  75. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.js +0 -105
  76. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.js +0 -401
  77. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.js +0 -197
  78. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/fixedZoneWidget.js +0 -41
  79. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/lineAlignment.js +0 -128
  80. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/media/mergeEditor.css.js +0 -6
  81. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.js +0 -612
  82. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/scrollSynchronizer.js +0 -158
  83. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.js +0 -264
  84. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewZones.js +0 -173
  85. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/media/typeHierarchy.css.js +0 -6
  86. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +0 -282
  87. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.js +0 -360
  88. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree.js +0 -133
  89. package/vscode/src/vs/workbench/contrib/webview/browser/overlayWebview.js +0 -290
  90. package/vscode/src/vs/workbench/contrib/webview/browser/resourceLoading.js +0 -96
  91. package/vscode/src/vs/workbench/contrib/webview/browser/themeing.js +0 -88
  92. package/vscode/src/vs/workbench/contrib/webview/browser/webview.contribution.js +0 -79
  93. package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +0 -648
  94. package/vscode/src/vs/workbench/contrib/webview/browser/webviewFindWidget.js +0 -65
  95. package/vscode/src/vs/workbench/contrib/webview/browser/webviewService.js +0 -59
  96. package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.js +0 -142
  97. package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewEditorInputSerializer.js +0 -121
  98. package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +0 -68
  99. package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewPane.js +0 -235
  100. package/vscode/src/vs/workbench/services/activity/browser/activityService.js +0 -145
  101. package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +0 -670
  102. package/vscode/src/vs/workbench/services/history/browser/historyService.js +0 -1484
  103. package/vscode/src/vs/workbench/services/progress/browser/media/progressService.css.js +0 -6
  104. package/vscode/src/vs/workbench/services/progress/browser/progressService.js +0 -523
  105. package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorHandler.js +0 -101
  106. package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +0 -713
  107. package/vscode/src/vs/workbench/services/views/common/viewContainerModel.js +0 -598
@@ -1,365 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
- import './media/callHierarchy.css.js';
3
- import { PeekViewWidget, peekViewBorder, peekViewTitleBackground, peekViewTitleForeground, peekViewTitleInfoForeground, peekViewEditorMatchHighlight, peekViewResultsBackground, IPeekViewService } from 'vscode/vscode/vs/editor/contrib/peekView/browser/peekView';
4
- import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
5
- import { WorkbenchAsyncDataTree } from 'vscode/vscode/vs/platform/list/browser/listService';
6
- import { VirtualDelegate, CallRenderer, DataSource, Sorter, AccessibilityProvider, IdentityProvider } from './callHierarchyTree.js';
7
- import { localizeWithPath } from 'vscode/vscode/vs/nls';
8
- import { Range } from 'vscode/vscode/vs/editor/common/core/range';
9
- import { SplitView, Sizing } from 'vscode/vscode/vs/base/browser/ui/splitview/splitview';
10
- import { Dimension, isKeyboardEvent } from 'vscode/vscode/vs/base/browser/dom';
11
- import { Event } from 'vscode/vscode/vs/base/common/event';
12
- import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
13
- import { EmbeddedCodeEditorWidget } from 'vscode/vscode/vs/editor/browser/widget/embeddedCodeEditorWidget';
14
- import { ITextModelService } from 'vscode/vscode/vs/editor/common/services/resolverService';
15
- import { DisposableStore, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
16
- import { OverviewRulerLane } from 'vscode/vscode/vs/editor/common/model';
17
- import { themeColorFromId, IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService';
18
- import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage';
19
- import { Color } from 'vscode/vscode/vs/base/common/color';
20
- import { TreeMouseEventTarget } from 'vscode/vscode/vs/base/browser/ui/tree/tree';
21
- import { MenuId, IMenuService } from 'vscode/vscode/vs/platform/actions/common/actions';
22
- import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
23
- import { createAndFillInActionBarActions } from 'vscode/vscode/vs/platform/actions/browser/menuEntryActionViewItem';
24
-
25
- var CallHierarchyTreePeekWidget_1;
26
- class LayoutInfo {
27
- static store(info, storageService) {
28
- storageService.store('callHierarchyPeekLayout', JSON.stringify(info), 0 , 1 );
29
- }
30
- static retrieve(storageService) {
31
- const value = storageService.get('callHierarchyPeekLayout', 0 , '{}');
32
- const defaultInfo = { ratio: 0.7, height: 17 };
33
- try {
34
- return { ...defaultInfo, ...JSON.parse(value) };
35
- }
36
- catch {
37
- return defaultInfo;
38
- }
39
- }
40
- constructor(ratio, height) {
41
- this.ratio = ratio;
42
- this.height = height;
43
- }
44
- }
45
- class CallHierarchyTree extends WorkbenchAsyncDataTree {
46
- }
47
- let CallHierarchyTreePeekWidget = class CallHierarchyTreePeekWidget extends PeekViewWidget {
48
- static { CallHierarchyTreePeekWidget_1 = this; }
49
- static { this.TitleMenu = ( new MenuId('callhierarchy/title')); }
50
- constructor(editor, _where, _direction, themeService, _peekViewService, _editorService, _textModelService, _storageService, _menuService, _contextKeyService, _instantiationService) {
51
- super(editor, { showFrame: true, showArrow: true, isResizeable: true, isAccessible: true }, _instantiationService);
52
- this._where = _where;
53
- this._direction = _direction;
54
- this._peekViewService = _peekViewService;
55
- this._editorService = _editorService;
56
- this._textModelService = _textModelService;
57
- this._storageService = _storageService;
58
- this._menuService = _menuService;
59
- this._contextKeyService = _contextKeyService;
60
- this._instantiationService = _instantiationService;
61
- this._treeViewStates = ( new Map());
62
- this._previewDisposable = ( new DisposableStore());
63
- this.create();
64
- this._peekViewService.addExclusiveWidget(editor, this);
65
- this._applyTheme(themeService.getColorTheme());
66
- this._disposables.add(themeService.onDidColorThemeChange(this._applyTheme, this));
67
- this._disposables.add(this._previewDisposable);
68
- }
69
- dispose() {
70
- LayoutInfo.store(this._layoutInfo, this._storageService);
71
- this._splitView.dispose();
72
- this._tree.dispose();
73
- this._editor.dispose();
74
- super.dispose();
75
- }
76
- get direction() {
77
- return this._direction;
78
- }
79
- _applyTheme(theme) {
80
- const borderColor = theme.getColor(peekViewBorder) || Color.transparent;
81
- this.style({
82
- arrowColor: borderColor,
83
- frameColor: borderColor,
84
- headerBackgroundColor: theme.getColor(peekViewTitleBackground) || Color.transparent,
85
- primaryHeadingColor: theme.getColor(peekViewTitleForeground),
86
- secondaryHeadingColor: theme.getColor(peekViewTitleInfoForeground)
87
- });
88
- }
89
- _fillHead(container) {
90
- super._fillHead(container, true);
91
- const menu = this._menuService.createMenu(CallHierarchyTreePeekWidget_1.TitleMenu, this._contextKeyService);
92
- const updateToolbar = () => {
93
- const actions = [];
94
- createAndFillInActionBarActions(menu, undefined, actions);
95
- this._actionbarWidget.clear();
96
- this._actionbarWidget.push(actions, { label: false, icon: true });
97
- };
98
- this._disposables.add(menu);
99
- this._disposables.add(menu.onDidChange(updateToolbar));
100
- updateToolbar();
101
- }
102
- _fillBody(parent) {
103
- this._layoutInfo = LayoutInfo.retrieve(this._storageService);
104
- this._dim = ( new Dimension(0, 0));
105
- this._parent = parent;
106
- parent.classList.add('call-hierarchy');
107
- const message = document.createElement('div');
108
- message.classList.add('message');
109
- parent.appendChild(message);
110
- this._message = message;
111
- this._message.tabIndex = 0;
112
- const container = document.createElement('div');
113
- container.classList.add('results');
114
- parent.appendChild(container);
115
- this._splitView = ( new SplitView(container, { orientation: 1 }));
116
- const editorContainer = document.createElement('div');
117
- editorContainer.classList.add('editor');
118
- container.appendChild(editorContainer);
119
- const editorOptions = {
120
- scrollBeyondLastLine: false,
121
- scrollbar: {
122
- verticalScrollbarSize: 14,
123
- horizontal: 'auto',
124
- useShadows: true,
125
- verticalHasArrows: false,
126
- horizontalHasArrows: false,
127
- alwaysConsumeMouseWheel: false
128
- },
129
- overviewRulerLanes: 2,
130
- fixedOverflowWidgets: true,
131
- minimap: {
132
- enabled: false
133
- }
134
- };
135
- this._editor = this._instantiationService.createInstance(EmbeddedCodeEditorWidget, editorContainer, editorOptions, {}, this.editor);
136
- const treeContainer = document.createElement('div');
137
- treeContainer.classList.add('tree');
138
- container.appendChild(treeContainer);
139
- const options = {
140
- sorter: new Sorter(),
141
- accessibilityProvider: new AccessibilityProvider(() => this._direction),
142
- identityProvider: new IdentityProvider(() => this._direction),
143
- expandOnlyOnTwistieClick: true,
144
- overrideStyles: {
145
- listBackground: peekViewResultsBackground
146
- }
147
- };
148
- this._tree = this._instantiationService.createInstance(CallHierarchyTree, 'CallHierarchyPeek', treeContainer, new VirtualDelegate(), [this._instantiationService.createInstance(CallRenderer)], this._instantiationService.createInstance(DataSource, () => this._direction), options);
149
- this._splitView.addView({
150
- onDidChange: Event.None,
151
- element: editorContainer,
152
- minimumSize: 200,
153
- maximumSize: Number.MAX_VALUE,
154
- layout: (width) => {
155
- if (this._dim.height) {
156
- this._editor.layout({ height: this._dim.height, width });
157
- }
158
- }
159
- }, Sizing.Distribute);
160
- this._splitView.addView({
161
- onDidChange: Event.None,
162
- element: treeContainer,
163
- minimumSize: 100,
164
- maximumSize: Number.MAX_VALUE,
165
- layout: (width) => {
166
- if (this._dim.height) {
167
- this._tree.layout(this._dim.height, width);
168
- }
169
- }
170
- }, Sizing.Distribute);
171
- this._disposables.add(this._splitView.onDidSashChange(() => {
172
- if (this._dim.width) {
173
- this._layoutInfo.ratio = this._splitView.getViewSize(0) / this._dim.width;
174
- }
175
- }));
176
- this._disposables.add(this._tree.onDidChangeFocus(this._updatePreview, this));
177
- this._disposables.add(this._editor.onMouseDown(e => {
178
- const { event, target } = e;
179
- if (event.detail !== 2) {
180
- return;
181
- }
182
- const [focus] = this._tree.getFocus();
183
- if (!focus) {
184
- return;
185
- }
186
- this.dispose();
187
- this._editorService.openEditor({
188
- resource: focus.item.uri,
189
- options: { selection: target.range }
190
- });
191
- }));
192
- this._disposables.add(this._tree.onMouseDblClick(e => {
193
- if (e.target === TreeMouseEventTarget.Twistie) {
194
- return;
195
- }
196
- if (e.element) {
197
- this.dispose();
198
- this._editorService.openEditor({
199
- resource: e.element.item.uri,
200
- options: { selection: e.element.item.selectionRange, pinned: true }
201
- });
202
- }
203
- }));
204
- this._disposables.add(this._tree.onDidChangeSelection(e => {
205
- const [element] = e.elements;
206
- if (element && isKeyboardEvent(e.browserEvent)) {
207
- this.dispose();
208
- this._editorService.openEditor({
209
- resource: element.item.uri,
210
- options: { selection: element.item.selectionRange, pinned: true }
211
- });
212
- }
213
- }));
214
- }
215
- async _updatePreview() {
216
- const [element] = this._tree.getFocus();
217
- if (!element) {
218
- return;
219
- }
220
- this._previewDisposable.clear();
221
- const options = {
222
- description: 'call-hierarchy-decoration',
223
- stickiness: 1 ,
224
- className: 'call-decoration',
225
- overviewRuler: {
226
- color: themeColorFromId(peekViewEditorMatchHighlight),
227
- position: OverviewRulerLane.Center
228
- },
229
- };
230
- let previewUri;
231
- if (this._direction === "outgoingCalls" ) {
232
- previewUri = element.parent ? element.parent.item.uri : element.model.root.uri;
233
- }
234
- else {
235
- previewUri = element.item.uri;
236
- }
237
- const value = await this._textModelService.createModelReference(previewUri);
238
- this._editor.setModel(value.object.textEditorModel);
239
- const decorations = [];
240
- let fullRange;
241
- let locations = element.locations;
242
- if (!locations) {
243
- locations = [{ uri: element.item.uri, range: element.item.selectionRange }];
244
- }
245
- for (const loc of locations) {
246
- if (( loc.uri.toString()) === ( previewUri.toString())) {
247
- decorations.push({ range: loc.range, options });
248
- fullRange = !fullRange ? loc.range : Range.plusRange(loc.range, fullRange);
249
- }
250
- }
251
- if (fullRange) {
252
- this._editor.revealRangeInCenter(fullRange, 1 );
253
- const decorationsCollection = this._editor.createDecorationsCollection(decorations);
254
- this._previewDisposable.add(toDisposable(() => decorationsCollection.clear()));
255
- }
256
- this._previewDisposable.add(value);
257
- const title = this._direction === "outgoingCalls"
258
- ? ( localizeWithPath(
259
- 'vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek',
260
- 'callFrom',
261
- "Calls from '{0}'",
262
- element.model.root.name
263
- ))
264
- : ( localizeWithPath(
265
- 'vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek',
266
- 'callsTo',
267
- "Callers of '{0}'",
268
- element.model.root.name
269
- ));
270
- this.setTitle(title);
271
- }
272
- showLoading() {
273
- this._parent.dataset['state'] = "loading" ;
274
- this.setTitle(( localizeWithPath(
275
- 'vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek',
276
- 'title.loading',
277
- "Loading..."
278
- )));
279
- this._show();
280
- }
281
- showMessage(message) {
282
- this._parent.dataset['state'] = "message" ;
283
- this.setTitle('');
284
- this.setMetaTitle('');
285
- this._message.innerText = message;
286
- this._show();
287
- this._message.focus();
288
- }
289
- async showModel(model) {
290
- this._show();
291
- const viewState = this._treeViewStates.get(this._direction);
292
- await this._tree.setInput(model, viewState);
293
- const root = this._tree.getNode(model).children[0];
294
- await this._tree.expand(root.element);
295
- if (root.children.length === 0) {
296
- this.showMessage(this._direction === "outgoingCalls"
297
- ? ( localizeWithPath(
298
- 'vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek',
299
- 'empt.callsFrom',
300
- "No calls from '{0}'",
301
- model.root.name
302
- ))
303
- : ( localizeWithPath(
304
- 'vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek',
305
- 'empt.callsTo',
306
- "No callers of '{0}'",
307
- model.root.name
308
- )));
309
- }
310
- else {
311
- this._parent.dataset['state'] = "data" ;
312
- if (!viewState || this._tree.getFocus().length === 0) {
313
- this._tree.setFocus([root.children[0].element]);
314
- }
315
- this._tree.domFocus();
316
- this._updatePreview();
317
- }
318
- }
319
- getModel() {
320
- return this._tree.getInput();
321
- }
322
- getFocused() {
323
- return this._tree.getFocus()[0];
324
- }
325
- async updateDirection(newDirection) {
326
- const model = this._tree.getInput();
327
- if (model && newDirection !== this._direction) {
328
- this._treeViewStates.set(this._direction, this._tree.getViewState());
329
- this._direction = newDirection;
330
- await this.showModel(model);
331
- }
332
- }
333
- _show() {
334
- if (!this._isShowing) {
335
- this.editor.revealLineInCenterIfOutsideViewport(this._where.lineNumber, 0 );
336
- super.show(Range.fromPositions(this._where), this._layoutInfo.height);
337
- }
338
- }
339
- _onWidth(width) {
340
- if (this._dim) {
341
- this._doLayoutBody(this._dim.height, width);
342
- }
343
- }
344
- _doLayoutBody(height, width) {
345
- if (this._dim.height !== height || this._dim.width !== width) {
346
- super._doLayoutBody(height, width);
347
- this._dim = ( new Dimension(width, height));
348
- this._layoutInfo.height = this._viewZone ? this._viewZone.heightInLines : this._layoutInfo.height;
349
- this._splitView.layout(width);
350
- this._splitView.resizeView(0, width * this._layoutInfo.ratio);
351
- }
352
- }
353
- };
354
- CallHierarchyTreePeekWidget = CallHierarchyTreePeekWidget_1 = ( __decorate([
355
- ( __param(3, IThemeService)),
356
- ( __param(4, IPeekViewService)),
357
- ( __param(5, IEditorService)),
358
- ( __param(6, ITextModelService)),
359
- ( __param(7, IStorageService)),
360
- ( __param(8, IMenuService)),
361
- ( __param(9, IContextKeyService)),
362
- ( __param(10, IInstantiationService))
363
- ], CallHierarchyTreePeekWidget));
364
-
365
- export { CallHierarchyTreePeekWidget };
@@ -1,135 +0,0 @@
1
- import { CallHierarchyModel } from 'vscode/vscode/vs/workbench/contrib/callHierarchy/common/callHierarchy';
2
- import { CancellationToken } from 'vscode/vscode/vs/base/common/cancellation';
3
- import { createMatches } from 'vscode/vscode/vs/base/common/filters';
4
- import { IconLabel } from 'vscode/vscode/vs/base/browser/ui/iconLabel/iconLabel';
5
- import { SymbolKinds } from 'vscode/vscode/vs/editor/common/languages';
6
- import { compare } from 'vscode/vscode/vs/base/common/strings';
7
- import { Range } from 'vscode/vscode/vs/editor/common/core/range';
8
- import { localizeWithPath } from 'vscode/vscode/vs/nls';
9
- import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
10
-
11
- class Call {
12
- constructor(item, locations, model, parent) {
13
- this.item = item;
14
- this.locations = locations;
15
- this.model = model;
16
- this.parent = parent;
17
- }
18
- static compare(a, b) {
19
- let res = compare(( a.item.uri.toString()), ( b.item.uri.toString()));
20
- if (res === 0) {
21
- res = Range.compareRangesUsingStarts(a.item.range, b.item.range);
22
- }
23
- return res;
24
- }
25
- }
26
- class DataSource {
27
- constructor(getDirection) {
28
- this.getDirection = getDirection;
29
- }
30
- hasChildren() {
31
- return true;
32
- }
33
- async getChildren(element) {
34
- if (element instanceof CallHierarchyModel) {
35
- return ( element.roots.map(root => ( new Call(root, undefined, element, undefined))));
36
- }
37
- const { model, item } = element;
38
- if (this.getDirection() === "outgoingCalls" ) {
39
- return ( (await model.resolveOutgoingCalls(item, CancellationToken.None)).map(call => {
40
- return ( new Call(call.to, ( call.fromRanges.map(range => ({ range, uri: item.uri }))), model, element));
41
- }));
42
- }
43
- else {
44
- return ( (await model.resolveIncomingCalls(item, CancellationToken.None)).map(call => {
45
- return ( new Call(call.from, ( call.fromRanges.map(range => ({ range, uri: call.from.uri }))), model, element));
46
- }));
47
- }
48
- }
49
- }
50
- class Sorter {
51
- compare(element, otherElement) {
52
- return Call.compare(element, otherElement);
53
- }
54
- }
55
- class IdentityProvider {
56
- constructor(getDirection) {
57
- this.getDirection = getDirection;
58
- }
59
- getId(element) {
60
- let res = this.getDirection() + JSON.stringify(element.item.uri) + JSON.stringify(element.item.range);
61
- if (element.parent) {
62
- res += this.getId(element.parent);
63
- }
64
- return res;
65
- }
66
- }
67
- class CallRenderingTemplate {
68
- constructor(icon, label) {
69
- this.icon = icon;
70
- this.label = label;
71
- }
72
- }
73
- class CallRenderer {
74
- constructor() {
75
- this.templateId = CallRenderer.id;
76
- }
77
- static { this.id = 'CallRenderer'; }
78
- renderTemplate(container) {
79
- container.classList.add('callhierarchy-element');
80
- const icon = document.createElement('div');
81
- container.appendChild(icon);
82
- const label = ( new IconLabel(container, { supportHighlights: true }));
83
- return ( new CallRenderingTemplate(icon, label));
84
- }
85
- renderElement(node, _index, template) {
86
- const { element, filterData } = node;
87
- const deprecated = element.item.tags?.includes(1 );
88
- template.icon.className = '';
89
- template.icon.classList.add('inline', ...ThemeIcon.asClassNameArray(SymbolKinds.toIcon(element.item.kind)));
90
- template.label.setLabel(element.item.name, element.item.detail, { labelEscapeNewLines: true, matches: createMatches(filterData), strikethrough: deprecated });
91
- }
92
- disposeTemplate(template) {
93
- template.label.dispose();
94
- }
95
- }
96
- class VirtualDelegate {
97
- getHeight(_element) {
98
- return 22;
99
- }
100
- getTemplateId(_element) {
101
- return CallRenderer.id;
102
- }
103
- }
104
- class AccessibilityProvider {
105
- constructor(getDirection) {
106
- this.getDirection = getDirection;
107
- }
108
- getWidgetAriaLabel() {
109
- return ( localizeWithPath(
110
- 'vs/workbench/contrib/callHierarchy/browser/callHierarchyTree',
111
- 'tree.aria',
112
- "Call Hierarchy"
113
- ));
114
- }
115
- getAriaLabel(element) {
116
- if (this.getDirection() === "outgoingCalls" ) {
117
- return ( localizeWithPath(
118
- 'vs/workbench/contrib/callHierarchy/browser/callHierarchyTree',
119
- 'from',
120
- "calls from {0}",
121
- element.item.name
122
- ));
123
- }
124
- else {
125
- return ( localizeWithPath(
126
- 'vs/workbench/contrib/callHierarchy/browser/callHierarchyTree',
127
- 'to',
128
- "callers of {0}",
129
- element.item.name
130
- ));
131
- }
132
- }
133
- }
134
-
135
- export { AccessibilityProvider, Call, CallRenderer, DataSource, IdentityProvider, Sorter, VirtualDelegate };
@@ -1,6 +0,0 @@
1
- import n from '../../../../../../../../external/rollup-plugin-styles/dist/runtime/inject-css.js';
2
-
3
- var css = ".monaco-workbench .call-hierarchy .message,.monaco-workbench .call-hierarchy .results{display:none}.monaco-workbench .call-hierarchy[data-state=data] .results{display:inherit;height:100%}.monaco-workbench .call-hierarchy[data-state=message] .message{align-items:center;display:flex;height:100%;justify-content:center}.monaco-workbench .call-hierarchy .editor,.monaco-workbench .call-hierarchy .tree{height:100%}.monaco-editor .call-hierarchy .tree{background-color:var(--vscode-peekViewResult-background);color:var(--vscode-peekViewResult-fileForeground)}.monaco-workbench .call-hierarchy .tree .callhierarchy-element{align-items:center;display:flex;flex:1;flex-flow:row nowrap}.monaco-workbench .call-hierarchy .tree .callhierarchy-element .monaco-icon-label{padding-left:4px}.monaco-editor .call-hierarchy .tree .monaco-list:focus .monaco-list-rows>.monaco-list-row.selected:not(.highlighted){background-color:var(--vscode-peekViewResult-selectionBackground);color:var(--vscode-peekViewResult-selectionForeground)!important}.monaco-editor .call-hierarchy .call-decoration{background-color:var(--vscode-peekViewEditor-matchHighlightBackground);border:2px solid var(--vscode-peekViewEditor-matchHighlightBorder);box-sizing:border-box}.monaco-editor .call-hierarchy .editor .monaco-editor .inputarea.ime-input,.monaco-editor .call-hierarchy .editor .monaco-editor .monaco-editor-background{background-color:var(--vscode-peekViewEditor-background)}.monaco-editor .call-hierarchy .editor .monaco-editor .margin{background-color:var(--vscode-peekViewEditorGutter-background)}";
4
- n(css,{});
5
-
6
- export { css, css as default };
@@ -1,17 +0,0 @@
1
- import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
2
- import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
3
- import { EditorPaneDescriptor } from 'vscode/vscode/vs/workbench/browser/editor';
4
- import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
5
- import { EditorExtensions } from 'vscode/vscode/vs/workbench/common/editor';
6
- import { CustomEditorInputSerializer, ComplexCustomWorkingCopyEditorHandler } from './customEditorInputFactory.js';
7
- import { WebviewEditor } from 'vscode/vscode/vs/workbench/contrib/webviewPanel/browser/webviewEditor';
8
- import { CustomEditorInput } from 'vscode/vscode/vs/workbench/contrib/customEditor/browser/customEditorInput';
9
-
10
- ( Registry.as(EditorExtensions.EditorPane))
11
- .registerEditorPane(EditorPaneDescriptor.create(WebviewEditor, WebviewEditor.ID, 'Webview Editor'), [
12
- ( new SyncDescriptor(CustomEditorInput))
13
- ]);
14
- ( Registry.as(EditorExtensions.EditorFactory))
15
- .registerEditorSerializer(CustomEditorInputSerializer.ID, CustomEditorInputSerializer);
16
- ( Registry.as(Extensions.Workbench))
17
- .registerWorkbenchContribution(ComplexCustomWorkingCopyEditorHandler, 1 );
@@ -1,145 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
- import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
3
- import { Schemas } from 'vscode/vscode/vs/base/common/network';
4
- import { isEqual } from 'vscode/vscode/vs/base/common/resources';
5
- import { URI } from 'vscode/vscode/vs/base/common/uri';
6
- import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
7
- import { CustomEditorInput } from 'vscode/vscode/vs/workbench/contrib/customEditor/browser/customEditorInput';
8
- import { ICustomEditorService } from 'vscode/vscode/vs/workbench/contrib/customEditor/common/customEditor';
9
- import { NotebookEditorInput } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookEditorInput';
10
- import { IWebviewService } from 'vscode/vscode/vs/workbench/contrib/webview/browser/webview';
11
- import { WebviewEditorInputSerializer, reviveWebviewExtensionDescription, restoreWebviewOptions, restoreWebviewContentOptions } from '../../webviewPanel/browser/webviewEditorInputSerializer.js';
12
- import { IWebviewWorkbenchService } from 'vscode/vscode/vs/workbench/contrib/webviewPanel/browser/webviewWorkbenchService';
13
- import { IWorkingCopyBackupService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyBackup';
14
- import { IWorkingCopyEditorService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyEditorService';
15
-
16
- let CustomEditorInputSerializer = class CustomEditorInputSerializer extends WebviewEditorInputSerializer {
17
- static { this.ID = CustomEditorInput.typeId; }
18
- constructor(webviewWorkbenchService, _instantiationService, _webviewService) {
19
- super(webviewWorkbenchService);
20
- this._instantiationService = _instantiationService;
21
- this._webviewService = _webviewService;
22
- }
23
- serialize(input) {
24
- const dirty = input.isDirty();
25
- const data = {
26
- ...this.toJson(input),
27
- editorResource: input.resource.toJSON(),
28
- dirty,
29
- backupId: dirty ? input.backupId : undefined,
30
- };
31
- try {
32
- return JSON.stringify(data);
33
- }
34
- catch {
35
- return undefined;
36
- }
37
- }
38
- fromJson(data) {
39
- return {
40
- ...super.fromJson(data),
41
- editorResource: ( URI.from(data.editorResource)),
42
- dirty: data.dirty,
43
- };
44
- }
45
- deserialize(_instantiationService, serializedEditorInput) {
46
- const data = this.fromJson(JSON.parse(serializedEditorInput));
47
- const webview = reviveWebview(this._webviewService, data);
48
- const customInput = this._instantiationService.createInstance(CustomEditorInput, { resource: data.editorResource, viewType: data.viewType }, webview, { startsDirty: data.dirty, backupId: data.backupId });
49
- if (typeof data.group === 'number') {
50
- customInput.updateGroup(data.group);
51
- }
52
- return customInput;
53
- }
54
- };
55
- CustomEditorInputSerializer = ( __decorate([
56
- ( __param(0, IWebviewWorkbenchService)),
57
- ( __param(1, IInstantiationService)),
58
- ( __param(2, IWebviewService))
59
- ], CustomEditorInputSerializer));
60
- function reviveWebview(webviewService, data) {
61
- const webview = webviewService.createWebviewOverlay({
62
- providedViewType: data.viewType,
63
- origin: data.origin,
64
- title: undefined,
65
- options: {
66
- purpose: "customEditor" ,
67
- enableFindWidget: data.webviewOptions.enableFindWidget,
68
- retainContextWhenHidden: data.webviewOptions.retainContextWhenHidden,
69
- },
70
- contentOptions: data.contentOptions,
71
- extension: data.extension,
72
- });
73
- webview.state = data.state;
74
- return webview;
75
- }
76
- let ComplexCustomWorkingCopyEditorHandler = class ComplexCustomWorkingCopyEditorHandler extends Disposable {
77
- constructor(_instantiationService, _workingCopyEditorService, _workingCopyBackupService, _webviewService, _customEditorService
78
- ) {
79
- super();
80
- this._instantiationService = _instantiationService;
81
- this._workingCopyBackupService = _workingCopyBackupService;
82
- this._webviewService = _webviewService;
83
- this._register(_workingCopyEditorService.registerHandler(this));
84
- }
85
- handles(workingCopy) {
86
- return workingCopy.resource.scheme === Schemas.vscodeCustomEditor;
87
- }
88
- isOpen(workingCopy, editor) {
89
- if (!this.handles(workingCopy)) {
90
- return false;
91
- }
92
- if (workingCopy.resource.authority === 'jupyter-notebook-ipynb' && editor instanceof NotebookEditorInput) {
93
- try {
94
- const data = JSON.parse(workingCopy.resource.query);
95
- const workingCopyResource = ( URI.from(data));
96
- return isEqual(workingCopyResource, editor.resource);
97
- }
98
- catch {
99
- return false;
100
- }
101
- }
102
- if (!(editor instanceof CustomEditorInput)) {
103
- return false;
104
- }
105
- if (workingCopy.resource.authority !== editor.viewType.replace(/[^a-z0-9\-_]/gi, '-').toLowerCase()) {
106
- return false;
107
- }
108
- try {
109
- const data = JSON.parse(workingCopy.resource.query);
110
- const workingCopyResource = ( URI.from(data));
111
- return isEqual(workingCopyResource, editor.resource);
112
- }
113
- catch {
114
- return false;
115
- }
116
- }
117
- async createEditor(workingCopy) {
118
- const backup = await this._workingCopyBackupService.resolve(workingCopy);
119
- if (!backup?.meta) {
120
- throw new Error(`No backup found for custom editor: ${workingCopy.resource}`);
121
- }
122
- const backupData = backup.meta;
123
- const extension = reviveWebviewExtensionDescription(backupData.extension?.id, backupData.extension?.location);
124
- const webview = reviveWebview(this._webviewService, {
125
- viewType: backupData.viewType,
126
- origin: backupData.webview.origin,
127
- webviewOptions: restoreWebviewOptions(backupData.webview.options),
128
- contentOptions: restoreWebviewContentOptions(backupData.webview.options),
129
- state: backupData.webview.state,
130
- extension,
131
- });
132
- const editor = this._instantiationService.createInstance(CustomEditorInput, { resource: URI.revive(backupData.editorResource), viewType: backupData.viewType }, webview, { backupId: backupData.backupId });
133
- editor.updateGroup(0);
134
- return editor;
135
- }
136
- };
137
- ComplexCustomWorkingCopyEditorHandler = ( __decorate([
138
- ( __param(0, IInstantiationService)),
139
- ( __param(1, IWorkingCopyEditorService)),
140
- ( __param(2, IWorkingCopyBackupService)),
141
- ( __param(3, IWebviewService)),
142
- ( __param(4, ICustomEditorService))
143
- ], ComplexCustomWorkingCopyEditorHandler));
144
-
145
- export { ComplexCustomWorkingCopyEditorHandler, CustomEditorInputSerializer };