@codingame/monaco-vscode-extensions-service-override 1.83.7 → 1.83.9

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 (183) hide show
  1. package/assets/webWorkerExtensionHostIframe.html +123 -0
  2. package/extensions.d.ts +12 -13
  3. package/extensions.js +456 -0
  4. package/external/rollup-plugin-styles/dist/runtime/inject-css.js +3 -0
  5. package/external/tslib/tslib.es6.js +11 -0
  6. package/index.d.ts +1 -1
  7. package/index.js +2 -2
  8. package/override/vs/platform/dialogs/common/dialogs.js +8 -0
  9. package/override/vs/workbench/browser/parts/editor/textEditor.weak.js +8 -0
  10. package/override/vs/workbench/contrib/notebook/common/notebookEditorInput.js +3 -0
  11. package/package.json +5 -3
  12. package/tools/url.js +10 -0
  13. package/tools.js +5 -0
  14. package/vscode/src/vs/base/common/console.js +59 -0
  15. package/vscode/src/vs/base/common/prefixTree.js +131 -0
  16. package/vscode/src/vs/platform/files/common/watcher.js +71 -0
  17. package/vscode/src/vs/platform/lifecycle/common/lifecycle.js +27 -0
  18. package/vscode/src/vs/platform/log/browser/log.js +26 -0
  19. package/vscode/src/vs/platform/remote/common/managedSocket.js +98 -0
  20. package/vscode/src/vs/workbench/api/browser/mainThreadAiEmbeddingVector.js +31 -0
  21. package/vscode/src/vs/workbench/api/browser/mainThreadAiRelatedInformation.js +35 -0
  22. package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +330 -0
  23. package/vscode/src/vs/workbench/api/browser/mainThreadBulkEdits.js +68 -0
  24. package/vscode/src/vs/workbench/api/browser/mainThreadChat.js +174 -0
  25. package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents.js +52 -0
  26. package/vscode/src/vs/workbench/api/browser/mainThreadChatProvider.js +61 -0
  27. package/vscode/src/vs/workbench/api/browser/mainThreadChatSlashCommands.js +49 -0
  28. package/vscode/src/vs/workbench/api/browser/mainThreadChatVariables.js +31 -0
  29. package/vscode/src/vs/workbench/api/browser/mainThreadClipboard.js +24 -0
  30. package/vscode/src/vs/workbench/api/browser/mainThreadCodeInsets.js +107 -0
  31. package/vscode/src/vs/workbench/api/browser/mainThreadCommands.js +94 -0
  32. package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +541 -0
  33. package/vscode/src/vs/workbench/api/browser/mainThreadConfiguration.js +80 -0
  34. package/vscode/src/vs/workbench/api/browser/mainThreadConsole.js +35 -0
  35. package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +578 -0
  36. package/vscode/src/vs/workbench/api/browser/mainThreadDebugService.js +387 -0
  37. package/vscode/src/vs/workbench/api/browser/mainThreadDecorations.js +102 -0
  38. package/vscode/src/vs/workbench/api/browser/mainThreadDiagnostics.js +69 -0
  39. package/vscode/src/vs/workbench/api/browser/mainThreadDialogs.js +68 -0
  40. package/vscode/src/vs/workbench/api/browser/mainThreadDocumentContentProviders.js +75 -0
  41. package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.js +249 -0
  42. package/vscode/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.js +370 -0
  43. package/vscode/src/vs/workbench/api/browser/mainThreadDownloadService.js +22 -0
  44. package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.js +41 -0
  45. package/vscode/src/vs/workbench/api/browser/mainThreadEditor.js +411 -0
  46. package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +475 -0
  47. package/vscode/src/vs/workbench/api/browser/mainThreadEditors.js +227 -0
  48. package/vscode/src/vs/workbench/api/browser/mainThreadErrors.js +24 -0
  49. package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +317 -0
  50. package/vscode/src/vs/workbench/api/browser/mainThreadFileSystem.js +280 -0
  51. package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +283 -0
  52. package/vscode/src/vs/workbench/api/browser/mainThreadInlineChat.js +68 -0
  53. package/vscode/src/vs/workbench/api/browser/mainThreadInteractive.js +28 -0
  54. package/vscode/src/vs/workbench/api/browser/mainThreadIssueReporter.js +33 -0
  55. package/vscode/src/vs/workbench/api/browser/mainThreadLabelService.js +27 -0
  56. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +947 -0
  57. package/vscode/src/vs/workbench/api/browser/mainThreadLanguages.js +78 -0
  58. package/vscode/src/vs/workbench/api/browser/mainThreadLocalization.js +35 -0
  59. package/vscode/src/vs/workbench/api/browser/mainThreadLogService.js +78 -0
  60. package/vscode/src/vs/workbench/api/browser/mainThreadManagedSockets.js +93 -0
  61. package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.js +118 -0
  62. package/vscode/src/vs/workbench/api/browser/mainThreadNotebook.js +158 -0
  63. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocuments.js +123 -0
  64. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.js +188 -0
  65. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDto.js +129 -0
  66. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookEditors.js +131 -0
  67. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookKernels.js +341 -0
  68. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookRenderers.js +25 -0
  69. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js +48 -0
  70. package/vscode/src/vs/workbench/api/browser/mainThreadOutputService.js +76 -0
  71. package/vscode/src/vs/workbench/api/browser/mainThreadProfilContentHandlers.js +38 -0
  72. package/vscode/src/vs/workbench/api/browser/mainThreadProgress.js +68 -0
  73. package/vscode/src/vs/workbench/api/browser/mainThreadQuickDiff.js +49 -0
  74. package/vscode/src/vs/workbench/api/browser/mainThreadQuickOpen.js +185 -0
  75. package/vscode/src/vs/workbench/api/browser/mainThreadRemoteConnectionData.js +30 -0
  76. package/vscode/src/vs/workbench/api/browser/mainThreadSCM.js +463 -0
  77. package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.js +49 -0
  78. package/vscode/src/vs/workbench/api/browser/mainThreadSearch.js +148 -0
  79. package/vscode/src/vs/workbench/api/browser/mainThreadSecretState.js +70 -0
  80. package/vscode/src/vs/workbench/api/browser/mainThreadShare.js +50 -0
  81. package/vscode/src/vs/workbench/api/browser/mainThreadStatusBar.js +53 -0
  82. package/vscode/src/vs/workbench/api/browser/mainThreadStorage.js +72 -0
  83. package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +731 -0
  84. package/vscode/src/vs/workbench/api/browser/mainThreadTelemetry.js +53 -0
  85. package/vscode/src/vs/workbench/api/browser/mainThreadTerminalService.js +412 -0
  86. package/vscode/src/vs/workbench/api/browser/mainThreadTesting.js +182 -0
  87. package/vscode/src/vs/workbench/api/browser/mainThreadTheming.js +24 -0
  88. package/vscode/src/vs/workbench/api/browser/mainThreadTimeline.js +55 -0
  89. package/vscode/src/vs/workbench/api/browser/mainThreadTreeViews.js +313 -0
  90. package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +223 -0
  91. package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.js +110 -0
  92. package/vscode/src/vs/workbench/api/browser/mainThreadUrls.js +61 -0
  93. package/vscode/src/vs/workbench/api/browser/mainThreadWebviewManager.js +29 -0
  94. package/vscode/src/vs/workbench/api/browser/mainThreadWebviewPanels.js +283 -0
  95. package/vscode/src/vs/workbench/api/browser/mainThreadWebviewViews.js +100 -0
  96. package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +135 -0
  97. package/vscode/src/vs/workbench/api/browser/mainThreadWindow.js +57 -0
  98. package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +273 -0
  99. package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHost.api.impl.d.ts +2 -2
  100. package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostConfiguration.d.ts +3 -3
  101. package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostExtensionService.d.ts +3 -4
  102. package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostManagedSockets.d.ts +2 -2
  103. package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostTerminalService.d.ts +19 -20
  104. package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostTunnelService.d.ts +7 -8
  105. package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostWorkspace.d.ts +25 -26
  106. package/vscode/src/vs/workbench/api/common/shared/dataTransferCache.js +35 -0
  107. package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +217 -0
  108. package/vscode/src/vs/workbench/contrib/comments/browser/commentColors.js +57 -0
  109. package/vscode/src/vs/workbench/contrib/comments/browser/commentFormActions.js +51 -0
  110. package/vscode/src/vs/workbench/contrib/comments/browser/commentGlyphWidget.js +92 -0
  111. package/vscode/src/vs/workbench/contrib/comments/browser/commentNode.js +648 -0
  112. package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +297 -0
  113. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadAdditionalActions.js +62 -0
  114. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +249 -0
  115. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadHeader.js +109 -0
  116. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadRangeDecorator.js +109 -0
  117. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadWidget.js +331 -0
  118. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +380 -0
  119. package/vscode/src/vs/workbench/contrib/comments/browser/comments.js +5 -0
  120. package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +1196 -0
  121. package/vscode/src/vs/workbench/contrib/comments/browser/commentsFilterOptions.js +19 -0
  122. package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +334 -0
  123. package/vscode/src/vs/workbench/contrib/comments/browser/commentsView.js +543 -0
  124. package/vscode/src/vs/workbench/contrib/comments/browser/commentsViewActions.js +178 -0
  125. package/vscode/src/vs/workbench/contrib/comments/browser/media/panel.css.js +6 -0
  126. package/vscode/src/vs/workbench/contrib/comments/browser/media/review.css.js +6 -0
  127. package/vscode/src/vs/workbench/contrib/comments/browser/reactionsAction.js +101 -0
  128. package/vscode/src/vs/workbench/contrib/comments/browser/timestamp.js +57 -0
  129. package/vscode/src/vs/workbench/contrib/comments/common/commentModel.js +145 -0
  130. package/vscode/src/vs/workbench/contrib/comments/common/commentsConfiguration.js +3 -0
  131. package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +73 -0
  132. package/vscode/src/vs/workbench/contrib/externalUriOpener/common/contributedOpeners.js +83 -0
  133. package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveEditorInput.js +179 -0
  134. package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveHistoryService.js +5 -0
  135. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.js +144 -0
  136. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +482 -0
  137. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeMarkers/mergeMarkersController.js +6 -0
  138. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/diffComputer.js +85 -0
  139. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/editing.js +56 -0
  140. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/lineRange.js +110 -0
  141. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mapping.js +260 -0
  142. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.js +616 -0
  143. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/modifiedBaseRange.js +309 -0
  144. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/rangeUtils.js +38 -0
  145. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/textModelDiffs.js +167 -0
  146. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/telemetry.js +80 -0
  147. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/utils.js +70 -0
  148. package/vscode/src/vs/workbench/contrib/mergeEditor/common/mergeEditor.js +3 -0
  149. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.js +108 -0
  150. package/vscode/src/vs/workbench/contrib/tasks/common/tasks.js +506 -0
  151. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessExtHostProxy.js +132 -0
  152. package/vscode/src/vs/workbench/contrib/testing/common/getComputedState.js +103 -0
  153. package/vscode/src/vs/workbench/contrib/testing/common/observableValue.js +28 -0
  154. package/vscode/src/vs/workbench/contrib/testing/common/testCoverage.js +25 -0
  155. package/vscode/src/vs/workbench/contrib/testing/common/testResult.js +336 -0
  156. package/vscode/src/vs/workbench/contrib/testing/common/testingStates.js +46 -0
  157. package/vscode/src/vs/workbench/services/extensions/browser/extensionService.js +283 -0
  158. package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.js +273 -0
  159. package/vscode/src/vs/workbench/services/extensions/browser/webWorkerFileSystemProvider.js +52 -0
  160. package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +1093 -0
  161. package/vscode/src/vs/workbench/services/extensions/common/extHostCustomers.js +41 -0
  162. package/vscode/src/vs/workbench/services/extensions/common/extensionDevOptions.js +25 -0
  163. package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +643 -0
  164. package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocationTracker.js +274 -0
  165. package/vscode/src/vs/workbench/services/extensions/common/extensionStorageMigration.js +58 -0
  166. package/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.js +80 -0
  167. package/vscode/src/vs/workbench/services/extensions/common/extensionsUtil.js +64 -0
  168. package/vscode/src/vs/workbench/services/extensions/common/remoteConsoleUtil.js +49 -0
  169. package/vscode/src/vs/workbench/services/extensions/common/remoteExtensionHost.js +220 -0
  170. package/vscode/src/vs/workbench/services/themes/common/iconExtensionPoint.js +5 -0
  171. package/vscode/src/vs/workbench/services/workingCopy/common/resourceWorkingCopy.js +79 -0
  172. package/vscode-proposed.d.ts +0 -3872
  173. /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHost.protocol.d.ts +0 -0
  174. /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostExtensionActivator.d.ts +0 -0
  175. /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostFileSystemInfo.d.ts +0 -0
  176. /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostInitDataService.d.ts +0 -0
  177. /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostLocalizationService.d.ts +0 -0
  178. /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostRpcService.d.ts +0 -0
  179. /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostStoragePaths.d.ts +0 -0
  180. /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostTypes.d.ts +0 -0
  181. /package/{dist/main/vscode → vscode}/src/vs/workbench/api/common/extHostUriTransformerService.d.ts +0 -0
  182. /package/{dist/main/vscode → vscode}/src/vs/workbench/api/worker/extHostExtensionService.d.ts +0 -0
  183. /package/{dist/main/vscode → vscode}/src/vs/workbench/services/search/common/queryBuilder.d.ts +0 -0
@@ -0,0 +1,380 @@
1
+ import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
+ import { Color } from 'monaco-editor/esm/vs/base/common/color.js';
3
+ import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
4
+ import { DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
5
+ import { Range } from 'monaco-editor/esm/vs/editor/common/core/range.js';
6
+ import * as languages from 'monaco-editor/esm/vs/editor/common/languages.js';
7
+ import { ZoneWidget } from 'monaco-editor/esm/vs/editor/contrib/zoneWidget/browser/zoneWidget.js';
8
+ import { IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
9
+ import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
10
+ import { IThemeService } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
11
+ import { CommentGlyphWidget } from './commentGlyphWidget.js';
12
+ import { ICommentService } from 'vscode/vscode/vs/workbench/contrib/comments/browser/commentService';
13
+ import { EDITOR_FONT_DEFAULTS } from 'monaco-editor/esm/vs/editor/common/config/editorOptions.js';
14
+ import { ServiceCollection } from 'monaco-editor/esm/vs/platform/instantiation/common/serviceCollection.js';
15
+ import { CommentThreadWidget } from './commentThreadWidget.js';
16
+ import { commentThreadStateColorVar, commentThreadStateBackgroundColorVar, getCommentThreadStateBorderColor } from './commentColors.js';
17
+ import { peekViewBorder } from 'monaco-editor/esm/vs/editor/contrib/peekView/browser/peekView.js';
18
+ import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
19
+
20
+ function getCommentThreadWidgetStateColor(thread, theme) {
21
+ return getCommentThreadStateBorderColor(thread, theme) ?? theme.getColor(peekViewBorder);
22
+ }
23
+ function parseMouseDownInfoFromEvent(e) {
24
+ const range = e.target.range;
25
+ if (!range) {
26
+ return null;
27
+ }
28
+ if (!e.event.leftButton) {
29
+ return null;
30
+ }
31
+ if (e.target.type !== 4 ) {
32
+ return null;
33
+ }
34
+ const data = e.target.detail;
35
+ const gutterOffsetX = data.offsetX - data.glyphMarginWidth - data.lineNumbersWidth - data.glyphMarginLeft;
36
+ if (gutterOffsetX > 20) {
37
+ return null;
38
+ }
39
+ return { lineNumber: range.startLineNumber };
40
+ }
41
+ function isMouseUpEventDragFromMouseDown(mouseDownInfo, e) {
42
+ if (!mouseDownInfo) {
43
+ return null;
44
+ }
45
+ const { lineNumber } = mouseDownInfo;
46
+ const range = e.target.range;
47
+ if (!range) {
48
+ return null;
49
+ }
50
+ return lineNumber;
51
+ }
52
+ let ReviewZoneWidget = class ReviewZoneWidget extends ZoneWidget {
53
+ get owner() {
54
+ return this._owner;
55
+ }
56
+ get commentThread() {
57
+ return this._commentThread;
58
+ }
59
+ get expanded() {
60
+ return this._isExpanded;
61
+ }
62
+ constructor(editor, _owner, _commentThread, _pendingComment, _pendingEdits, instantiationService, themeService, commentService, contextKeyService, configurationService) {
63
+ super(editor, { keepEditorSelection: true, isAccessible: true });
64
+ this._owner = _owner;
65
+ this._commentThread = _commentThread;
66
+ this._pendingComment = _pendingComment;
67
+ this._pendingEdits = _pendingEdits;
68
+ this.themeService = themeService;
69
+ this.commentService = commentService;
70
+ this.configurationService = configurationService;
71
+ this._onDidClose = ( new Emitter());
72
+ this._onDidCreateThread = ( new Emitter());
73
+ this._globalToDispose = ( new DisposableStore());
74
+ this._commentThreadDisposables = [];
75
+ this._contextKeyService = contextKeyService.createScoped(this.domNode);
76
+ this._scopedInstantiationService = instantiationService.createChild(( new ServiceCollection([IContextKeyService, this._contextKeyService])));
77
+ const controller = this.commentService.getCommentController(this._owner);
78
+ if (controller) {
79
+ this._commentOptions = controller.options;
80
+ }
81
+ this._initialCollapsibleState = _commentThread.initialCollapsibleState;
82
+ this._isExpanded = _commentThread.initialCollapsibleState === languages.CommentThreadCollapsibleState.Expanded;
83
+ this._commentThreadDisposables = [];
84
+ this.create();
85
+ this._globalToDispose.add(this.themeService.onDidColorThemeChange(this._applyTheme, this));
86
+ this._globalToDispose.add(this.editor.onDidChangeConfiguration(e => {
87
+ if (e.hasChanged(50 )) {
88
+ this._applyTheme(this.themeService.getColorTheme());
89
+ }
90
+ }));
91
+ this._applyTheme(this.themeService.getColorTheme());
92
+ }
93
+ get onDidClose() {
94
+ return this._onDidClose.event;
95
+ }
96
+ get onDidCreateThread() {
97
+ return this._onDidCreateThread.event;
98
+ }
99
+ getPosition() {
100
+ if (this.position) {
101
+ return this.position;
102
+ }
103
+ if (this._commentGlyph) {
104
+ return this._commentGlyph.getPosition().position ?? undefined;
105
+ }
106
+ return undefined;
107
+ }
108
+ revealRange() {
109
+ }
110
+ reveal(commentUniqueId, focus = false) {
111
+ if (!this._isExpanded) {
112
+ this.show(this.arrowPosition(this._commentThread.range), 2);
113
+ }
114
+ if (commentUniqueId !== undefined) {
115
+ const height = this.editor.getLayoutInfo().height;
116
+ const coords = this._commentThreadWidget.getCommentCoords(commentUniqueId);
117
+ if (coords) {
118
+ let scrollTop = 1;
119
+ if (this._commentThread.range) {
120
+ const commentThreadCoords = coords.thread;
121
+ const commentCoords = coords.comment;
122
+ scrollTop = this.editor.getTopForLineNumber(this._commentThread.range.startLineNumber) - height / 2 + commentCoords.top - commentThreadCoords.top;
123
+ }
124
+ this.editor.setScrollTop(scrollTop);
125
+ if (focus) {
126
+ this._commentThreadWidget.focus();
127
+ }
128
+ return;
129
+ }
130
+ }
131
+ this.editor.revealRangeInCenter(this._commentThread.range ?? ( new Range(1, 1, 1, 1)));
132
+ if (focus) {
133
+ this._commentThreadWidget.focus();
134
+ }
135
+ }
136
+ getPendingComments() {
137
+ return {
138
+ newComment: this._commentThreadWidget.getPendingComment(),
139
+ edits: this._commentThreadWidget.getPendingEdits()
140
+ };
141
+ }
142
+ _fillContainer(container) {
143
+ this.setCssClass('review-widget');
144
+ this._commentThreadWidget = this._scopedInstantiationService.createInstance(CommentThreadWidget, container, this.editor, this._owner, this.editor.getModel().uri, this._contextKeyService, this._scopedInstantiationService, this._commentThread, this._pendingComment, this._pendingEdits, { editor: this.editor, codeBlockFontSize: '', codeBlockFontFamily: this.configurationService.getValue('editor').fontFamily || EDITOR_FONT_DEFAULTS.fontFamily }, this._commentOptions, {
145
+ actionRunner: () => {
146
+ if (!this._commentThread.comments || !this._commentThread.comments.length) {
147
+ const newPosition = this.getPosition();
148
+ if (newPosition) {
149
+ const originalRange = this._commentThread.range;
150
+ if (!originalRange) {
151
+ return;
152
+ }
153
+ let range;
154
+ if (newPosition.lineNumber !== originalRange.endLineNumber) {
155
+ const distance = newPosition.lineNumber - originalRange.endLineNumber;
156
+ range = ( new Range(
157
+ originalRange.startLineNumber + distance,
158
+ originalRange.startColumn,
159
+ originalRange.endLineNumber + distance,
160
+ originalRange.endColumn
161
+ ));
162
+ }
163
+ else {
164
+ range = ( new Range(
165
+ originalRange.startLineNumber,
166
+ originalRange.startColumn,
167
+ originalRange.endLineNumber,
168
+ originalRange.endColumn
169
+ ));
170
+ }
171
+ this.commentService.updateCommentThreadTemplate(this.owner, this._commentThread.commentThreadHandle, range);
172
+ }
173
+ }
174
+ },
175
+ collapse: () => {
176
+ this.collapse();
177
+ }
178
+ });
179
+ this._disposables.add(this._commentThreadWidget);
180
+ }
181
+ arrowPosition(range) {
182
+ if (!range) {
183
+ return undefined;
184
+ }
185
+ return { lineNumber: range.endLineNumber, column: range.endLineNumber === range.startLineNumber ? (range.startColumn + range.endColumn + 1) / 2 : 1 };
186
+ }
187
+ deleteCommentThread() {
188
+ this.dispose();
189
+ this.commentService.disposeCommentThread(this.owner, this._commentThread.threadId);
190
+ }
191
+ collapse() {
192
+ this._commentThread.collapsibleState = languages.CommentThreadCollapsibleState.Collapsed;
193
+ }
194
+ expand() {
195
+ this._commentThread.collapsibleState = languages.CommentThreadCollapsibleState.Expanded;
196
+ }
197
+ getGlyphPosition() {
198
+ if (this._commentGlyph) {
199
+ return this._commentGlyph.getPosition().position.lineNumber;
200
+ }
201
+ return 0;
202
+ }
203
+ toggleExpand() {
204
+ if (this._isExpanded) {
205
+ this._commentThread.collapsibleState = languages.CommentThreadCollapsibleState.Collapsed;
206
+ }
207
+ else {
208
+ this._commentThread.collapsibleState = languages.CommentThreadCollapsibleState.Expanded;
209
+ }
210
+ }
211
+ async update(commentThread) {
212
+ if (this._commentThread !== commentThread) {
213
+ this._commentThreadDisposables.forEach(disposable => disposable.dispose());
214
+ this._commentThread = commentThread;
215
+ this._commentThreadDisposables = [];
216
+ this.bindCommentThreadListeners();
217
+ }
218
+ this._commentThreadWidget.updateCommentThread(commentThread);
219
+ const lineNumber = this._commentThread.range?.endLineNumber ?? 1;
220
+ let shouldMoveWidget = false;
221
+ if (this._commentGlyph) {
222
+ this._commentGlyph.setThreadState(commentThread.state);
223
+ if (this._commentGlyph.getPosition().position.lineNumber !== lineNumber) {
224
+ shouldMoveWidget = true;
225
+ this._commentGlyph.setLineNumber(lineNumber);
226
+ }
227
+ }
228
+ if (shouldMoveWidget && this._isExpanded) {
229
+ this.show(this.arrowPosition(this._commentThread.range), 2);
230
+ }
231
+ if (this._commentThread.collapsibleState === languages.CommentThreadCollapsibleState.Expanded) {
232
+ this.show(this.arrowPosition(this._commentThread.range), 2);
233
+ }
234
+ else {
235
+ this.hide();
236
+ }
237
+ }
238
+ _onWidth(widthInPixel) {
239
+ this._commentThreadWidget.layout(widthInPixel);
240
+ }
241
+ _doLayout(heightInPixel, widthInPixel) {
242
+ this._commentThreadWidget.layout(widthInPixel);
243
+ }
244
+ display(range) {
245
+ if (range) {
246
+ this._commentGlyph = ( new CommentGlyphWidget(this.editor, range?.endLineNumber ?? -1));
247
+ this._commentGlyph.setThreadState(this._commentThread.state);
248
+ }
249
+ this._commentThreadWidget.display(this.editor.getOption(66 ));
250
+ this._disposables.add(this._commentThreadWidget.onDidResize(dimension => {
251
+ this._refresh(dimension);
252
+ }));
253
+ if ((this._commentThread.collapsibleState === languages.CommentThreadCollapsibleState.Expanded) || (range === undefined)) {
254
+ this.show(this.arrowPosition(range), 2);
255
+ }
256
+ if (this._commentThread.canReply && this._commentThread.isTemplate && (!this._commentThread.comments || (this._commentThread.comments.length === 0))) {
257
+ this.reveal();
258
+ }
259
+ this.bindCommentThreadListeners();
260
+ }
261
+ bindCommentThreadListeners() {
262
+ this._commentThreadDisposables.push(this._commentThread.onDidChangeComments(async (_) => {
263
+ await this.update(this._commentThread);
264
+ }));
265
+ this._commentThreadDisposables.push(this._commentThread.onDidChangeRange(range => {
266
+ const lineNumber = this._commentThread.range?.startLineNumber ?? 1;
267
+ let shouldMoveWidget = false;
268
+ if (this._commentGlyph) {
269
+ if (this._commentGlyph.getPosition().position.lineNumber !== lineNumber) {
270
+ shouldMoveWidget = true;
271
+ this._commentGlyph.setLineNumber(lineNumber);
272
+ }
273
+ }
274
+ if (shouldMoveWidget && this._isExpanded) {
275
+ this.show(this.arrowPosition(this._commentThread.range), 2);
276
+ }
277
+ }));
278
+ this._commentThreadDisposables.push(this._commentThread.onDidChangeCollapsibleState(state => {
279
+ if (state === languages.CommentThreadCollapsibleState.Expanded && !this._isExpanded) {
280
+ this.show(this.arrowPosition(this._commentThread.range), 2);
281
+ return;
282
+ }
283
+ if (state === languages.CommentThreadCollapsibleState.Collapsed && this._isExpanded) {
284
+ this.hide();
285
+ return;
286
+ }
287
+ }));
288
+ if (this._initialCollapsibleState === undefined) {
289
+ const onDidChangeInitialCollapsibleState = this._commentThread.onDidChangeInitialCollapsibleState(state => {
290
+ this._initialCollapsibleState = this._commentThread.range ? state : languages.CommentThreadCollapsibleState.Expanded;
291
+ this._commentThread.collapsibleState = this._initialCollapsibleState;
292
+ onDidChangeInitialCollapsibleState.dispose();
293
+ });
294
+ this._commentThreadDisposables.push(onDidChangeInitialCollapsibleState);
295
+ }
296
+ this._commentThreadDisposables.push(this._commentThread.onDidChangeState(() => {
297
+ const borderColor = getCommentThreadWidgetStateColor(this._commentThread.state, this.themeService.getColorTheme()) || Color.transparent;
298
+ this.style({
299
+ frameColor: borderColor,
300
+ arrowColor: borderColor,
301
+ });
302
+ this.container?.style.setProperty(commentThreadStateColorVar, `${borderColor}`);
303
+ this.container?.style.setProperty(commentThreadStateBackgroundColorVar, `${( borderColor.transparent(.1))}`);
304
+ }));
305
+ }
306
+ async submitComment() {
307
+ return this._commentThreadWidget.submitComment();
308
+ }
309
+ _refresh(dimensions) {
310
+ if (dimensions.height === 0 && dimensions.width === 0) {
311
+ this.commentThread.collapsibleState = languages.CommentThreadCollapsibleState.Collapsed;
312
+ return;
313
+ }
314
+ if (this._isExpanded) {
315
+ this._commentThreadWidget.layout();
316
+ const headHeight = Math.ceil(this.editor.getOption(66 ) * 1.2);
317
+ const lineHeight = this.editor.getOption(66 );
318
+ const arrowHeight = Math.round(lineHeight / 3);
319
+ const frameThickness = Math.round(lineHeight / 9) * 2;
320
+ const computedLinesNumber = Math.ceil(((headHeight + dimensions.height + arrowHeight + frameThickness + 8) ) / lineHeight);
321
+ if (this._viewZone?.heightInLines === computedLinesNumber) {
322
+ return;
323
+ }
324
+ const currentPosition = this.getPosition();
325
+ if (this._viewZone && currentPosition && currentPosition.lineNumber !== this._viewZone.afterLineNumber && this._viewZone.afterLineNumber !== 0) {
326
+ this._viewZone.afterLineNumber = currentPosition.lineNumber;
327
+ }
328
+ if (!this._commentThread.comments || !this._commentThread.comments.length) {
329
+ this._commentThreadWidget.focusCommentEditor();
330
+ }
331
+ this._relayout(computedLinesNumber);
332
+ }
333
+ }
334
+ _applyTheme(theme) {
335
+ const borderColor = getCommentThreadWidgetStateColor(this._commentThread.state, this.themeService.getColorTheme()) || Color.transparent;
336
+ this.style({
337
+ arrowColor: borderColor,
338
+ frameColor: borderColor
339
+ });
340
+ const fontInfo = this.editor.getOption(50 );
341
+ this._commentThreadWidget.applyTheme(theme, fontInfo);
342
+ }
343
+ show(rangeOrPos, heightInLines) {
344
+ this._isExpanded = true;
345
+ super.show(rangeOrPos ?? ( new Range(0, 0, 0, 0)), heightInLines);
346
+ this._commentThread.collapsibleState = languages.CommentThreadCollapsibleState.Expanded;
347
+ this._refresh(this._commentThreadWidget.getDimensions());
348
+ }
349
+ hide() {
350
+ if (this._isExpanded) {
351
+ this._isExpanded = false;
352
+ if (this.editor.hasWidgetFocus()) {
353
+ this.editor.focus();
354
+ }
355
+ if (!this._commentThread.comments || !this._commentThread.comments.length) {
356
+ this.deleteCommentThread();
357
+ }
358
+ }
359
+ super.hide();
360
+ }
361
+ dispose() {
362
+ super.dispose();
363
+ if (this._commentGlyph) {
364
+ this._commentGlyph.dispose();
365
+ this._commentGlyph = undefined;
366
+ }
367
+ this._globalToDispose.dispose();
368
+ this._commentThreadDisposables.forEach(global => global.dispose());
369
+ this._onDidClose.fire(undefined);
370
+ }
371
+ };
372
+ ReviewZoneWidget = ( __decorate([
373
+ ( __param(5, IInstantiationService)),
374
+ ( __param(6, IThemeService)),
375
+ ( __param(7, ICommentService)),
376
+ ( __param(8, IContextKeyService)),
377
+ ( __param(9, IConfigurationService))
378
+ ], ReviewZoneWidget));
379
+
380
+ export { ReviewZoneWidget, isMouseUpEventDragFromMouseDown, parseMouseDownInfoFromEvent };
@@ -0,0 +1,5 @@
1
+ import { RawContextKey } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
2
+
3
+ const CommentsViewFilterFocusContextKey = ( new RawContextKey('commentsFilterFocus', false));
4
+
5
+ export { CommentsViewFilterFocusContextKey };