@codingame/monaco-vscode-api 2.0.3 → 2.1.0-update-vscode-1.86.1

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 (511) hide show
  1. package/api.js +15 -12
  2. package/extensions.d.ts +4 -7
  3. package/external/@xterm/xterm/typings/xterm.d.ts +22 -0
  4. package/missing-services.js +62 -6
  5. package/package.json +8 -8
  6. package/service-override/tools/editor.js +14 -0
  7. package/services.d.ts +3 -2
  8. package/services.js +6 -4
  9. package/vscode/src/vs/base/browser/browser.js +45 -30
  10. package/vscode/src/vs/base/browser/canIUse.js +1 -1
  11. package/vscode/src/vs/base/browser/defaultWorkerFactory.js +12 -5
  12. package/vscode/src/vs/base/browser/dom.js +104 -14
  13. package/vscode/src/vs/base/browser/indexedDB.js +3 -3
  14. package/vscode/src/vs/base/browser/markdownRenderer.js +29 -1
  15. package/vscode/src/vs/base/browser/mouseEvent.js +17 -3
  16. package/vscode/src/vs/base/browser/ui/actionbar/actionbar.js +3 -3
  17. package/vscode/src/vs/base/browser/ui/breadcrumbs/breadcrumbsWidget.css.js +4 -0
  18. package/vscode/src/vs/base/browser/ui/breadcrumbs/breadcrumbsWidget.d.ts +1 -1
  19. package/vscode/src/vs/base/browser/ui/breadcrumbs/breadcrumbsWidget.js +287 -0
  20. package/vscode/src/vs/base/browser/ui/button/button.js +9 -0
  21. package/vscode/src/vs/base/browser/ui/codicons/codicon/codicon.css.js +1 -1
  22. package/vscode/src/vs/base/browser/ui/dialog/dialog.js +1 -1
  23. package/vscode/src/vs/base/browser/ui/iconLabel/iconLabelHover.js +16 -5
  24. package/vscode/src/vs/base/browser/ui/list/listView.js +31 -11
  25. package/vscode/src/vs/base/browser/ui/list/listWidget.js +35 -21
  26. package/vscode/src/vs/base/browser/ui/menu/menu.js +10 -1
  27. package/vscode/src/vs/base/browser/ui/menu/menubar.js +8 -4
  28. package/vscode/src/vs/base/browser/ui/scrollbar/scrollableElement.js +6 -5
  29. package/vscode/src/vs/base/browser/ui/tree/abstractTree.js +469 -95
  30. package/vscode/src/vs/base/browser/ui/tree/asyncDataTree.js +22 -7
  31. package/vscode/src/vs/base/browser/ui/tree/indexTreeModel.js +0 -5
  32. package/vscode/src/vs/base/browser/ui/tree/media/tree.css.js +1 -1
  33. package/vscode/src/vs/base/browser/ui/tree/objectTree.js +70 -4
  34. package/vscode/src/vs/base/common/assert.js +6 -1
  35. package/vscode/src/vs/base/common/async.js +31 -6
  36. package/vscode/src/vs/base/common/codicons.js +5 -0
  37. package/vscode/src/vs/base/common/event.d.ts +0 -5
  38. package/vscode/src/vs/base/common/event.js +0 -15
  39. package/vscode/src/vs/base/common/filters.d.ts +1 -18
  40. package/vscode/src/vs/base/common/htmlContent.js +12 -6
  41. package/vscode/src/vs/base/common/iterator.js +8 -0
  42. package/vscode/src/vs/base/common/labels.js +2 -1
  43. package/vscode/src/vs/base/common/map.js +20 -1
  44. package/vscode/src/vs/base/common/observableInternal/base.d.ts +4 -0
  45. package/vscode/src/vs/base/common/observableInternal/base.js +16 -8
  46. package/vscode/src/vs/base/common/observableInternal/derived.js +4 -6
  47. package/vscode/src/vs/base/common/observableInternal/utils.js +60 -5
  48. package/vscode/src/vs/base/common/platform.js +20 -20
  49. package/vscode/src/vs/base/common/prefixTree.js +4 -3
  50. package/vscode/src/vs/base/common/product.d.ts +5 -2
  51. package/vscode/src/vs/base/common/strings.js +23 -7
  52. package/vscode/src/vs/base/common/themables.js +4 -1
  53. package/vscode/src/vs/base/common/uri.js +11 -1
  54. package/vscode/src/vs/base/common/worker/simpleWorker.js +1 -1
  55. package/vscode/src/vs/editor/browser/config/migrateOptions.js +5 -0
  56. package/vscode/src/vs/editor/browser/controller/mouseHandler.js +1 -0
  57. package/vscode/src/vs/editor/browser/controller/mouseTarget.js +14 -8
  58. package/vscode/src/vs/editor/browser/controller/pointerHandler.js +18 -11
  59. package/vscode/src/vs/editor/browser/controller/textAreaHandler.js +1 -1
  60. package/vscode/src/vs/editor/browser/controller/textAreaInput.js +3 -3
  61. package/vscode/src/vs/{workbench/services/hover/browser → editor/browser/services}/hoverService.d.ts +7 -6
  62. package/vscode/src/vs/editor/browser/services/hoverService.js +195 -0
  63. package/vscode/src/vs/editor/browser/view.js +29 -39
  64. package/vscode/src/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.js +41 -19
  65. package/vscode/src/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.js +1 -1
  66. package/vscode/src/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js +30 -23
  67. package/vscode/src/vs/editor/browser/viewParts/lineNumbers/lineNumbers.js +23 -8
  68. package/vscode/src/vs/editor/browser/viewParts/lines/viewLines.js +1 -1
  69. package/vscode/src/vs/editor/browser/viewParts/linesDecorations/linesDecorations.js +8 -1
  70. package/vscode/src/vs/editor/browser/viewParts/marginDecorations/marginDecorations.js +7 -1
  71. package/vscode/src/vs/editor/browser/viewParts/minimap/minimap.js +1 -1
  72. package/vscode/src/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.js +30 -3
  73. package/vscode/src/vs/editor/browser/widget/codeEditorWidget.js +39 -15
  74. package/vscode/src/vs/editor/browser/widget/diffEditor/{accessibleDiffViewer.css.js → components/accessibleDiffViewer.css.js} +1 -1
  75. package/vscode/src/vs/editor/browser/widget/diffEditor/{accessibleDiffViewer.js → components/accessibleDiffViewer.js} +43 -43
  76. package/vscode/src/vs/editor/browser/widget/diffEditor/components/diffEditorDecorations.js +89 -0
  77. package/vscode/src/vs/editor/browser/widget/diffEditor/{diffEditorEditors.js → components/diffEditorEditors.js} +14 -14
  78. package/vscode/src/vs/editor/browser/widget/diffEditor/{diffEditorSash.js → components/diffEditorSash.js} +5 -5
  79. package/vscode/src/vs/editor/browser/widget/diffEditor/{lineAlignment.js → components/diffEditorViewZones/diffEditorViewZones.js} +38 -28
  80. package/vscode/src/vs/editor/browser/widget/diffEditor/{inlineDiffDeletedCodeMargin.js → components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js} +14 -14
  81. package/vscode/src/vs/editor/browser/widget/diffEditor/{renderLines.js → components/diffEditorViewZones/renderLines.js} +7 -7
  82. package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditor.contribution.js +29 -38
  83. package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditorViewModel.js +150 -38
  84. package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditorWidget.js +17 -16
  85. package/vscode/src/vs/editor/browser/widget/diffEditor/diffProviderFactoryService.js +104 -6
  86. package/vscode/src/vs/editor/browser/widget/diffEditor/{hideUnchangedRegionsFeature.js → features/hideUnchangedRegionsFeature.js} +51 -78
  87. package/vscode/src/vs/editor/browser/widget/diffEditor/{movedBlocksLines.js → features/movedBlocksLinesFeature.js} +23 -23
  88. package/vscode/src/vs/editor/browser/widget/diffEditor/{overviewRulerPart.js → features/overviewRulerFeature.js} +28 -28
  89. package/vscode/src/vs/editor/browser/widget/diffEditor/features/revertButtonsFeature.js +145 -0
  90. package/vscode/src/vs/editor/browser/widget/diffEditor/{decorations.js → registrations.contribution.js} +18 -2
  91. package/vscode/src/vs/editor/browser/widget/diffEditor/utils.js +10 -2
  92. package/vscode/src/vs/editor/browser/widget/hoverWidget/hover.css.js +4 -0
  93. package/vscode/src/vs/editor/browser/widget/hoverWidget/hoverWidget.js +527 -0
  94. package/vscode/src/vs/editor/{contrib → browser/widget}/markdownRenderer/browser/markdownRenderer.js +11 -11
  95. package/vscode/src/vs/editor/{contrib → browser/widget}/markdownRenderer/browser/renderedMarkdown.css.js +1 -1
  96. package/vscode/src/vs/editor/common/config/editorOptions.d.ts +11 -10
  97. package/vscode/src/vs/editor/common/config/editorOptions.js +46 -42
  98. package/vscode/src/vs/editor/common/core/editorColorRegistry.js +3 -3
  99. package/vscode/src/vs/editor/common/core/offsetRange.d.ts +2 -0
  100. package/vscode/src/vs/editor/common/core/offsetRange.js +8 -0
  101. package/vscode/src/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/diffAlgorithm.js +9 -0
  102. package/vscode/src/vs/editor/common/diff/defaultLinesDiffComputer/heuristicSequenceOptimizations.js +50 -47
  103. package/vscode/src/vs/editor/common/diff/defaultLinesDiffComputer/linesSliceCharSequence.js +4 -1
  104. package/vscode/src/vs/editor/common/diff/rangeMapping.d.ts +2 -1
  105. package/vscode/src/vs/editor/common/diff/rangeMapping.js +13 -2
  106. package/vscode/src/vs/editor/common/languages.d.ts +10 -2
  107. package/vscode/src/vs/editor/common/model/textModel.js +19 -13
  108. package/vscode/src/vs/editor/common/model/tokenizationTextModelPart.js +1 -1
  109. package/vscode/src/vs/editor/common/model.d.ts +19 -1
  110. package/vscode/src/vs/editor/common/model.js +2 -1
  111. package/vscode/src/vs/editor/common/services/editorSimpleWorker.js +2 -1
  112. package/vscode/src/vs/editor/common/services/getIconClasses.js +4 -1
  113. package/vscode/src/vs/editor/common/services/semanticTokensProviderStyling.js +3 -3
  114. package/vscode/src/vs/editor/common/standalone/standaloneEnums.js +9 -8
  115. package/vscode/src/vs/editor/common/standaloneStrings.js +18 -18
  116. package/vscode/src/vs/editor/common/viewEvents.js +2 -0
  117. package/vscode/src/vs/editor/common/viewModel/glyphLanesModel.js +55 -0
  118. package/vscode/src/vs/editor/common/viewModel/viewModelImpl.js +4 -1
  119. package/vscode/src/vs/editor/contrib/clipboard/browser/clipboard.js +5 -1
  120. package/vscode/src/vs/editor/contrib/codeAction/browser/codeAction.js +1 -0
  121. package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionController.js +46 -20
  122. package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionMenu.js +1 -1
  123. package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionModel.js +38 -11
  124. package/vscode/src/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +56 -101
  125. package/vscode/src/vs/editor/contrib/codelens/browser/codelensWidget.js +3 -2
  126. package/vscode/src/vs/editor/contrib/colorPicker/browser/colorContributions.js +2 -2
  127. package/vscode/src/vs/editor/contrib/colorPicker/browser/colorHoverParticipant.js +10 -29
  128. package/vscode/src/vs/editor/contrib/colorPicker/browser/colorPickerWidget.js +4 -4
  129. package/vscode/src/vs/editor/contrib/diffEditorBreadcrumbs/browser/contribution.js +51 -0
  130. package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js +19 -1
  131. package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +38 -10
  132. package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +29 -1
  133. package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/edit.js +10 -3
  134. package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +3 -17
  135. package/vscode/src/vs/editor/contrib/find/browser/findController.js +3 -35
  136. package/vscode/src/vs/editor/contrib/folding/browser/foldingDecorations.js +26 -6
  137. package/vscode/src/vs/editor/contrib/fontZoom/browser/fontZoom.js +6 -6
  138. package/vscode/src/vs/editor/contrib/format/browser/format.js +9 -9
  139. package/vscode/src/vs/editor/contrib/format/browser/formatActions.js +5 -5
  140. package/vscode/src/vs/editor/contrib/gotoError/browser/media/gotoErrorWidget.css.js +1 -1
  141. package/vscode/src/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +2 -2
  142. package/vscode/src/vs/editor/contrib/hover/browser/contentHover.js +85 -76
  143. package/vscode/src/vs/editor/contrib/hover/browser/hover.js +120 -90
  144. package/vscode/src/vs/editor/contrib/hover/browser/marginHover.js +18 -6
  145. package/vscode/src/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +1 -1
  146. package/vscode/src/vs/editor/contrib/hover/browser/markerHoverParticipant.js +2 -2
  147. package/vscode/src/vs/editor/contrib/inlayHints/browser/inlayHints.js +4 -2
  148. package/vscode/src/vs/editor/contrib/inlayHints/browser/inlayHintsController.js +56 -38
  149. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/hoverParticipant.js +1 -1
  150. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsController.js +12 -0
  151. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsHintsWidget.js +4 -0
  152. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsModel.js +2 -2
  153. package/vscode/src/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +50 -53
  154. package/vscode/src/vs/editor/contrib/message/browser/messageController.js +5 -2
  155. package/vscode/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +1 -1
  156. package/vscode/src/vs/editor/contrib/semanticTokens/browser/documentSemanticTokens.js +5 -1
  157. package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScroll.css.js +1 -1
  158. package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +4 -4
  159. package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js +8 -5
  160. package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js +58 -46
  161. package/vscode/src/vs/editor/contrib/suggest/browser/suggestController.js +34 -7
  162. package/vscode/src/vs/editor/contrib/suggest/browser/suggestInlineCompletions.js +30 -38
  163. package/vscode/src/vs/editor/contrib/suggest/browser/suggestModel.js +2 -2
  164. package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidget.js +11 -3
  165. package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +18 -7
  166. package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +8 -10
  167. package/vscode/src/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
  168. package/vscode/src/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +7 -6
  169. package/vscode/src/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +3 -0
  170. package/vscode/src/vs/editor/editor.api.d.ts +82 -11
  171. package/vscode/src/vs/editor/standalone/browser/quickInput/standaloneQuickInputService.js +8 -3
  172. package/vscode/src/vs/editor/standalone/browser/standaloneLayoutService.js +4 -3
  173. package/vscode/src/vs/editor/standalone/browser/standaloneServices.js +22 -11
  174. package/vscode/src/vs/editor/standalone/browser/standaloneThemeService.js +1 -1
  175. package/vscode/src/vs/nls.d.ts +6 -0
  176. package/vscode/src/vs/platform/accessibility/browser/accessibilityService.js +4 -1
  177. package/vscode/src/vs/platform/accessibility/common/accessibility.d.ts +2 -16
  178. package/vscode/src/vs/platform/accessibility/common/accessibility.js +1 -2
  179. package/vscode/src/vs/platform/action/common/actionCommonCategories.d.ts +7 -20
  180. package/vscode/src/vs/platform/action/common/actionCommonCategories.js +8 -8
  181. package/vscode/src/vs/platform/actionWidget/browser/actionList.js +0 -1
  182. package/vscode/src/vs/platform/actionWidget/browser/actionWidget.css.js +1 -1
  183. package/vscode/src/vs/platform/actions/browser/buttonbar.js +2 -0
  184. package/vscode/src/vs/platform/actions/browser/dropdownWithPrimaryActionViewItem.js +5 -0
  185. package/vscode/src/vs/platform/actions/browser/menuEntryActionViewItem.css.js +1 -1
  186. package/vscode/src/vs/platform/actions/browser/menuEntryActionViewItem.js +2 -2
  187. package/vscode/src/vs/platform/actions/common/actions.d.ts +9 -1
  188. package/vscode/src/vs/platform/actions/common/actions.js +12 -1
  189. package/vscode/src/vs/platform/audioCues/browser/audioCueService.d.ts +11 -1
  190. package/vscode/src/vs/platform/audioCues/browser/audioCueService.js +174 -28
  191. package/vscode/src/vs/platform/clipboard/browser/clipboardService.js +38 -5
  192. package/vscode/src/vs/platform/configuration/common/configuration.d.ts +0 -1
  193. package/vscode/src/vs/platform/environment/common/environmentService.js +1 -1
  194. package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.d.ts +5 -1
  195. package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.js +24 -5
  196. package/vscode/src/vs/platform/extensions/common/extensions.d.ts +6 -1
  197. package/vscode/src/vs/{workbench/services → platform}/hover/browser/hover.d.ts +6 -8
  198. package/vscode/src/vs/platform/hover/browser/hover.js +3 -0
  199. package/vscode/src/vs/platform/instantiation/common/instantiationService.js +14 -4
  200. package/vscode/src/vs/platform/keybinding/common/abstractKeybindingService.js +11 -4
  201. package/vscode/src/vs/platform/keybinding/common/keybinding.d.ts +7 -0
  202. package/vscode/src/vs/platform/layout/browser/layoutService.d.ts +6 -0
  203. package/vscode/src/vs/platform/list/browser/listService.js +7 -5
  204. package/vscode/src/vs/platform/log/common/bufferLog.js +1 -0
  205. package/vscode/src/vs/platform/log/common/log.d.ts +0 -1
  206. package/vscode/src/vs/platform/log/common/log.js +1 -2
  207. package/vscode/src/vs/platform/notification/common/notification.d.ts +36 -19
  208. package/vscode/src/vs/platform/notification/common/notification.js +9 -3
  209. package/vscode/src/vs/platform/quickinput/browser/pickerQuickAccess.js +4 -1
  210. package/vscode/src/vs/platform/quickinput/browser/quickInput.js +50 -48
  211. package/vscode/src/vs/platform/quickinput/browser/quickInputController.js +3 -5
  212. package/vscode/src/vs/platform/quickinput/browser/quickInputList.js +49 -66
  213. package/vscode/src/vs/platform/quickinput/browser/quickInputService.js +11 -3
  214. package/vscode/src/vs/platform/quickinput/browser/quickInputUtils.js +16 -2
  215. package/vscode/src/vs/platform/quickinput/common/quickInput.d.ts +230 -26
  216. package/vscode/src/vs/platform/remote/common/remoteAuthorityResolver.d.ts +1 -0
  217. package/vscode/src/vs/platform/telemetry/common/telemetryUtils.js +1 -0
  218. package/vscode/src/vs/platform/theme/browser/defaultStyles.js +5 -3
  219. package/vscode/src/vs/platform/theme/common/colorRegistry.js +28 -9
  220. package/vscode/src/vs/platform/tunnel/common/tunnel.d.ts +2 -0
  221. package/vscode/src/vs/platform/window/common/window.js +14 -8
  222. package/vscode/src/vs/workbench/api/common/extHost.api.impl.js +97 -78
  223. package/vscode/src/vs/workbench/api/common/extHost.protocol.js +1 -1
  224. package/vscode/src/vs/workbench/api/common/extHostAuthentication.js +1 -22
  225. package/vscode/src/vs/workbench/api/common/extHostChat.js +0 -6
  226. package/vscode/src/vs/workbench/api/common/extHostChatAgents2.js +31 -36
  227. package/vscode/src/vs/workbench/api/common/extHostChatVariables.js +1 -1
  228. package/vscode/src/vs/workbench/api/common/extHostComments.js +6 -1
  229. package/vscode/src/vs/workbench/api/common/extHostConsoleForwarder.js +1 -0
  230. package/vscode/src/vs/workbench/api/common/extHostDebugService.js +130 -6
  231. package/vscode/src/vs/workbench/api/common/extHostDocumentContentProviders.js +28 -15
  232. package/vscode/src/vs/workbench/api/common/extHostDocuments.js +4 -5
  233. package/vscode/src/vs/workbench/api/common/extHostExtensionService.js +5 -1
  234. package/vscode/src/vs/workbench/api/common/extHostFileSystem.js +1 -2
  235. package/vscode/src/vs/workbench/api/common/extHostFileSystemConsumer.js +2 -2
  236. package/vscode/src/vs/workbench/api/common/extHostInlineChat.js +35 -33
  237. package/vscode/src/vs/workbench/api/common/extHostLanguageFeatures.js +40 -13
  238. package/vscode/src/vs/workbench/api/common/extHostMessageService.js +10 -1
  239. package/vscode/src/vs/workbench/api/common/extHostNotebook.js +11 -7
  240. package/vscode/src/vs/workbench/api/common/extHostNotebookEditors.js +2 -3
  241. package/vscode/src/vs/workbench/api/common/extHostNotebookKernels.js +29 -4
  242. package/vscode/src/vs/workbench/api/common/extHostProfileContentHandler.js +1 -1
  243. package/vscode/src/vs/workbench/api/common/extHostProgress.js +1 -7
  244. package/vscode/src/vs/workbench/api/common/extHostSCM.js +49 -93
  245. package/vscode/src/vs/workbench/api/common/extHostSpeech.js +21 -0
  246. package/vscode/src/vs/workbench/api/common/extHostTask.js +18 -22
  247. package/vscode/src/vs/workbench/api/common/extHostTelemetry.js +1 -0
  248. package/vscode/src/vs/workbench/api/common/extHostTerminalService.js +3 -3
  249. package/vscode/src/vs/workbench/api/common/extHostTesting.js +55 -36
  250. package/vscode/src/vs/workbench/api/common/extHostTextEditor.js +5 -2
  251. package/vscode/src/vs/workbench/api/common/extHostTextEditors.js +6 -7
  252. package/vscode/src/vs/workbench/api/common/extHostTreeViews.js +6 -3
  253. package/vscode/src/vs/workbench/api/common/extHostTunnelService.js +4 -2
  254. package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +74 -12
  255. package/vscode/src/vs/workbench/api/common/extHostTypes.js +27 -8
  256. package/vscode/src/vs/workbench/api/worker/extHostConsoleForwarder.js +1 -1
  257. package/vscode/src/vs/workbench/browser/actions/layoutActions.js +172 -103
  258. package/vscode/src/vs/workbench/browser/actions/windowActions.js +13 -17
  259. package/vscode/src/vs/workbench/browser/actions/workspaceActions.js +34 -34
  260. package/vscode/src/vs/workbench/browser/actions/workspaceCommands.js +4 -4
  261. package/vscode/src/vs/workbench/browser/dnd.js +2 -2
  262. package/vscode/src/vs/workbench/browser/labels.js +34 -4
  263. package/vscode/src/vs/workbench/browser/part.js +2 -2
  264. package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions.js +4 -4
  265. package/vscode/src/vs/workbench/browser/parts/compositeBarActions.js +1 -1
  266. package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsControl.js +801 -0
  267. package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsModel.js +140 -0
  268. package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsPicker.js +410 -0
  269. package/vscode/src/vs/workbench/browser/parts/editor/editor.js +1 -2
  270. package/vscode/src/vs/workbench/browser/parts/editor/editorActions.js +304 -303
  271. package/vscode/src/vs/workbench/browser/parts/editor/editorAutoSave.js +101 -47
  272. package/vscode/src/vs/workbench/browser/parts/editor/editorCommands.js +114 -47
  273. package/vscode/src/vs/workbench/browser/parts/editor/editorGroupView.js +1313 -0
  274. package/vscode/src/vs/workbench/browser/parts/editor/editorGroupWatermark.js +190 -0
  275. package/vscode/src/vs/workbench/browser/parts/editor/editorPanes.js +344 -0
  276. package/vscode/src/vs/workbench/browser/parts/editor/editorQuickAccess.js +1 -1
  277. package/vscode/src/vs/workbench/browser/parts/editor/editorStatus.js +10 -10
  278. package/vscode/src/vs/workbench/browser/parts/editor/editorTabsControl.js +27 -42
  279. package/vscode/src/vs/workbench/browser/parts/editor/editorTitleControl.js +152 -0
  280. package/vscode/src/vs/workbench/browser/parts/editor/editorsObserver.js +8 -8
  281. package/vscode/src/vs/workbench/browser/parts/editor/media/breadcrumbscontrol.css.js +4 -0
  282. package/vscode/src/vs/workbench/browser/parts/editor/media/editorgroupview.css.js +4 -0
  283. package/vscode/src/vs/workbench/browser/parts/editor/media/editortitlecontrol.css.js +4 -0
  284. package/vscode/src/vs/workbench/browser/parts/editor/media/multieditortabscontrol.css.js +4 -0
  285. package/vscode/src/vs/workbench/browser/parts/editor/media/singleeditortabscontrol.css.js +4 -0
  286. package/vscode/src/vs/workbench/browser/parts/editor/multiEditorTabsControl.js +1626 -0
  287. package/vscode/src/vs/workbench/browser/parts/editor/multiRowEditorTabsControl.js +150 -0
  288. package/vscode/src/vs/workbench/browser/parts/editor/noEditorTabsControl.js +52 -0
  289. package/vscode/src/vs/workbench/browser/parts/editor/singleEditorTabsControl.js +260 -0
  290. package/vscode/src/vs/workbench/browser/parts/editor/textEditor.js +1 -1
  291. package/vscode/src/vs/workbench/browser/parts/editor/textResourceEditor.js +2 -2
  292. package/vscode/src/vs/workbench/browser/parts/globalCompositeBar.js +39 -36
  293. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsCommands.js +68 -28
  294. package/vscode/src/vs/workbench/browser/parts/panel/media/panelpart.css.js +1 -1
  295. package/vscode/src/vs/workbench/browser/parts/panel/panelActions.js +15 -14
  296. package/vscode/src/vs/workbench/browser/parts/titlebar/menubarControl.js +18 -17
  297. package/vscode/src/vs/workbench/browser/parts/titlebar/windowTitle.js +1 -1
  298. package/vscode/src/vs/workbench/browser/parts/views/media/views.css.js +1 -1
  299. package/vscode/src/vs/workbench/browser/parts/views/treeView.js +7 -10
  300. package/vscode/src/vs/workbench/browser/parts/views/viewPane.js +2 -1
  301. package/vscode/src/vs/workbench/browser/parts/views/viewPaneContainer.d.ts +2 -1
  302. package/vscode/src/vs/workbench/browser/parts/views/viewPaneContainer.js +18 -17
  303. package/vscode/src/vs/workbench/browser/quickaccess.js +33 -1
  304. package/vscode/src/vs/workbench/browser/web.api.d.ts +6 -0
  305. package/vscode/src/vs/workbench/browser/window.js +92 -9
  306. package/vscode/src/vs/workbench/browser/workbench.contribution.js +114 -65
  307. package/vscode/src/vs/workbench/common/component.d.ts +5 -1
  308. package/vscode/src/vs/workbench/common/component.js +6 -0
  309. package/vscode/src/vs/workbench/common/configuration.js +11 -1
  310. package/vscode/src/vs/workbench/common/contextkeys.js +8 -4
  311. package/vscode/src/vs/workbench/common/editor/editorInput.d.ts +6 -0
  312. package/vscode/src/vs/workbench/common/editor/editorInput.js +3 -0
  313. package/vscode/src/vs/workbench/common/editor/filteredEditorGroupModel.js +107 -0
  314. package/vscode/src/vs/workbench/common/editor/resourceEditorInput.d.ts +6 -3
  315. package/vscode/src/vs/workbench/common/editor/resourceEditorInput.js +21 -3
  316. package/vscode/src/vs/workbench/common/editor/textResourceEditorInput.d.ts +2 -1
  317. package/vscode/src/vs/workbench/common/editor/textResourceEditorInput.js +9 -6
  318. package/vscode/src/vs/workbench/common/editor.d.ts +16 -4
  319. package/vscode/src/vs/workbench/common/editor.js +7 -1
  320. package/vscode/src/vs/workbench/common/memento.js +33 -12
  321. package/vscode/src/vs/workbench/common/notifications.js +30 -7
  322. package/vscode/src/vs/workbench/common/theme.js +61 -1
  323. package/vscode/src/vs/workbench/common/views.d.ts +1 -28
  324. package/vscode/src/vs/workbench/common/views.js +1 -2
  325. package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.js +232 -19
  326. package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityContributions.js +9 -9
  327. package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleView.js +1 -0
  328. package/vscode/src/vs/workbench/contrib/accessibility/browser/editorAccessibilityHelp.js +19 -31
  329. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +8 -3
  330. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.js +57 -38
  331. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +4 -4
  332. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditorInput.js +9 -2
  333. package/vscode/src/vs/workbench/contrib/chat/browser/chatFollowups.js +7 -0
  334. package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPart.js +31 -20
  335. package/vscode/src/vs/workbench/contrib/chat/browser/chatListRenderer.js +93 -49
  336. package/vscode/src/vs/workbench/contrib/chat/browser/chatMarkdownDecorationsRenderer.js +30 -6
  337. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommandContentWidget.js +24 -12
  338. package/vscode/src/vs/workbench/contrib/chat/browser/chatWidget.js +9 -5
  339. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables.js +12 -1
  340. package/vscode/src/vs/workbench/contrib/chat/browser/media/chat.css.js +1 -1
  341. package/vscode/src/vs/workbench/contrib/chat/common/chatContextKeys.js +2 -1
  342. package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +21 -43
  343. package/vscode/src/vs/workbench/contrib/chat/common/chatService.js +6 -6
  344. package/vscode/src/vs/workbench/contrib/codeActions/browser/codeActionsContribution.js +4 -4
  345. package/vscode/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.css.js +1 -1
  346. package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleMultiCursorModifier.js +4 -4
  347. package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleWordWrap.js +0 -3
  348. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +1 -1
  349. package/vscode/src/vs/workbench/contrib/comments/browser/{comments.contribution.js → commentsAccessibility.js} +36 -128
  350. package/vscode/src/vs/workbench/contrib/comments/browser/reactionsAction.js +41 -18
  351. package/vscode/src/vs/workbench/contrib/debug/browser/baseDebugView.js +202 -0
  352. package/vscode/src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.js +27 -4
  353. package/vscode/src/vs/workbench/contrib/debug/browser/breakpointWidget.js +165 -52
  354. package/vscode/src/vs/workbench/contrib/debug/browser/breakpointsView.js +48 -31
  355. package/vscode/src/vs/workbench/contrib/debug/browser/debugIcons.js +6 -1
  356. package/vscode/src/vs/workbench/contrib/debug/browser/media/breakpointWidget.css.js +1 -1
  357. package/vscode/src/vs/workbench/contrib/debug/common/debug.d.ts +40 -10
  358. package/vscode/src/vs/workbench/contrib/debug/common/debug.js +28 -1
  359. package/vscode/src/vs/workbench/contrib/debug/common/debugContext.js +14 -0
  360. package/vscode/src/vs/workbench/contrib/debug/common/debugModel.js +52 -23
  361. package/vscode/src/vs/workbench/contrib/debug/common/debugSource.js +1 -1
  362. package/vscode/src/vs/workbench/contrib/debug/common/debugVisualizers.js +164 -0
  363. package/vscode/src/vs/workbench/contrib/debug/common/disassemblyViewInput.js +10 -0
  364. package/vscode/src/vs/workbench/contrib/debug/common/replModel.js +285 -0
  365. package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.js +123 -78
  366. package/vscode/src/vs/workbench/contrib/extensions/common/extensionsInput.js +10 -0
  367. package/vscode/src/vs/workbench/contrib/files/browser/editors/fileEditorInput.js +3 -19
  368. package/vscode/src/vs/workbench/contrib/files/browser/explorerViewlet.js +1 -2
  369. package/vscode/src/vs/workbench/contrib/files/browser/fileActions.js +8 -9
  370. package/vscode/src/vs/workbench/contrib/files/browser/files.configuration.contribution.js +70 -2
  371. package/vscode/src/vs/workbench/contrib/files/browser/files.d.ts +5 -2
  372. package/vscode/src/vs/workbench/contrib/files/browser/views/emptyView.js +2 -2
  373. package/vscode/src/vs/workbench/contrib/files/browser/views/explorerView.js +34 -17
  374. package/vscode/src/vs/workbench/contrib/files/browser/views/explorerViewer.js +5 -4
  375. package/vscode/src/vs/workbench/contrib/files/browser/views/openEditorsView.js +48 -14
  376. package/vscode/src/vs/workbench/contrib/format/browser/formatActionsMultiple.js +16 -8
  377. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.css.js +1 -1
  378. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +317 -321
  379. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatLivePreviewWidget.js +17 -24
  380. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSavingService.js +3 -0
  381. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.js +306 -130
  382. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.js +3 -0
  383. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.js +385 -613
  384. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +69 -64
  385. package/vscode/src/vs/workbench/contrib/inlineChat/browser/utils.js +71 -3
  386. package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +39 -44
  387. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.js +5 -3
  388. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +1 -1
  389. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findModel.js +1 -1
  390. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/coreActions.js +4 -4
  391. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/foldingController.js +3 -3
  392. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellChat.css.js +1 -1
  393. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookEditorStickyScroll.css.js +1 -1
  394. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditor.js +38 -7
  395. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +36 -8
  396. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookOptions.js +32 -12
  397. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellPart.js +24 -14
  398. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.js +4 -4
  399. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellStatusPart.js +1 -1
  400. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbarStickyScroll.js +1 -2
  401. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatActions.js +264 -12
  402. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatController.js +60 -27
  403. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.js +12 -5
  404. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellExecutionIcon.js +2 -2
  405. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellList.js +2 -2
  406. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.js +12 -9
  407. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.js +6 -3
  408. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.js +1 -0
  409. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorStickyScroll.js +188 -155
  410. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelView.js +4 -4
  411. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellTextModel.js +10 -3
  412. package/vscode/src/vs/workbench/contrib/notebook/common/notebookCommon.js +16 -33
  413. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorInput.js +9 -7
  414. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.js +6 -2
  415. package/vscode/src/vs/workbench/contrib/notebook/common/notebookKernelService.js +2 -1
  416. package/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.js +29 -14
  417. package/vscode/src/vs/workbench/contrib/remote/browser/tunnelView.js +15 -3
  418. package/vscode/src/vs/workbench/contrib/remote/browser/urlFinder.js +2 -2
  419. package/vscode/src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.js +22 -6
  420. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsFind.js +1 -1
  421. package/vscode/src/vs/workbench/contrib/search/browser/searchModel.js +16 -17
  422. package/vscode/src/vs/workbench/contrib/snippets/browser/snippetCompletionProvider.js +78 -50
  423. package/vscode/src/vs/workbench/contrib/speech/common/speechService.js +15 -1
  424. package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.d.ts +25 -45
  425. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalEditorInput.js +12 -4
  426. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalIcon.js +2 -1
  427. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.js +33 -36
  428. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationStyles.js +1 -1
  429. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/markNavigationAddon.js +3 -0
  430. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.d.ts +5 -8
  431. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.js +15 -27
  432. package/vscode/src/vs/workbench/contrib/terminal/common/terminalColorRegistry.js +3 -3
  433. package/vscode/src/vs/workbench/contrib/testing/common/testCoverage.js +38 -22
  434. package/vscode/src/vs/workbench/contrib/testing/common/testCoverageService.js +5 -2
  435. package/vscode/src/vs/workbench/contrib/testing/common/testProfileService.js +60 -40
  436. package/vscode/src/vs/workbench/contrib/testing/common/testResult.js +2 -2
  437. package/vscode/src/vs/workbench/contrib/testing/common/testResultStorage.js +15 -11
  438. package/vscode/src/vs/workbench/contrib/testing/common/testService.js +26 -1
  439. package/vscode/src/vs/workbench/contrib/testing/common/testTypes.js +24 -23
  440. package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService.js +1 -1
  441. package/vscode/src/vs/workbench/services/authentication/browser/authenticationService.js +124 -26
  442. package/vscode/src/vs/workbench/services/authentication/common/authentication.d.ts +68 -0
  443. package/vscode/src/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.js +76 -36
  444. package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolver.js +1 -0
  445. package/vscode/src/vs/workbench/services/configurationResolver/common/variableResolver.js +1 -0
  446. package/vscode/src/vs/workbench/services/editor/browser/editorService.js +15 -3
  447. package/vscode/src/vs/workbench/services/editor/common/editorGroupFinder.js +10 -1
  448. package/vscode/src/vs/workbench/services/editor/common/editorGroupsService.d.ts +51 -43
  449. package/vscode/src/vs/workbench/services/editor/common/editorService.d.ts +13 -8
  450. package/vscode/src/vs/workbench/services/editor/common/editorService.js +2 -1
  451. package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionBisect.js +10 -10
  452. package/vscode/src/vs/workbench/services/extensions/browser/extensionUrlHandler.js +8 -8
  453. package/vscode/src/vs/workbench/services/extensions/common/extensionsApiProposals.js +7 -7
  454. package/vscode/src/vs/workbench/services/extensions/common/rpcProtocol.js +1 -0
  455. package/vscode/src/vs/workbench/services/filesConfiguration/common/filesConfigurationService.d.ts +29 -9
  456. package/vscode/src/vs/workbench/services/filesConfiguration/common/filesConfigurationService.js +160 -63
  457. package/vscode/src/vs/workbench/services/host/browser/host.d.ts +8 -0
  458. package/vscode/src/vs/workbench/services/keybinding/common/keybindingEditing.js +60 -72
  459. package/vscode/src/vs/workbench/services/layout/browser/layoutService.d.ts +0 -4
  460. package/vscode/src/vs/workbench/services/notebook/common/notebookDocumentService.js +56 -0
  461. package/vscode/src/vs/workbench/services/output/common/output.js +2 -2
  462. package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorInput.js +10 -0
  463. package/vscode/src/vs/workbench/services/preferences/common/preferencesEditorInput.js +10 -0
  464. package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.js +2 -1
  465. package/vscode/src/vs/workbench/services/textfile/common/textFileEditorModel.js +5 -4
  466. package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorInput.js +21 -8
  467. package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorService.d.ts +4 -0
  468. package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorService.js +3 -0
  469. package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfile.js +4 -4
  470. package/vscode/src/vs/workbench/{browser/parts/views → services/views/browser}/viewsService.js +20 -15
  471. package/vscode/src/vs/workbench/services/views/common/viewsService.d.ts +34 -0
  472. package/vscode/src/vs/workbench/services/{hover/browser/hover.js → views/common/viewsService.js} +2 -2
  473. package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopy.d.ts +6 -1
  474. package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopy.js +5 -2
  475. package/vscode/src/vs/workbench/services/workspaces/common/workspaceTrust.js +1 -0
  476. package/vscode-dts/vscode.proposed.chatAgents2.d.ts +112 -47
  477. package/vscode-dts/vscode.proposed.chatAgents2Additions.d.ts +68 -9
  478. package/vscode-dts/{vscode.proposed.scmInputBoxActionButton.d.ts → vscode.proposed.codeActionRanges.d.ts} +8 -10
  479. package/vscode-dts/{vscode.proposed.readonlyMessage.d.ts → vscode.proposed.commentReactor.d.ts} +3 -4
  480. package/vscode-dts/vscode.proposed.contribMultiDiffEditorMenus.d.ts +6 -0
  481. package/vscode-dts/vscode.proposed.contribSourceControlHistoryItemGroupMenu.d.ts +8 -0
  482. package/vscode-dts/vscode.proposed.contribSourceControlHistoryItemMenu.d.ts +8 -0
  483. package/vscode-dts/vscode.proposed.debugVisualization.d.ts +100 -0
  484. package/vscode-dts/vscode.proposed.defaultChatAgent.d.ts +1 -1
  485. package/vscode-dts/vscode.proposed.interactive.d.ts +13 -16
  486. package/vscode-dts/vscode.proposed.notebookVariableProvider.d.ts +4 -1
  487. package/vscode-dts/vscode.proposed.resolvers.d.ts +4 -0
  488. package/vscode-dts/vscode.proposed.scmHistoryProvider.d.ts +4 -10
  489. package/vscode-dts/vscode.proposed.scmMultiDiffEditor.d.ts +34 -0
  490. package/vscode-dts/vscode.proposed.speech.d.ts +17 -3
  491. package/vscode-dts/vscode.proposed.testCoverage.d.ts +7 -1
  492. package/vscode-dts/vscode.proposed.tunnelFactory.d.ts +4 -0
  493. package/vscode/src/vs/editor/browser/widget/diffEditor/colors.js +0 -17
  494. package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditorDecorations.js +0 -231
  495. package/vscode/src/vs/editor/browser/widget/diffEditor/outlineModel.js +0 -299
  496. package/vscode/src/vs/editor/browser/widget/diffEditor/workerBasedDocumentDiffProvider.js +0 -101
  497. package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/suggestAddon.js +0 -390
  498. package/vscode/src/vs/workbench/services/editor/common/editorGroupColumn.d.ts +0 -10
  499. package/vscode/src/vs/workbench/services/suggest/browser/media/suggest.css.js +0 -4
  500. package/vscode/src/vs/workbench/services/suggest/browser/simpleCompletionItem.d.ts +0 -28
  501. package/vscode/src/vs/workbench/services/suggest/browser/simpleCompletionItem.js +0 -10
  502. package/vscode/src/vs/workbench/services/suggest/browser/simpleCompletionModel.d.ts +0 -30
  503. package/vscode/src/vs/workbench/services/suggest/browser/simpleCompletionModel.js +0 -98
  504. package/vscode/src/vs/workbench/services/suggest/browser/simpleSuggestWidget.d.ts +0 -10
  505. package/vscode/src/vs/workbench/services/suggest/browser/simpleSuggestWidget.js +0 -428
  506. package/vscode/src/vs/workbench/services/suggest/browser/simpleSuggestWidgetRenderer.js +0 -83
  507. package/vscode-dts/vscode.proposed.chatVariables.d.ts +0 -39
  508. package/vscode-dts/vscode.proposed.interactiveUserActions.d.ts +0 -77
  509. package/vscode-dts/vscode.proposed.saveEditor.d.ts +0 -35
  510. package/vscode-dts/vscode.proposed.scmInputBoxValueProvider.d.ts +0 -25
  511. package/vscode-dts/vscode.proposed.testingActiveProfile.d.ts +0 -21
@@ -1,7 +1,6 @@
1
1
  import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
2
  import { renderMarkdownAsPlaintext } from '../../../../base/browser/markdownRenderer.js';
3
3
  import { alert } from '../../../../base/browser/ui/aria/aria.js';
4
- import { coalesceInPlace } from '../../../../base/common/arrays.js';
5
4
  import { raceCancellationError, raceCancellation, Barrier, Queue } from '../../../../base/common/async.js';
6
5
  import { CancellationTokenSource } from '../../../../base/common/cancellation.js';
7
6
  import { toErrorMessage } from '../../../../base/common/errorMessage.js';
@@ -17,9 +16,7 @@ import { generateUuid } from '../../../../base/common/uuid.js';
17
16
  import { IBulkEditService } from '../../../../editor/browser/services/bulkEditService.js';
18
17
  import { Position } from '../../../../editor/common/core/position.js';
19
18
  import { Range } from '../../../../editor/common/core/range.js';
20
- import { Selection } from '../../../../editor/common/core/selection.js';
21
19
  import { TextEdit } from '../../../../editor/common/languages.js';
22
- import { ModelDecorationOptions } from '../../../../editor/common/model/textModel.js';
23
20
  import { IEditorWorkerService } from '../../../../editor/common/services/editorWorker.js';
24
21
  import { InlineCompletionsController } from '../../../../editor/contrib/inlineCompletions/browser/inlineCompletionsController.js';
25
22
  import { localizeWithPath } from '../../../../nls.js';
@@ -35,42 +32,27 @@ import { IChatWidgetService, IChatAccessibilityService } from '../../chat/browse
35
32
  import { IChatAgentService } from '../../chat/common/chatAgents.js';
36
33
  import { chatSubcommandLeader, chatAgentLeader } from '../../chat/common/chatParserTypes.js';
37
34
  import { IChatService } from '../../chat/common/chatService.js';
38
- import { ReplyResponse, SessionPrompt, SessionExchange, EmptyResponse, ErrorResponse, ExpansionState, IInlineChatSessionService } from './inlineChatSession.js';
39
- import { LivePreviewStrategy, PreviewStrategy, LiveStrategy3, LiveStrategy } from './inlineChatStrategies.js';
35
+ import { IInlineChatSavingService } from './inlineChatSavingService.js';
36
+ import { ReplyResponse, SessionPrompt, SessionExchange, EmptyResponse, ErrorResponse, ExpansionState } from './inlineChatSession.js';
37
+ import { IInlineChatSessionService } from './inlineChatSessionService.js';
38
+ import { LivePreviewStrategy, PreviewStrategy, LiveStrategy } from './inlineChatStrategies.js';
40
39
  import { InlineChatZoneWidget } from './inlineChatWidget.js';
41
- import { INLINE_CHAT_ID, CTX_INLINE_CHAT_HAS_ACTIVE_REQUEST, CTX_INLINE_CHAT_DID_EDIT, CTX_INLINE_CHAT_USER_DID_EDIT, CTX_INLINE_CHAT_RESPONSE_TYPES, CTX_INLINE_CHAT_LAST_RESPONSE_TYPE, CTX_INLINE_CHAT_LAST_FEEDBACK, CTX_INLINE_CHAT_SUPPORT_ISSUE_REPORTING, CTX_INLINE_CHAT_HAS_STASHED_SESSION } from '../common/inlineChat.js';
40
+ import { INLINE_CHAT_ID, CTX_INLINE_CHAT_HAS_ACTIVE_REQUEST, CTX_INLINE_CHAT_DID_EDIT, CTX_INLINE_CHAT_USER_DID_EDIT, CTX_INLINE_CHAT_RESPONSE_TYPES, CTX_INLINE_CHAT_LAST_FEEDBACK, CTX_INLINE_CHAT_SUPPORT_ISSUE_REPORTING } from '../common/inlineChat.js';
41
+ import { ICommandService } from '../../../../platform/commands/common/commands.js';
42
42
  import { IDialogService } from '../../../../platform/dialogs/common/dialogs.js';
43
43
  var InlineChatController_1;
44
- class InlineChatRunOptions {
45
- static isInteractiveEditorOptions(options) {
46
- const { initialSelection, initialRange, message, autoSend, position } = options;
47
- if (typeof message !== 'undefined' && typeof message !== 'string'
48
- || typeof autoSend !== 'undefined' && typeof autoSend !== 'boolean'
49
- || typeof initialRange !== 'undefined' && !Range.isIRange(initialRange)
50
- || typeof initialSelection !== 'undefined' && !Selection.isISelection(initialSelection)
51
- || typeof position !== 'undefined' && !Position.isIPosition(position)) {
52
- return false;
53
- }
54
- return true;
55
- }
56
- }
57
44
  let InlineChatController = class InlineChatController {
58
45
  static { InlineChatController_1 = this; }
59
46
  static get(editor) {
60
47
  return editor.getContribution(INLINE_CHAT_ID);
61
48
  }
62
- static { this._decoBlock = ModelDecorationOptions.register({
63
- description: 'inline-chat',
64
- showIfCollapsed: false,
65
- isWholeLine: true,
66
- className: 'inline-chat-block-selection',
67
- }); }
68
49
  static { this._storageKey = 'inline-chat-history'; }
69
50
  static { this._promptHistory = []; }
70
- constructor(_editor, _instaService, _inlineChatSessionService, _editorWorkerService, _logService, _configurationService, _dialogService, contextKeyService, _accessibilityService, _chatAccessibilityService, _chatAgentService, _bulkEditService, _storageService) {
51
+ constructor(_editor, _instaService, _inlineChatSessionService, _inlineChatSavingService, _editorWorkerService, _logService, _configurationService, _dialogService, contextKeyService, _accessibilityService, _chatAccessibilityService, _chatAgentService, _bulkEditService, _storageService, _commandService) {
71
52
  this._editor = _editor;
72
53
  this._instaService = _instaService;
73
54
  this._inlineChatSessionService = _inlineChatSessionService;
55
+ this._inlineChatSavingService = _inlineChatSavingService;
74
56
  this._editorWorkerService = _editorWorkerService;
75
57
  this._logService = _logService;
76
58
  this._configurationService = _configurationService;
@@ -80,7 +62,10 @@ let InlineChatController = class InlineChatController {
80
62
  this._chatAgentService = _chatAgentService;
81
63
  this._bulkEditService = _bulkEditService;
82
64
  this._storageService = _storageService;
65
+ this._commandService = _commandService;
83
66
  this._historyOffset = -1;
67
+ this._historyCandidate = '';
68
+ this._isDisposed = false;
84
69
  this._store = ( new DisposableStore());
85
70
  this._messages = this._store.add(( new Emitter()));
86
71
  this._onWillStartSession = this._store.add(( new Emitter()));
@@ -89,29 +74,32 @@ let InlineChatController = class InlineChatController {
89
74
  this.onDidCancelInput = Event.filter(this._messages.event, m => m === 16 || m === 2 , this._store);
90
75
  this._sessionStore = this._store.add(( new DisposableStore()));
91
76
  this._stashedSession = this._store.add(( new MutableDisposable()));
92
- this._ignoreModelContentChanged = false;
93
77
  this._forcedPlaceholder = undefined;
94
78
  this._ctxHasActiveRequest = CTX_INLINE_CHAT_HAS_ACTIVE_REQUEST.bindTo(contextKeyService);
95
79
  this._ctxDidEdit = CTX_INLINE_CHAT_DID_EDIT.bindTo(contextKeyService);
96
80
  this._ctxUserDidEdit = CTX_INLINE_CHAT_USER_DID_EDIT.bindTo(contextKeyService);
97
81
  this._ctxResponseTypes = CTX_INLINE_CHAT_RESPONSE_TYPES.bindTo(contextKeyService);
98
- this._ctxLastResponseType = CTX_INLINE_CHAT_LAST_RESPONSE_TYPE.bindTo(contextKeyService);
99
82
  this._ctxLastFeedbackKind = CTX_INLINE_CHAT_LAST_FEEDBACK.bindTo(contextKeyService);
100
83
  this._ctxSupportIssueReporting = CTX_INLINE_CHAT_SUPPORT_ISSUE_REPORTING.bindTo(contextKeyService);
101
84
  this._zone = ( new Lazy(
102
85
  () => this._store.add(_instaService.createInstance(InlineChatZoneWidget, this._editor))
103
86
  ));
104
87
  this._store.add(this._editor.onDidChangeModel(async (e) => {
105
- if (this._activeSession || !e.newModelUrl) {
88
+ if (this._session || !e.newModelUrl) {
106
89
  return;
107
90
  }
108
91
  const existingSession = this._inlineChatSessionService.getSession(this._editor, e.newModelUrl);
109
92
  if (!existingSession) {
110
93
  return;
111
94
  }
112
- this._log('session RESUMING', e);
95
+ this._log('session RESUMING after model change', e);
113
96
  await this.run({ existingSession });
114
- this._log('session done or paused');
97
+ }));
98
+ this._store.add(this._inlineChatSessionService.onDidMoveSession(async (e) => {
99
+ if (e.editor === this._editor) {
100
+ this._log('session RESUMING after move', e);
101
+ await this.run({ existingSession: e.session });
102
+ }
115
103
  }));
116
104
  this._log('NEW controller');
117
105
  InlineChatController_1._promptHistory = JSON.parse(_storageService.get(InlineChatController_1._storageKey, 0 , '[]'));
@@ -122,17 +110,17 @@ let InlineChatController = class InlineChatController {
122
110
  }
123
111
  InlineChatController_1._promptHistory.unshift(prompt);
124
112
  this._historyOffset = -1;
113
+ this._historyCandidate = '';
125
114
  this._storageService.store(InlineChatController_1._storageKey, JSON.stringify(InlineChatController_1._promptHistory), 0 , 0 );
126
115
  };
127
116
  }
128
117
  dispose() {
129
- this._strategy?.dispose();
130
- this._stashedSession.clear();
131
- if (this._activeSession) {
132
- this._inlineChatSessionService.releaseSession(this._activeSession);
118
+ if (this._currentRun) {
119
+ this._messages.fire(((this._session?.lastExchange ? 4 : 2) ));
133
120
  }
134
121
  this._store.dispose();
135
- this._log('controller disposed');
122
+ this._isDisposed = true;
123
+ this._log('DISPOSED controller');
136
124
  }
137
125
  _log(message, ...more) {
138
126
  if (message instanceof Error) {
@@ -149,7 +137,7 @@ let InlineChatController = class InlineChatController {
149
137
  return INLINE_CHAT_ID;
150
138
  }
151
139
  _getMode() {
152
- const editMode = this._configurationService.inspect('inlineChat.mode');
140
+ const editMode = this._configurationService.inspect("inlineChat.mode" );
153
141
  let editModeValue = editMode.value;
154
142
  if (this._accessibilityService.isScreenReaderOptimized() && editModeValue === editMode.defaultValue) {
155
143
  editModeValue = "preview" ;
@@ -165,18 +153,20 @@ let InlineChatController = class InlineChatController {
165
153
  if (this._currentRun) {
166
154
  await this._currentRun;
167
155
  }
168
- this._stashedSession.clear();
169
156
  if (options.initialSelection) {
170
157
  this._editor.setSelection(options.initialSelection);
171
158
  }
159
+ this._historyOffset = -1;
160
+ this._historyCandidate = '';
161
+ this._stashedSession.clear();
172
162
  this._onWillStartSession.fire();
173
163
  this._currentRun = this._nextState("CREATE_SESSION" , options);
174
164
  await this._currentRun;
175
165
  }
176
166
  catch (error) {
177
167
  onUnexpectedError(error);
178
- if (this._activeSession) {
179
- this._inlineChatSessionService.releaseSession(this._activeSession);
168
+ if (this._session) {
169
+ this._inlineChatSessionService.releaseSession(this._session);
180
170
  }
181
171
  this["PAUSE" ]();
182
172
  }
@@ -184,56 +174,15 @@ let InlineChatController = class InlineChatController {
184
174
  this._currentRun = undefined;
185
175
  }
186
176
  }
187
- joinCurrentRun() {
188
- return this._currentRun;
189
- }
190
- _showWidget(initialRender = false, position) {
191
- assertType(this._editor.hasModel());
192
- let widgetPosition;
193
- if (position) {
194
- widgetPosition = position;
195
- }
196
- else if (this._zone.value.position) {
197
- if (this._zone.value.position.lineNumber === 1) {
198
- widgetPosition = this._zone.value.position.delta(-1);
199
- }
200
- else {
201
- widgetPosition = this._zone.value.position;
202
- }
203
- }
204
- else {
205
- widgetPosition = this._editor.getSelection().getStartPosition().delta(-1);
206
- }
207
- let needsMargin = false;
208
- if (initialRender) {
209
- this._zone.value.setContainerMargins();
210
- }
211
- if (this._activeSession && !position && (this._activeSession.hasChangedText || this._activeSession.lastExchange)) {
212
- widgetPosition = this._activeSession.wholeRange.value.getStartPosition().delta(-1);
213
- }
214
- if (this._activeSession) {
215
- this._zone.value.updateBackgroundColor(widgetPosition, this._activeSession.wholeRange.value);
216
- }
217
- if (this._strategy) {
218
- needsMargin = this._strategy.needsMargin();
219
- }
220
- if (!this._zone.value.position) {
221
- this._zone.value.setWidgetMargins(widgetPosition, !needsMargin ? 0 : undefined);
222
- this._zone.value.show(widgetPosition);
223
- }
224
- else {
225
- this._zone.value.updatePositionAndHeight(widgetPosition);
226
- }
227
- }
228
177
  async _nextState(state, options) {
229
178
  let nextState = state;
230
- while (nextState) {
179
+ while (nextState && !this._isDisposed) {
231
180
  this._log('setState to ', nextState);
232
181
  nextState = await this[nextState](options);
233
182
  }
234
183
  }
235
184
  async ["CREATE_SESSION" ](options) {
236
- assertType(this._activeSession === undefined);
185
+ assertType(this._session === undefined);
237
186
  assertType(this._editor.hasModel());
238
187
  let session = options.existingSession;
239
188
  let initPosition;
@@ -242,11 +191,6 @@ let InlineChatController = class InlineChatController {
242
191
  delete options.position;
243
192
  }
244
193
  this._showWidget(true, initPosition);
245
- this._zone.value.widget.updateInfo(( localizeWithPath(
246
- 'vs/workbench/contrib/inlineChat/browser/inlineChatController',
247
- 'welcome.1',
248
- "AI-generated code may be incorrect"
249
- )));
250
194
  this._updatePlaceholder();
251
195
  if (!session) {
252
196
  const createSessionCts = ( new CancellationTokenSource());
@@ -269,7 +213,10 @@ let InlineChatController = class InlineChatController {
269
213
  createSessionCts.dispose();
270
214
  msgListener.dispose();
271
215
  if (createSessionCts.token.isCancellationRequested) {
272
- return "PAUSE" ;
216
+ if (session) {
217
+ this._inlineChatSessionService.releaseSession(session);
218
+ }
219
+ return "CANCEL" ;
273
220
  }
274
221
  }
275
222
  delete options.initialRange;
@@ -290,52 +237,49 @@ let InlineChatController = class InlineChatController {
290
237
  case "live" :
291
238
  this._strategy = this._instaService.createInstance(LiveStrategy, session, this._editor, this._zone.value);
292
239
  break;
293
- case "live3" :
294
- this._strategy = this._instaService.createInstance(LiveStrategy3, session, this._editor, this._zone.value);
295
- break;
296
240
  case "preview" :
297
- this._strategy = this._instaService.createInstance(PreviewStrategy, session, this._zone.value);
241
+ this._strategy = this._instaService.createInstance(PreviewStrategy, session, this._editor, this._zone.value);
298
242
  break;
299
243
  case "livePreview" :
300
244
  default:
301
245
  this._strategy = this._instaService.createInstance(LivePreviewStrategy, session, this._editor, this._zone.value);
302
246
  break;
303
247
  }
304
- this._activeSession = session;
248
+ this._session = session;
305
249
  return "INIT_UI" ;
306
250
  }
307
251
  async ["INIT_UI" ](options) {
308
- assertType(this._activeSession);
252
+ assertType(this._session);
309
253
  assertType(this._strategy);
310
254
  InlineCompletionsController.get(this._editor)?.hide();
311
255
  this._sessionStore.clear();
256
+ this._sessionStore.add(this._zone.value.widget.onRequestWithoutIntentDetection(async () => {
257
+ options.withIntentDetection = false;
258
+ this.regenerate();
259
+ }));
312
260
  const wholeRangeDecoration = this._editor.createDecorationsCollection();
313
261
  const updateWholeRangeDecoration = () => {
314
- const ranges = [this._activeSession.wholeRange.value];
315
- const newDecorations = ( ranges.map(
316
- range => range.isEmpty() ? undefined : ({ range, options: InlineChatController_1._decoBlock })
317
- ));
318
- coalesceInPlace(newDecorations);
262
+ const newDecorations = this._strategy?.getWholeRangeDecoration() ?? [];
319
263
  wholeRangeDecoration.set(newDecorations);
320
264
  };
321
265
  this._sessionStore.add(toDisposable(() => wholeRangeDecoration.clear()));
322
- this._sessionStore.add(this._activeSession.wholeRange.onDidChange(updateWholeRangeDecoration));
266
+ this._sessionStore.add(this._session.wholeRange.onDidChange(updateWholeRangeDecoration));
323
267
  updateWholeRangeDecoration();
324
- this._zone.value.widget.updateSlashCommands(this._activeSession.session.slashCommands ?? []);
268
+ this._zone.value.widget.updateSlashCommands(this._session.session.slashCommands ?? []);
325
269
  this._updatePlaceholder();
326
- this._zone.value.widget.updateInfo(this._activeSession.session.message ?? ( localizeWithPath(
270
+ this._zone.value.widget.updateInfo(this._session.session.message ?? ( localizeWithPath(
327
271
  'vs/workbench/contrib/inlineChat/browser/inlineChatController',
328
272
  'welcome.1',
329
273
  "AI-generated code may be incorrect"
330
274
  )));
331
- this._zone.value.widget.preferredExpansionState = this._activeSession.lastExpansionState;
332
- this._zone.value.widget.value = this._activeSession.session.input ?? this._activeSession.lastInput?.value ?? this._zone.value.widget.value;
333
- if (this._activeSession.session.input) {
275
+ this._zone.value.widget.preferredExpansionState = this._session.lastExpansionState;
276
+ this._zone.value.widget.value = this._session.session.input ?? this._session.lastInput?.value ?? this._zone.value.widget.value;
277
+ if (this._session.session.input) {
334
278
  this._zone.value.widget.selectAll();
335
279
  }
336
280
  this._showWidget(true);
337
281
  this._sessionStore.add(this._editor.onDidChangeModel((e) => {
338
- const msg = this._activeSession?.lastExchange
282
+ const msg = this._session?.lastExchange
339
283
  ? 4
340
284
  : 2 ;
341
285
  this._log('model changed, pause or cancel session', msg, e);
@@ -343,25 +287,27 @@ let InlineChatController = class InlineChatController {
343
287
  }));
344
288
  const altVersionNow = this._editor.getModel()?.getAlternativeVersionId();
345
289
  this._sessionStore.add(this._editor.onDidChangeModelContent(e => {
346
- if (!this._ignoreModelContentChanged && this._strategy?.hasFocus()) {
290
+ if (!this._session?.hunkData.ignoreTextModelNChanges) {
347
291
  this._ctxUserDidEdit.set(altVersionNow !== this._editor.getModel()?.getAlternativeVersionId());
348
292
  }
349
- if (this._ignoreModelContentChanged || this._strategy?.hasFocus()) {
293
+ if (this._session?.hunkData.ignoreTextModelNChanges || this._strategy?.hasFocus()) {
350
294
  return;
351
295
  }
352
- const wholeRange = this._activeSession.wholeRange;
353
- let editIsOutsideOfWholeRange = false;
354
- for (const { range } of e.changes) {
355
- editIsOutsideOfWholeRange = !Range.areIntersectingOrTouching(range, wholeRange.value);
296
+ const wholeRange = this._session.wholeRange;
297
+ let shouldFinishSession = false;
298
+ if (this._configurationService.getValue("inlineChat.finishOnType" )) {
299
+ for (const { range } of e.changes) {
300
+ shouldFinishSession = !Range.areIntersectingOrTouching(range, wholeRange.value);
301
+ }
356
302
  }
357
- this._activeSession.recordExternalEditOccurred(editIsOutsideOfWholeRange);
358
- if (editIsOutsideOfWholeRange) {
303
+ this._session.recordExternalEditOccurred(shouldFinishSession);
304
+ if (shouldFinishSession) {
359
305
  this._log('text changed outside of whole range, FINISH session');
360
306
  this.finishExistingSession();
361
307
  }
362
308
  }));
363
- this._ctxSupportIssueReporting.set(this._activeSession.provider.supportIssueReporting ?? false);
364
- if (!this._activeSession.lastExchange) {
309
+ this._ctxSupportIssueReporting.set(this._session.provider.supportIssueReporting ?? false);
310
+ if (!this._session.lastExchange) {
365
311
  return "WAIT_FOR_INPUT" ;
366
312
  }
367
313
  else if (options.isUnstashed) {
@@ -372,26 +318,8 @@ let InlineChatController = class InlineChatController {
372
318
  return "SHOW_RESPONSE" ;
373
319
  }
374
320
  }
375
- setPlaceholder(text) {
376
- this._forcedPlaceholder = text;
377
- this._updatePlaceholder();
378
- }
379
- resetPlaceholder() {
380
- this._forcedPlaceholder = undefined;
381
- this._updatePlaceholder();
382
- }
383
- _updatePlaceholder() {
384
- this._zone.value.widget.placeholder = this._getPlaceholderText();
385
- }
386
- _getPlaceholderText() {
387
- return this._forcedPlaceholder ?? this._activeSession?.session.placeholder ?? ( localizeWithPath(
388
- 'vs/workbench/contrib/inlineChat/browser/inlineChatController',
389
- 'default.placeholder',
390
- "Ask a question"
391
- ));
392
- }
393
321
  async ["WAIT_FOR_INPUT" ](options) {
394
- assertType(this._activeSession);
322
+ assertType(this._session);
395
323
  assertType(this._strategy);
396
324
  this._updatePlaceholder();
397
325
  if (options.message) {
@@ -417,26 +345,28 @@ let InlineChatController = class InlineChatController {
417
345
  await barrier.wait();
418
346
  store.dispose();
419
347
  }
420
- this._zone.value.widget.selectAll(false);
421
348
  if (message & ((16 | 2) )) {
422
349
  return "CANCEL" ;
423
350
  }
424
- if (message & 1 ) {
425
- return "DONE" ;
426
- }
427
351
  if (message & 4 ) {
428
352
  return "PAUSE" ;
429
353
  }
430
- if (message & 64 && this._activeSession.lastExchange) {
431
- const { lastExchange } = this._activeSession;
432
- this._activeSession.addInput(lastExchange.prompt.retry());
354
+ if (message & 1 ) {
355
+ this._zone.value.widget.selectAll(false);
356
+ return "DONE" ;
357
+ }
358
+ if (message & 64 && this._session.lastExchange) {
359
+ const { lastExchange } = this._session;
360
+ if (options.withIntentDetection === undefined) {
361
+ this._session.addInput(lastExchange.prompt.retry());
362
+ }
433
363
  if (lastExchange.response instanceof ReplyResponse) {
434
364
  try {
435
- this._ignoreModelContentChanged = true;
365
+ this._session.hunkData.ignoreTextModelNChanges = true;
436
366
  await this._strategy.undoChanges(lastExchange.response.modelAltVersionId);
437
367
  }
438
368
  finally {
439
- this._ignoreModelContentChanged = false;
369
+ this._session.hunkData.ignoreTextModelNChanges = false;
440
370
  }
441
371
  }
442
372
  return "MAKE_REQUEST" ;
@@ -446,10 +376,10 @@ let InlineChatController = class InlineChatController {
446
376
  }
447
377
  const input = this.getInput();
448
378
  this._historyUpdate(input);
449
- const refer = this._activeSession.session.slashCommands?.some(value => value.refer && input.startsWith(`/${value.command}`));
379
+ const refer = this._session.session.slashCommands?.some(value => value.refer && input.startsWith(`/${value.command}`));
450
380
  if (refer) {
451
- this._log('[IE] seeing refer command, continuing outside editor', this._activeSession.provider.debugName);
452
- this._editor.setSelection(this._activeSession.wholeRange.value);
381
+ this._log('[IE] seeing refer command, continuing outside editor', this._session.provider.debugName);
382
+ this._editor.setSelection(this._session.wholeRange.value);
453
383
  let massagedInput = input;
454
384
  if (input.startsWith(chatSubcommandLeader)) {
455
385
  const withoutSubCommandLeader = input.slice(1);
@@ -464,19 +394,19 @@ let InlineChatController = class InlineChatController {
464
394
  }
465
395
  }
466
396
  this._instaService.invokeFunction(sendRequest, massagedInput);
467
- if (!this._activeSession.lastExchange) {
397
+ if (!this._session.lastExchange) {
468
398
  return "DONE" ;
469
399
  }
470
400
  return "WAIT_FOR_INPUT" ;
471
401
  }
472
- this._activeSession.addInput(( new SessionPrompt(input)));
402
+ this._session.addInput(( new SessionPrompt(input)));
473
403
  return "MAKE_REQUEST" ;
474
404
  }
475
- async ["MAKE_REQUEST" ]() {
405
+ async ["MAKE_REQUEST" ](options) {
476
406
  assertType(this._editor.hasModel());
477
- assertType(this._activeSession);
407
+ assertType(this._session);
478
408
  assertType(this._strategy);
479
- assertType(this._activeSession.lastInput);
409
+ assertType(this._session.lastInput);
480
410
  const requestCts = ( new CancellationTokenSource());
481
411
  let message = 0 ;
482
412
  const msgListener = Event.once(this._messages.event)(m => {
@@ -488,13 +418,15 @@ let InlineChatController = class InlineChatController {
488
418
  const requestClock = StopWatch.create();
489
419
  const request = {
490
420
  requestId: generateUuid(),
491
- prompt: this._activeSession.lastInput.value,
492
- attempt: this._activeSession.lastInput.attempt,
421
+ prompt: this._session.lastInput.value,
422
+ attempt: this._session.lastInput.attempt,
493
423
  selection: this._editor.getSelection(),
494
- wholeRange: this._activeSession.wholeRange.value,
495
- live: this._activeSession.editMode !== "preview"
424
+ wholeRange: this._session.wholeRange.trackedInitialRange,
425
+ live: this._session.editMode !== "preview" ,
426
+ withIntentDetection: options.withIntentDetection ?? true ,
496
427
  };
497
- const modelAltVersionIdNow = this._activeSession.textModelN.getAlternativeVersionId();
428
+ delete options.withIntentDetection;
429
+ const modelAltVersionIdNow = this._session.textModelN.getAlternativeVersionId();
498
430
  const progressEdits = [];
499
431
  const progressiveEditsAvgDuration = ( new MovingAverage());
500
432
  const progressiveEditsCts = ( new CancellationTokenSource(requestCts.token));
@@ -524,11 +456,11 @@ let InlineChatController = class InlineChatController {
524
456
  progressiveEditsAvgDuration.update(progressiveEditsClock.elapsed());
525
457
  progressiveEditsClock.reset();
526
458
  progressiveEditsQueue.queue(async () => {
527
- const startThen = this._activeSession.wholeRange.value.getStartPosition();
459
+ const startThen = this._session.wholeRange.value.getStartPosition();
528
460
  await this._makeChanges(data.edits, data.editsShouldBeInstant
529
461
  ? undefined
530
462
  : { duration: progressiveEditsAvgDuration.value, token: progressiveEditsCts.token });
531
- const startNow = this._activeSession.wholeRange.value.getStartPosition();
463
+ const startNow = this._session.wholeRange.value.getStartPosition();
532
464
  if (!startNow.equals(startThen) || !this._zone.value.position?.equals(startNow)) {
533
465
  this._showWidget(false, startNow.delta(-1));
534
466
  }
@@ -541,7 +473,7 @@ let InlineChatController = class InlineChatController {
541
473
  data.markdownFragment,
542
474
  { supportThemeIcons: true, supportHtml: true, isTrusted: false }
543
475
  )),
544
- providerId: this._activeSession.provider.debugName,
476
+ providerId: this._session.provider.debugName,
545
477
  requestId: request.requestId,
546
478
  };
547
479
  progressiveChatResponse = this._zone.value.widget.updateChatMessage(message, true);
@@ -554,25 +486,22 @@ let InlineChatController = class InlineChatController {
554
486
  let a11yResponse;
555
487
  const a11yVerboseInlineChat = this._configurationService.getValue('accessibility.verbosity.inlineChat') === true;
556
488
  const requestId = this._chatAccessibilityService.acceptRequest();
557
- const task = this._activeSession.provider.provideResponse(this._activeSession.session, request, progress, requestCts.token);
558
- this._log('request started', this._activeSession.provider.debugName, this._activeSession.session, request);
489
+ const task = this._session.provider.provideResponse(this._session.session, request, progress, requestCts.token);
490
+ this._log('request started', this._session.provider.debugName, this._session.session, request);
559
491
  let response;
560
492
  let reply;
561
493
  try {
562
494
  this._zone.value.widget.updateChatMessage(undefined);
563
495
  this._zone.value.widget.updateFollowUps(undefined);
564
496
  this._zone.value.widget.updateProgress(true);
565
- this._zone.value.widget.updateInfo(!this._activeSession.lastExchange ? ( localizeWithPath(
497
+ this._zone.value.widget.updateInfo(!this._session.lastExchange ? ( localizeWithPath(
566
498
  'vs/workbench/contrib/inlineChat/browser/inlineChatController',
567
499
  'thinking',
568
500
  "Thinking\u2026"
569
501
  )) : '');
570
- await this._strategy.start();
571
502
  this._ctxHasActiveRequest.set(true);
572
503
  reply = await raceCancellationError(Promise.resolve(task), requestCts.token);
573
- if (progressiveEditsQueue.size > 0) {
574
- await Event.toPromise(progressiveEditsQueue.onDrained);
575
- }
504
+ await progressiveEditsQueue.whenIdle();
576
505
  if (progressiveChatResponse) {
577
506
  progressiveChatResponse.cancel();
578
507
  }
@@ -586,7 +515,7 @@ let InlineChatController = class InlineChatController {
586
515
  }
587
516
  else {
588
517
  const markdownContents = reply.message ?? ( new MarkdownString('', { supportThemeIcons: true, supportHtml: true, isTrusted: false }));
589
- const replyResponse = response = this._instaService.createInstance(ReplyResponse, reply, markdownContents, this._activeSession.textModelN.uri, modelAltVersionIdNow, progressEdits, request.requestId);
518
+ const replyResponse = response = this._instaService.createInstance(ReplyResponse, reply, markdownContents, this._session.textModelN.uri, modelAltVersionIdNow, progressEdits, request.requestId);
590
519
  for (let i = progressEdits.length; i < replyResponse.allLocalEdits.length; i++) {
591
520
  await this._makeChanges(replyResponse.allLocalEdits[i], undefined);
592
521
  }
@@ -606,6 +535,7 @@ let InlineChatController = class InlineChatController {
606
535
  }
607
536
  }
608
537
  catch (e) {
538
+ progressiveEditsQueue.clear();
609
539
  response = ( new ErrorResponse(e));
610
540
  a11yResponse = response.message;
611
541
  }
@@ -614,19 +544,22 @@ let InlineChatController = class InlineChatController {
614
544
  this._zone.value.widget.updateProgress(false);
615
545
  this._zone.value.widget.updateInfo('');
616
546
  this._zone.value.widget.updateToolbar(true);
617
- this._log('request took', requestClock.elapsed(), this._activeSession.provider.debugName);
547
+ this._log('request took', requestClock.elapsed(), this._session.provider.debugName);
618
548
  this._chatAccessibilityService.acceptResponse(a11yResponse, requestId);
619
549
  }
620
- const diff = await this._editorWorkerService.computeDiff(this._activeSession.textModel0.uri, this._activeSession.textModelN.uri, { computeMoves: false, maxComputationTimeMs: Number.MAX_SAFE_INTEGER, ignoreTrimWhitespace: false }, 'advanced');
621
- this._activeSession.wholeRange.fixup(diff?.changes ?? []);
550
+ const diff = await this._editorWorkerService.computeDiff(this._session.textModel0.uri, this._session.textModelN.uri, { computeMoves: false, maxComputationTimeMs: Number.MAX_SAFE_INTEGER, ignoreTrimWhitespace: false }, 'advanced');
551
+ this._session.wholeRange.fixup(diff?.changes ?? []);
622
552
  progressiveEditsCts.dispose(true);
623
553
  requestCts.dispose();
624
554
  msgListener.dispose();
625
555
  typeListener.dispose();
626
- if (request.live && !(response instanceof ReplyResponse)) {
556
+ if (response instanceof ReplyResponse) {
557
+ await this._session.hunkData.recompute();
558
+ }
559
+ else if (request.live) {
627
560
  this._strategy?.undoChanges(modelAltVersionIdNow);
628
561
  }
629
- this._activeSession.addExchange(( new SessionExchange(this._activeSession.lastInput, response)));
562
+ this._session.addExchange(( new SessionExchange(this._session.lastInput, response)));
630
563
  if (message & 2 ) {
631
564
  return "CANCEL" ;
632
565
  }
@@ -636,52 +569,29 @@ let InlineChatController = class InlineChatController {
636
569
  else if (message & 1 ) {
637
570
  return "DONE" ;
638
571
  }
572
+ else if (message & ((32 | 64) )) {
573
+ return "MAKE_REQUEST" ;
574
+ }
639
575
  else {
640
576
  return "APPLY_RESPONSE" ;
641
577
  }
642
578
  }
643
579
  async ["APPLY_RESPONSE" ]() {
644
- assertType(this._activeSession);
580
+ assertType(this._session);
645
581
  assertType(this._strategy);
646
- const { response } = this._activeSession.lastExchange;
582
+ const { response } = this._session.lastExchange;
647
583
  if (response instanceof ReplyResponse && response.workspaceEdit) {
648
584
  this._bulkEditService.apply(response.workspaceEdit, { showPreview: true });
649
585
  return "CANCEL" ;
650
586
  }
651
587
  return "SHOW_RESPONSE" ;
652
588
  }
653
- async _makeChanges(edits, opts) {
654
- assertType(this._activeSession);
655
- assertType(this._strategy);
656
- const moreMinimalEdits = await this._editorWorkerService.computeMoreMinimalEdits(this._activeSession.textModelN.uri, edits);
657
- this._log('edits from PROVIDER and after making them MORE MINIMAL', this._activeSession.provider.debugName, edits, moreMinimalEdits);
658
- if (moreMinimalEdits?.length === 0) {
659
- return;
660
- }
661
- const actualEdits = !opts && moreMinimalEdits ? moreMinimalEdits : edits;
662
- const editOperations = ( actualEdits.map(TextEdit.asEditOperation));
663
- try {
664
- this._ignoreModelContentChanged = true;
665
- this._activeSession.wholeRange.trackEdits(editOperations);
666
- if (opts) {
667
- await this._strategy.makeProgressiveChanges(editOperations, opts);
668
- }
669
- else {
670
- await this._strategy.makeChanges(editOperations);
671
- }
672
- this._ctxDidEdit.set(this._activeSession.hasChangedText);
673
- }
674
- finally {
675
- this._ignoreModelContentChanged = false;
676
- }
677
- }
678
589
  async ["SHOW_RESPONSE" ]() {
679
- assertType(this._activeSession);
590
+ assertType(this._session);
680
591
  assertType(this._strategy);
681
- const { response } = this._activeSession.lastExchange;
682
- this._ctxLastResponseType.set(response instanceof ReplyResponse ? response.raw.type : undefined);
592
+ const { response } = this._session.lastExchange;
683
593
  let responseTypes;
684
- for (const { response } of this._activeSession.exchanges) {
594
+ for (const { response } of this._session.exchanges) {
685
595
  const thisType = response instanceof ReplyResponse
686
596
  ? response.responseType
687
597
  : undefined;
@@ -694,7 +604,7 @@ let InlineChatController = class InlineChatController {
694
604
  }
695
605
  }
696
606
  this._ctxResponseTypes.set(responseTypes);
697
- this._ctxDidEdit.set(this._activeSession.hasChangedText);
607
+ this._ctxDidEdit.set(this._session.hasChangedText);
698
608
  let newPosition;
699
609
  if (response instanceof EmptyResponse) {
700
610
  const status = ( localizeWithPath(
@@ -712,24 +622,29 @@ let InlineChatController = class InlineChatController {
712
622
  }
713
623
  else if (response instanceof ReplyResponse) {
714
624
  this._zone.value.widget.updateStatus('');
715
- const message = { message: response.mdContent, providerId: this._activeSession.provider.debugName, requestId: response.requestId };
625
+ const message = { message: response.mdContent, providerId: this._session.provider.debugName, requestId: response.requestId };
716
626
  this._zone.value.widget.updateChatMessage(message);
717
- this._activeSession.lastExpansionState = this._zone.value.widget.expansionState;
627
+ this._session.lastExpansionState = this._zone.value.widget.expansionState;
718
628
  this._zone.value.widget.updateToolbar(true);
719
629
  newPosition = await this._strategy.renderChanges(response);
720
- if (this._activeSession.provider.provideFollowups) {
630
+ if (this._session.provider.provideFollowups) {
721
631
  const followupCts = ( new CancellationTokenSource());
722
632
  const msgListener = Event.once(this._messages.event)(() => {
723
633
  followupCts.cancel();
724
634
  });
725
- const followupTask = this._activeSession.provider.provideFollowups(this._activeSession.session, response.raw, followupCts.token);
726
- this._log('followup request started', this._activeSession.provider.debugName, this._activeSession.session, response.raw);
635
+ const followupTask = this._session.provider.provideFollowups(this._session.session, response.raw, followupCts.token);
636
+ this._log('followup request started', this._session.provider.debugName, this._session.session, response.raw);
727
637
  raceCancellation(Promise.resolve(followupTask), followupCts.token).then(followupReply => {
728
- if (followupReply && this._activeSession) {
729
- this._log('followup request received', this._activeSession.provider.debugName, this._activeSession.session, followupReply);
638
+ if (followupReply && this._session) {
639
+ this._log('followup request received', this._session.provider.debugName, this._session.session, followupReply);
730
640
  this._zone.value.widget.updateFollowUps(followupReply, followup => {
731
- this.updateInput(followup.message);
732
- this.acceptInput();
641
+ if (followup.kind === 'reply') {
642
+ this.updateInput(followup.message);
643
+ this.acceptInput();
644
+ }
645
+ else {
646
+ this._commandService.executeCommand(followup.commandId, ...(followup.args ?? []));
647
+ }
733
648
  });
734
649
  }
735
650
  }).finally(() => {
@@ -742,21 +657,12 @@ let InlineChatController = class InlineChatController {
742
657
  return "WAIT_FOR_INPUT" ;
743
658
  }
744
659
  async ["PAUSE" ]() {
745
- this._ctxDidEdit.reset();
746
- this._ctxUserDidEdit.reset();
747
- this._ctxLastResponseType.reset();
748
- this._ctxLastFeedbackKind.reset();
749
- this._ctxSupportIssueReporting.reset();
750
- this._zone.value.hide();
751
- if (this._editor.hasWidgetFocus()) {
752
- this._editor.focus();
753
- }
754
- this._strategy?.dispose();
755
- this._strategy = undefined;
756
- this._activeSession = undefined;
660
+ this._resetWidget();
661
+ this._strategy?.dispose?.();
662
+ this._session = undefined;
757
663
  }
758
664
  async ["DONE" ]() {
759
- assertType(this._activeSession);
665
+ assertType(this._session);
760
666
  assertType(this._strategy);
761
667
  this._sessionStore.clear();
762
668
  try {
@@ -772,35 +678,134 @@ let InlineChatController = class InlineChatController {
772
678
  this._log('FAILED to apply changes');
773
679
  this._log(err);
774
680
  }
775
- this._inlineChatSessionService.releaseSession(this._activeSession);
776
- this["PAUSE" ]();
681
+ this._inlineChatSessionService.releaseSession(this._session);
682
+ this._resetWidget();
683
+ this._strategy?.dispose();
684
+ this._strategy = undefined;
685
+ this._session = undefined;
777
686
  }
778
687
  async ["CANCEL" ]() {
779
- assertType(this._activeSession);
780
- assertType(this._strategy);
688
+ if (this._session) {
689
+ assertType(this._strategy);
690
+ this._sessionStore.clear();
691
+ const shouldStash = !this._session.isUnstashed && !!this._session.lastExchange && this._session.hunkData.size === this._session.hunkData.pending;
692
+ let undoCancelEdits = [];
693
+ try {
694
+ undoCancelEdits = this._strategy.cancel();
695
+ }
696
+ catch (err) {
697
+ this._dialogService.error(( localizeWithPath(
698
+ 'vs/workbench/contrib/inlineChat/browser/inlineChatController',
699
+ 'err.discard',
700
+ "Failed to discard changes.",
701
+ toErrorMessage(err)
702
+ )));
703
+ this._log('FAILED to discard changes');
704
+ this._log(err);
705
+ }
706
+ this._stashedSession.clear();
707
+ if (shouldStash) {
708
+ this._stashedSession.value = this._inlineChatSessionService.stashSession(this._session, this._editor, undoCancelEdits);
709
+ }
710
+ else {
711
+ this._inlineChatSessionService.releaseSession(this._session);
712
+ }
713
+ }
714
+ this._resetWidget();
715
+ this._strategy?.dispose();
716
+ this._strategy = undefined;
717
+ this._session = undefined;
718
+ }
719
+ _showWidget(initialRender = false, position) {
720
+ assertType(this._editor.hasModel());
721
+ let widgetPosition;
722
+ if (position) {
723
+ widgetPosition = position;
724
+ }
725
+ else if (this._zone.value.position) {
726
+ if (this._zone.value.position.lineNumber === 1) {
727
+ widgetPosition = this._zone.value.position.delta(-1);
728
+ }
729
+ else {
730
+ widgetPosition = this._zone.value.position;
731
+ }
732
+ }
733
+ else {
734
+ widgetPosition = this._editor.getSelection().getStartPosition().delta(-1);
735
+ }
736
+ if (initialRender) {
737
+ this._zone.value.setContainerMargins();
738
+ }
739
+ if (this._session && !position && (this._session.hasChangedText || this._session.lastExchange)) {
740
+ widgetPosition = this._session.wholeRange.value.getStartPosition().delta(-1);
741
+ }
742
+ if (this._session) {
743
+ this._zone.value.updateBackgroundColor(widgetPosition, this._session.wholeRange.value);
744
+ }
745
+ if (!this._zone.value.position) {
746
+ this._zone.value.setWidgetMargins(widgetPosition);
747
+ this._zone.value.show(widgetPosition);
748
+ }
749
+ else {
750
+ this._zone.value.updatePositionAndHeight(widgetPosition);
751
+ }
752
+ }
753
+ _resetWidget() {
781
754
  this._sessionStore.clear();
782
- const mySession = this._activeSession;
783
- try {
784
- await this._strategy.cancel();
755
+ this._ctxDidEdit.reset();
756
+ this._ctxUserDidEdit.reset();
757
+ this._ctxLastFeedbackKind.reset();
758
+ this._ctxSupportIssueReporting.reset();
759
+ this._zone.value.hide();
760
+ if (this._editor.hasWidgetFocus()) {
761
+ this._editor.focus();
785
762
  }
786
- catch (err) {
787
- this._dialogService.error(( localizeWithPath(
788
- 'vs/workbench/contrib/inlineChat/browser/inlineChatController',
789
- 'err.discard',
790
- "Failed to discard changes.",
791
- toErrorMessage(err)
792
- )));
793
- this._log('FAILED to discard changes');
794
- this._log(err);
763
+ }
764
+ async _makeChanges(edits, opts) {
765
+ assertType(this._session);
766
+ assertType(this._strategy);
767
+ const moreMinimalEdits = await this._editorWorkerService.computeMoreMinimalEdits(this._session.textModelN.uri, edits);
768
+ this._log('edits from PROVIDER and after making them MORE MINIMAL', this._session.provider.debugName, edits, moreMinimalEdits);
769
+ if (moreMinimalEdits?.length === 0) {
770
+ return;
795
771
  }
796
- this["PAUSE" ]();
797
- this._stashedSession.clear();
798
- if (!mySession.isUnstashed && mySession.lastExchange) {
799
- this._stashedSession.value = this._instaService.createInstance(StashedSession, this._editor, mySession);
772
+ const actualEdits = !opts && moreMinimalEdits ? moreMinimalEdits : edits;
773
+ const editOperations = ( actualEdits.map(TextEdit.asEditOperation));
774
+ const editsObserver = {
775
+ start: () => this._session.hunkData.ignoreTextModelNChanges = true,
776
+ stop: () => this._session.hunkData.ignoreTextModelNChanges = false,
777
+ };
778
+ this._inlineChatSavingService.markChanged(this._session);
779
+ this._session.wholeRange.trackEdits(editOperations);
780
+ if (opts) {
781
+ await this._strategy.makeProgressiveChanges(editOperations, editsObserver, opts);
800
782
  }
801
783
  else {
802
- this._inlineChatSessionService.releaseSession(mySession);
784
+ await this._strategy.makeChanges(editOperations, editsObserver);
803
785
  }
786
+ this._ctxDidEdit.set(this._session.hasChangedText);
787
+ }
788
+ _updatePlaceholder() {
789
+ this._zone.value.widget.placeholder = this._getPlaceholderText();
790
+ }
791
+ _getPlaceholderText() {
792
+ return this._forcedPlaceholder ?? this._session?.session.placeholder ?? '';
793
+ }
794
+ showSaveHint() {
795
+ const status = ( localizeWithPath(
796
+ 'vs/workbench/contrib/inlineChat/browser/inlineChatController',
797
+ 'savehint',
798
+ "Accept or discard changes to continue saving"
799
+ ));
800
+ this._zone.value.widget.updateStatus(status, { classes: ['warn'] });
801
+ }
802
+ setPlaceholder(text) {
803
+ this._forcedPlaceholder = text;
804
+ this._updatePlaceholder();
805
+ }
806
+ resetPlaceholder() {
807
+ this._forcedPlaceholder = undefined;
808
+ this._updatePlaceholder();
804
809
  }
805
810
  acceptInput() {
806
811
  this._messages.fire(32 );
@@ -840,30 +845,43 @@ let InlineChatController = class InlineChatController {
840
845
  if (len === 0) {
841
846
  return;
842
847
  }
843
- const pos = (len + this._historyOffset + (up ? 1 : -1)) % len;
844
- const entry = InlineChatController_1._promptHistory[pos];
848
+ if (this._historyOffset === -1) {
849
+ this._historyCandidate = this._zone.value.widget.value;
850
+ }
851
+ const newIdx = this._historyOffset + (up ? 1 : -1);
852
+ if (newIdx >= len) {
853
+ return;
854
+ }
855
+ let entry;
856
+ if (newIdx < 0) {
857
+ entry = this._historyCandidate;
858
+ this._historyOffset = -1;
859
+ }
860
+ else {
861
+ entry = InlineChatController_1._promptHistory[newIdx];
862
+ this._historyOffset = newIdx;
863
+ }
845
864
  this._zone.value.widget.value = entry;
846
865
  this._zone.value.widget.selectAll();
847
- this._historyOffset = pos;
848
866
  }
849
867
  viewInChat() {
850
- if (this._activeSession?.lastExchange?.response instanceof ReplyResponse) {
851
- this._instaService.invokeFunction(showMessageResponse, this._activeSession.lastExchange.prompt.value, this._activeSession.lastExchange.response.mdContent.value);
868
+ if (this._session?.lastExchange?.response instanceof ReplyResponse) {
869
+ this._instaService.invokeFunction(showMessageResponse, this._session.lastExchange.prompt.value, this._session.lastExchange.response.mdContent.value);
852
870
  }
853
871
  }
854
872
  updateExpansionState(expand) {
855
- if (this._activeSession) {
873
+ if (this._session) {
856
874
  const expansionState = expand ? ExpansionState.EXPANDED : ExpansionState.CROPPED;
857
875
  this._zone.value.widget.updateChatMessageExpansionState(expansionState);
858
- this._activeSession.lastExpansionState = expansionState;
876
+ this._session.lastExpansionState = expansionState;
859
877
  }
860
878
  }
861
879
  toggleDiff() {
862
880
  this._strategy?.toggleDiff?.();
863
881
  }
864
882
  feedbackLast(kind) {
865
- if (this._activeSession?.lastExchange && this._activeSession.lastExchange.response instanceof ReplyResponse) {
866
- this._activeSession.provider.handleInlineChatResponseFeedback?.(this._activeSession.session, this._activeSession.lastExchange.response.raw, kind);
883
+ if (this._session?.lastExchange && this._session.lastExchange.response instanceof ReplyResponse) {
884
+ this._session.provider.handleInlineChatResponseFeedback?.(this._session.session, this._session.lastExchange.response.raw, kind);
867
885
  switch (kind) {
868
886
  case 1 :
869
887
  this._ctxLastFeedbackKind.set('helpful');
@@ -876,102 +894,80 @@ let InlineChatController = class InlineChatController {
876
894
  }
877
895
  }
878
896
  createSnapshot() {
879
- if (this._activeSession && !this._activeSession.textModel0.equalsTextBuffer(this._activeSession.textModelN.getTextBuffer())) {
880
- this._activeSession.createSnapshot();
897
+ if (this._session && !this._session.textModel0.equalsTextBuffer(this._session.textModelN.getTextBuffer())) {
898
+ this._session.createSnapshot();
881
899
  }
882
900
  }
883
901
  acceptSession() {
884
- if (this._activeSession?.lastExchange && this._activeSession.lastExchange.response instanceof ReplyResponse) {
885
- this._activeSession.provider.handleInlineChatResponseFeedback?.(this._activeSession.session, this._activeSession.lastExchange.response.raw, 3 );
902
+ if (this._session?.lastExchange && this._session.lastExchange.response instanceof ReplyResponse) {
903
+ this._session.provider.handleInlineChatResponseFeedback?.(this._session.session, this._session.lastExchange.response.raw, 3 );
886
904
  }
887
905
  this._messages.fire(1 );
888
906
  }
907
+ acceptHunk() {
908
+ return this._strategy?.acceptHunk();
909
+ }
910
+ discardHunk() {
911
+ return this._strategy?.discardHunk();
912
+ }
889
913
  async cancelSession() {
890
914
  let result;
891
- if (this._activeSession) {
892
- const diff = await this._editorWorkerService.computeDiff(this._activeSession.textModel0.uri, this._activeSession.textModelN.uri, { ignoreTrimWhitespace: false, maxComputationTimeMs: 5000, computeMoves: false }, 'advanced');
893
- result = this._activeSession.asChangedText(diff?.changes ?? []);
894
- if (this._activeSession.lastExchange && this._activeSession.lastExchange.response instanceof ReplyResponse) {
895
- this._activeSession.provider.handleInlineChatResponseFeedback?.(this._activeSession.session, this._activeSession.lastExchange.response.raw, 2 );
915
+ if (this._session) {
916
+ const diff = await this._editorWorkerService.computeDiff(this._session.textModel0.uri, this._session.textModelN.uri, { ignoreTrimWhitespace: false, maxComputationTimeMs: 5000, computeMoves: false }, 'advanced');
917
+ result = this._session.asChangedText(diff?.changes ?? []);
918
+ if (this._session.lastExchange && this._session.lastExchange.response instanceof ReplyResponse) {
919
+ this._session.provider.handleInlineChatResponseFeedback?.(this._session.session, this._session.lastExchange.response.raw, 2 );
896
920
  }
897
921
  }
898
922
  this._messages.fire(2 );
899
923
  return result;
900
924
  }
901
925
  finishExistingSession() {
902
- if (this._activeSession) {
903
- if (this._activeSession.editMode === "preview" ) {
904
- this._log('finishing existing session, using CANCEL', this._activeSession.editMode);
926
+ if (this._session) {
927
+ if (this._session.editMode === "preview" ) {
928
+ this._log('finishing existing session, using CANCEL', this._session.editMode);
905
929
  this.cancelSession();
906
930
  }
907
931
  else {
908
- this._log('finishing existing session, using APPLY', this._activeSession.editMode);
932
+ this._log('finishing existing session, using APPLY', this._session.editMode);
909
933
  this.acceptSession();
910
934
  }
911
935
  }
912
936
  }
913
937
  unstashLastSession() {
914
- return this._stashedSession.value?.unstash();
938
+ const result = this._stashedSession.value?.unstash();
939
+ if (result) {
940
+ this._inlineChatSavingService.markChanged(result);
941
+ }
942
+ return result;
943
+ }
944
+ joinCurrentRun() {
945
+ return this._currentRun;
915
946
  }
916
947
  };
917
948
  InlineChatController = InlineChatController_1 = ( __decorate([
918
949
  ( __param(1, IInstantiationService)),
919
950
  ( __param(2, IInlineChatSessionService)),
920
- ( __param(3, IEditorWorkerService)),
921
- ( __param(4, ILogService)),
922
- ( __param(5, IConfigurationService)),
923
- ( __param(6, IDialogService)),
924
- ( __param(7, IContextKeyService)),
925
- ( __param(8, IAccessibilityService)),
926
- ( __param(9, IChatAccessibilityService)),
927
- ( __param(10, IChatAgentService)),
928
- ( __param(11, IBulkEditService)),
929
- ( __param(12, IStorageService))
951
+ ( __param(3, IInlineChatSavingService)),
952
+ ( __param(4, IEditorWorkerService)),
953
+ ( __param(5, ILogService)),
954
+ ( __param(6, IConfigurationService)),
955
+ ( __param(7, IDialogService)),
956
+ ( __param(8, IContextKeyService)),
957
+ ( __param(9, IAccessibilityService)),
958
+ ( __param(10, IChatAccessibilityService)),
959
+ ( __param(11, IChatAgentService)),
960
+ ( __param(12, IBulkEditService)),
961
+ ( __param(13, IStorageService)),
962
+ ( __param(14, ICommandService))
930
963
  ], InlineChatController));
931
- let StashedSession = class StashedSession {
932
- constructor(editor, session, contextKeyService, _sessionService, _logService) {
933
- this._sessionService = _sessionService;
934
- this._logService = _logService;
935
- this._ctxHasStashedSession = CTX_INLINE_CHAT_HAS_STASHED_SESSION.bindTo(contextKeyService);
936
- this._session = session;
937
- this._ctxHasStashedSession.set(true);
938
- this._listener = Event.once(Event.any(editor.onDidChangeCursorSelection, editor.onDidChangeModelContent, editor.onDidChangeModel))(() => {
939
- this._session = undefined;
940
- this._sessionService.releaseSession(session);
941
- this._ctxHasStashedSession.reset();
942
- });
943
- }
944
- dispose() {
945
- this._listener.dispose();
946
- this._ctxHasStashedSession.reset();
947
- if (this._session) {
948
- this._sessionService.releaseSession(this._session);
949
- }
950
- }
951
- unstash() {
952
- if (!this._session) {
953
- return undefined;
954
- }
955
- this._listener.dispose();
956
- const result = this._session;
957
- result.markUnstashed();
958
- this._session = undefined;
959
- this._logService.debug('[IE] Unstashed session');
960
- return result;
961
- }
962
- };
963
- StashedSession = ( __decorate([
964
- ( __param(2, IContextKeyService)),
965
- ( __param(3, IInlineChatSessionService)),
966
- ( __param(4, ILogService))
967
- ], StashedSession));
968
964
  async function showMessageResponse(accessor, query, response) {
969
965
  const chatService = accessor.get(IChatService);
970
966
  const providerId = chatService.getProviderInfos()[0]?.id;
971
967
  const chatWidgetService = accessor.get(IChatWidgetService);
972
968
  const widget = await chatWidgetService.revealViewForProvider(providerId);
973
969
  if (widget && widget.viewModel) {
974
- chatService.addCompleteRequest(widget.viewModel.sessionId, query, { message: response });
970
+ chatService.addCompleteRequest(widget.viewModel.sessionId, query, undefined, { message: response });
975
971
  widget.focusLastMessage();
976
972
  }
977
973
  }
@@ -985,4 +981,4 @@ async function sendRequest(accessor, query) {
985
981
  }
986
982
  widget.acceptInput(query);
987
983
  }
988
- export { InlineChatController, InlineChatRunOptions };
984
+ export { InlineChatController };