@codingame/monaco-vscode-api 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 (194) hide show
  1. package/README.md +24 -0
  2. package/contributions.js +1 -0
  3. package/extensions.d.ts +7 -3
  4. package/extensions.js +28 -8
  5. package/lifecycle.js +11 -3
  6. package/localExtensionHost.js +13 -10
  7. package/missing-services.js +55 -10
  8. package/monaco.js +7 -3
  9. package/package.json +8 -8
  10. package/service-override/tools/views.d.ts +98 -0
  11. package/service-override/tools/views.js +249 -0
  12. package/services.d.ts +4 -2
  13. package/services.js +11 -9
  14. package/vscode/src/vs/base/browser/deviceAccess.js +60 -0
  15. package/vscode/src/vs/base/browser/dom.js +18 -1
  16. package/vscode/src/vs/base/browser/ui/centered/centeredViewLayout.js +178 -0
  17. package/vscode/src/vs/base/browser/ui/grid/grid.js +492 -0
  18. package/vscode/src/vs/base/browser/ui/grid/gridview.css.js +4 -0
  19. package/vscode/src/vs/base/browser/ui/grid/gridview.d.ts +1 -0
  20. package/vscode/src/vs/base/browser/ui/grid/gridview.js +1109 -0
  21. package/vscode/src/vs/base/browser/ui/sash/sash.js +9 -1
  22. package/vscode/src/vs/base/browser/ui/splitview/splitview.d.ts +348 -1
  23. package/vscode/src/vs/base/common/async.js +46 -2
  24. package/vscode/src/vs/base/common/codicons.d.ts +579 -0
  25. package/vscode/src/vs/base/common/event.js +11 -2
  26. package/vscode/src/vs/base/common/keybindingParser.js +87 -0
  27. package/vscode/src/vs/base/common/network.js +1 -2
  28. package/vscode/src/vs/base/common/observableInternal/utils.js +1 -1
  29. package/vscode/src/vs/base/common/platform.js +2 -1
  30. package/vscode/src/vs/base/common/scrollable.d.ts +28 -0
  31. package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/colors.js +17 -0
  32. package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/diffEditorItemTemplate.js +214 -0
  33. package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/multiDiffEditorViewModel.js +84 -0
  34. package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/multiDiffEditorWidget.js +54 -0
  35. package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/multiDiffEditorWidgetImpl.js +324 -0
  36. package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/objectPool.js +46 -0
  37. package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/style.css.js +4 -0
  38. package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/utils.js +11 -0
  39. package/vscode/src/vs/platform/keyboardLayout/common/keyboardLayout.js +61 -1
  40. package/vscode/src/vs/platform/languagePacks/common/localizedStrings.js +10 -0
  41. package/vscode/src/vs/platform/log/browser/log.js +24 -0
  42. package/vscode/src/vs/platform/product/common/product.js +1 -2
  43. package/vscode/src/vs/platform/userDataSync/common/abstractSynchronizer.js +772 -0
  44. package/vscode/src/vs/platform/userDataSync/common/userDataSyncStoreService.js +551 -0
  45. package/vscode/src/vs/platform/webview/common/mimeTypes.js +22 -0
  46. package/vscode/src/vs/platform/webview/common/webviewPortMapping.js +62 -0
  47. package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +788 -0
  48. package/vscode/src/vs/workbench/browser/actions/listCommands.js +763 -0
  49. package/vscode/src/vs/workbench/browser/layout.d.ts +26 -0
  50. package/vscode/src/vs/workbench/browser/media/style.css.js +1 -1
  51. package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.js +610 -0
  52. package/vscode/src/vs/workbench/browser/parts/activitybar/media/activityaction.css.js +4 -0
  53. package/vscode/src/vs/workbench/browser/parts/activitybar/media/activitybarpart.css.js +4 -0
  54. package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.js +148 -0
  55. package/vscode/src/vs/workbench/browser/parts/auxiliarybar/media/auxiliaryBarPart.css.js +4 -0
  56. package/vscode/src/vs/workbench/browser/parts/compositeBar.js +603 -0
  57. package/vscode/src/vs/workbench/browser/parts/compositePart.js +333 -0
  58. package/vscode/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.js +221 -0
  59. package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +1406 -0
  60. package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +184 -0
  61. package/vscode/src/vs/workbench/browser/parts/editor/editorDropTarget.js +509 -0
  62. package/vscode/src/vs/workbench/browser/parts/editor/editorPane.d.ts +112 -0
  63. package/vscode/src/vs/workbench/browser/parts/editor/editorPart.js +1018 -0
  64. package/vscode/src/vs/workbench/browser/parts/editor/editorParts.js +389 -0
  65. package/vscode/src/vs/workbench/browser/parts/editor/media/editordroptarget.css.js +4 -0
  66. package/vscode/src/vs/workbench/browser/parts/media/compositepart.css.js +4 -0
  67. package/vscode/src/vs/workbench/browser/parts/media/paneCompositePart.css.js +4 -0
  68. package/vscode/src/vs/workbench/browser/parts/notifications/media/notificationsActions.css.js +4 -0
  69. package/vscode/src/vs/workbench/browser/parts/notifications/media/notificationsCenter.css.js +4 -0
  70. package/vscode/src/vs/workbench/browser/parts/notifications/media/notificationsList.css.js +4 -0
  71. package/vscode/src/vs/workbench/browser/parts/notifications/media/notificationsToasts.css.js +4 -0
  72. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsActions.js +213 -0
  73. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsAlerts.js +73 -0
  74. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsCenter.js +307 -0
  75. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsList.js +226 -0
  76. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsStatus.js +218 -0
  77. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsToasts.js +433 -0
  78. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsViewer.js +436 -0
  79. package/vscode/src/vs/workbench/browser/parts/paneCompositeBar.js +643 -0
  80. package/vscode/src/vs/workbench/browser/parts/paneCompositePart.js +377 -0
  81. package/vscode/src/vs/workbench/browser/parts/paneCompositePartService.js +66 -0
  82. package/vscode/src/vs/workbench/browser/parts/panel/panelPart.js +144 -0
  83. package/vscode/src/vs/workbench/browser/parts/sidebar/media/sidebarpart.css.js +4 -0
  84. package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.js +220 -0
  85. package/vscode/src/vs/workbench/browser/window.js +239 -5
  86. package/vscode/src/vs/workbench/common/configuration.js +11 -1
  87. package/vscode/src/vs/workbench/common/theme.js +3 -3
  88. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +298 -0
  89. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.js +363 -0
  90. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.js +133 -0
  91. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/media/callHierarchy.css.js +4 -0
  92. package/vscode/src/vs/workbench/contrib/comments/browser/commentGlyphWidget.js +90 -0
  93. package/vscode/src/vs/workbench/contrib/comments/browser/commentMenus.js +43 -0
  94. package/vscode/src/vs/workbench/contrib/comments/browser/commentService.js +317 -2
  95. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadRangeDecorator.js +107 -0
  96. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +395 -0
  97. package/vscode/src/vs/workbench/contrib/comments/browser/comments.js +3 -0
  98. package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +1277 -0
  99. package/vscode/src/vs/workbench/contrib/comments/browser/commentsFilterOptions.js +17 -0
  100. package/vscode/src/vs/workbench/contrib/comments/browser/commentsModel.js +123 -0
  101. package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +342 -0
  102. package/vscode/src/vs/workbench/contrib/comments/browser/commentsView.js +451 -0
  103. package/vscode/src/vs/workbench/contrib/comments/browser/commentsViewActions.js +176 -0
  104. package/vscode/src/vs/workbench/contrib/comments/browser/media/panel.css.js +4 -0
  105. package/vscode/src/vs/workbench/contrib/comments/common/commentModel.js +35 -0
  106. package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditor.contribution.js +16 -0
  107. package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.js +143 -0
  108. package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditors.js +212 -0
  109. package/vscode/src/vs/workbench/contrib/customEditor/browser/media/customEditor.css.js +4 -0
  110. package/vscode/src/vs/workbench/contrib/customEditor/common/contributedCustomEditors.js +76 -0
  111. package/vscode/src/vs/workbench/contrib/customEditor/common/customEditorModelManager.js +61 -0
  112. package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.js +117 -0
  113. package/vscode/src/vs/workbench/contrib/editSessions/common/editSessions.js +62 -0
  114. package/vscode/src/vs/workbench/contrib/externalUriOpener/common/externalUriOpener.contribution.js +5 -0
  115. package/vscode/src/vs/workbench/contrib/files/browser/editors/binaryFileEditor.js +77 -0
  116. package/vscode/src/vs/workbench/contrib/files/browser/editors/fileEditorHandler.js +72 -0
  117. package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditor.js +254 -0
  118. package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditorTracker.js +97 -0
  119. package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.js +442 -0
  120. package/vscode/src/vs/workbench/contrib/files/browser/explorerService.js +430 -0
  121. package/vscode/src/vs/workbench/contrib/files/browser/explorerViewlet.js +10 -10
  122. package/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.js +784 -0
  123. package/vscode/src/vs/workbench/contrib/files/browser/fileCommands.js +487 -0
  124. package/vscode/src/vs/workbench/contrib/files/browser/files.contribution.js +521 -0
  125. package/vscode/src/vs/workbench/contrib/files/browser/workspaceWatcher.js +150 -0
  126. package/vscode/src/vs/workbench/contrib/files/common/dirtyFilesIndicator.js +61 -0
  127. package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveDocumentService.js +25 -1
  128. package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveEditorInput.js +178 -0
  129. package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveHistoryService.js +49 -0
  130. package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.js +408 -0
  131. package/vscode/src/vs/workbench/contrib/languageStatus/browser/media/languageStatus.css.js +4 -0
  132. package/vscode/src/vs/workbench/contrib/limitIndicator/browser/limitIndicator.contribution.js +145 -0
  133. package/vscode/src/vs/workbench/contrib/mappedEdits/common/mappedEdits.contribution.js +22 -0
  134. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.js +691 -0
  135. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/devCommands.js +238 -0
  136. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.js +76 -0
  137. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorSerializer.js +40 -0
  138. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/colors.js +69 -0
  139. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/conflictActions.js +346 -0
  140. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editorGutter.js +96 -0
  141. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.js +144 -0
  142. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.js +103 -0
  143. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.js +399 -0
  144. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.js +195 -0
  145. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/fixedZoneWidget.js +39 -0
  146. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/lineAlignment.js +126 -0
  147. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/media/mergeEditor.css.js +4 -0
  148. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.js +611 -0
  149. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/scrollSynchronizer.js +156 -0
  150. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.js +262 -0
  151. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewZones.js +171 -0
  152. package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/multiDiffSourceResolverService.js +41 -0
  153. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +317 -0
  154. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/notebookVisibleCellObserver.js +56 -0
  155. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +315 -0
  156. package/vscode/src/vs/workbench/contrib/preferences/browser/keyboardLayoutPicker.js +193 -0
  157. package/vscode/src/vs/workbench/contrib/preferences/common/preferences.js +2 -1
  158. package/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.js +2 -2
  159. package/vscode/src/vs/workbench/contrib/sash/browser/sash.contribution.js +37 -0
  160. package/vscode/src/vs/workbench/contrib/sash/browser/sash.js +39 -0
  161. package/vscode/src/vs/workbench/contrib/speech/common/speechService.js +138 -2
  162. package/vscode/src/vs/workbench/contrib/tags/browser/workspaceTagsService.js +12 -0
  163. package/vscode/src/vs/workbench/contrib/tags/common/workspaceTags.js +3 -0
  164. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/media/typeHierarchy.css.js +4 -0
  165. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +281 -0
  166. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.js +358 -0
  167. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree.js +131 -0
  168. package/vscode/src/vs/workbench/contrib/update/common/update.js +2 -0
  169. package/vscode/src/vs/workbench/contrib/webview/browser/overlayWebview.js +288 -0
  170. package/vscode/src/vs/workbench/contrib/webview/browser/resourceLoading.js +94 -0
  171. package/vscode/src/vs/workbench/contrib/webview/browser/themeing.js +86 -0
  172. package/vscode/src/vs/workbench/contrib/webview/browser/webview.contribution.js +77 -0
  173. package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +646 -0
  174. package/vscode/src/vs/workbench/contrib/webview/browser/webviewFindWidget.js +63 -0
  175. package/vscode/src/vs/workbench/contrib/webview/browser/webviewService.js +57 -0
  176. package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.js +140 -0
  177. package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewEditorInputSerializer.js +119 -0
  178. package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +67 -0
  179. package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewPane.js +233 -0
  180. package/vscode/src/vs/workbench/contrib/workspace/common/workspace.js +16 -0
  181. package/vscode/src/vs/workbench/services/activity/browser/activityService.js +143 -0
  182. package/vscode/src/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.js +0 -3
  183. package/vscode/src/vs/workbench/services/driver/browser/driver.js +184 -0
  184. package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +668 -0
  185. package/vscode/src/vs/workbench/services/history/browser/historyService.js +1482 -0
  186. package/vscode/src/vs/workbench/services/layout/browser/layoutService.js +17 -1
  187. package/vscode/src/vs/workbench/services/lifecycle/common/lifecycle.js +8 -1
  188. package/vscode/src/vs/workbench/services/progress/browser/media/progressService.css.js +4 -0
  189. package/vscode/src/vs/workbench/services/progress/browser/progressService.js +521 -0
  190. package/vscode/src/vs/workbench/services/textMate/common/TMGrammars.js +102 -0
  191. package/vscode/src/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.js +296 -0
  192. package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorHandler.js +99 -0
  193. package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +711 -0
  194. package/vscode/src/vs/workbench/services/views/common/viewContainerModel.js +596 -0
@@ -0,0 +1,358 @@
1
+ import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
+ import './media/typeHierarchy.css.js';
3
+ import { Dimension, isKeyboardEvent } from '../../../../base/browser/dom.js';
4
+ import { SplitView, Sizing } from '../../../../base/browser/ui/splitview/splitview.js';
5
+ import { TreeMouseEventTarget } from '../../../../base/browser/ui/tree/tree.js';
6
+ import { Color } from '../../../../base/common/color.js';
7
+ import { Event } from '../../../../base/common/event.js';
8
+ import { DisposableStore, toDisposable } from '../../../../base/common/lifecycle.js';
9
+ import { EmbeddedCodeEditorWidget } from '../../../../editor/browser/widget/embeddedCodeEditorWidget.js';
10
+ import { Range } from '../../../../editor/common/core/range.js';
11
+ import { OverviewRulerLane } from '../../../../editor/common/model.js';
12
+ import { ITextModelService } from '../../../../editor/common/services/resolverService.js';
13
+ import { PeekViewWidget, peekViewBorder, peekViewTitleBackground, peekViewTitleForeground, peekViewTitleInfoForeground, peekViewResultsBackground, peekViewEditorMatchHighlight, IPeekViewService } from '../../../../editor/contrib/peekView/browser/peekView.js';
14
+ import { localizeWithPath } from '../../../../nls.js';
15
+ import { createAndFillInActionBarActions } from '../../../../platform/actions/browser/menuEntryActionViewItem.js';
16
+ import { MenuId, IMenuService } from '../../../../platform/actions/common/actions.js';
17
+ import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';
18
+ import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';
19
+ import { WorkbenchAsyncDataTree } from '../../../../platform/list/browser/listService.js';
20
+ import { IStorageService } from '../../../../platform/storage/common/storage.js';
21
+ import { themeColorFromId, IThemeService } from '../../../../platform/theme/common/themeService.js';
22
+ import { VirtualDelegate, TypeRenderer, DataSource, Sorter, AccessibilityProvider, IdentityProvider } from './typeHierarchyTree.js';
23
+ import { IEditorService } from '../../../services/editor/common/editorService.js';
24
+ var TypeHierarchyTreePeekWidget_1;
25
+ class LayoutInfo {
26
+ static store(info, storageService) {
27
+ storageService.store('typeHierarchyPeekLayout', JSON.stringify(info), 0 , 1 );
28
+ }
29
+ static retrieve(storageService) {
30
+ const value = storageService.get('typeHierarchyPeekLayout', 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 TypeHierarchyTree extends WorkbenchAsyncDataTree {
45
+ }
46
+ let TypeHierarchyTreePeekWidget = class TypeHierarchyTreePeekWidget extends PeekViewWidget {
47
+ static { TypeHierarchyTreePeekWidget_1 = this; }
48
+ static { this.TitleMenu = ( new MenuId('typehierarchy/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(TypeHierarchyTreePeekWidget_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('type-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(TypeHierarchyTree, 'TypeHierarchyPeek', treeContainer, new VirtualDelegate(), [this._instantiationService.createInstance(TypeRenderer)], 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: 'type-hierarchy-decoration',
222
+ stickiness: 1 ,
223
+ className: 'type-decoration',
224
+ overviewRuler: {
225
+ color: themeColorFromId(peekViewEditorMatchHighlight),
226
+ position: OverviewRulerLane.Center
227
+ },
228
+ };
229
+ let previewUri;
230
+ if (this._direction === "supertypes" ) {
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
+ const loc = { uri: element.item.uri, range: element.item.selectionRange };
241
+ if (( loc.uri.toString()) === ( previewUri.toString())) {
242
+ decorations.push({ range: loc.range, options });
243
+ fullRange = !fullRange ? loc.range : Range.plusRange(loc.range, fullRange);
244
+ }
245
+ if (fullRange) {
246
+ this._editor.revealRangeInCenter(fullRange, 1 );
247
+ const decorationsCollection = this._editor.createDecorationsCollection(decorations);
248
+ this._previewDisposable.add(toDisposable(() => decorationsCollection.clear()));
249
+ }
250
+ this._previewDisposable.add(value);
251
+ const title = this._direction === "supertypes"
252
+ ? ( localizeWithPath(
253
+ 'vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek',
254
+ 'supertypes',
255
+ "Supertypes of '{0}'",
256
+ element.model.root.name
257
+ ))
258
+ : ( localizeWithPath(
259
+ 'vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek',
260
+ 'subtypes',
261
+ "Subtypes of '{0}'",
262
+ element.model.root.name
263
+ ));
264
+ this.setTitle(title);
265
+ }
266
+ showLoading() {
267
+ this._parent.dataset['state'] = "loading" ;
268
+ this.setTitle(( localizeWithPath(
269
+ 'vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek',
270
+ 'title.loading',
271
+ "Loading..."
272
+ )));
273
+ this._show();
274
+ }
275
+ showMessage(message) {
276
+ this._parent.dataset['state'] = "message" ;
277
+ this.setTitle('');
278
+ this.setMetaTitle('');
279
+ this._message.innerText = message;
280
+ this._show();
281
+ this._message.focus();
282
+ }
283
+ async showModel(model) {
284
+ this._show();
285
+ const viewState = this._treeViewStates.get(this._direction);
286
+ await this._tree.setInput(model, viewState);
287
+ const root = this._tree.getNode(model).children[0];
288
+ await this._tree.expand(root.element);
289
+ if (root.children.length === 0) {
290
+ this.showMessage(this._direction === "supertypes"
291
+ ? ( localizeWithPath(
292
+ 'vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek',
293
+ 'empt.supertypes',
294
+ "No supertypes of '{0}'",
295
+ model.root.name
296
+ ))
297
+ : ( localizeWithPath(
298
+ 'vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek',
299
+ 'empt.subtypes',
300
+ "No subtypes of '{0}'",
301
+ model.root.name
302
+ )));
303
+ }
304
+ else {
305
+ this._parent.dataset['state'] = "data" ;
306
+ if (!viewState || this._tree.getFocus().length === 0) {
307
+ this._tree.setFocus([root.children[0].element]);
308
+ }
309
+ this._tree.domFocus();
310
+ this._updatePreview();
311
+ }
312
+ }
313
+ getModel() {
314
+ return this._tree.getInput();
315
+ }
316
+ getFocused() {
317
+ return this._tree.getFocus()[0];
318
+ }
319
+ async updateDirection(newDirection) {
320
+ const model = this._tree.getInput();
321
+ if (model && newDirection !== this._direction) {
322
+ this._treeViewStates.set(this._direction, this._tree.getViewState());
323
+ this._direction = newDirection;
324
+ await this.showModel(model);
325
+ }
326
+ }
327
+ _show() {
328
+ if (!this._isShowing) {
329
+ this.editor.revealLineInCenterIfOutsideViewport(this._where.lineNumber, 0 );
330
+ super.show(Range.fromPositions(this._where), this._layoutInfo.height);
331
+ }
332
+ }
333
+ _onWidth(width) {
334
+ if (this._dim) {
335
+ this._doLayoutBody(this._dim.height, width);
336
+ }
337
+ }
338
+ _doLayoutBody(height, width) {
339
+ if (this._dim.height !== height || this._dim.width !== width) {
340
+ super._doLayoutBody(height, width);
341
+ this._dim = ( new Dimension(width, height));
342
+ this._layoutInfo.height = this._viewZone ? this._viewZone.heightInLines : this._layoutInfo.height;
343
+ this._splitView.layout(width);
344
+ this._splitView.resizeView(0, width * this._layoutInfo.ratio);
345
+ }
346
+ }
347
+ };
348
+ TypeHierarchyTreePeekWidget = TypeHierarchyTreePeekWidget_1 = ( __decorate([
349
+ ( __param(3, IThemeService)),
350
+ ( __param(4, IPeekViewService)),
351
+ ( __param(5, IEditorService)),
352
+ ( __param(6, ITextModelService)),
353
+ ( __param(7, IStorageService)),
354
+ ( __param(8, IMenuService)),
355
+ ( __param(9, IContextKeyService)),
356
+ ( __param(10, IInstantiationService))
357
+ ], TypeHierarchyTreePeekWidget));
358
+ export { TypeHierarchyTreePeekWidget };
@@ -0,0 +1,131 @@
1
+ import { TypeHierarchyModel } from '../common/typeHierarchy.js';
2
+ import { CancellationToken } from '../../../../base/common/cancellation.js';
3
+ import { createMatches } from '../../../../base/common/filters.js';
4
+ import { IconLabel } from '../../../../base/browser/ui/iconLabel/iconLabel.js';
5
+ import { SymbolKinds } from '../../../../editor/common/languages.js';
6
+ import { compare } from '../../../../base/common/strings.js';
7
+ import { Range } from '../../../../editor/common/core/range.js';
8
+ import { localizeWithPath } from '../../../../nls.js';
9
+ import { ThemeIcon } from '../../../../base/common/themables.js';
10
+ class Type {
11
+ constructor(item, model, parent) {
12
+ this.item = item;
13
+ this.model = model;
14
+ this.parent = parent;
15
+ }
16
+ static compare(a, b) {
17
+ let res = compare(( a.item.uri.toString()), ( b.item.uri.toString()));
18
+ if (res === 0) {
19
+ res = Range.compareRangesUsingStarts(a.item.range, b.item.range);
20
+ }
21
+ return res;
22
+ }
23
+ }
24
+ class DataSource {
25
+ constructor(getDirection) {
26
+ this.getDirection = getDirection;
27
+ }
28
+ hasChildren() {
29
+ return true;
30
+ }
31
+ async getChildren(element) {
32
+ if (element instanceof TypeHierarchyModel) {
33
+ return ( element.roots.map(root => ( new Type(root, element, undefined))));
34
+ }
35
+ const { model, item } = element;
36
+ if (this.getDirection() === "supertypes" ) {
37
+ return ( (await model.provideSupertypes(item, CancellationToken.None)).map(item => {
38
+ return ( new Type(item, model, element));
39
+ }));
40
+ }
41
+ else {
42
+ return ( (await model.provideSubtypes(item, CancellationToken.None)).map(item => {
43
+ return ( new Type(item, model, element));
44
+ }));
45
+ }
46
+ }
47
+ }
48
+ class Sorter {
49
+ compare(element, otherElement) {
50
+ return Type.compare(element, otherElement);
51
+ }
52
+ }
53
+ class IdentityProvider {
54
+ constructor(getDirection) {
55
+ this.getDirection = getDirection;
56
+ }
57
+ getId(element) {
58
+ let res = this.getDirection() + JSON.stringify(element.item.uri) + JSON.stringify(element.item.range);
59
+ if (element.parent) {
60
+ res += this.getId(element.parent);
61
+ }
62
+ return res;
63
+ }
64
+ }
65
+ class TypeRenderingTemplate {
66
+ constructor(icon, label) {
67
+ this.icon = icon;
68
+ this.label = label;
69
+ }
70
+ }
71
+ class TypeRenderer {
72
+ constructor() {
73
+ this.templateId = TypeRenderer.id;
74
+ }
75
+ static { this.id = 'TypeRenderer'; }
76
+ renderTemplate(container) {
77
+ container.classList.add('typehierarchy-element');
78
+ const icon = document.createElement('div');
79
+ container.appendChild(icon);
80
+ const label = ( new IconLabel(container, { supportHighlights: true }));
81
+ return ( new TypeRenderingTemplate(icon, label));
82
+ }
83
+ renderElement(node, _index, template) {
84
+ const { element, filterData } = node;
85
+ const deprecated = element.item.tags?.includes(1 );
86
+ template.icon.classList.add('inline', ...ThemeIcon.asClassNameArray(SymbolKinds.toIcon(element.item.kind)));
87
+ template.label.setLabel(element.item.name, element.item.detail, { labelEscapeNewLines: true, matches: createMatches(filterData), strikethrough: deprecated });
88
+ }
89
+ disposeTemplate(template) {
90
+ template.label.dispose();
91
+ }
92
+ }
93
+ class VirtualDelegate {
94
+ getHeight(_element) {
95
+ return 22;
96
+ }
97
+ getTemplateId(_element) {
98
+ return TypeRenderer.id;
99
+ }
100
+ }
101
+ class AccessibilityProvider {
102
+ constructor(getDirection) {
103
+ this.getDirection = getDirection;
104
+ }
105
+ getWidgetAriaLabel() {
106
+ return ( localizeWithPath(
107
+ 'vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree',
108
+ 'tree.aria',
109
+ "Type Hierarchy"
110
+ ));
111
+ }
112
+ getAriaLabel(element) {
113
+ if (this.getDirection() === "supertypes" ) {
114
+ return ( localizeWithPath(
115
+ 'vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree',
116
+ 'supertypes',
117
+ "supertypes of {0}",
118
+ element.item.name
119
+ ));
120
+ }
121
+ else {
122
+ return ( localizeWithPath(
123
+ 'vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree',
124
+ 'subtypes',
125
+ "subtypes of {0}",
126
+ element.item.name
127
+ ));
128
+ }
129
+ }
130
+ }
131
+ export { AccessibilityProvider, DataSource, IdentityProvider, Sorter, Type, TypeRenderer, VirtualDelegate };
@@ -0,0 +1,2 @@
1
+ const ShowCurrentReleaseNotesActionId = 'update.showCurrentReleaseNotes';
2
+ export { ShowCurrentReleaseNotesActionId };