@codingame/monaco-vscode-chat-service-override 16.1.0 → 17.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. package/index.js +6 -6
  2. package/package.json +30 -27
  3. package/vscode/src/vs/base/common/objectCache.d.ts +1 -1
  4. package/vscode/src/vs/base/common/objectCache.js +1 -1
  5. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +41 -41
  6. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.d.ts +2 -2
  7. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +16 -15
  8. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.d.ts +4 -6
  9. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +410 -443
  10. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +6 -6
  11. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +2 -2
  12. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +4 -4
  13. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.d.ts +1 -7
  14. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.js +3 -18
  15. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +6 -6
  16. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +9 -12
  17. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +9 -9
  18. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTransfer.js +1 -1
  19. package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.d.ts +4 -2
  20. package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +32 -28
  21. package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/chatAttachInstructionsAction.d.ts +10 -0
  22. package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/chatAttachInstructionsAction.js +61 -0
  23. package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/chatRunPromptAction.d.ts +4 -0
  24. package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/chatRunPromptAction.js +159 -0
  25. package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/chatSaveToPromptAction.d.ts +9 -0
  26. package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/chatSaveToPromptAction.js +140 -0
  27. package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/dialogs/askToSelectPrompt/promptFilePickers.d.ts +32 -0
  28. package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/dialogs/askToSelectPrompt/promptFilePickers.js +244 -0
  29. package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/dialogs/askToSelectPrompt/utils/attachInstructions.d.ts +12 -0
  30. package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/dialogs/askToSelectPrompt/utils/attachInstructions.js +30 -0
  31. package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/dialogs/askToSelectPrompt/utils/runPrompt.d.ts +15 -0
  32. package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/dialogs/askToSelectPrompt/utils/runPrompt.js +12 -0
  33. package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/index.d.ts +2 -0
  34. package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/index.js +13 -0
  35. package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +171 -168
  36. package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.d.ts +1 -1
  37. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMarkdownAnchorService.d.ts +1 -1
  38. package/vscode/src/vs/workbench/contrib/chat/browser/chatEdinputInputContentProvider.js +1 -1
  39. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.d.ts +5 -5
  40. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +48 -45
  41. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.d.ts +5 -5
  42. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +46 -44
  43. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +118 -123
  44. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.d.ts +5 -7
  45. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +45 -29
  46. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.d.ts +12 -7
  47. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +48 -34
  48. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.d.ts +3 -3
  49. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +53 -20
  50. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.d.ts +2 -2
  51. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +32 -15
  52. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.d.ts +9 -23
  53. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +80 -268
  54. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSessionStorage.d.ts +36 -0
  55. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSessionStorage.js +214 -0
  56. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookDiff.js +1 -1
  57. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookSnapshot.js +1 -1
  58. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.d.ts +7 -6
  59. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.js +26 -10
  60. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.d.ts +7 -7
  61. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +186 -106
  62. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/overlayToolbarDecorator.d.ts +19 -0
  63. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/overlayToolbarDecorator.js +129 -0
  64. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/simpleBrowserEditorOverlay.d.ts +9 -0
  65. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/simpleBrowserEditorOverlay.js +313 -0
  66. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.d.ts +4 -6
  67. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +12 -16
  68. package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.d.ts +0 -4
  69. package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +42 -181
  70. package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.d.ts +1 -1
  71. package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js +3 -3
  72. package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.d.ts +1 -1
  73. package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.js +15 -1
  74. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.d.ts +2 -5
  75. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.js +484 -384
  76. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus.d.ts +2 -2
  77. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus.js +187 -101
  78. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatusItemService.d.ts +4 -1
  79. package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.d.ts +3 -12
  80. package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js +8 -52
  81. package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.d.ts +53 -0
  82. package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.js +264 -0
  83. package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockContextProviderService.d.ts +1 -1
  84. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.js +28 -22
  85. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.d.ts +1 -1
  86. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.js +3 -3
  87. package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.d.ts +2 -1
  88. package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.js +41 -45
  89. package/vscode/src/vs/workbench/contrib/chat/browser/media/chatEditingEditorOverlay.css +8 -32
  90. package/vscode/src/vs/workbench/contrib/chat/browser/media/chatSetup.css +2 -18
  91. package/vscode/src/vs/workbench/contrib/chat/browser/media/chatStatus.css +20 -4
  92. package/vscode/src/vs/workbench/contrib/chat/browser/media/simpleBrowserOverlay.css +67 -0
  93. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/attachInstructionsCommand.d.ts +6 -0
  94. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/attachInstructionsCommand.js +73 -0
  95. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/createPromptCommand.d.ts +2 -1
  96. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/createPromptCommand.js +82 -67
  97. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/dialogs/askForPromptName.d.ts +4 -1
  98. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/dialogs/askForPromptName.js +44 -14
  99. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/dialogs/askForPromptSourceFolder.d.ts +5 -4
  100. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/dialogs/askForPromptSourceFolder.js +24 -14
  101. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/errors.js +2 -2
  102. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/utils/createPromptFile.js +2 -2
  103. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +6 -6
  104. package/vscode/src/vs/workbench/contrib/chat/common/chatCodeMapperService.d.ts +2 -0
  105. package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.d.ts +7 -1
  106. package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.js +14 -1
  107. package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.d.ts +8 -7
  108. package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +84 -80
  109. package/vscode/src/vs/workbench/contrib/chat/common/chatSessionStore.d.ts +1 -1
  110. package/vscode/src/vs/workbench/contrib/chat/common/chatSessionStore.js +3 -3
  111. package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.d.ts +1 -0
  112. package/vscode/src/vs/workbench/contrib/chat/common/chatTransferService.d.ts +5 -1
  113. package/vscode/src/vs/workbench/contrib/chat/common/chatTransferService.js +27 -3
  114. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/configMigration.d.ts +5 -0
  115. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/configMigration.js +62 -0
  116. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/index.d.ts +3 -0
  117. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/index.js +16 -0
  118. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/index.d.ts +2 -0
  119. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/index.js +17 -0
  120. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/frontMatterDecoration.d.ts +29 -0
  121. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/frontMatterDecoration.js +74 -0
  122. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/frontMatterMarkerDecoration.d.ts +14 -0
  123. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/frontMatterMarkerDecoration.js +40 -0
  124. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/utils/decorationBase.d.ts +23 -0
  125. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/utils/decorationBase.js +40 -0
  126. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/utils/index.d.ts +5 -0
  127. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/utils/index.js +9 -0
  128. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/utils/reactiveDecorationBase.d.ts +23 -0
  129. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/utils/reactiveDecorationBase.js +68 -0
  130. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/utils/types.d.ts +13 -0
  131. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/promptDecorationsProvider.d.ts +19 -0
  132. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/promptDecorationsProvider.js +121 -0
  133. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/types.d.ts +13 -0
  134. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/types.js +13 -0
  135. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/promptHeaderDiagnosticsProvider.d.ts +15 -0
  136. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/promptHeaderDiagnosticsProvider.js +62 -0
  137. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/promptLinkDiagnosticsProvider.d.ts +15 -0
  138. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/promptLinkDiagnosticsProvider.js +65 -0
  139. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/{languageFeatures → contributions/languageFeatures/providers}/promptLinkProvider.js +3 -8
  140. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/{languageFeatures → contributions/languageFeatures/providers}/promptPathAutocompletion.d.ts +2 -2
  141. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/{languageFeatures → contributions/languageFeatures/providers}/promptPathAutocompletion.js +14 -19
  142. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/providerInstanceBase.d.ts +11 -0
  143. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/providerInstanceBase.js +22 -0
  144. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/providerInstanceManagerBase.d.ts +17 -0
  145. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/providerInstanceManagerBase.js +83 -0
  146. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/textModelPromptParser.d.ts +4 -3
  147. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/textModelPromptParser.js +8 -6
  148. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.d.ts +17 -5
  149. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.js +223 -21
  150. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +5 -4
  151. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +28 -22
  152. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/treeUtils.d.ts +10 -0
  153. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/treeUtils.js +25 -0
  154. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +20 -31
  155. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.d.ts +1 -1
  156. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +2 -2
  157. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +15 -12
  158. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibilityHelp.js +1 -1
  159. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibleView.js +2 -2
  160. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.js +12 -12
  161. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.js +3 -3
  162. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.d.ts +2 -2
  163. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.js +2 -2
  164. package/vscode/src/vs/workbench/services/workspaces/common/workspaceUtils.d.ts +0 -2
  165. package/vscode/src/vs/workbench/services/workspaces/common/workspaceUtils.js +1 -14
  166. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/chatAttachPromptAction.d.ts +0 -10
  167. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/chatAttachPromptAction.js +0 -54
  168. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/askToSelectPrompt.d.ts +0 -25
  169. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/askToSelectPrompt.js +0 -79
  170. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/constants.d.ts +0 -7
  171. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/constants.js +0 -27
  172. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/attachPrompts.d.ts +0 -5
  173. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/attachPrompts.js +0 -53
  174. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/createPlaceholderText.d.ts +0 -2
  175. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/createPlaceholderText.js +0 -19
  176. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/createPromptPickItem.d.ts +0 -5
  177. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/createPromptPickItem.js +0 -27
  178. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/handleButtonClick.d.ts +0 -13
  179. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/handleButtonClick.js +0 -49
  180. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/usePromptCommand.d.ts +0 -6
  181. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/usePromptCommand.js +0 -80
  182. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/constants.d.ts +0 -3
  183. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/constants.js +0 -13
  184. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contentProviders/textModelContentsProvider.d.ts +0 -21
  185. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contentProviders/textModelContentsProvider.js +0 -64
  186. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageFeatures/promptLinkDiagnosticsProvider.d.ts +0 -9
  187. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageFeatures/promptLinkDiagnosticsProvider.js +0 -117
  188. /package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/{languageFeatures → contributions/languageFeatures/providers}/promptLinkProvider.d.ts +0 -0
@@ -2,30 +2,33 @@
2
2
  import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
3
  import { Disposable, toDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
4
4
  import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
5
- import { debouncedObservable, observableFromEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/utils';
6
5
  import { basename } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
7
6
  import { assertType } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
8
7
  import { LineRange } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/lineRange';
9
8
  import { Range } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/range';
10
9
  import { nullDocumentDiff } from '../../../../../../editor/common/diff/documentDiffProvider.js';
10
+ import { PrefixSumComputer } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/model/prefixSumComputer';
11
11
  import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
12
12
  import { AccessibilitySignal } from '@codingame/monaco-vscode-api/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService';
13
13
  import { IAccessibilitySignalService } from '@codingame/monaco-vscode-api/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService.service';
14
14
  import { MenuId } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
15
15
  import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
16
+ import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
16
17
  import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
17
- import { NotebookDeletedCellDecorator } from '@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator';
18
- import { NotebookInsertedCellDecorator } from '@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator';
18
+ import { NotebookDeletedCellDecorator } from '@codingame/monaco-vscode-e4d0fd26-1b26-5583-b3f7-582e08d7b389-common/vscode/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator';
19
+ import { NotebookInsertedCellDecorator } from '@codingame/monaco-vscode-e4d0fd26-1b26-5583-b3f7-582e08d7b389-common/vscode/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator';
19
20
  import { NotebookModifiedCellDecorator } from '../../../../notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.js';
20
- import { getNotebookEditorFromEditorPane } from '@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
21
+ import { getNotebookEditorFromEditorPane, CellEditState } from '@codingame/monaco-vscode-324f9a6e-6231-5bfc-af17-e147abd2dfd2-common/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
21
22
  import { INotebookEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/services/notebookEditorService.service';
22
23
  import { CellKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
23
24
  import { IChatAgentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatAgents.service';
24
25
  import { ChatAgentLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
25
26
  import { ChatEditingCodeEditorIntegration } from '../chatEditingCodeEditorIntegration.js';
26
27
  import { sortCellChanges, countChanges } from './notebookCellChanges.js';
28
+ import { OverlayToolbarDecorator } from './overlayToolbarDecorator.js';
27
29
  import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/base';
28
30
  import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/autorun';
31
+ import { debouncedObservable, observableFromEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/utils';
29
32
 
30
33
  let ChatEditingNotebookEditorIntegration = class ChatEditingNotebookEditorIntegration extends Disposable {
31
34
  constructor(_entry, editor, notebookModel, originalModel, cellChanges, instantiationService) {
@@ -60,13 +63,13 @@ let ChatEditingNotebookEditorIntegration = class ChatEditingNotebookEditorIntegr
60
63
  this.integration.enableAccessibleDiffView();
61
64
  }
62
65
  acceptNearestChange(change) {
63
- this.integration.acceptNearestChange(change);
66
+ return this.integration.acceptNearestChange(change);
64
67
  }
65
68
  rejectNearestChange(change) {
66
- this.integration.rejectNearestChange(change);
69
+ return this.integration.rejectNearestChange(change);
67
70
  }
68
- toggleDiff(change) {
69
- return this.integration.toggleDiff(change);
71
+ toggleDiff(change, show) {
72
+ return this.integration.toggleDiff(change, show);
70
73
  }
71
74
  dispose() {
72
75
  this.integration.dispose();
@@ -77,7 +80,7 @@ ChatEditingNotebookEditorIntegration = ( __decorate([
77
80
  ( __param(5, IInstantiationService))
78
81
  ], ChatEditingNotebookEditorIntegration));
79
82
  let ChatEditingNotebookEditorWidgetIntegration = class ChatEditingNotebookEditorWidgetIntegration extends Disposable {
80
- constructor(_entry, notebookEditor, notebookModel, originalModel, cellChanges, instantiationService, _editorService, _chatAgentService, notebookEditorService, accessibilitySignalService) {
83
+ constructor(_entry, notebookEditor, notebookModel, originalModel, cellChanges, instantiationService, _editorService, _chatAgentService, notebookEditorService, accessibilitySignalService, logService) {
81
84
  super();
82
85
  this._entry = _entry;
83
86
  this.notebookEditor = notebookEditor;
@@ -87,13 +90,14 @@ let ChatEditingNotebookEditorWidgetIntegration = class ChatEditingNotebookEditor
87
90
  this._editorService = _editorService;
88
91
  this._chatAgentService = _chatAgentService;
89
92
  this.accessibilitySignalService = accessibilitySignalService;
93
+ this.logService = logService;
90
94
  this._currentIndex = observableValue(this, -1);
91
95
  this.currentIndex = this._currentIndex;
92
- this._currentChange = observableValue(this, undefined);
93
- this.currentChange = this._currentChange;
94
96
  this.cellEditorIntegrations = ( new Map());
95
- this.mdCellEditorAttached = observableValue(this, -1);
97
+ this.markdownEditState = observableValue(this, '');
96
98
  this.markupCellListeners = ( new Map());
99
+ this.sortedCellChanges = [];
100
+ this.changeIndexComputer = ( new PrefixSumComputer(( new Uint32Array(0))));
97
101
  const onDidChangeVisibleRanges = debouncedObservable(observableFromEvent(notebookEditor.onDidChangeVisibleRanges, () => notebookEditor.visibleRanges), 50);
98
102
  this._register(toDisposable(() => {
99
103
  this.markupCellListeners.forEach((v) => v.dispose());
@@ -131,6 +135,19 @@ let ChatEditingNotebookEditorWidgetIntegration = class ChatEditingNotebookEditor
131
135
  this.reveal(true);
132
136
  }
133
137
  }));
138
+ this._register(autorun(r => {
139
+ this.sortedCellChanges = sortCellChanges(cellChanges.read(r));
140
+ const indexes = [];
141
+ for (const change of this.sortedCellChanges) {
142
+ indexes.push(change.type === 'insert' || change.type === 'delete' ? 1
143
+ : change.type === 'modified' ? change.diff.read(r).changes.length
144
+ : 0);
145
+ }
146
+ this.changeIndexComputer = ( new PrefixSumComputer(( new Uint32Array(indexes))));
147
+ if (this.changeIndexComputer.getTotalSum() === 0) {
148
+ this.revertMarkupCellState();
149
+ }
150
+ }));
134
151
  this._register(autorun(r => {
135
152
  if (this.notebookEditor.textModel !== this.notebookModel) {
136
153
  return;
@@ -144,7 +161,7 @@ let ChatEditingNotebookEditorWidgetIntegration = class ChatEditingNotebookEditor
144
161
  });
145
162
  return;
146
163
  }
147
- this.mdCellEditorAttached.read(r);
164
+ this.markdownEditState.read(r);
148
165
  const validCells = ( new Set());
149
166
  changes.forEach((change) => {
150
167
  if (change.modifiedCellIndex === undefined || change.modifiedCellIndex >= notebookModel.cells.length) {
@@ -157,20 +174,18 @@ let ChatEditingNotebookEditorWidgetIntegration = class ChatEditingNotebookEditor
157
174
  if (!cell || !originalModel || !modifiedModel) {
158
175
  return;
159
176
  }
160
- if (!editor) {
161
- if (!( this.markupCellListeners.has(cell.handle)) && cell.cellKind === CellKind.Markup) {
162
- const cellModel = this.notebookEditor.getViewModel()?.viewCells.find(c => c.handle === cell.handle);
163
- if (cellModel) {
164
- const listener = cellModel.onDidChangeEditorAttachState(() => {
165
- if (cellModel.editorAttached) {
166
- this.mdCellEditorAttached.set(cell.handle, undefined);
167
- listener.dispose();
168
- this.markupCellListeners.delete(cell.handle);
169
- }
170
- });
171
- this.markupCellListeners.set(cell.handle, listener);
172
- }
177
+ if (cell.cellKind === CellKind.Markup && !( this.markupCellListeners.has(cell.handle))) {
178
+ const cellModel = this.notebookEditor.getViewModel()?.viewCells.find(c => c.handle === cell.handle);
179
+ if (cellModel) {
180
+ const listener = cellModel.onDidChangeState((e) => {
181
+ if (e.editStateChanged) {
182
+ setTimeout(() => this.markdownEditState.set(cellModel.handle + '-' + cellModel.getEditState(), undefined), 0);
183
+ }
184
+ });
185
+ this.markupCellListeners.set(cell.handle, listener);
173
186
  }
187
+ }
188
+ if (!editor) {
174
189
  return;
175
190
  }
176
191
  const diff = {
@@ -189,7 +204,7 @@ let ChatEditingNotebookEditorWidgetIntegration = class ChatEditingNotebookEditor
189
204
  }
190
205
  else {
191
206
  const diff2 = observableValue(`diff${cell.handle}`, diff);
192
- const integration = this.instantiationService.createInstance(ChatEditingCodeEditorIntegration, _entry, editor, diff2);
207
+ const integration = this.instantiationService.createInstance(ChatEditingCodeEditorIntegration, _entry, editor, diff2, true);
193
208
  this.cellEditorIntegrations.set(cell, { integration, diff: diff2 });
194
209
  this._register(integration);
195
210
  this._register(editor.onDidDispose(() => {
@@ -211,30 +226,6 @@ let ChatEditingNotebookEditorWidgetIntegration = class ChatEditingNotebookEditor
211
226
  }
212
227
  });
213
228
  }));
214
- this._register(autorun(r => {
215
- const currentChange = this.currentChange.read(r);
216
- if (!currentChange) {
217
- this._currentIndex.set(-1, undefined);
218
- return;
219
- }
220
- let index = 0;
221
- const sortedCellChanges = sortCellChanges(cellChanges.read(r));
222
- for (const change of sortedCellChanges) {
223
- if (currentChange && currentChange.change === change) {
224
- if (change.type === 'modified') {
225
- index += currentChange.index;
226
- }
227
- break;
228
- }
229
- if (change.type === 'insert' || change.type === 'delete') {
230
- index++;
231
- }
232
- else if (change.type === 'modified') {
233
- index += change.diff.read(r).changes.length;
234
- }
235
- }
236
- this._currentIndex.set(index, undefined);
237
- }));
238
229
  const cellsAreVisible = ( onDidChangeVisibleRanges.map(v => v.length > 0));
239
230
  const debouncedChanges = debouncedObservable(cellChanges, 10);
240
231
  this._register(autorun(r => {
@@ -244,16 +235,38 @@ let ChatEditingNotebookEditorWidgetIntegration = class ChatEditingNotebookEditor
244
235
  const changes = debouncedChanges.read(r).filter(c => c.type === 'insert' ? !c.diff.read(r).identical : true);
245
236
  const modifiedChanges = changes.filter(c => c.type === 'modified');
246
237
  this.createDecorators();
247
- this.insertedCellDecorator?.apply(changes);
248
- this.modifiedCellDecorator?.apply(modifiedChanges);
249
- this.deletedCellDecorator?.apply(changes, originalModel);
238
+ if (changes.every(c => c.type === 'insert')) {
239
+ this.insertedCellDecorator?.apply([]);
240
+ this.modifiedCellDecorator?.apply([]);
241
+ this.deletedCellDecorator?.apply([], originalModel);
242
+ this.overlayToolbarDecorator?.decorate([]);
243
+ }
244
+ else {
245
+ this.insertedCellDecorator?.apply(changes);
246
+ this.modifiedCellDecorator?.apply(modifiedChanges);
247
+ this.deletedCellDecorator?.apply(changes, originalModel);
248
+ this.overlayToolbarDecorator?.decorate(changes.filter(c => c.type === 'insert' || c.type === 'modified'));
249
+ }
250
250
  }));
251
251
  }
252
+ getCurrentChange() {
253
+ const currentIndex = Math.min(this._currentIndex.get(), this.changeIndexComputer.getTotalSum() - 1);
254
+ const index = this.changeIndexComputer.getIndexOf(currentIndex);
255
+ const change = this.sortedCellChanges[index.index];
256
+ return change ? { change, index: index.remainder } : undefined;
257
+ }
258
+ updateCurrentIndex(change, indexInCell = 0) {
259
+ const index = this.sortedCellChanges.indexOf(change);
260
+ const changeIndex = this.changeIndexComputer.getPrefixSum(index - 1);
261
+ const currentIndex = Math.min(changeIndex + indexInCell, this.changeIndexComputer.getTotalSum() - 1);
262
+ this._currentIndex.set(currentIndex, undefined);
263
+ }
252
264
  createDecorators() {
253
265
  const cellChanges = this.cellChanges.get();
254
266
  const accessibilitySignalService = this.accessibilitySignalService;
255
267
  this.insertedCellDecorator ??= this._register(this.instantiationService.createInstance(NotebookInsertedCellDecorator, this.notebookEditor));
256
268
  this.modifiedCellDecorator ??= this._register(this.instantiationService.createInstance(NotebookModifiedCellDecorator, this.notebookEditor));
269
+ this.overlayToolbarDecorator ??= this._register(this.instantiationService.createInstance(OverlayToolbarDecorator, this.notebookEditor, this.notebookModel));
257
270
  if (this.deletedCellDecorator) {
258
271
  this._store.delete(this.deletedCellDecorator);
259
272
  this.deletedCellDecorator.dispose();
@@ -290,9 +303,9 @@ let ChatEditingNotebookEditorWidgetIntegration = class ChatEditingNotebookEditor
290
303
  return integration;
291
304
  }
292
305
  reveal(firstOrLast) {
293
- const changes = sortCellChanges(this.cellChanges.get().filter(c => c.type !== 'unchanged'));
306
+ const changes = this.sortedCellChanges.filter(c => c.type !== 'unchanged');
294
307
  if (!changes.length) {
295
- return undefined;
308
+ return;
296
309
  }
297
310
  const change = firstOrLast ? changes[0] : changes[changes.length - 1];
298
311
  this._revealFirstOrLast(change, firstOrLast);
@@ -302,20 +315,14 @@ let ChatEditingNotebookEditorWidgetIntegration = class ChatEditingNotebookEditor
302
315
  case 'insert':
303
316
  case 'modified':
304
317
  {
318
+ this.blur(this.getCurrentChange()?.change);
305
319
  const index = firstOrLast || change.type === 'insert' ? 0 : change.diff.get().changes.length - 1;
306
- const cellIntegration = this.getCell(change.modifiedCellIndex);
307
- if (cellIntegration) {
308
- cellIntegration.reveal(firstOrLast);
309
- this._currentChange.set({ change: change, index }, undefined);
310
- return true;
311
- }
312
- else {
313
- return this._revealChange(change, index);
314
- }
320
+ return this._revealChange(change, index);
315
321
  }
316
322
  case 'delete':
323
+ this.blur(this.getCurrentChange()?.change);
317
324
  this.deletedCellDecorator?.reveal(change.originalCellIndex);
318
- this._currentChange.set({ change: change, index: 0 }, undefined);
325
+ this.updateCurrentIndex(change);
319
326
  return true;
320
327
  }
321
328
  return false;
@@ -328,34 +335,58 @@ let ChatEditingNotebookEditorWidgetIntegration = class ChatEditingNotebookEditor
328
335
  const textChange = change.diff.get().changes[indexInCell];
329
336
  const cellViewModel = this.getCellViewModel(change);
330
337
  if (cellViewModel) {
331
- this.revealChangeInView(cellViewModel, textChange?.modified);
332
- this._currentChange.set({ change: change, index: indexInCell }, undefined);
338
+ this.updateCurrentIndex(change, indexInCell);
339
+ this.revealChangeInView(cellViewModel, textChange?.modified, change)
340
+ .catch(err => { this.logService.warn(`Error revealing change in view: ${err}`); });
341
+ return true;
333
342
  }
334
- return true;
343
+ break;
335
344
  }
336
345
  case 'delete':
346
+ this.updateCurrentIndex(change);
337
347
  this.deletedCellDecorator?.reveal(change.originalCellIndex);
338
- this._currentChange.set({ change: change, index: 0 }, undefined);
339
348
  return true;
340
349
  }
341
350
  return false;
342
351
  }
343
352
  getCellViewModel(change) {
344
- if (change.type === 'delete' || change.modifiedCellIndex === undefined) {
353
+ if (change.type === 'delete' || change.modifiedCellIndex === undefined || change.modifiedCellIndex >= this.notebookModel.cells.length) {
345
354
  return undefined;
346
355
  }
347
356
  const cell = this.notebookModel.cells[change.modifiedCellIndex];
348
357
  const cellViewModel = this.notebookEditor.getViewModel()?.viewCells.find(c => c.handle === cell.handle);
349
358
  return cellViewModel;
350
359
  }
351
- async revealChangeInView(cell, lines) {
360
+ async revealChangeInView(cell, lines, change) {
352
361
  const targetLines = lines ?? ( new LineRange(0, 0));
353
- await this.notebookEditor.focusNotebookCell(cell, 'container', { focusEditorLine: targetLines.startLineNumber });
362
+ if (change.type === 'modified' && cell.cellKind === CellKind.Markup && cell.getEditState() === CellEditState.Preview) {
363
+ cell.updateEditState(CellEditState.Editing, 'chatEditNavigation');
364
+ }
365
+ const focusTarget = cell.cellKind === CellKind.Code || change.type === 'modified' ? 'editor' : 'container';
366
+ await this.notebookEditor.focusNotebookCell(cell, focusTarget, { focusEditorLine: targetLines.startLineNumber });
354
367
  await this.notebookEditor.revealRangeInCenterAsync(cell, ( new Range(targetLines.startLineNumber, 0, targetLines.endLineNumberExclusive, 0)));
355
368
  }
369
+ revertMarkupCellState() {
370
+ for (const change of this.sortedCellChanges) {
371
+ const cellViewModel = this.getCellViewModel(change);
372
+ if (cellViewModel?.cellKind === CellKind.Markup && cellViewModel.getEditState() === CellEditState.Editing &&
373
+ (cellViewModel.editStateSource === 'chatEditNavigation' || cellViewModel.editStateSource === 'chatEdit')) {
374
+ cellViewModel.updateEditState(CellEditState.Preview, 'chatEdit');
375
+ }
376
+ }
377
+ }
378
+ blur(change) {
379
+ if (!change) {
380
+ return;
381
+ }
382
+ const cellViewModel = this.getCellViewModel(change);
383
+ if (cellViewModel?.cellKind === CellKind.Markup && cellViewModel.getEditState() === CellEditState.Editing && cellViewModel.editStateSource === 'chatEditNavigation') {
384
+ cellViewModel.updateEditState(CellEditState.Preview, 'chatEditNavigation');
385
+ }
386
+ }
356
387
  next(wrap) {
357
- const changes = sortCellChanges(this.cellChanges.get().filter(c => c.type !== 'unchanged'));
358
- const currentChange = this.currentChange.get();
388
+ const changes = this.sortedCellChanges.filter(c => c.type !== 'unchanged');
389
+ const currentChange = this.getCurrentChange();
359
390
  if (!currentChange) {
360
391
  const firstChange = changes[0];
361
392
  if (firstChange) {
@@ -369,36 +400,45 @@ let ChatEditingNotebookEditorWidgetIntegration = class ChatEditingNotebookEditor
369
400
  const cellIntegration = this.getCell(currentChange.change.modifiedCellIndex);
370
401
  if (cellIntegration) {
371
402
  if (cellIntegration.next(false)) {
372
- this._currentChange.set({ change: currentChange.change, index: cellIntegration.currentIndex.get() }, undefined);
403
+ this.updateCurrentIndex(currentChange.change, cellIntegration.currentIndex.get());
373
404
  return true;
374
405
  }
375
406
  }
376
- const isLastChangeInCell = currentChange.index === lastChangeIndex(currentChange.change);
407
+ const isLastChangeInCell = currentChange.index >= lastChangeIndex(currentChange.change);
377
408
  const index = isLastChangeInCell ? 0 : currentChange.index + 1;
378
409
  const change = isLastChangeInCell ? changes[changes.indexOf(currentChange.change) + 1] : currentChange.change;
379
410
  if (change) {
380
- return this._revealChange(change, index);
411
+ if (isLastChangeInCell) {
412
+ this.blur(currentChange.change);
413
+ }
414
+ if (this._revealChange(change, index)) {
415
+ return true;
416
+ }
381
417
  }
382
418
  }
383
419
  break;
384
420
  case 'insert':
385
421
  case 'delete':
386
422
  {
423
+ this.blur(currentChange.change);
387
424
  const nextChange = changes[changes.indexOf(currentChange.change) + 1];
388
- if (nextChange) {
389
- return this._revealFirstOrLast(nextChange, true);
425
+ if (nextChange && this._revealFirstOrLast(nextChange, true)) {
426
+ return true;
390
427
  }
391
428
  }
392
429
  break;
393
430
  }
394
431
  if (wrap) {
395
- return this.next(false);
432
+ const firstChange = changes[0];
433
+ if (firstChange) {
434
+ return this._revealFirstOrLast(firstChange, true);
435
+ }
396
436
  }
397
437
  return false;
398
438
  }
399
439
  previous(wrap) {
400
- const changes = sortCellChanges(this.cellChanges.get().filter(c => c.type !== 'unchanged'));
401
- const currentChange = this.currentChange.get();
440
+ const changes = this.sortedCellChanges.filter(c => c.type !== 'unchanged');
441
+ const currentChange = this.getCurrentChange();
402
442
  if (!currentChange) {
403
443
  const lastChange = changes[changes.length - 1];
404
444
  if (lastChange) {
@@ -412,24 +452,30 @@ let ChatEditingNotebookEditorWidgetIntegration = class ChatEditingNotebookEditor
412
452
  const cellIntegration = this.getCell(currentChange.change.modifiedCellIndex);
413
453
  if (cellIntegration) {
414
454
  if (cellIntegration.previous(false)) {
415
- this._currentChange.set({ change: currentChange.change, index: cellIntegration.currentIndex.get() }, undefined);
455
+ this.updateCurrentIndex(currentChange.change, cellIntegration.currentIndex.get());
416
456
  return true;
417
457
  }
418
458
  }
419
- const isFirstChangeInCell = currentChange.index === 0;
459
+ const isFirstChangeInCell = currentChange.index <= 0;
420
460
  const change = isFirstChangeInCell ? changes[changes.indexOf(currentChange.change) - 1] : currentChange.change;
421
461
  if (change) {
422
462
  const index = isFirstChangeInCell ? lastChangeIndex(change) : currentChange.index - 1;
423
- return this._revealChange(change, index);
463
+ if (isFirstChangeInCell) {
464
+ this.blur(currentChange.change);
465
+ }
466
+ if (this._revealChange(change, index)) {
467
+ return true;
468
+ }
424
469
  }
425
470
  }
426
471
  break;
427
472
  case 'insert':
428
473
  case 'delete':
429
474
  {
475
+ this.blur(currentChange.change);
430
476
  const prevChange = changes[changes.indexOf(currentChange.change) - 1];
431
- if (prevChange) {
432
- return this._revealFirstOrLast(prevChange, false);
477
+ if (prevChange && this._revealFirstOrLast(prevChange, false)) {
478
+ return true;
433
479
  }
434
480
  }
435
481
  break;
@@ -449,27 +495,60 @@ let ChatEditingNotebookEditorWidgetIntegration = class ChatEditingNotebookEditor
449
495
  integration?.enableAccessibleDiffView();
450
496
  }
451
497
  }
452
- acceptNearestChange(change) {
453
- change.accept();
454
- this.next(true);
498
+ getfocusedIntegration() {
499
+ const first = this.notebookEditor.getSelectionViewModels()[0];
500
+ if (first) {
501
+ return this.cellEditorIntegrations.get(first.model)?.integration;
502
+ }
503
+ return undefined;
455
504
  }
456
- rejectNearestChange(change) {
457
- change.reject();
458
- this.next(true);
505
+ async acceptNearestChange(hunk) {
506
+ if (hunk) {
507
+ await hunk.accept();
508
+ }
509
+ else {
510
+ const current = this.getCurrentChange();
511
+ const focused = this.getfocusedIntegration();
512
+ if (current && !focused || current?.change.type === 'delete') {
513
+ current.change.keep(current?.change.diff.get().changes[current.index]);
514
+ }
515
+ else if (focused) {
516
+ await focused.acceptNearestChange();
517
+ }
518
+ this._currentIndex.set(this._currentIndex.get() - 1, undefined);
519
+ this.next(true);
520
+ }
459
521
  }
460
- async toggleDiff(_change) {
461
- const defaultAgentName = this._chatAgentService.getDefaultAgent(ChatAgentLocation.EditingSession)?.fullName;
522
+ async rejectNearestChange(hunk) {
523
+ if (hunk) {
524
+ await hunk.reject();
525
+ }
526
+ else {
527
+ const current = this.getCurrentChange();
528
+ const focused = this.getfocusedIntegration();
529
+ if (current && !focused || current?.change.type === 'delete') {
530
+ current.change.undo(current.change.diff.get().changes[current.index]);
531
+ }
532
+ else if (focused) {
533
+ await focused.rejectNearestChange();
534
+ }
535
+ this._currentIndex.set(this._currentIndex.get() - 1, undefined);
536
+ this.next(true);
537
+ }
538
+ }
539
+ async toggleDiff(_change, _show) {
540
+ const defaultAgentName = this._chatAgentService.getDefaultAgent(ChatAgentLocation.Panel)?.fullName;
462
541
  const diffInput = {
463
- original: { resource: this._entry.originalURI, options: { selection: undefined } },
464
- modified: { resource: this._entry.modifiedURI, options: { selection: undefined } },
542
+ original: { resource: this._entry.originalURI },
543
+ modified: { resource: this._entry.modifiedURI },
465
544
  label: defaultAgentName
466
545
  ? ( localize(
467
- 4695,
546
+ 4759,
468
547
  '{0} (changes from {1})',
469
548
  basename(this._entry.modifiedURI),
470
549
  defaultAgentName
471
550
  ))
472
- : ( localize(4696, '{0} (changes from chat)', basename(this._entry.modifiedURI)))
551
+ : ( localize(4760, '{0} (changes from chat)', basename(this._entry.modifiedURI)))
473
552
  };
474
553
  await this._editorService.openEditor(diffInput);
475
554
  }
@@ -479,7 +558,8 @@ ChatEditingNotebookEditorWidgetIntegration = ( __decorate([
479
558
  ( __param(6, IEditorService)),
480
559
  ( __param(7, IChatAgentService)),
481
560
  ( __param(8, INotebookEditorService)),
482
- ( __param(9, IAccessibilitySignalService))
561
+ ( __param(9, IAccessibilitySignalService)),
562
+ ( __param(10, ILogService))
483
563
  ], ChatEditingNotebookEditorWidgetIntegration));
484
564
  class ChatEditingNotebookDiffEditorIntegration extends Disposable {
485
565
  constructor(notebookDiffEditor, cellChanges) {
@@ -530,15 +610,15 @@ class ChatEditingNotebookDiffEditorIntegration extends Disposable {
530
610
  }
531
611
  enableAccessibleDiffView() {
532
612
  }
533
- acceptNearestChange(change) {
534
- change.accept();
613
+ async acceptNearestChange(change) {
614
+ await change.accept();
535
615
  this.next(true);
536
616
  }
537
- rejectNearestChange(change) {
538
- change.reject();
617
+ async rejectNearestChange(change) {
618
+ await change.reject();
539
619
  this.next(true);
540
620
  }
541
- async toggleDiff(_change) {
621
+ async toggleDiff(_change, _show) {
542
622
  }
543
623
  }
544
624
  function areDocumentDiff2Equal(diff1, diff2) {
@@ -0,0 +1,19 @@
1
+ import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
2
+ import { IAccessibilitySignalService } from "@codingame/monaco-vscode-api/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService.service";
3
+ import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
4
+ import { INotebookEditor } from "@codingame/monaco-vscode-324f9a6e-6231-5bfc-af17-e147abd2dfd2-common/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser";
5
+ import { NotebookTextModel } from "@codingame/monaco-vscode-notebook-service-override/vscode/vs/workbench/contrib/notebook/common/model/notebookTextModel";
6
+ import { ICellDiffInfo } from "./notebookCellChanges.js";
7
+ export declare class OverlayToolbarDecorator extends Disposable {
8
+ private readonly notebookEditor;
9
+ private readonly notebookModel;
10
+ private readonly instantiationService;
11
+ private readonly accessibilitySignalService;
12
+ private _timeout;
13
+ private readonly overlayDisposables;
14
+ constructor(notebookEditor: INotebookEditor, notebookModel: NotebookTextModel, instantiationService: IInstantiationService, accessibilitySignalService: IAccessibilitySignalService);
15
+ decorate(changes: ICellDiffInfo[]): void;
16
+ private createMarkdownPreviewToolbars;
17
+ private getCellViewModel;
18
+ dispose(): void;
19
+ }