@codingame/monaco-vscode-api 1.82.6 → 1.83.0-next.0

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 (199) hide show
  1. package/api.js +5 -5
  2. package/assets/index-no-csp.html +2 -1
  3. package/assets/index.html +3 -2
  4. package/extensions.js +17 -14
  5. package/external/xterm/typings/xterm.d.ts +171 -109
  6. package/missing-services.js +33 -22
  7. package/monaco-editor-treemending.patch +1745 -1628
  8. package/monaco-treemending.js +2 -2
  9. package/monaco.js +2 -2
  10. package/package.json +2 -2
  11. package/service-override/extensions.js +10 -11
  12. package/services.d.ts +1 -1
  13. package/vscode/src/vs/base/browser/ui/menu/menubar.js +1 -1
  14. package/vscode/src/vs/base/common/event.d.ts +13 -17
  15. package/vscode/src/vs/base/common/keyCodes.d.ts +18 -18
  16. package/vscode/src/vs/base/common/lifecycle.d.ts +9 -0
  17. package/vscode/src/vs/base/common/observableInternal/base.d.ts +2 -0
  18. package/vscode/src/vs/base/common/product.d.ts +1 -0
  19. package/vscode/src/vs/base/parts/ipc/common/ipc.js +6 -2
  20. package/vscode/src/vs/base/parts/storage/common/storage.d.ts +1 -0
  21. package/vscode/src/vs/editor/common/config/editorOptions.d.ts +12 -3
  22. package/vscode/src/vs/editor/common/core/lineRange.d.ts +0 -5
  23. package/vscode/src/vs/editor/common/core/offsetRange.d.ts +9 -2
  24. package/vscode/src/vs/editor/common/diff/documentDiffProvider.d.ts +6 -20
  25. package/vscode/src/vs/editor/common/diff/legacyLinesDiffComputer.d.ts +2 -2
  26. package/vscode/src/vs/editor/common/diff/linesDiffComputer.d.ts +5 -55
  27. package/vscode/src/vs/editor/common/diff/rangeMapping.d.ts +55 -0
  28. package/vscode/src/vs/editor/common/languages.d.ts +7 -10
  29. package/vscode/src/vs/editor/common/model.d.ts +1 -1
  30. package/vscode/src/vs/platform/actions/common/actions.d.ts +1 -0
  31. package/vscode/src/vs/platform/extensionManagement/common/extensionNls.js +5 -5
  32. package/vscode/src/vs/platform/files/common/fileService.js +46 -40
  33. package/vscode/src/vs/platform/files/common/files.d.ts +46 -1
  34. package/vscode/src/vs/platform/files/common/inMemoryFilesystemProvider.js +45 -0
  35. package/vscode/src/vs/platform/storage/common/storage.d.ts +5 -0
  36. package/vscode/src/vs/platform/storage/common/storage.js +4 -0
  37. package/vscode/src/vs/platform/telemetry/common/telemetryUtils.js +4 -1
  38. package/vscode/src/vs/platform/terminal/common/terminal.js +1 -3
  39. package/vscode/src/vs/platform/tunnel/common/tunnel.d.ts +1 -1
  40. package/vscode/src/vs/platform/userDataProfile/common/userDataProfile.d.ts +1 -0
  41. package/vscode/src/vs/workbench/api/browser/mainThreadChat.js +11 -0
  42. package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents.js +50 -0
  43. package/vscode/src/vs/workbench/api/browser/mainThreadChatSlashCommands.js +3 -2
  44. package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +16 -11
  45. package/vscode/src/vs/workbench/api/browser/mainThreadDebugService.js +20 -6
  46. package/vscode/src/vs/workbench/api/browser/mainThreadEditor.js +2 -2
  47. package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +1 -1
  48. package/vscode/src/vs/workbench/api/browser/mainThreadEditors.js +8 -8
  49. package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +3 -2
  50. package/vscode/src/vs/workbench/api/browser/mainThreadSCM.js +93 -0
  51. package/vscode/src/vs/workbench/api/browser/mainThreadSecretState.js +3 -166
  52. package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +3 -0
  53. package/vscode/src/vs/workbench/api/browser/mainThreadTreeViews.js +18 -11
  54. package/vscode/src/vs/workbench/api/common/extHost.api.impl.js +14 -9
  55. package/vscode/src/vs/workbench/api/common/extHost.protocol.js +2 -1
  56. package/vscode/src/vs/workbench/api/common/extHostApiCommands.js +11 -2
  57. package/vscode/src/vs/workbench/api/common/extHostChat.js +10 -1
  58. package/vscode/src/vs/workbench/api/common/extHostChatAgents.js +62 -0
  59. package/vscode/src/vs/workbench/api/common/extHostChatSlashCommand.js +13 -4
  60. package/vscode/src/vs/workbench/api/common/extHostCommands.js +4 -4
  61. package/vscode/src/vs/workbench/api/common/extHostComments.js +1 -1
  62. package/vscode/src/vs/workbench/api/common/extHostExtensionService.js +36 -4
  63. package/vscode/src/vs/workbench/api/common/extHostInlineChat.js +6 -29
  64. package/vscode/src/vs/workbench/api/common/extHostLanguageFeatures.js +24 -12
  65. package/vscode/src/vs/workbench/api/common/extHostNotebookKernels.js +0 -2
  66. package/vscode/src/vs/workbench/api/common/extHostRequireInterceptor.js +0 -63
  67. package/vscode/src/vs/workbench/api/common/extHostSCM.js +80 -0
  68. package/vscode/src/vs/workbench/api/common/extHostTerminalService.js +24 -0
  69. package/vscode/src/vs/workbench/api/common/extHostTesting.js +14 -10
  70. package/vscode/src/vs/workbench/api/common/extHostTextEditor.js +4 -4
  71. package/vscode/src/vs/workbench/api/common/extHostTreeViews.js +11 -7
  72. package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +34 -16
  73. package/vscode/src/vs/workbench/api/common/extHostTypes.js +31 -13
  74. package/vscode/src/vs/workbench/api/common/extHostWebview.js +14 -2
  75. package/vscode/src/vs/workbench/api/common/extHostWebviewPanels.js +11 -5
  76. package/vscode/src/vs/workbench/api/common/extensionHostMain.js +1 -1
  77. package/vscode/src/vs/workbench/browser/actions/layoutActions.js +32 -9
  78. package/vscode/src/vs/workbench/browser/actions/quickAccessActions.js +3 -1
  79. package/vscode/src/vs/workbench/browser/codeeditor.js +1 -1
  80. package/vscode/src/vs/workbench/browser/dnd.js +7 -6
  81. package/vscode/src/vs/workbench/browser/media/part.css.js +1 -1
  82. package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +7 -10
  83. package/vscode/src/vs/workbench/browser/parts/editor/editor.js +7 -1
  84. package/vscode/src/vs/workbench/browser/parts/editor/editorActions.js +9 -3
  85. package/vscode/src/vs/workbench/browser/parts/editor/editorAutoSave.js +1 -1
  86. package/vscode/src/vs/workbench/browser/parts/editor/editorCommands.js +9 -2
  87. package/vscode/src/vs/workbench/browser/parts/editor/editorStatus.js +44 -14
  88. package/vscode/src/vs/workbench/browser/parts/editor/media/editorplaceholder.css.js +1 -1
  89. package/vscode/src/vs/workbench/browser/parts/editor/textDiffEditor.js +3 -19
  90. package/vscode/src/vs/workbench/browser/parts/editor/textResourceEditor.js +1 -1
  91. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsCommands.js +9 -3
  92. package/vscode/src/vs/workbench/browser/parts/statusbar/statusbarPart.d.ts +1 -1
  93. package/vscode/src/vs/workbench/browser/parts/titlebar/menubarControl.js +10 -9
  94. package/vscode/src/vs/workbench/browser/parts/views/viewFilter.js +2 -0
  95. package/vscode/src/vs/workbench/browser/parts/views/viewPane.js +2 -2
  96. package/vscode/src/vs/workbench/browser/parts/views/viewPaneContainer.js +6 -5
  97. package/vscode/src/vs/workbench/browser/web.api.d.ts +0 -6
  98. package/vscode/src/vs/workbench/browser/workbench.contribution.js +34 -3
  99. package/vscode/src/vs/workbench/common/contextkeys.js +2 -1
  100. package/vscode/src/vs/workbench/common/editor/editorGroupModel.js +4 -4
  101. package/vscode/src/vs/workbench/common/editor/editorInput.d.ts +0 -1
  102. package/vscode/src/vs/workbench/common/editor/editorInput.js +2 -4
  103. package/vscode/src/vs/workbench/common/editor/editorModel.d.ts +0 -1
  104. package/vscode/src/vs/workbench/common/editor/editorModel.js +1 -3
  105. package/vscode/src/vs/workbench/common/editor.d.ts +2 -0
  106. package/vscode/src/vs/workbench/common/theme.js +21 -1
  107. package/vscode/src/vs/workbench/common/views.d.ts +1 -1
  108. package/vscode/src/vs/workbench/common/views.js +1 -2
  109. package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.js +12 -4
  110. package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityContributions.js +335 -0
  111. package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleView.js +81 -27
  112. package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkEditService.js +1 -1
  113. package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkTextEdits.js +22 -14
  114. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.js +2 -0
  115. package/vscode/src/vs/workbench/contrib/chat/common/chatAgents.js +136 -0
  116. package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +14 -3
  117. package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.js +78 -1
  118. package/vscode/src/vs/workbench/contrib/codeActions/browser/codeActionsContribution.js +43 -17
  119. package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorHelper.js +30 -26
  120. package/vscode/src/vs/workbench/contrib/codeEditor/browser/largeFileOptimizations.js +1 -1
  121. package/vscode/src/vs/workbench/contrib/codeEditor/browser/saveParticipants.js +23 -18
  122. package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleWordWrap.js +8 -8
  123. package/vscode/src/vs/workbench/contrib/comments/browser/commentNode.js +55 -20
  124. package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +26 -10
  125. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +7 -6
  126. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadWidget.js +58 -9
  127. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +9 -6
  128. package/vscode/src/vs/workbench/contrib/comments/browser/comments.contribution.js +171 -0
  129. package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +204 -33
  130. package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +3 -7
  131. package/vscode/src/vs/workbench/contrib/comments/browser/commentsView.js +2 -2
  132. package/vscode/src/vs/workbench/contrib/comments/browser/media/review.css.js +1 -1
  133. package/vscode/src/vs/workbench/contrib/comments/browser/simpleCommentEditor.js +21 -4
  134. package/vscode/src/vs/workbench/contrib/comments/common/commentContextKeys.js +22 -0
  135. package/vscode/src/vs/workbench/contrib/debug/common/debug.d.ts +5 -2
  136. package/vscode/src/vs/workbench/contrib/debug/common/debugUtils.js +2 -1
  137. package/vscode/src/vs/workbench/contrib/files/browser/explorerViewlet.js +1 -1
  138. package/vscode/src/vs/workbench/contrib/files/browser/fileImportExport.js +2 -2
  139. package/vscode/src/vs/workbench/contrib/files/browser/files.contribution.js +4 -4
  140. package/vscode/src/vs/workbench/contrib/files/browser/views/emptyView.js +1 -1
  141. package/vscode/src/vs/workbench/contrib/files/browser/views/explorerViewer.js +7 -4
  142. package/vscode/src/vs/workbench/contrib/files/browser/views/openEditorsView.js +2 -1
  143. package/vscode/src/vs/workbench/contrib/files/common/files.js +7 -5
  144. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +2 -2
  145. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/diffComputer.js +2 -2
  146. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mapping.js +2 -1
  147. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.js +17 -17
  148. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/textModelDiffs.js +2 -2
  149. package/vscode/src/vs/workbench/contrib/notebook/common/notebookCommon.js +4 -1
  150. package/vscode/src/vs/workbench/contrib/output/browser/output.contribution.js +22 -19
  151. package/vscode/src/vs/workbench/contrib/output/browser/outputServices.js +2 -38
  152. package/vscode/src/vs/workbench/contrib/preferences/common/preferences.js +14 -1
  153. package/vscode/src/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.js +3 -8
  154. package/vscode/src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.js +10 -12
  155. package/vscode/src/vs/workbench/contrib/snippets/browser/tabCompletion.js +2 -2
  156. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.d.ts +2 -2
  157. package/vscode/src/vs/workbench/contrib/terminal/common/terminalContextKey.js +0 -16
  158. package/vscode/src/vs/workbench/contrib/testing/common/observableValue.js +2 -1
  159. package/vscode/src/vs/workbench/contrib/testing/common/testResult.js +8 -6
  160. package/vscode/src/vs/workbench/services/actions/common/menusExtensionPoint.js +2 -4
  161. package/vscode/src/vs/workbench/services/authentication/browser/authenticationService.js +2 -4
  162. package/vscode/src/vs/workbench/services/decorations/browser/decorationsService.js +7 -3
  163. package/vscode/src/vs/workbench/services/editor/common/editorGroupsService.d.ts +2 -6
  164. package/vscode/src/vs/workbench/services/extensions/browser/extensionService.js +18 -20
  165. package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.js +9 -13
  166. package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.d.ts +2 -1
  167. package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +47 -15
  168. package/vscode/src/vs/workbench/services/extensions/common/extensionDescriptionRegistry.d.ts +14 -4
  169. package/vscode/src/vs/workbench/services/extensions/common/extensionDescriptionRegistry.js +22 -3
  170. package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.d.ts +1 -1
  171. package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +15 -14
  172. package/vscode/src/vs/workbench/services/extensions/common/extensionHostProtocol.d.ts +12 -7
  173. package/vscode/src/vs/workbench/services/extensions/common/extensions.d.ts +10 -6
  174. package/vscode/src/vs/workbench/services/extensions/common/extensions.js +27 -11
  175. package/vscode/src/vs/workbench/services/extensions/common/extensionsApiProposals.js +2 -5
  176. package/vscode/src/vs/workbench/services/extensions/common/remoteExtensionHost.js +7 -11
  177. package/vscode/src/vs/workbench/services/extensions/common/rpcProtocol.js +20 -4
  178. package/vscode/src/vs/workbench/services/keybinding/browser/keybindingService.js +24 -16
  179. package/vscode/src/vs/workbench/services/output/common/output.js +1 -2
  180. package/vscode/src/vs/workbench/services/preferences/common/preferences.d.ts +6 -6
  181. package/vscode/src/vs/workbench/services/preferences/common/preferences.js +4 -3
  182. package/vscode/src/vs/workbench/services/preferences/common/preferencesModels.d.ts +0 -1
  183. package/vscode/src/vs/workbench/services/search/common/fileSearchManager.js +3 -1
  184. package/vscode/src/vs/workbench/services/search/common/search.js +2 -1
  185. package/vscode/src/vs/workbench/services/search/common/textSearchManager.js +1 -2
  186. package/vscode/src/vs/workbench/services/textfile/common/textFileEditorModel.js +2 -2
  187. package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfileService.js +3 -8
  188. package/vscode/src/vs/workbench/services/workingCopy/common/resourceWorkingCopy.js +3 -4
  189. package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopySaveParticipant.js +1 -0
  190. package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyBackupService.js +2 -1
  191. package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyService.js +4 -2
  192. package/vscode/src/vs/editor/browser/widget/diffEditorWidget2/diffEditorWidget2.contribution.js +0 -180
  193. package/vscode/src/vs/platform/credentials/common/credentials.d.ts +0 -13
  194. package/vscode/src/vs/platform/credentials/common/credentials.js +0 -3
  195. package/vscode/src/vs/workbench/api/browser/mainThreadKeytar.js +0 -31
  196. package/vscode/src/vs/workbench/browser/iframe.js +0 -16
  197. package/vscode/src/vs/workbench/browser/parts/editor/accessibilityStatus.js +0 -90
  198. package/vscode/src/vs/workbench/browser/parts/editor/tabFocus.js +0 -77
  199. package/vscode/src/vs/workbench/contrib/output/browser/logViewer.js +0 -67
@@ -48,7 +48,7 @@ class ToggleWordWrapAction extends EditorAction {
48
48
  newState = null;
49
49
  }
50
50
  else {
51
- const actualWrappingInfo = editor.getOption(143 );
51
+ const actualWrappingInfo = editor.getOption(144 );
52
52
  const wordWrapOverride = (actualWrappingInfo.wrappingColumn === -1 ? 'on' : 'off');
53
53
  newState = { wordWrapOverride };
54
54
  }
@@ -66,7 +66,7 @@ class ToggleWordWrapAction extends EditorAction {
66
66
  }
67
67
  }
68
68
  function findDiffEditorContainingCodeEditor(editor, codeEditorService) {
69
- if (!editor.getOption(60 )) {
69
+ if (!editor.getOption(61 )) {
70
70
  return null;
71
71
  }
72
72
  for (const diffEditor of codeEditorService.listDiffEditors()) {
@@ -86,16 +86,16 @@ let ToggleWordWrapController = class ToggleWordWrapController extends Disposable
86
86
  this._contextKeyService = _contextKeyService;
87
87
  this._codeEditorService = _codeEditorService;
88
88
  const options = this._editor.getOptions();
89
- const wrappingInfo = options.get(143 );
89
+ const wrappingInfo = options.get(144 );
90
90
  const isWordWrapMinified = this._contextKeyService.createKey(isWordWrapMinifiedKey, wrappingInfo.isWordWrapMinified);
91
91
  const isDominatedByLongLines = this._contextKeyService.createKey(isDominatedByLongLinesKey, wrappingInfo.isDominatedByLongLines);
92
92
  let currentlyApplyingEditorConfig = false;
93
93
  this._register(_editor.onDidChangeConfiguration((e) => {
94
- if (!e.hasChanged(143 )) {
94
+ if (!e.hasChanged(144 )) {
95
95
  return;
96
96
  }
97
97
  const options = this._editor.getOptions();
98
- const wrappingInfo = options.get(143 );
98
+ const wrappingInfo = options.get(144 );
99
99
  isWordWrapMinified.set(wrappingInfo.isWordWrapMinified);
100
100
  isDominatedByLongLines.set(wrappingInfo.isDominatedByLongLines);
101
101
  if (!currentlyApplyingEditorConfig) {
@@ -178,7 +178,7 @@ function canToggleWordWrap(codeEditorService, editor) {
178
178
  if (model.uri.scheme === 'output') {
179
179
  return false;
180
180
  }
181
- if (editor.getOption(60 )) {
181
+ if (editor.getOption(61 )) {
182
182
  for (const diffEditor of codeEditorService.listDiffEditors()) {
183
183
  if (diffEditor.getOriginalEditor() === editor && !diffEditor.renderSideBySide) {
184
184
  return false;
@@ -211,7 +211,7 @@ let EditorWordWrapContextKeyTracker = class EditorWordWrapContextKeyTracker {
211
211
  if (activeEditor) {
212
212
  this._activeEditorListener.add(activeEditor.onDidChangeModel(() => this._updateFromCodeEditor()));
213
213
  this._activeEditorListener.add(activeEditor.onDidChangeConfiguration((e) => {
214
- if (e.hasChanged(143 )) {
214
+ if (e.hasChanged(144 )) {
215
215
  this._updateFromCodeEditor();
216
216
  }
217
217
  }));
@@ -223,7 +223,7 @@ let EditorWordWrapContextKeyTracker = class EditorWordWrapContextKeyTracker {
223
223
  return this._setValues(false, false);
224
224
  }
225
225
  else {
226
- const wrappingInfo = this._activeEditor.getOption(143 );
226
+ const wrappingInfo = this._activeEditor.getOption(144 );
227
227
  this._setValues(true, wrappingInfo.wrappingColumn !== -1);
228
228
  }
229
229
  }
@@ -10,7 +10,7 @@ import { IModelService } from 'monaco-editor/esm/vs/editor/common/services/model
10
10
  import { ILanguageService } from 'monaco-editor/esm/vs/editor/common/languages/language.js';
11
11
  import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
12
12
  import { ICommentService } from './commentService.js';
13
- import { SimpleCommentEditor } from './simpleCommentEditor.js';
13
+ import { MIN_EDITOR_HEIGHT, SimpleCommentEditor, calculateEditorHeight } from './simpleCommentEditor.js';
14
14
  import { Selection } from 'monaco-editor/esm/vs/editor/common/core/selection.js';
15
15
  import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
16
16
  import { INotificationService } from 'monaco-editor/esm/vs/platform/notification/common/notification.js';
@@ -35,6 +35,7 @@ import { CommentContextKeys } from '../common/commentContextKeys.js';
35
35
  import { FileAccess } from 'monaco-editor/esm/vs/base/common/network.js';
36
36
  import { COMMENTS_SECTION } from '../common/commentsConfiguration.js';
37
37
  import { StandardMouseEvent } from 'monaco-editor/esm/vs/base/browser/mouseEvent.js';
38
+ import { IAccessibilityService } from 'monaco-editor/esm/vs/platform/accessibility/common/accessibility.js';
38
39
  class CommentsActionRunner extends ActionRunner {
39
40
  async runAction(action, context) {
40
41
  await action.run(...context);
@@ -44,8 +45,9 @@ let CommentNode = class CommentNode extends Disposable {
44
45
  get domNode() {
45
46
  return this._domNode;
46
47
  }
47
- constructor(commentThread, comment, pendingEdit, owner, resource, parentThread, markdownRenderer, instantiationService, commentService, modelService, languageService, notificationService, contextMenuService, contextKeyService, configurationService) {
48
+ constructor(parentEditor, commentThread, comment, pendingEdit, owner, resource, parentThread, markdownRenderer, instantiationService, commentService, modelService, languageService, notificationService, contextMenuService, contextKeyService, configurationService, accessibilityService) {
48
49
  super();
50
+ this.parentEditor = parentEditor;
49
51
  this.commentThread = commentThread;
50
52
  this.comment = comment;
51
53
  this.pendingEdit = pendingEdit;
@@ -60,11 +62,13 @@ let CommentNode = class CommentNode extends Disposable {
60
62
  this.notificationService = notificationService;
61
63
  this.contextMenuService = contextMenuService;
62
64
  this.configurationService = configurationService;
65
+ this.accessibilityService = accessibilityService;
63
66
  this._editAction = null;
64
67
  this._commentEditContainer = null;
65
68
  this._commentEditor = null;
66
69
  this._commentEditorDisposables = [];
67
70
  this._commentEditorModel = null;
71
+ this._editorHeight = MIN_EDITOR_HEIGHT;
68
72
  this._commentFormActions = null;
69
73
  this._commentEditorActions = null;
70
74
  this._onDidClick = ( new Emitter());
@@ -105,6 +109,9 @@ let CommentNode = class CommentNode extends Disposable {
105
109
  if (pendingEdit) {
106
110
  this.switchToEditMode();
107
111
  }
112
+ this._register(this.accessibilityService.onDidChangeScreenReaderOptimized(() => {
113
+ this.toggleToolbarHidden(true);
114
+ }));
108
115
  }
109
116
  createScroll(container, body) {
110
117
  this._scrollable = ( new Scrollable({
@@ -186,9 +193,18 @@ let CommentNode = class CommentNode extends Disposable {
186
193
  else {
187
194
  this._isPendingLabel.innerText = '';
188
195
  }
189
- this._actionsToolbarContainer = dom.append(header, dom.$('.comment-actions.hidden'));
196
+ this._actionsToolbarContainer = dom.append(header, dom.$('.comment-actions'));
197
+ this.toggleToolbarHidden(true);
190
198
  this.createActionsToolbar();
191
199
  }
200
+ toggleToolbarHidden(hidden) {
201
+ if (hidden && !this.accessibilityService.isScreenReaderOptimized()) {
202
+ this._actionsToolbarContainer.classList.add('hidden');
203
+ }
204
+ else {
205
+ this._actionsToolbarContainer.classList.remove('hidden');
206
+ }
207
+ }
192
208
  getToolbarActions(menu) {
193
209
  const contributedActions = menu.getActions({ shouldForwardArgs: true });
194
210
  const primary = [];
@@ -277,7 +293,8 @@ let CommentNode = class CommentNode extends Disposable {
277
293
  }
278
294
  async submitComment() {
279
295
  if (this._commentEditor && this._commentFormActions) {
280
- this._commentFormActions.triggerDefaultAction();
296
+ await this._commentFormActions.triggerDefaultAction();
297
+ this.pendingEdit = undefined;
281
298
  }
282
299
  }
283
300
  createReactionPicker(reactionGroup) {
@@ -365,14 +382,14 @@ let CommentNode = class CommentNode extends Disposable {
365
382
  this._commentEditor.setModel(this._commentEditorModel);
366
383
  this._commentEditor.setValue(this.pendingEdit ?? this.commentBodyValue);
367
384
  this.pendingEdit = undefined;
368
- this._commentEditor.layout({ width: container.clientWidth - 14, height: 90 });
385
+ this._commentEditor.layout({ width: container.clientWidth - 14, height: this._editorHeight });
369
386
  this._commentEditor.focus();
370
387
  dom.scheduleAtNextAnimationFrame(() => {
371
- this._commentEditor.layout({ width: container.clientWidth - 14, height: 90 });
388
+ this._commentEditor.layout({ width: container.clientWidth - 14, height: this._editorHeight });
372
389
  this._commentEditor.focus();
373
390
  });
374
391
  const lastLine = this._commentEditorModel.getLineCount();
375
- const lastColumn = this._commentEditorModel.getLineContent(lastLine).length + 1;
392
+ const lastColumn = this._commentEditorModel.getLineLength(lastLine) + 1;
376
393
  this._commentEditor.setSelection(( new Selection(lastLine, lastColumn, lastLine, lastColumn)));
377
394
  const commentThread = this.commentThread;
378
395
  commentThread.input = {
@@ -398,9 +415,26 @@ let CommentNode = class CommentNode extends Disposable {
398
415
  }
399
416
  }
400
417
  }));
418
+ this.calculateEditorHeight();
419
+ this._register((this._commentEditorModel.onDidChangeContent(() => {
420
+ if (this._commentEditor && this.calculateEditorHeight()) {
421
+ this._commentEditor.layout({ height: this._editorHeight, width: this._commentEditor.getLayoutInfo().width });
422
+ this._commentEditor.render(true);
423
+ }
424
+ })));
401
425
  this._register(this._commentEditor);
402
426
  this._register(this._commentEditorModel);
403
427
  }
428
+ calculateEditorHeight() {
429
+ if (this._commentEditor) {
430
+ const newEditorHeight = calculateEditorHeight(this.parentEditor, this._commentEditor, this._editorHeight);
431
+ if (newEditorHeight !== this._editorHeight) {
432
+ this._editorHeight = newEditorHeight;
433
+ return true;
434
+ }
435
+ }
436
+ return false;
437
+ }
404
438
  getPendingEdit() {
405
439
  const model = this._commentEditor?.getModel();
406
440
  if (model && model.getValueLength() > 0) {
@@ -424,7 +458,7 @@ let CommentNode = class CommentNode extends Disposable {
424
458
  this._commentEditContainer.remove();
425
459
  }
426
460
  layout() {
427
- this._commentEditor?.layout();
461
+ this._commentEditor?.layout({ width: this._commentEditor.getLayoutInfo().width, height: this._editorHeight });
428
462
  const scrollWidth = this._body.scrollWidth;
429
463
  const width = dom.getContentWidth(this._body);
430
464
  const scrollHeight = this._body.scrollHeight;
@@ -488,7 +522,7 @@ let CommentNode = class CommentNode extends Disposable {
488
522
  setFocus(focused, visible = false) {
489
523
  if (focused) {
490
524
  this._domNode.focus();
491
- this._actionsToolbarContainer.classList.remove('hidden');
525
+ this.toggleToolbarHidden(false);
492
526
  this._actionsToolbarContainer.classList.add('tabfocused');
493
527
  this._domNode.tabIndex = 0;
494
528
  if (this.comment.mode === languages.CommentMode.Editing) {
@@ -497,7 +531,7 @@ let CommentNode = class CommentNode extends Disposable {
497
531
  }
498
532
  else {
499
533
  if (this._actionsToolbarContainer.classList.contains('tabfocused') && !this._actionsToolbarContainer.classList.contains('mouseover')) {
500
- this._actionsToolbarContainer.classList.add('hidden');
534
+ this.toggleToolbarHidden(true);
501
535
  this._domNode.tabIndex = -1;
502
536
  }
503
537
  this._actionsToolbarContainer.classList.remove('tabfocused');
@@ -505,12 +539,12 @@ let CommentNode = class CommentNode extends Disposable {
505
539
  }
506
540
  registerActionBarListeners(actionsContainer) {
507
541
  this._register(dom.addDisposableListener(this._domNode, 'mouseenter', () => {
508
- actionsContainer.classList.remove('hidden');
542
+ this.toggleToolbarHidden(false);
509
543
  actionsContainer.classList.add('mouseover');
510
544
  }));
511
545
  this._register(dom.addDisposableListener(this._domNode, 'mouseleave', () => {
512
546
  if (actionsContainer.classList.contains('mouseover') && !actionsContainer.classList.contains('tabfocused')) {
513
- actionsContainer.classList.add('hidden');
547
+ this.toggleToolbarHidden(true);
514
548
  }
515
549
  actionsContainer.classList.remove('mouseover');
516
550
  }));
@@ -574,14 +608,15 @@ let CommentNode = class CommentNode extends Disposable {
574
608
  }
575
609
  };
576
610
  CommentNode = ( __decorate([
577
- ( __param(7, IInstantiationService)),
578
- ( __param(8, ICommentService)),
579
- ( __param(9, IModelService)),
580
- ( __param(10, ILanguageService)),
581
- ( __param(11, INotificationService)),
582
- ( __param(12, IContextMenuService)),
583
- ( __param(13, IContextKeyService)),
584
- ( __param(14, IConfigurationService))
611
+ ( __param(8, IInstantiationService)),
612
+ ( __param(9, ICommentService)),
613
+ ( __param(10, IModelService)),
614
+ ( __param(11, ILanguageService)),
615
+ ( __param(12, INotificationService)),
616
+ ( __param(13, IContextMenuService)),
617
+ ( __param(14, IContextKeyService)),
618
+ ( __param(15, IConfigurationService)),
619
+ ( __param(16, IAccessibilityService))
585
620
  ], CommentNode));
586
621
  function fillInActions(groups, target, useAlternativeActions, isPrimaryGroup = group => group === 'navigation') {
587
622
  for (const tuple of groups) {
@@ -13,14 +13,15 @@ import { IThemeService } from 'monaco-editor/esm/vs/platform/theme/common/themeS
13
13
  import { CommentFormActions } from './commentFormActions.js';
14
14
  import { ICommentService } from './commentService.js';
15
15
  import { CommentContextKeys } from '../common/commentContextKeys.js';
16
- import { SimpleCommentEditor } from './simpleCommentEditor.js';
16
+ import { MIN_EDITOR_HEIGHT, SimpleCommentEditor, calculateEditorHeight } from './simpleCommentEditor.js';
17
17
  const COMMENT_SCHEME = 'comment';
18
18
  let INMEM_MODEL_ID = 0;
19
19
  const COMMENTEDITOR_DECORATION_KEY = 'commenteditordecoration';
20
20
  let CommentReply = class CommentReply extends Disposable {
21
- constructor(owner, container, _commentThread, _scopedInstatiationService, _contextKeyService, _commentMenus, _commentOptions, _pendingComment, _parentThread, _actionRunDelegate, commentService, languageService, modelService, themeService, configurationService) {
21
+ constructor(owner, container, _parentEditor, _commentThread, _scopedInstatiationService, _contextKeyService, _commentMenus, _commentOptions, _pendingComment, _parentThread, _actionRunDelegate, commentService, languageService, modelService, themeService, configurationService) {
22
22
  super();
23
23
  this.owner = owner;
24
+ this._parentEditor = _parentEditor;
24
25
  this._commentThread = _commentThread;
25
26
  this._scopedInstatiationService = _scopedInstatiationService;
26
27
  this._contextKeyService = _contextKeyService;
@@ -34,6 +35,7 @@ let CommentReply = class CommentReply extends Disposable {
34
35
  this.modelService = modelService;
35
36
  this.themeService = themeService;
36
37
  this._commentThreadDisposables = [];
38
+ this._editorHeight = MIN_EDITOR_HEIGHT;
37
39
  this.form = dom.append(container, dom.$('.comment-form'));
38
40
  this.commentEditor = this._register(this._scopedInstatiationService.createInstance(SimpleCommentEditor, this.form, SimpleCommentEditor.getEditorOptions(configurationService), _contextKeyService, this._parentThread));
39
41
  this.commentEditorIsEmpty = CommentContextKeys.commentIsEmpty.bindTo(this._contextKeyService);
@@ -54,9 +56,14 @@ let CommentReply = class CommentReply extends Disposable {
54
56
  const model = this.modelService.createModel(this._pendingComment || '', this.languageService.createByFilepathOrFirstLine(resource), resource, false);
55
57
  this._register(model);
56
58
  this.commentEditor.setModel(model);
57
- this._register((this.commentEditor.getModel().onDidChangeContent(() => {
59
+ this.calculateEditorHeight();
60
+ this._register((model.onDidChangeContent(() => {
58
61
  this.setCommentEditorDecorations();
59
62
  this.commentEditorIsEmpty?.set(!this.commentEditor.getValue());
63
+ if (this.calculateEditorHeight()) {
64
+ this.commentEditor.layout({ height: this._editorHeight, width: this.commentEditor.getLayoutInfo().width });
65
+ this.commentEditor.render(true);
66
+ }
60
67
  })));
61
68
  this.createTextModelListener(this.commentEditor, this.form);
62
69
  this.setCommentEditorDecorations();
@@ -73,6 +80,14 @@ let CommentReply = class CommentReply extends Disposable {
73
80
  this._editorActions = dom.append(formActions, dom.$('.editor-actions'));
74
81
  this.createCommentWidgetEditorActions(this._editorActions, model);
75
82
  }
83
+ calculateEditorHeight() {
84
+ const newEditorHeight = calculateEditorHeight(this._parentEditor, this.commentEditor, this._editorHeight);
85
+ if (newEditorHeight !== this._editorHeight) {
86
+ this._editorHeight = newEditorHeight;
87
+ return true;
88
+ }
89
+ return false;
90
+ }
76
91
  updateCommentThread(commentThread) {
77
92
  const isReplying = this.commentEditor.hasTextFocus();
78
93
  if (!this._reviewThreadReplyButton) {
@@ -93,7 +108,7 @@ let CommentReply = class CommentReply extends Disposable {
93
108
  return undefined;
94
109
  }
95
110
  layout(widthInPixel) {
96
- this.commentEditor.layout({ height: 5 * 18, width: widthInPixel - 54 });
111
+ this.commentEditor.layout({ height: this._editorHeight, width: widthInPixel - 54 });
97
112
  }
98
113
  focusIfNeeded() {
99
114
  if (!this._commentThread.comments || !this._commentThread.comments.length) {
@@ -125,7 +140,8 @@ let CommentReply = class CommentReply extends Disposable {
125
140
  }
126
141
  }
127
142
  async submitComment() {
128
- return this._commentFormActions?.triggerDefaultAction();
143
+ await this._commentFormActions?.triggerDefaultAction();
144
+ this._pendingComment = undefined;
129
145
  }
130
146
  setCommentEditorDecorations() {
131
147
  const model = this.commentEditor.getModel();
@@ -266,10 +282,10 @@ let CommentReply = class CommentReply extends Disposable {
266
282
  }
267
283
  };
268
284
  CommentReply = ( __decorate([
269
- ( __param(10, ICommentService)),
270
- ( __param(11, ILanguageService)),
271
- ( __param(12, IModelService)),
272
- ( __param(13, IThemeService)),
273
- ( __param(14, IConfigurationService))
285
+ ( __param(11, ICommentService)),
286
+ ( __param(12, ILanguageService)),
287
+ ( __param(13, IModelService)),
288
+ ( __param(14, IThemeService)),
289
+ ( __param(15, IConfigurationService))
274
290
  ], CommentReply));
275
291
  export { COMMENTEDITOR_DECORATION_KEY, CommentReply };
@@ -17,8 +17,9 @@ let CommentThreadBody = class CommentThreadBody extends Disposable {
17
17
  get activeComment() {
18
18
  return this._commentElements.filter(node => node.isEditing)[0];
19
19
  }
20
- constructor(owner, parentResourceUri, container, _options, _commentThread, _pendingEdits, _scopedInstatiationService, _parentCommentThreadWidget, commentService, openerService, languageService) {
20
+ constructor(_parentEditor, owner, parentResourceUri, container, _options, _commentThread, _pendingEdits, _scopedInstatiationService, _parentCommentThreadWidget, commentService, openerService, languageService) {
21
21
  super();
22
+ this._parentEditor = _parentEditor;
22
23
  this.owner = owner;
23
24
  this.parentResourceUri = parentResourceUri;
24
25
  this.container = container;
@@ -50,7 +51,7 @@ let CommentThreadBody = class CommentThreadBody extends Disposable {
50
51
  this._updateAriaLabel();
51
52
  this._register(dom.addDisposableListener(this._commentsElement, dom.EventType.KEY_DOWN, (e) => {
52
53
  const event = ( new StandardKeyboardEvent(e));
53
- if (event.equals(16 ) || event.equals(18 )) {
54
+ if ((event.equals(16 ) || event.equals(18 )) && (!this._focusedComment || !this._commentElements[this._focusedComment].isEditing)) {
54
55
  const moveFocusWithinBounds = (change) => {
55
56
  if (this._focusedComment === undefined && change >= 0) {
56
57
  return 0;
@@ -221,7 +222,7 @@ let CommentThreadBody = class CommentThreadBody extends Disposable {
221
222
  }
222
223
  }
223
224
  createNewCommentNode(comment) {
224
- const newCommentNode = this._scopedInstatiationService.createInstance(CommentNode, this._commentThread, comment, this._pendingEdits ? this._pendingEdits[comment.uniqueIdInThread] : undefined, this.owner, this.parentResourceUri, this._parentCommentThreadWidget, this._markdownRenderer);
225
+ const newCommentNode = this._scopedInstatiationService.createInstance(CommentNode, this._parentEditor, this._commentThread, comment, this._pendingEdits ? this._pendingEdits[comment.uniqueIdInThread] : undefined, this.owner, this.parentResourceUri, this._parentCommentThreadWidget, this._markdownRenderer);
225
226
  this._register(newCommentNode);
226
227
  this._commentDisposable.set(newCommentNode, newCommentNode.onDidClick(clickedNode => this._setFocusedComment(this._commentElements.findIndex(commentNode => commentNode.comment.uniqueIdInThread === clickedNode.comment.uniqueIdInThread))));
227
228
  return newCommentNode;
@@ -236,8 +237,8 @@ let CommentThreadBody = class CommentThreadBody extends Disposable {
236
237
  }
237
238
  };
238
239
  CommentThreadBody = ( __decorate([
239
- ( __param(8, ICommentService)),
240
- ( __param(9, IOpenerService)),
241
- ( __param(10, ILanguageService))
240
+ ( __param(9, ICommentService)),
241
+ ( __param(10, IOpenerService)),
242
+ ( __param(11, ILanguageService))
242
243
  ], CommentThreadBody));
243
244
  export { CommentThreadBody };
@@ -3,6 +3,7 @@ import './media/review.css.js';
3
3
  import * as dom from 'monaco-editor/esm/vs/base/browser/dom.js';
4
4
  import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
5
5
  import { Disposable, dispose } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
6
+ import * as languages from 'monaco-editor/esm/vs/editor/common/languages.js';
6
7
  import { CommentReply } from './commentReply.js';
7
8
  import { ICommentService } from './commentService.js';
8
9
  import { CommentThreadBody } from './commentThreadBody.js';
@@ -14,17 +15,22 @@ import { PANEL_BORDER } from '../../../common/theme.js';
14
15
  import { commentThreadStateColorVar, commentThreadStateBackgroundColorVar } from './commentColors.js';
15
16
  import { IContextMenuService } from 'monaco-editor/esm/vs/platform/contextview/browser/contextView.js';
16
17
  import { registerNavigableContainer } from '../../../browser/actions/widgetNavigationCommands.js';
18
+ import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
19
+ import { COMMENTS_SECTION } from '../common/commentsConfiguration.js';
20
+ import { localize } from 'monaco-editor/esm/vs/nls.js';
21
+ import { IKeybindingService } from 'monaco-editor/esm/vs/platform/keybinding/common/keybinding.js';
17
22
  let CommentThreadWidget = class CommentThreadWidget extends Disposable {
18
23
  get commentThread() {
19
24
  return this._commentThread;
20
25
  }
21
- constructor(container, _owner, _parentResourceUri, _contextKeyService, _scopedInstatiationService, _commentThread, _pendingComment, _pendingEdits, _markdownOptions, _commentOptions, _containerDelegate, commentService, contextMenuService) {
26
+ constructor(container, _parentEditor, _owner, _parentResourceUri, _contextKeyService, _scopedInstantiationService, _commentThread, _pendingComment, _pendingEdits, _markdownOptions, _commentOptions, _containerDelegate, commentService, contextMenuService, configurationService, _keybindingService) {
22
27
  super();
23
28
  this.container = container;
29
+ this._parentEditor = _parentEditor;
24
30
  this._owner = _owner;
25
31
  this._parentResourceUri = _parentResourceUri;
26
32
  this._contextKeyService = _contextKeyService;
27
- this._scopedInstatiationService = _scopedInstatiationService;
33
+ this._scopedInstantiationService = _scopedInstantiationService;
28
34
  this._commentThread = _commentThread;
29
35
  this._pendingComment = _pendingComment;
30
36
  this._pendingEdits = _pendingEdits;
@@ -32,15 +38,18 @@ let CommentThreadWidget = class CommentThreadWidget extends Disposable {
32
38
  this._commentOptions = _commentOptions;
33
39
  this._containerDelegate = _containerDelegate;
34
40
  this.commentService = commentService;
41
+ this.configurationService = configurationService;
42
+ this._keybindingService = _keybindingService;
35
43
  this._commentThreadDisposables = [];
36
44
  this._onDidResize = ( new Emitter());
37
45
  this.onDidResize = this._onDidResize.event;
38
46
  this._threadIsEmpty = CommentContextKeys.commentThreadIsEmpty.bindTo(this._contextKeyService);
39
47
  this._threadIsEmpty.set(!_commentThread.comments || !_commentThread.comments.length);
48
+ this._focusedContextKey = CommentContextKeys.commentFocused.bindTo(this._contextKeyService);
40
49
  this._commentMenus = this.commentService.getCommentMenus(this._owner);
41
50
  this._header = ( new CommentThreadHeader(container, {
42
51
  collapse: this.collapse.bind(this)
43
- }, this._commentMenus, this._commentThread, this._contextKeyService, this._scopedInstatiationService, contextMenuService));
52
+ }, this._commentMenus, this._commentThread, this._contextKeyService, this._scopedInstantiationService, contextMenuService));
44
53
  this._header.updateCommentThread(this._commentThread);
45
54
  const bodyElement = dom.$('.body');
46
55
  container.appendChild(bodyElement);
@@ -58,8 +67,16 @@ let CommentThreadWidget = class CommentThreadWidget extends Disposable {
58
67
  }
59
68
  }
60
69
  }));
61
- this._body = this._scopedInstatiationService.createInstance(CommentThreadBody, this._owner, this._parentResourceUri, bodyElement, this._markdownOptions, this._commentThread, this._pendingEdits, this._scopedInstatiationService, this);
70
+ this._register(tracker.onDidFocus(() => this._focusedContextKey.set(true)));
71
+ this._register(tracker.onDidBlur(() => this._focusedContextKey.reset()));
72
+ this._register(this.configurationService.onDidChangeConfiguration(e => {
73
+ if (e.affectsConfiguration("accessibility.verbosity.comments" )) {
74
+ this._setAriaLabel();
75
+ }
76
+ }));
77
+ this._body = this._scopedInstantiationService.createInstance(CommentThreadBody, this._parentEditor, this._owner, this._parentResourceUri, bodyElement, this._markdownOptions, this._commentThread, this._pendingEdits, this._scopedInstantiationService, this);
62
78
  this._register(this._body);
79
+ this._setAriaLabel();
63
80
  this._styleElement = dom.createStyleSheet(this.container);
64
81
  this._commentThreadContextValue = CommentContextKeys.commentThreadContext.bindTo(this._contextKeyService);
65
82
  this._commentThreadContextValue.set(_commentThread.contextValue);
@@ -70,6 +87,30 @@ let CommentThreadWidget = class CommentThreadWidget extends Disposable {
70
87
  }
71
88
  this.currentThreadListeners();
72
89
  }
90
+ _setAriaLabel() {
91
+ let ariaLabel = ( localize('commentLabel', "Comment"));
92
+ let keybinding;
93
+ const verbose = this.configurationService.getValue("accessibility.verbosity.comments" );
94
+ if (verbose) {
95
+ keybinding = this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp" , this._contextKeyService)?.getLabel() ?? undefined;
96
+ }
97
+ if (keybinding) {
98
+ ariaLabel = ( localize(
99
+ 'commentLabelWithKeybinding',
100
+ "{0}, use ({1}) for accessibility help",
101
+ ariaLabel,
102
+ keybinding
103
+ ));
104
+ }
105
+ else {
106
+ ariaLabel = ( localize(
107
+ 'commentLabelWithKeybindingNoKeybinding',
108
+ "{0}, run the command Open Accessibility Help which is currently not triggerable via keybinding.",
109
+ ariaLabel
110
+ ));
111
+ }
112
+ this._body.container.ariaLabel = ariaLabel;
113
+ }
73
114
  updateCurrentThread(hasMouse, hasFocus) {
74
115
  if (hasMouse || hasFocus) {
75
116
  this.commentService.setCurrentCommentThread(this.commentThread);
@@ -103,6 +144,9 @@ let CommentThreadWidget = class CommentThreadWidget extends Disposable {
103
144
  }, true));
104
145
  }
105
146
  updateCommentThread(commentThread) {
147
+ const shouldCollapse = (this._commentThread.collapsibleState === languages.CommentThreadCollapsibleState.Expanded) && (this._commentThreadState === languages.CommentThreadState.Unresolved)
148
+ && (commentThread.state === languages.CommentThreadState.Resolved);
149
+ this._commentThreadState = commentThread.state;
106
150
  this._commentThread = commentThread;
107
151
  dispose(this._commentThreadDisposables);
108
152
  this._commentThreadDisposables = [];
@@ -117,9 +161,12 @@ let CommentThreadWidget = class CommentThreadWidget extends Disposable {
117
161
  else {
118
162
  this._commentThreadContextValue.reset();
119
163
  }
164
+ if (shouldCollapse && this.configurationService.getValue(COMMENTS_SECTION).collapseOnResolve) {
165
+ this.collapse();
166
+ }
120
167
  }
121
168
  display(lineHeight) {
122
- const headHeight = Math.ceil(lineHeight * 1.2);
169
+ const headHeight = Math.max(23, Math.ceil(lineHeight * 1.2));
123
170
  this._header.updateHeight(headHeight);
124
171
  this._body.display();
125
172
  if (this._commentThread.canReply) {
@@ -161,11 +208,11 @@ let CommentThreadWidget = class CommentThreadWidget extends Disposable {
161
208
  }));
162
209
  }
163
210
  _createCommentForm() {
164
- this._commentReply = this._scopedInstatiationService.createInstance(CommentReply, this._owner, this._body.container, this._commentThread, this._scopedInstatiationService, this._contextKeyService, this._commentMenus, this._commentOptions, this._pendingComment, this, this._containerDelegate.actionRunner);
211
+ this._commentReply = this._scopedInstantiationService.createInstance(CommentReply, this._owner, this._body.container, this._parentEditor, this._commentThread, this._scopedInstantiationService, this._contextKeyService, this._commentMenus, this._commentOptions, this._pendingComment, this, this._containerDelegate.actionRunner);
165
212
  this._register(this._commentReply);
166
213
  }
167
214
  _createAdditionalActions() {
168
- this._additionalActions = this._scopedInstatiationService.createInstance(CommentThreadAdditionalActions, this._body.container, this._commentThread, this._contextKeyService, this._commentMenus, this._containerDelegate.actionRunner);
215
+ this._additionalActions = this._scopedInstantiationService.createInstance(CommentThreadAdditionalActions, this._body.container, this._commentThread, this._contextKeyService, this._commentMenus, this._containerDelegate.actionRunner);
169
216
  this._register(this._additionalActions);
170
217
  }
171
218
  getCommentCoords(commentUniqueId) {
@@ -268,7 +315,9 @@ let CommentThreadWidget = class CommentThreadWidget extends Disposable {
268
315
  }
269
316
  };
270
317
  CommentThreadWidget = ( __decorate([
271
- ( __param(11, ICommentService)),
272
- ( __param(12, IContextMenuService))
318
+ ( __param(12, ICommentService)),
319
+ ( __param(13, IContextMenuService)),
320
+ ( __param(14, IConfigurationService)),
321
+ ( __param(15, IKeybindingService))
273
322
  ], CommentThreadWidget));
274
323
  export { CommentThreadWidget };
@@ -83,7 +83,7 @@ let ReviewZoneWidget = class ReviewZoneWidget extends ZoneWidget {
83
83
  this.create();
84
84
  this._globalToDispose.add(this.themeService.onDidColorThemeChange(this._applyTheme, this));
85
85
  this._globalToDispose.add(this.editor.onDidChangeConfiguration(e => {
86
- if (e.hasChanged(49 )) {
86
+ if (e.hasChanged(50 )) {
87
87
  this._applyTheme(this.themeService.getColorTheme());
88
88
  }
89
89
  }));
@@ -121,6 +121,9 @@ let ReviewZoneWidget = class ReviewZoneWidget extends ZoneWidget {
121
121
  scrollTop = this.editor.getTopForLineNumber(this._commentThread.range.startLineNumber) - height / 2 + commentCoords.top - commentThreadCoords.top;
122
122
  }
123
123
  this.editor.setScrollTop(scrollTop);
124
+ if (focus) {
125
+ this._commentThreadWidget.focus();
126
+ }
124
127
  return;
125
128
  }
126
129
  }
@@ -137,7 +140,7 @@ let ReviewZoneWidget = class ReviewZoneWidget extends ZoneWidget {
137
140
  }
138
141
  _fillContainer(container) {
139
142
  this.setCssClass('review-widget');
140
- this._commentThreadWidget = this._scopedInstantiationService.createInstance(CommentThreadWidget, container, 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, {
143
+ 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, {
141
144
  actionRunner: () => {
142
145
  if (!this._commentThread.comments || !this._commentThread.comments.length) {
143
146
  const newPosition = this.getPosition();
@@ -242,7 +245,7 @@ let ReviewZoneWidget = class ReviewZoneWidget extends ZoneWidget {
242
245
  this._commentGlyph = ( (new CommentGlyphWidget(this.editor, range?.endLineNumber ?? -1)));
243
246
  this._commentGlyph.setThreadState(this._commentThread.state);
244
247
  }
245
- this._commentThreadWidget.display(this.editor.getOption(65 ));
248
+ this._commentThreadWidget.display(this.editor.getOption(66 ));
246
249
  this._disposables.add(this._commentThreadWidget.onDidResize(dimension => {
247
250
  this._refresh(dimension);
248
251
  }));
@@ -309,8 +312,8 @@ let ReviewZoneWidget = class ReviewZoneWidget extends ZoneWidget {
309
312
  }
310
313
  if (this._isExpanded) {
311
314
  this._commentThreadWidget.layout();
312
- const headHeight = Math.ceil(this.editor.getOption(65 ) * 1.2);
313
- const lineHeight = this.editor.getOption(65 );
315
+ const headHeight = Math.ceil(this.editor.getOption(66 ) * 1.2);
316
+ const lineHeight = this.editor.getOption(66 );
314
317
  const arrowHeight = Math.round(lineHeight / 3);
315
318
  const frameThickness = Math.round(lineHeight / 9) * 2;
316
319
  const computedLinesNumber = Math.ceil(((headHeight + dimensions.height + arrowHeight + frameThickness + 8) ) / lineHeight);
@@ -333,7 +336,7 @@ let ReviewZoneWidget = class ReviewZoneWidget extends ZoneWidget {
333
336
  arrowColor: borderColor,
334
337
  frameColor: borderColor
335
338
  });
336
- const fontInfo = this.editor.getOption(49 );
339
+ const fontInfo = this.editor.getOption(50 );
337
340
  this._commentThreadWidget.applyTheme(theme, fontInfo);
338
341
  }
339
342
  show(rangeOrPos, heightInLines) {