@codingame/monaco-vscode-katex-common 25.1.2 → 26.0.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 (317) hide show
  1. package/package.json +2 -2
  2. package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.d.ts +23 -2
  3. package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.js +64 -27
  4. package/vscode/src/vs/platform/actions/browser/actionWidgetDropdownActionViewItem.d.ts +3 -1
  5. package/vscode/src/vs/platform/actions/browser/actionWidgetDropdownActionViewItem.js +31 -28
  6. package/vscode/src/vs/platform/actions/browser/buttonbar.d.ts +2 -0
  7. package/vscode/src/vs/platform/actions/browser/buttonbar.js +71 -50
  8. package/vscode/src/vs/platform/editor/browser/editor.js +17 -7
  9. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityProvider.js +112 -129
  10. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.d.ts +10 -1
  11. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +110 -85
  12. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +5 -5
  13. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.d.ts +21 -6
  14. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +308 -216
  15. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +153 -148
  16. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.d.ts +27 -0
  17. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.js +247 -0
  18. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.d.ts +71 -0
  19. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +347 -0
  20. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.d.ts +44 -0
  21. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +287 -0
  22. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.d.ts +20 -0
  23. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.js +89 -0
  24. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.d.ts +188 -0
  25. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +677 -0
  26. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentSessionHoverWidget.css +98 -0
  27. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsviewer.css +263 -0
  28. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentModel.js +34 -25
  29. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.d.ts +19 -14
  30. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js +762 -359
  31. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatImplicitContext.d.ts +22 -1
  32. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatImplicitContext.js +188 -99
  33. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.d.ts +9 -3
  34. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +166 -113
  35. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.d.ts +12 -5
  36. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +279 -213
  37. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.d.ts +46 -0
  38. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +533 -0
  39. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.d.ts +28 -0
  40. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +382 -0
  41. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.d.ts +101 -0
  42. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +509 -0
  43. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingEditorOverlay.css +130 -0
  44. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingExplanationWidget.css +276 -0
  45. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.d.ts +24 -7
  46. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +128 -52
  47. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.d.ts +153 -0
  48. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.js +1218 -0
  49. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/media/chatSessionPickerActionItem.css +14 -0
  50. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.d.ts +39 -0
  51. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.js +193 -0
  52. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController.d.ts +2 -0
  53. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController.js +93 -89
  54. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcome.js +5 -2
  55. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatAgentHover.js +42 -47
  56. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentMarkdownRenderer.js +58 -56
  57. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAgentCommandContentPart.js +18 -14
  58. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAnonymousRateLimitedPart.js +17 -15
  59. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.d.ts +6 -2
  60. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.js +132 -68
  61. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.d.ts +0 -2
  62. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.js +68 -47
  63. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCodeCitationContentPart.js +14 -13
  64. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleContentPart.d.ts +4 -4
  65. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleContentPart.js +36 -24
  66. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleMarkdownContentPart.d.ts +18 -0
  67. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleMarkdownContentPart.js +32 -0
  68. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollections.d.ts +7 -2
  69. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollections.js +15 -4
  70. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCommandContentPart.d.ts +1 -0
  71. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCommandContentPart.js +22 -14
  72. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationContentPart.d.ts +0 -2
  73. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationContentPart.js +34 -27
  74. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.d.ts +1 -5
  75. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.js +198 -135
  76. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentCodePools.d.ts +2 -0
  77. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentCodePools.js +38 -10
  78. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDiffBlockPart.js +29 -27
  79. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatElicitationContentPart.d.ts +0 -2
  80. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatElicitationContentPart.js +41 -36
  81. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatErrorConfirmationPart.d.ts +0 -2
  82. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatErrorConfirmationPart.js +23 -18
  83. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatErrorContentPart.js +13 -13
  84. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExtensionsContentPart.d.ts +0 -3
  85. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExtensionsContentPart.js +20 -14
  86. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.d.ts +11 -1
  87. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.js +291 -152
  88. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.d.ts +2 -3
  89. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +227 -162
  90. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownDecorationsRenderer.js +68 -72
  91. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.d.ts +2 -4
  92. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.js +76 -75
  93. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.d.ts +2 -5
  94. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.js +96 -76
  95. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.d.ts +4 -1
  96. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +74 -38
  97. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPullRequestContentPart.d.ts +0 -2
  98. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPullRequestContentPart.js +11 -25
  99. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.d.ts +107 -0
  100. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +814 -0
  101. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.d.ts +0 -2
  102. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.js +34 -29
  103. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.d.ts +8 -10
  104. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.js +236 -197
  105. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.d.ts +123 -0
  106. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.js +492 -0
  107. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.js +75 -47
  108. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTaskContentPart.d.ts +2 -4
  109. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTaskContentPart.js +31 -20
  110. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.d.ts +0 -3
  111. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.js +42 -36
  112. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.d.ts +55 -7
  113. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +714 -148
  114. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.d.ts +7 -0
  115. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.js +21 -0
  116. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.d.ts +2 -7
  117. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.js +143 -153
  118. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.d.ts +14 -5
  119. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.js +79 -61
  120. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolOutputContentSubPart.d.ts +10 -4
  121. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolOutputContentSubPart.js +209 -77
  122. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTreeContentPart.d.ts +9 -7
  123. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTreeContentPart.js +71 -54
  124. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatWorkspaceEditContentPart.d.ts +18 -0
  125. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatWorkspaceEditContentPart.js +83 -0
  126. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.d.ts +4 -4
  127. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.js +248 -190
  128. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatConfirmationWidget.css +1 -14
  129. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatInlineAnchorWidget.css +23 -0
  130. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatPullRequestContent.css +5 -41
  131. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatQuestionCarousel.css +493 -0
  132. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatSubagentContent.css +63 -0
  133. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTerminalToolProgressPart.css +9 -1
  134. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatThinkingContent.css +121 -5
  135. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTipContent.css +37 -0
  136. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +51 -45
  137. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.js +46 -42
  138. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.d.ts +4 -2
  139. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.js +99 -67
  140. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.d.ts +112 -0
  141. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.js +634 -0
  142. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.d.ts +49 -0
  143. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.js +132 -0
  144. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatResultListSubPart.js +15 -9
  145. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +196 -149
  146. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.d.ts +17 -1
  147. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +577 -193
  148. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +119 -86
  149. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.d.ts +10 -2
  150. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.js +165 -36
  151. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationSubPart.d.ts +0 -2
  152. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationSubPart.js +5 -8
  153. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.d.ts +5 -3
  154. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.js +75 -65
  155. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPartUtilities.js +30 -28
  156. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.d.ts +1 -5
  157. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.js +102 -106
  158. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolProgressPart.js +44 -20
  159. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolStreamingSubPart.d.ts +19 -0
  160. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolStreamingSubPart.js +67 -0
  161. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/terminalToolAutoExpand.d.ts +57 -0
  162. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/terminalToolAutoExpand.js +69 -0
  163. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatDragAndDrop.js +122 -82
  164. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.d.ts +39 -12
  165. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +1110 -597
  166. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.d.ts +291 -0
  167. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.js +485 -0
  168. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatOptions.js +38 -28
  169. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.d.ts +9 -20
  170. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +650 -689
  171. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatFollowups.js +21 -18
  172. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.d.ts +102 -36
  173. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +1253 -790
  174. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPartWidgets.d.ts +0 -7
  175. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPartWidgets.js +11 -11
  176. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPickerActionItem.d.ts +34 -0
  177. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPickerActionItem.js +55 -0
  178. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatSelectedTools.d.ts +6 -2
  179. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatSelectedTools.js +51 -35
  180. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.d.ts +22 -0
  181. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.js +102 -0
  182. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.d.ts +16 -4
  183. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +192 -44
  184. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.d.ts +11 -12
  185. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.js +99 -66
  186. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.d.ts +47 -0
  187. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.js +188 -0
  188. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.d.ts +20 -0
  189. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.js +115 -0
  190. package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chat.css +129 -167
  191. package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chatViewWelcome.css +16 -3
  192. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.d.ts +37 -0
  193. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.js +143 -0
  194. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.d.ts +56 -0
  195. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.js +206 -0
  196. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatContextUsageDetails.css +152 -0
  197. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatContextUsageWidget.css +67 -0
  198. package/vscode/src/vs/workbench/contrib/chat/common/widget/annotations.d.ts +22 -0
  199. package/vscode/src/vs/workbench/contrib/chat/common/widget/annotations.js +170 -0
  200. package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.d.ts +1 -0
  201. package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.js +80 -19
  202. package/vscode/src/vs/workbench/contrib/chat/common/widget/chatWidgetHistoryService.js +20 -28
  203. package/vscode/src/vs/workbench/contrib/chat/common/widget/codeBlockModelCollection.d.ts +2 -1
  204. package/vscode/src/vs/workbench/contrib/chat/common/widget/codeBlockModelCollection.js +22 -19
  205. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.d.ts +15 -0
  206. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.js +122 -0
  207. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.d.ts +19 -104
  208. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +316 -1040
  209. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.d.ts +28 -0
  210. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.js +162 -0
  211. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatGutterAffordance.d.ts +21 -0
  212. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatGutterAffordance.js +98 -0
  213. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.d.ts +68 -0
  214. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.js +416 -0
  215. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.d.ts +1 -6
  216. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +194 -215
  217. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.d.ts +0 -1
  218. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +74 -104
  219. package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChat.css +45 -91
  220. package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatEditorAffordance.css +22 -0
  221. package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatOverlayWidget.css +98 -0
  222. package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.d.ts +5 -2
  223. package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +96 -68
  224. package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveCommon.d.ts +7 -0
  225. package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveCommon.js +11 -0
  226. package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.d.ts +20 -0
  227. package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.js +150 -0
  228. package/vscode/src/vs/workbench/contrib/markdown/browser/markedKatexSupport.js +141 -147
  229. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpToolCallUI.d.ts +64 -0
  230. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpToolCallUI.js +200 -0
  231. package/vscode/src/vs/workbench/contrib/mcp/common/modelContextProtocolApps.d.ts +548 -0
  232. package/vscode/src/vs/workbench/contrib/mcp/common/modelContextProtocolApps.js +23 -0
  233. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.d.ts +22 -0
  234. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +338 -0
  235. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/notebookVisibleCellObserver.d.ts +18 -0
  236. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/notebookVisibleCellObserver.js +58 -0
  237. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.d.ts +75 -0
  238. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +364 -0
  239. package/vscode/src/vs/workbench/contrib/replNotebook/browser/interactiveEditor.css +21 -0
  240. package/vscode/src/vs/workbench/contrib/replNotebook/browser/media/interactive.css +36 -0
  241. package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditor.d.ts +110 -0
  242. package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditor.js +692 -0
  243. package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.d.ts +40 -0
  244. package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.js +158 -0
  245. package/vscode/src/vs/workbench/contrib/terminal/browser/chatTerminalCommandMirror.d.ts +80 -21
  246. package/vscode/src/vs/workbench/contrib/terminal/browser/chatTerminalCommandMirror.js +440 -82
  247. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatInputRelatedFilesContrib.d.ts +0 -34
  248. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatInputRelatedFilesContrib.js +0 -139
  249. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.d.ts +0 -10
  250. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +0 -1081
  251. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.d.ts +0 -199
  252. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.js +0 -482
  253. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.d.ts +0 -28
  254. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.js +0 -37
  255. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.d.ts +0 -94
  256. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +0 -495
  257. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.d.ts +0 -72
  258. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.js +0 -454
  259. package/vscode/src/vs/workbench/contrib/inlineChat/browser/utils.d.ts +0 -13
  260. package/vscode/src/vs/workbench/contrib/inlineChat/browser/utils.js +0 -66
  261. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.d.ts +0 -41
  262. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +0 -372
  263. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.d.ts +0 -4
  264. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +0 -58
  265. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.d.ts +0 -26
  266. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +0 -594
  267. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.d.ts +0 -8
  268. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.js +0 -55
  269. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.d.ts +0 -273
  270. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +0 -1746
  271. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.d.ts +0 -50
  272. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +0 -269
  273. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.d.ts +0 -258
  274. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +0 -806
  275. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.d.ts +0 -41
  276. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.js +0 -116
  277. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/editorHeightCalculator.d.ts +0 -17
  278. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/editorHeightCalculator.js +0 -62
  279. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.d.ts +0 -27
  280. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.js +0 -40
  281. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookCellDiffDecorator.d.ts +0 -23
  282. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookCellDiffDecorator.js +0 -295
  283. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator.d.ts +0 -51
  284. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator.js +0 -241
  285. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiff.d.ts +0 -24
  286. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiff.js +0 -146
  287. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiffWidget.d.ts +0 -28
  288. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiffWidget.js +0 -90
  289. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator.d.ts +0 -10
  290. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator.js +0 -41
  291. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalCellModelFactory.d.ts +0 -21
  292. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalCellModelFactory.js +0 -42
  293. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalModelRefFactory.d.ts +0 -25
  294. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalModelRefFactory.js +0 -77
  295. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiff.css +0 -469
  296. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.d.ts +0 -149
  297. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +0 -823
  298. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.d.ts +0 -180
  299. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +0 -29
  300. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.d.ts +0 -102
  301. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +0 -567
  302. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.d.ts +0 -30
  303. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.js +0 -189
  304. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel.d.ts +0 -75
  305. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel.js +0 -439
  306. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.d.ts +0 -57
  307. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.js +0 -263
  308. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditorInput.d.ts +0 -22
  309. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditorInput.js +0 -48
  310. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/unchangedEditorRegions.d.ts +0 -13
  311. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/unchangedEditorRegions.js +0 -39
  312. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookMetadataTextModel.d.ts +0 -19
  313. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookMetadataTextModel.js +0 -89
  314. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiff.d.ts +0 -26
  315. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiff.js +0 -92
  316. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.d.ts +0 -33
  317. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.js +0 -108
@@ -0,0 +1,692 @@
1
+
2
+ import { registerCss } from '@codingame/monaco-vscode-api/css';
3
+ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
4
+ import * as interactive from './media/interactive.css';
5
+ import { $, append, Dimension } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
6
+ import { createStyleSheet } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/domStylesheets';
7
+ import { Emitter, Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
8
+ import { DisposableStore, MutableDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
9
+ import { CodeEditorWidget } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/widget/codeEditor/codeEditorWidget';
10
+ import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
11
+ import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
12
+ import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
13
+ import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
14
+ import { IThemeService } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service';
15
+ import { EditorPane } from '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/parts/editor/editorPane';
16
+ import { EditorPaneSelectionChangeReason } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor';
17
+ import { getSimpleEditorOptions } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/codeEditor/browser/simpleEditorOptions';
18
+ import { NotebookEditorExtensionsRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/notebookEditorExtensions';
19
+ import { INotebookEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/services/notebookEditorService.service';
20
+ import { getDefaultNotebookCreationOptions, NotebookEditorWidget } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/notebookEditorWidget';
21
+ import { GroupsOrder } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService';
22
+ import { IEditorGroupsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
23
+ import { ExecutionStateCellStatusBarContrib, TimerCellStatusBarContrib } from '../../notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js';
24
+ import { INotebookKernelService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookKernelService.service';
25
+ import { ILanguageService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language.service';
26
+ import { MenuId } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
27
+ import { IMenuService } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions.service';
28
+ import { IKeybindingService } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding.service';
29
+ import { INTERACTIVE_INPUT_CURSOR_BOUNDARY, ReplEditorSettings } from '../../interactive/browser/interactiveCommon.js';
30
+ import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
31
+ import { NotebookOptions } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/notebookOptions';
32
+ import { ToolBar } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/toolbar/toolbar';
33
+ import { IContextMenuService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextview/browser/contextView.service';
34
+ import { createActionViewItem, getActionBarActions } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/menuEntryActionViewItem';
35
+ import { EditorExtensionsRegistry } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorExtensions';
36
+ import { SelectionClipboardContributionID } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/codeEditor/browser/selectionClipboard';
37
+ import { ContextMenuController } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/contextmenu/browser/contextmenu';
38
+ import { SuggestController } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/suggest/browser/suggestController';
39
+ import { MarkerController } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/gotoError/browser/gotoError';
40
+ import { ITextResourceConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/textResourceConfiguration.service';
41
+ import { TextEditorSelectionSource } from '@codingame/monaco-vscode-api/vscode/vs/platform/editor/common/editor';
42
+ import { NotebookExecutionType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookExecutionStateService';
43
+ import { INotebookExecutionStateService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookExecutionStateService.service';
44
+ import { NOTEBOOK_KERNEL } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
45
+ import { IExtensionService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service';
46
+ import { isEqual } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
47
+ import { NotebookFindContrib } from '../../notebook/browser/contrib/find/notebookFindWidget.js';
48
+ import { REPL_EDITOR_ID } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
49
+ import * as interactiveEditor from './interactiveEditor.css';
50
+ import { deepClone } from '@codingame/monaco-vscode-api/vscode/vs/base/common/objects';
51
+ import { GlyphHoverController } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/hover/browser/glyphHoverController';
52
+ import { ContentHoverController } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/hover/browser/contentHoverController';
53
+ import { ReplEditorInput } from './replEditorInput.js';
54
+ import { ReplInputHintContentWidget } from '../../interactive/browser/replInputHintContentWidget.js';
55
+ import { ServiceCollection } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/serviceCollection';
56
+ import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
57
+ import { IAccessibilityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/accessibility/common/accessibility.service';
58
+
59
+ registerCss(interactive);
60
+ registerCss(interactiveEditor);
61
+ const INTERACTIVE_EDITOR_VIEW_STATE_PREFERENCE_KEY = "InteractiveEditorViewState";
62
+ const INPUT_CELL_VERTICAL_PADDING = 8;
63
+ const INPUT_CELL_HORIZONTAL_PADDING_RIGHT = 10;
64
+ const INPUT_EDITOR_PADDING = 8;
65
+ let ReplEditor = class ReplEditor extends EditorPane {
66
+ get onDidFocus() {
67
+ return this._onDidFocusWidget.event;
68
+ }
69
+ constructor(
70
+ group,
71
+ telemetryService,
72
+ themeService,
73
+ storageService,
74
+ instantiationService,
75
+ notebookWidgetService,
76
+ contextKeyService,
77
+ notebookKernelService,
78
+ languageService,
79
+ keybindingService,
80
+ configurationService,
81
+ menuService,
82
+ contextMenuService,
83
+ editorGroupService,
84
+ textResourceConfigurationService,
85
+ notebookExecutionStateService,
86
+ extensionService,
87
+ _accessibilityService
88
+ ) {
89
+ super(REPL_EDITOR_ID, group, telemetryService, themeService, storageService);
90
+ this._accessibilityService = _accessibilityService;
91
+ this._notebookWidget = {
92
+ value: undefined
93
+ };
94
+ this._widgetDisposableStore = this._register(( new DisposableStore()));
95
+ this._groupListener = this._register(( new MutableDisposable()));
96
+ this._onDidFocusWidget = this._register(( new Emitter()));
97
+ this._onDidChangeSelection = this._register(( new Emitter()));
98
+ this.onDidChangeSelection = this._onDidChangeSelection.event;
99
+ this._onDidChangeScroll = this._register(( new Emitter()));
100
+ this.onDidChangeScroll = this._onDidChangeScroll.event;
101
+ this._notebookWidgetService = notebookWidgetService;
102
+ this._configurationService = configurationService;
103
+ this._notebookKernelService = notebookKernelService;
104
+ this._languageService = languageService;
105
+ this._keybindingService = keybindingService;
106
+ this._menuService = menuService;
107
+ this._contextMenuService = contextMenuService;
108
+ this._editorGroupService = editorGroupService;
109
+ this._extensionService = extensionService;
110
+ this._rootElement = $(".interactive-editor");
111
+ this._contextKeyService = this._register(contextKeyService.createScoped(this._rootElement));
112
+ this._contextKeyService.createKey("isCompositeNotebook", true);
113
+ this._instantiationService = this._register(instantiationService.createChild(( new ServiceCollection([IContextKeyService, this._contextKeyService]))));
114
+ this._editorOptions = this._computeEditorOptions();
115
+ this._register(this._configurationService.onDidChangeConfiguration(e => {
116
+ if (e.affectsConfiguration("editor") || e.affectsConfiguration("notebook")) {
117
+ this._editorOptions = this._computeEditorOptions();
118
+ }
119
+ }));
120
+ this._notebookOptions = instantiationService.createInstance(NotebookOptions, this.window, true, {
121
+ cellToolbarInteraction: "hover",
122
+ globalToolbar: true,
123
+ stickyScrollEnabled: false,
124
+ dragAndDropEnabled: false,
125
+ disableRulers: true
126
+ });
127
+ this._editorMemento = this.getEditorMemento(
128
+ editorGroupService,
129
+ textResourceConfigurationService,
130
+ INTERACTIVE_EDITOR_VIEW_STATE_PREFERENCE_KEY
131
+ );
132
+ this._register(
133
+ this._keybindingService.onDidUpdateKeybindings(this._updateInputHint, this)
134
+ );
135
+ this._register(notebookExecutionStateService.onDidChangeExecution(e => {
136
+ if (e.type === NotebookExecutionType.cell && isEqual(e.notebook, this._notebookWidget.value?.viewModel?.notebookDocument.uri)) {
137
+ const cell = this._notebookWidget.value?.getCellByHandle(e.cellHandle);
138
+ if (cell && e.changed?.state) {
139
+ this._scrollIfNecessary(cell);
140
+ }
141
+ }
142
+ }));
143
+ }
144
+ get inputCellContainerHeight() {
145
+ return 19 + 2 + INPUT_CELL_VERTICAL_PADDING * 2 + INPUT_EDITOR_PADDING * 2;
146
+ }
147
+ get inputCellEditorHeight() {
148
+ return 19 + INPUT_EDITOR_PADDING * 2;
149
+ }
150
+ createEditor(parent) {
151
+ append(parent, this._rootElement);
152
+ this._rootElement.style.position = "relative";
153
+ this._notebookEditorContainer = append(this._rootElement, $(".notebook-editor-container"));
154
+ this._inputCellContainer = append(this._rootElement, $(".input-cell-container"));
155
+ this._inputCellContainer.style.position = "absolute";
156
+ this._inputCellContainer.style.height = `${this.inputCellContainerHeight}px`;
157
+ this._inputFocusIndicator = append(this._inputCellContainer, $(".input-focus-indicator"));
158
+ this._inputRunButtonContainer = append(this._inputCellContainer, $(".run-button-container"));
159
+ this._setupRunButtonToolbar(this._inputRunButtonContainer);
160
+ this._inputEditorContainer = append(this._inputCellContainer, $(".input-editor-container"));
161
+ this._createLayoutStyles();
162
+ }
163
+ _setupRunButtonToolbar(runButtonContainer) {
164
+ const menu = this._register(
165
+ this._menuService.createMenu(MenuId.ReplInputExecute, this._contextKeyService)
166
+ );
167
+ this._runbuttonToolbar = this._register(( new ToolBar(runButtonContainer, this._contextMenuService, {
168
+ getKeyBinding: action => this._keybindingService.lookupKeybinding(action.id),
169
+ actionViewItemProvider: (action, options) => {
170
+ return createActionViewItem(this._instantiationService, action, options);
171
+ },
172
+ renderDropdownAsChildElement: true
173
+ })));
174
+ const {
175
+ primary,
176
+ secondary
177
+ } = getActionBarActions(menu.getActions({
178
+ shouldForwardArgs: true
179
+ }));
180
+ this._runbuttonToolbar.setActions([...primary, ...secondary]);
181
+ }
182
+ _createLayoutStyles() {
183
+ this._styleElement = createStyleSheet(this._rootElement);
184
+ const styleSheets = [];
185
+ const {
186
+ codeCellLeftMargin,
187
+ cellRunGutter
188
+ } = this._notebookOptions.getLayoutConfiguration();
189
+ const {
190
+ focusIndicator
191
+ } = this._notebookOptions.getDisplayOptions();
192
+ const leftMargin = this._notebookOptions.getCellEditorContainerLeftMargin();
193
+ styleSheets.push(`
194
+ .interactive-editor .input-cell-container {
195
+ padding: ${INPUT_CELL_VERTICAL_PADDING}px ${INPUT_CELL_HORIZONTAL_PADDING_RIGHT}px ${INPUT_CELL_VERTICAL_PADDING}px ${leftMargin}px;
196
+ }
197
+ `);
198
+ if (focusIndicator === "gutter") {
199
+ styleSheets.push(`
200
+ .interactive-editor .input-cell-container:focus-within .input-focus-indicator::before {
201
+ border-color: var(--vscode-notebook-focusedCellBorder) !important;
202
+ }
203
+ .interactive-editor .input-focus-indicator::before {
204
+ border-color: var(--vscode-notebook-inactiveFocusedCellBorder) !important;
205
+ }
206
+ .interactive-editor .input-cell-container .input-focus-indicator {
207
+ display: block;
208
+ top: ${INPUT_CELL_VERTICAL_PADDING}px;
209
+ }
210
+ .interactive-editor .input-cell-container {
211
+ border-top: 1px solid var(--vscode-notebook-inactiveFocusedCellBorder);
212
+ }
213
+ `);
214
+ } else {
215
+ styleSheets.push(`
216
+ .interactive-editor .input-cell-container {
217
+ border-top: 1px solid var(--vscode-notebook-inactiveFocusedCellBorder);
218
+ }
219
+ .interactive-editor .input-cell-container .input-focus-indicator {
220
+ display: none;
221
+ }
222
+ `);
223
+ }
224
+ styleSheets.push(`
225
+ .interactive-editor .input-cell-container .run-button-container {
226
+ width: ${cellRunGutter}px;
227
+ left: ${codeCellLeftMargin}px;
228
+ margin-top: ${INPUT_EDITOR_PADDING - 2}px;
229
+ }
230
+ `);
231
+ this._styleElement.textContent = styleSheets.join("\n");
232
+ }
233
+ _computeEditorOptions() {
234
+ let overrideIdentifier = undefined;
235
+ if (this._codeEditorWidget) {
236
+ overrideIdentifier = this._codeEditorWidget.getModel()?.getLanguageId();
237
+ }
238
+ const editorOptions = deepClone(this._configurationService.getValue("editor", {
239
+ overrideIdentifier
240
+ }));
241
+ const editorOptionsOverride = getSimpleEditorOptions(this._configurationService);
242
+ const computed = ( Object.freeze({
243
+ ...editorOptions,
244
+ ...editorOptionsOverride,
245
+ ...{
246
+ ariaLabel: ( localize(10737, "REPL Input")),
247
+ glyphMargin: true,
248
+ padding: {
249
+ top: INPUT_EDITOR_PADDING,
250
+ bottom: INPUT_EDITOR_PADDING
251
+ },
252
+ hover: {
253
+ enabled: "on"
254
+ },
255
+ rulers: []
256
+ }
257
+ }));
258
+ return computed;
259
+ }
260
+ saveState() {
261
+ this._saveEditorViewState(this.input);
262
+ super.saveState();
263
+ }
264
+ getViewState() {
265
+ const input = this.input;
266
+ if (!(input instanceof ReplEditorInput)) {
267
+ return undefined;
268
+ }
269
+ this._saveEditorViewState(input);
270
+ return this._loadNotebookEditorViewState(input);
271
+ }
272
+ _saveEditorViewState(input) {
273
+ if (this._notebookWidget.value && input instanceof ReplEditorInput) {
274
+ if (this._notebookWidget.value.isDisposed) {
275
+ return;
276
+ }
277
+ const state = this._notebookWidget.value.getEditorViewState();
278
+ const editorState = this._codeEditorWidget.saveViewState();
279
+ this._editorMemento.saveEditorState(this.group, input.resource, {
280
+ notebook: state,
281
+ input: editorState
282
+ });
283
+ }
284
+ }
285
+ _loadNotebookEditorViewState(input) {
286
+ const result = this._editorMemento.loadEditorState(this.group, input.resource);
287
+ if (result) {
288
+ return result;
289
+ }
290
+ for (const group of this._editorGroupService.getGroups(GroupsOrder.MOST_RECENTLY_ACTIVE)) {
291
+ if (group.activeEditorPane !== this && group.activeEditorPane === this && group.activeEditor?.matches(input)) {
292
+ const notebook = this._notebookWidget.value?.getEditorViewState();
293
+ const input = this._codeEditorWidget.saveViewState();
294
+ return {
295
+ notebook,
296
+ input
297
+ };
298
+ }
299
+ }
300
+ return;
301
+ }
302
+ async setInput(input, options, context, token) {
303
+ this._notebookWidget.value?.onWillHide();
304
+ this._codeEditorWidget?.dispose();
305
+ this._widgetDisposableStore.clear();
306
+ this._notebookWidget = this._instantiationService.invokeFunction(this._notebookWidgetService.retrieveWidget, this.group.id, input, {
307
+ isReplHistory: true,
308
+ isReadOnly: true,
309
+ contributions: NotebookEditorExtensionsRegistry.getSomeEditorContributions([
310
+ ExecutionStateCellStatusBarContrib.id,
311
+ TimerCellStatusBarContrib.id,
312
+ NotebookFindContrib.id
313
+ ]),
314
+ menuIds: {
315
+ notebookToolbar: MenuId.InteractiveToolbar,
316
+ cellTitleToolbar: MenuId.InteractiveCellTitle,
317
+ cellDeleteToolbar: MenuId.InteractiveCellDelete,
318
+ cellInsertToolbar: MenuId.NotebookCellBetween,
319
+ cellTopInsertToolbar: MenuId.NotebookCellListTop,
320
+ cellExecuteToolbar: MenuId.InteractiveCellExecute,
321
+ cellExecutePrimary: undefined
322
+ },
323
+ cellEditorContributions: EditorExtensionsRegistry.getSomeEditorContributions([
324
+ SelectionClipboardContributionID,
325
+ ContextMenuController.ID,
326
+ ContentHoverController.ID,
327
+ GlyphHoverController.ID,
328
+ MarkerController.ID
329
+ ]),
330
+ options: this._notebookOptions,
331
+ codeWindow: this.window
332
+ }, undefined, this.window);
333
+ const skipContributions = [
334
+ "workbench.notebook.cellToolbar",
335
+ "editor.contrib.inlineCompletionsController"
336
+ ];
337
+ const inputContributions = getDefaultNotebookCreationOptions().cellEditorContributions?.filter(c => skipContributions.indexOf(c.id) === -1);
338
+ this._codeEditorWidget = this._instantiationService.createInstance(CodeEditorWidget, this._inputEditorContainer, this._editorOptions, {
339
+ ...{
340
+ isSimpleWidget: false,
341
+ contributions: inputContributions
342
+ }
343
+ });
344
+ if (this._lastLayoutDimensions) {
345
+ this._notebookEditorContainer.style.height = `${this._lastLayoutDimensions.dimension.height - this.inputCellContainerHeight}px`;
346
+ this._notebookWidget.value.layout(new Dimension(
347
+ this._lastLayoutDimensions.dimension.width,
348
+ this._lastLayoutDimensions.dimension.height - this.inputCellContainerHeight
349
+ ), this._notebookEditorContainer);
350
+ const leftMargin = this._notebookOptions.getCellEditorContainerLeftMargin();
351
+ const maxHeight = Math.min(
352
+ this._lastLayoutDimensions.dimension.height / 2,
353
+ this.inputCellEditorHeight
354
+ );
355
+ this._codeEditorWidget.layout(this._validateDimension(
356
+ this._lastLayoutDimensions.dimension.width - leftMargin - INPUT_CELL_HORIZONTAL_PADDING_RIGHT,
357
+ maxHeight
358
+ ));
359
+ this._inputFocusIndicator.style.height = `${this.inputCellEditorHeight}px`;
360
+ this._inputCellContainer.style.top = `${this._lastLayoutDimensions.dimension.height - this.inputCellContainerHeight}px`;
361
+ this._inputCellContainer.style.width = `${this._lastLayoutDimensions.dimension.width}px`;
362
+ }
363
+ await super.setInput(input, options, context, token);
364
+ const model = await input.resolve();
365
+ if (this._runbuttonToolbar) {
366
+ this._runbuttonToolbar.context = input.resource;
367
+ }
368
+ if (model === null) {
369
+ throw ( new Error("The REPL model could not be resolved"));
370
+ }
371
+ this._notebookWidget.value?.setParentContextKeyService(this._contextKeyService);
372
+ const viewState = options?.viewState ?? this._loadNotebookEditorViewState(input);
373
+ await this._extensionService.whenInstalledExtensionsRegistered();
374
+ await this._notebookWidget.value.setModel(model.notebook, viewState?.notebook, undefined, "repl");
375
+ model.notebook.setCellCollapseDefault(this._notebookOptions.getCellCollapseDefault());
376
+ this._notebookWidget.value.setOptions({
377
+ isReadOnly: true
378
+ });
379
+ this._widgetDisposableStore.add(this._notebookWidget.value.onDidResizeOutput(cvm => {
380
+ this._scrollIfNecessary(cvm);
381
+ }));
382
+ this._widgetDisposableStore.add(
383
+ this._notebookWidget.value.onDidFocusWidget(() => this._onDidFocusWidget.fire())
384
+ );
385
+ this._widgetDisposableStore.add(this._notebookOptions.onDidChangeOptions(e => {
386
+ if (e.compactView || e.focusIndicator) {
387
+ this._styleElement?.remove();
388
+ this._createLayoutStyles();
389
+ }
390
+ if (this._lastLayoutDimensions && this.isVisible()) {
391
+ this.layout(this._lastLayoutDimensions.dimension, this._lastLayoutDimensions.position);
392
+ }
393
+ if (e.interactiveWindowCollapseCodeCells) {
394
+ model.notebook.setCellCollapseDefault(this._notebookOptions.getCellCollapseDefault());
395
+ }
396
+ }));
397
+ const editorModel = await input.resolveInput(model.notebook);
398
+ this._codeEditorWidget.setModel(editorModel);
399
+ if (viewState?.input) {
400
+ this._codeEditorWidget.restoreViewState(viewState.input);
401
+ }
402
+ this._editorOptions = this._computeEditorOptions();
403
+ this._codeEditorWidget.updateOptions(this._editorOptions);
404
+ this._widgetDisposableStore.add(
405
+ this._codeEditorWidget.onDidFocusEditorWidget(() => this._onDidFocusWidget.fire())
406
+ );
407
+ this._widgetDisposableStore.add(this._codeEditorWidget.onDidContentSizeChange(e => {
408
+ if (!e.contentHeightChanged) {
409
+ return;
410
+ }
411
+ if (this._lastLayoutDimensions) {
412
+ this._layoutWidgets(this._lastLayoutDimensions.dimension, this._lastLayoutDimensions.position);
413
+ }
414
+ }));
415
+ this._widgetDisposableStore.add(
416
+ this._codeEditorWidget.onDidChangeCursorPosition(e => this._onDidChangeSelection.fire({
417
+ reason: this._toEditorPaneSelectionChangeReason(e)
418
+ }))
419
+ );
420
+ this._widgetDisposableStore.add(
421
+ this._codeEditorWidget.onDidChangeModelContent(() => this._onDidChangeSelection.fire({
422
+ reason: EditorPaneSelectionChangeReason.EDIT
423
+ }))
424
+ );
425
+ this._widgetDisposableStore.add(
426
+ this._notebookKernelService.onDidChangeNotebookAffinity(this._syncWithKernel, this)
427
+ );
428
+ this._widgetDisposableStore.add(
429
+ this._notebookKernelService.onDidChangeSelectedNotebooks(this._syncWithKernel, this)
430
+ );
431
+ this._widgetDisposableStore.add(this.themeService.onDidColorThemeChange(() => {
432
+ if (this.isVisible()) {
433
+ this._updateInputHint();
434
+ }
435
+ }));
436
+ this._widgetDisposableStore.add(this._codeEditorWidget.onDidChangeModelContent(() => {
437
+ if (this.isVisible()) {
438
+ this._updateInputHint();
439
+ }
440
+ }));
441
+ this._widgetDisposableStore.add(this._codeEditorWidget.onDidChangeModelDecorations(() => {
442
+ if (this.isVisible()) {
443
+ this._updateInputHint();
444
+ }
445
+ }));
446
+ const cursorAtBoundaryContext = INTERACTIVE_INPUT_CURSOR_BOUNDARY.bindTo(this._contextKeyService);
447
+ if (input.resource && ( input.historyService.has(input.resource))) {
448
+ cursorAtBoundaryContext.set("top");
449
+ } else {
450
+ cursorAtBoundaryContext.set("none");
451
+ }
452
+ this._widgetDisposableStore.add(this._codeEditorWidget.onDidChangeCursorPosition((
453
+ {
454
+ position
455
+ }
456
+ ) => {
457
+ const viewModel = this._codeEditorWidget._getViewModel();
458
+ const lastLineNumber = viewModel.getLineCount();
459
+ const lastLineCol = viewModel.getLineLength(lastLineNumber) + 1;
460
+ const viewPosition = viewModel.coordinatesConverter.convertModelPositionToViewPosition(position);
461
+ const firstLine = viewPosition.lineNumber === 1 && viewPosition.column === 1;
462
+ const lastLine = viewPosition.lineNumber === lastLineNumber && viewPosition.column === lastLineCol;
463
+ if (firstLine) {
464
+ if (lastLine) {
465
+ cursorAtBoundaryContext.set("both");
466
+ } else {
467
+ cursorAtBoundaryContext.set("top");
468
+ }
469
+ } else {
470
+ if (lastLine) {
471
+ cursorAtBoundaryContext.set("bottom");
472
+ } else {
473
+ cursorAtBoundaryContext.set("none");
474
+ }
475
+ }
476
+ }));
477
+ this._widgetDisposableStore.add(editorModel.onDidChangeContent(() => {
478
+ const value = editorModel.getValue();
479
+ if (this.input?.resource && value !== "") {
480
+ const historyService = this.input.historyService;
481
+ if (!historyService.matchesCurrent(this.input.resource, value)) {
482
+ historyService.replaceLast(this.input.resource, value);
483
+ }
484
+ }
485
+ }));
486
+ this._widgetDisposableStore.add(
487
+ this._notebookWidget.value.onDidScroll(() => this._onDidChangeScroll.fire())
488
+ );
489
+ this._widgetDisposableStore.add(
490
+ this._notebookWidget.value.onDidChangeViewCells(this.handleViewCellChange, this)
491
+ );
492
+ this._updateInputHint();
493
+ this._syncWithKernel();
494
+ }
495
+ handleViewCellChange(e) {
496
+ const notebookWidget = this._notebookWidget.value;
497
+ if (!notebookWidget) {
498
+ return;
499
+ }
500
+ for (const splice of e.splices) {
501
+ const [_start, _delete, addedCells] = splice;
502
+ if (addedCells.length) {
503
+ const viewModel = notebookWidget.viewModel;
504
+ if (viewModel) {
505
+ this.handleAppend(notebookWidget, viewModel);
506
+ break;
507
+ }
508
+ }
509
+ }
510
+ }
511
+ handleAppend(notebookWidget, viewModel) {
512
+ this._notebookWidgetService.updateReplContextKey(( viewModel.notebookDocument.uri.toString()));
513
+ const navigateToCell = this._configurationService.getValue("accessibility.replEditor.autoFocusReplExecution");
514
+ if (this._accessibilityService.isScreenReaderOptimized()) {
515
+ if (navigateToCell === "lastExecution") {
516
+ setTimeout(() => {
517
+ const lastCellIndex = viewModel.length - 1;
518
+ if (lastCellIndex >= 0) {
519
+ const cell = viewModel.viewCells[lastCellIndex];
520
+ notebookWidget.focusNotebookCell(cell, "container");
521
+ }
522
+ }, 0);
523
+ } else if (navigateToCell === "input") {
524
+ this._codeEditorWidget.focus();
525
+ }
526
+ }
527
+ }
528
+ setOptions(options) {
529
+ this._notebookWidget.value?.setOptions(options);
530
+ super.setOptions(options);
531
+ }
532
+ _toEditorPaneSelectionChangeReason(e) {
533
+ switch (e.source) {
534
+ case TextEditorSelectionSource.PROGRAMMATIC:
535
+ return EditorPaneSelectionChangeReason.PROGRAMMATIC;
536
+ case TextEditorSelectionSource.NAVIGATION:
537
+ return EditorPaneSelectionChangeReason.NAVIGATION;
538
+ case TextEditorSelectionSource.JUMP:
539
+ return EditorPaneSelectionChangeReason.JUMP;
540
+ default:
541
+ return EditorPaneSelectionChangeReason.USER;
542
+ }
543
+ }
544
+ _cellAtBottom(cell) {
545
+ const visibleRanges = this._notebookWidget.value?.visibleRanges || [];
546
+ const cellIndex = this._notebookWidget.value?.getCellIndex(cell);
547
+ if (cellIndex === Math.max(...( visibleRanges.map(range => range.end - 1)))) {
548
+ return true;
549
+ }
550
+ return false;
551
+ }
552
+ _scrollIfNecessary(cvm) {
553
+ const index = this._notebookWidget.value.getCellIndex(cvm);
554
+ if (index === this._notebookWidget.value.getLength() - 1) {
555
+ if (this._configurationService.getValue(ReplEditorSettings.interactiveWindowAlwaysScrollOnNewCell) || this._cellAtBottom(cvm)) {
556
+ this._notebookWidget.value.scrollToBottom();
557
+ }
558
+ }
559
+ }
560
+ _syncWithKernel() {
561
+ const notebook = this._notebookWidget.value?.textModel;
562
+ const textModel = this._codeEditorWidget.getModel();
563
+ if (notebook && textModel) {
564
+ const info = this._notebookKernelService.getMatchingKernel(notebook);
565
+ const selectedOrSuggested = info.selected ?? (info.suggestions.length === 1 ? info.suggestions[0] : undefined) ?? (info.all.length === 1 ? info.all[0] : undefined);
566
+ if (selectedOrSuggested) {
567
+ const language = selectedOrSuggested.supportedLanguages[0];
568
+ if (language && language !== "plaintext") {
569
+ const newMode = this._languageService.createById(language).languageId;
570
+ textModel.setLanguage(newMode);
571
+ }
572
+ NOTEBOOK_KERNEL.bindTo(this._contextKeyService).set(selectedOrSuggested.id);
573
+ }
574
+ }
575
+ }
576
+ layout(dimension, position) {
577
+ this._rootElement.classList.toggle("mid-width", dimension.width < 1000 && dimension.width >= 600);
578
+ this._rootElement.classList.toggle("narrow-width", dimension.width < 600);
579
+ const editorHeightChanged = dimension.height !== this._lastLayoutDimensions?.dimension.height;
580
+ this._lastLayoutDimensions = {
581
+ dimension,
582
+ position
583
+ };
584
+ if (!this._notebookWidget.value) {
585
+ return;
586
+ }
587
+ if (editorHeightChanged && this._codeEditorWidget) {
588
+ SuggestController.get(this._codeEditorWidget)?.cancelSuggestWidget();
589
+ }
590
+ this._notebookEditorContainer.style.height = `${this._lastLayoutDimensions.dimension.height - this.inputCellContainerHeight}px`;
591
+ this._layoutWidgets(dimension, position);
592
+ }
593
+ _layoutWidgets(dimension, position) {
594
+ const contentHeight = this._codeEditorWidget.hasModel() ? this._codeEditorWidget.getContentHeight() : this.inputCellEditorHeight;
595
+ const maxHeight = Math.min(dimension.height / 2, contentHeight);
596
+ const leftMargin = this._notebookOptions.getCellEditorContainerLeftMargin();
597
+ const inputCellContainerHeight = maxHeight + INPUT_CELL_VERTICAL_PADDING * 2;
598
+ this._notebookEditorContainer.style.height = `${dimension.height - inputCellContainerHeight}px`;
599
+ this._notebookWidget.value.layout(
600
+ dimension.with(dimension.width, dimension.height - inputCellContainerHeight),
601
+ this._notebookEditorContainer,
602
+ position
603
+ );
604
+ this._codeEditorWidget.layout(this._validateDimension(
605
+ dimension.width - leftMargin - INPUT_CELL_HORIZONTAL_PADDING_RIGHT,
606
+ maxHeight
607
+ ));
608
+ this._inputFocusIndicator.style.height = `${contentHeight}px`;
609
+ this._inputCellContainer.style.top = `${dimension.height - inputCellContainerHeight}px`;
610
+ this._inputCellContainer.style.width = `${dimension.width}px`;
611
+ }
612
+ _validateDimension(width, height) {
613
+ return new Dimension(Math.max(0, width), Math.max(0, height));
614
+ }
615
+ _hasConflictingDecoration() {
616
+ return Boolean(this._codeEditorWidget.getLineDecorations(1)?.find(
617
+ d => d.options.beforeContentClassName || d.options.afterContentClassName || d.options.before?.content || d.options.after?.content
618
+ ));
619
+ }
620
+ _updateInputHint() {
621
+ if (!this._codeEditorWidget) {
622
+ return;
623
+ }
624
+ const shouldHide = !this._codeEditorWidget.hasModel() || this._configurationService.getValue(ReplEditorSettings.showExecutionHint) === false || this._codeEditorWidget.getModel().getValueLength() !== 0 || this._hasConflictingDecoration();
625
+ if (!this._hintElement && !shouldHide) {
626
+ this._hintElement = this._instantiationService.createInstance(ReplInputHintContentWidget, this._codeEditorWidget);
627
+ } else if (this._hintElement && shouldHide) {
628
+ this._hintElement.dispose();
629
+ this._hintElement = undefined;
630
+ }
631
+ }
632
+ getScrollPosition() {
633
+ return {
634
+ scrollTop: this._notebookWidget.value?.scrollTop ?? 0,
635
+ scrollLeft: 0
636
+ };
637
+ }
638
+ setScrollPosition(position) {
639
+ this._notebookWidget.value?.setScrollTop(position.scrollTop);
640
+ }
641
+ focus() {
642
+ super.focus();
643
+ this._notebookWidget.value?.onShow();
644
+ this._codeEditorWidget.focus();
645
+ }
646
+ focusHistory() {
647
+ this._notebookWidget.value.focus();
648
+ }
649
+ setEditorVisible(visible) {
650
+ super.setEditorVisible(visible);
651
+ this._groupListener.value = this.group.onWillCloseEditor(e => this._saveEditorViewState(e.editor));
652
+ if (!visible) {
653
+ this._saveEditorViewState(this.input);
654
+ if (this.input && this._notebookWidget.value) {
655
+ this._notebookWidget.value.onWillHide();
656
+ }
657
+ }
658
+ this._updateInputHint();
659
+ }
660
+ clearInput() {
661
+ if (this._notebookWidget.value) {
662
+ this._saveEditorViewState(this.input);
663
+ this._notebookWidget.value.onWillHide();
664
+ }
665
+ this._codeEditorWidget?.dispose();
666
+ this._notebookWidget = {
667
+ value: undefined
668
+ };
669
+ this._widgetDisposableStore.clear();
670
+ super.clearInput();
671
+ }
672
+ getControl() {
673
+ return {
674
+ notebookEditor: this._notebookWidget.value,
675
+ activeCodeEditor: this.getActiveCodeEditor(),
676
+ onDidChangeActiveEditor: Event.None
677
+ };
678
+ }
679
+ getActiveCodeEditor() {
680
+ if (!this._codeEditorWidget) {
681
+ return undefined;
682
+ }
683
+ return this._codeEditorWidget.hasWidgetFocus() || !this._notebookWidget.value?.activeCodeEditor ? this._codeEditorWidget : this._notebookWidget.value.activeCodeEditor;
684
+ }
685
+ };
686
+ ReplEditor = ( __decorate([( __param(1, ITelemetryService)), ( __param(2, IThemeService)), ( __param(3, IStorageService)), ( __param(4, IInstantiationService)), ( __param(5, INotebookEditorService)), ( __param(6, IContextKeyService)), ( __param(7, INotebookKernelService)), ( __param(8, ILanguageService)), ( __param(9, IKeybindingService)), ( __param(10, IConfigurationService)), ( __param(11, IMenuService)), ( __param(12, IContextMenuService)), ( __param(13, IEditorGroupsService)), ( __param(14, ITextResourceConfigurationService)), ( __param(15, INotebookExecutionStateService)), ( __param(16, IExtensionService)), ( __param(17, IAccessibilityService))], ReplEditor));
687
+ function isReplEditorControl(control) {
688
+ const candidate = control;
689
+ return candidate?.activeCodeEditor instanceof CodeEditorWidget && candidate?.notebookEditor instanceof NotebookEditorWidget;
690
+ }
691
+
692
+ export { ReplEditor, isReplEditorControl };