@codingame/monaco-vscode-katex-common 26.2.1 → 27.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 (183) hide show
  1. package/package.json +2 -2
  2. package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.d.ts +10 -4
  3. package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.js +35 -11
  4. package/vscode/src/vs/platform/actions/browser/buttonbar.d.ts +3 -0
  5. package/vscode/src/vs/platform/actions/browser/buttonbar.js +15 -4
  6. package/vscode/src/vs/platform/mcp/common/modelContextProtocolApps.d.ts +548 -0
  7. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityProvider.js +15 -15
  8. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.d.ts +5 -0
  9. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +168 -15
  10. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +1 -1
  11. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +67 -51
  12. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.d.ts +1 -0
  13. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +12 -11
  14. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.js +9 -9
  15. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.d.ts +8 -0
  16. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +42 -19
  17. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.d.ts +12 -1
  18. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +63 -40
  19. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.js +1 -1
  20. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.d.ts +7 -5
  21. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +77 -73
  22. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsviewer.css +69 -32
  23. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.d.ts +23 -6
  24. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js +381 -83
  25. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatImplicitContext.d.ts +1 -0
  26. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatImplicitContext.js +28 -13
  27. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +38 -19
  28. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +109 -113
  29. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +16 -15
  30. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.d.ts +2 -2
  31. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +8 -8
  32. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +14 -14
  33. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +2 -1
  34. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.d.ts +28 -9
  35. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.js +226 -123
  36. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.js +4 -4
  37. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController.js +4 -4
  38. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatAgentHover.js +2 -2
  39. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAgentCommandContentPart.js +1 -1
  40. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAnonymousRateLimitedPart.js +2 -2
  41. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.d.ts +3 -1
  42. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.js +9 -4
  43. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.d.ts +1 -3
  44. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.js +7 -10
  45. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCodeCitationContentPart.js +1 -1
  46. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleContentPart.d.ts +3 -1
  47. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleContentPart.js +22 -4
  48. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleMarkdownContentPart.d.ts +2 -1
  49. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleMarkdownContentPart.js +11 -3
  50. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCommandContentPart.js +1 -1
  51. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationContentPart.js +2 -2
  52. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.js +1 -1
  53. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDiffBlockPart.d.ts +0 -2
  54. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDiffBlockPart.js +0 -6
  55. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDisabledClaudeHooksContentPart.js +2 -2
  56. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatErrorConfirmationPart.d.ts +3 -1
  57. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatErrorConfirmationPart.js +6 -3
  58. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExtensionsContentPart.js +1 -1
  59. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.d.ts +2 -1
  60. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.js +5 -4
  61. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.d.ts +0 -1
  62. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.js +26 -27
  63. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.d.ts +3 -0
  64. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +52 -22
  65. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.js +8 -7
  66. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.js +4 -4
  67. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.d.ts +2 -1
  68. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +20 -8
  69. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPullRequestContentPart.d.ts +3 -3
  70. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPullRequestContentPart.js +11 -6
  71. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.d.ts +36 -1
  72. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +166 -45
  73. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.js +4 -4
  74. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.d.ts +3 -2
  75. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.js +16 -11
  76. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.d.ts +14 -5
  77. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.js +98 -26
  78. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.js +5 -5
  79. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTaskContentPart.js +1 -0
  80. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.js +1 -1
  81. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.d.ts +10 -1
  82. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +244 -80
  83. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.d.ts +29 -1
  84. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.js +252 -8
  85. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.d.ts +4 -0
  86. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.js +39 -18
  87. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.d.ts +5 -3
  88. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.js +36 -23
  89. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolOutputContentSubPart.js +5 -5
  90. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTreeContentPart.js +1 -1
  91. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatWorkspaceEditContentPart.js +3 -3
  92. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.d.ts +5 -7
  93. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.js +42 -37
  94. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatCodeBlockPill.css +12 -3
  95. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatConfirmationWidget.css +48 -18
  96. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatHookContentPart.css +9 -6
  97. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatInlineAnchorWidget.css +2 -2
  98. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatQuestionCarousel.css +351 -422
  99. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTerminalToolProgressPart.css +14 -7
  100. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatThinkingContent.css +102 -7
  101. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTipContent.css +69 -19
  102. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/codeBlockPart.css +48 -15
  103. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.d.ts +4 -1
  104. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +47 -23
  105. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.js +4 -4
  106. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.d.ts +0 -1
  107. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.js +0 -5
  108. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.js +2 -2
  109. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.js +7 -7
  110. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatSimpleToolProgressPart.d.ts +18 -0
  111. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatSimpleToolProgressPart.js +103 -0
  112. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +15 -18
  113. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.d.ts +1 -0
  114. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +63 -69
  115. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.d.ts +1 -1
  116. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +7 -9
  117. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.d.ts +3 -1
  118. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.js +41 -2
  119. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.js +2 -2
  120. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPartUtilities.js +3 -3
  121. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.d.ts +1 -1
  122. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.js +6 -5
  123. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolProgressPart.js +13 -1
  124. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolStreamingSubPart.js +2 -1
  125. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatDragAndDrop.js +11 -11
  126. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.d.ts +17 -3
  127. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +310 -79
  128. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.d.ts +6 -0
  129. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.js +13 -4
  130. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatQuestionCarouselAutoReply.d.ts +35 -0
  131. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatQuestionCarouselAutoReply.js +441 -0
  132. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.d.ts +24 -1
  133. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +392 -86
  134. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatFollowups.js +1 -1
  135. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.d.ts +52 -6
  136. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +271 -187
  137. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.d.ts +68 -0
  138. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.js +668 -0
  139. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.d.ts +12 -1
  140. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.js +57 -16
  141. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.d.ts +2 -6
  142. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +78 -45
  143. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.d.ts +1 -0
  144. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem2.d.ts +28 -0
  145. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem2.js +86 -0
  146. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.js +9 -5
  147. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.js +4 -3
  148. package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chat.css +393 -134
  149. package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chatViewWelcome.css +36 -17
  150. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.d.ts +2 -2
  151. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.js +20 -13
  152. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.d.ts +25 -6
  153. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.js +141 -79
  154. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatContextUsageWidget.css +18 -13
  155. package/vscode/src/vs/workbench/contrib/chat/common/widget/annotations.d.ts +7 -0
  156. package/vscode/src/vs/workbench/contrib/chat/common/widget/annotations.js +108 -27
  157. package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.d.ts +1 -0
  158. package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.js +20 -14
  159. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.d.ts +4 -6
  160. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.js +74 -32
  161. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.d.ts +11 -2
  162. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +68 -27
  163. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.d.ts +5 -0
  164. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.js +125 -13
  165. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatGutterAffordance.d.ts +8 -11
  166. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatGutterAffordance.js +54 -45
  167. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.d.ts +11 -10
  168. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.js +172 -112
  169. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +5 -5
  170. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +1 -1
  171. package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChat.css +0 -42
  172. package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatEditorAffordance.css +27 -3
  173. package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatOverlayWidget.css +83 -2
  174. package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.d.ts +8 -1
  175. package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +58 -33
  176. package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.js +3 -3
  177. package/vscode/src/vs/workbench/contrib/mcp/common/modelContextProtocolApps.d.ts +1 -548
  178. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +7 -7
  179. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +2 -2
  180. package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditor.js +1 -1
  181. package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.js +1 -1
  182. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.js +0 -187
  183. /package/vscode/src/vs/{workbench/contrib → platform}/mcp/common/modelContextProtocolApps.js +0 -0
@@ -32,6 +32,7 @@ import { SIDE_GROUP } from '@codingame/monaco-vscode-api/vscode/vs/workbench/ser
32
32
  import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
33
33
  import { IChatAttachmentResolveService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.service';
34
34
  import { ModifiedFileEntryState } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/editing/chatEditingService';
35
+ import { IChatEditingService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/editing/chatEditingService.service';
35
36
  import { ChatMode } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatModes';
36
37
  import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service';
37
38
  import { IDiagnosticVariableEntryFilterData } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/attachments/chatVariableEntries';
@@ -43,15 +44,15 @@ import { isNotebookContainingCellEditor } from '@codingame/monaco-vscode-api/vsc
43
44
  import { INotebookEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/services/notebookEditorService.service';
44
45
  import { CellUri } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
45
46
  import { INotebookService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookService.service';
46
- import { CTX_INLINE_CHAT_VISIBLE, InlineChatConfigKeys } from '../common/inlineChat.js';
47
+ import { CTX_INLINE_CHAT_VISIBLE, CTX_INLINE_CHAT_FILE_BELONGS_TO_CHAT, CTX_INLINE_CHAT_PENDING_CONFIRMATION, InlineChatConfigKeys } from '../common/inlineChat.js';
47
48
  import { InlineChatAffordance } from './inlineChatAffordance.js';
48
49
  import { InlineChatInputWidget, InlineChatSessionOverlayWidget } from './inlineChatOverlayWidget.js';
49
50
  import { IInlineChatSessionService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.service';
50
51
  import { InlineChatZoneWidget } from './inlineChatZoneWidget.js';
51
52
  import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
53
+ import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
52
54
  import { observableSignalFromEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableSignalFromEvent';
53
55
  import { derived } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/derived';
54
- import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
55
56
  import { waitForState } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/utils/utilsCancellation';
56
57
  import { observableFromEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableFromEvent';
57
58
 
@@ -69,9 +70,10 @@ class InlineChatRunOptions {
69
70
  position,
70
71
  attachments,
71
72
  modelSelector,
72
- resolveOnResponse
73
+ resolveOnResponse,
74
+ attachDiagnostics
73
75
  } = options;
74
- if (typeof message !== "undefined" && typeof message !== "string" || typeof autoSend !== "undefined" && typeof autoSend !== "boolean" || typeof initialRange !== "undefined" && !Range.isIRange(initialRange) || typeof initialSelection !== "undefined" && !Selection.isISelection(initialSelection) || typeof position !== "undefined" && !Position.isIPosition(position) || typeof attachments !== "undefined" && (!Array.isArray(attachments) || !attachments.every(item => item instanceof URI)) || typeof modelSelector !== "undefined" && !isILanguageModelChatSelector(modelSelector) || typeof resolveOnResponse !== "undefined" && typeof resolveOnResponse !== "boolean") {
76
+ if (typeof message !== "undefined" && typeof message !== "string" || typeof autoSend !== "undefined" && typeof autoSend !== "boolean" || typeof initialRange !== "undefined" && !Range.isIRange(initialRange) || typeof initialSelection !== "undefined" && !Selection.isISelection(initialSelection) || typeof position !== "undefined" && !Position.isIPosition(position) || typeof attachments !== "undefined" && (!Array.isArray(attachments) || !attachments.every(item => item instanceof URI)) || typeof modelSelector !== "undefined" && !isILanguageModelChatSelector(modelSelector) || typeof resolveOnResponse !== "undefined" && typeof resolveOnResponse !== "boolean" || typeof attachDiagnostics !== "undefined" && typeof attachDiagnostics !== "boolean") {
75
77
  return false;
76
78
  }
77
79
  return true;
@@ -96,6 +98,9 @@ let InlineChatController = class InlineChatController {
96
98
  get isActive() {
97
99
  return Boolean(this._currentSession.get());
98
100
  }
101
+ get inputWidget() {
102
+ return this._inputWidget;
103
+ }
99
104
  constructor(
100
105
  _editor,
101
106
  _instaService,
@@ -110,7 +115,9 @@ let InlineChatController = class InlineChatController {
110
115
  _editorService,
111
116
  _markerDecorationsService,
112
117
  _languageModelService,
113
- _logService
118
+ _logService,
119
+ _chatEditingService,
120
+ _chatService
114
121
  ) {
115
122
  this._editor = _editor;
116
123
  this._instaService = _instaService;
@@ -124,17 +131,43 @@ let InlineChatController = class InlineChatController {
124
131
  this._markerDecorationsService = _markerDecorationsService;
125
132
  this._languageModelService = _languageModelService;
126
133
  this._logService = _logService;
134
+ this._chatEditingService = _chatEditingService;
135
+ this._chatService = _chatService;
127
136
  this._store = ( new DisposableStore());
128
137
  this._isActiveController = observableValue(this, false);
129
138
  const editorObs = observableCodeEditor(_editor);
130
139
  const ctxInlineChatVisible = CTX_INLINE_CHAT_VISIBLE.bindTo(contextKeyService);
140
+ const ctxFileBelongsToChat = CTX_INLINE_CHAT_FILE_BELONGS_TO_CHAT.bindTo(contextKeyService);
141
+ const ctxPendingConfirmation = CTX_INLINE_CHAT_PENDING_CONFIRMATION.bindTo(contextKeyService);
131
142
  const notebookAgentConfig = observableConfigValue(InlineChatConfigKeys.notebookAgent, false, this._configurationService);
132
143
  this._renderMode = observableConfigValue(InlineChatConfigKeys.RenderMode, "zone", this._configurationService);
133
- const overlayWidget = this._store.add(this._instaService.createInstance(InlineChatInputWidget, editorObs));
144
+ this._store.add(autorun(r => {
145
+ const model = editorObs.model.read(r);
146
+ if (!model) {
147
+ ctxFileBelongsToChat.set(false);
148
+ return;
149
+ }
150
+ const sessions = this._chatEditingService.editingSessionsObs.read(r);
151
+ let hasEdits = false;
152
+ for (const session of sessions) {
153
+ const entries = session.entries.read(r);
154
+ for (const entry of entries) {
155
+ if (isEqual(entry.modifiedURI, model.uri)) {
156
+ hasEdits = true;
157
+ break;
158
+ }
159
+ }
160
+ if (hasEdits) {
161
+ break;
162
+ }
163
+ }
164
+ ctxFileBelongsToChat.set(hasEdits);
165
+ }));
166
+ const overlayWidget = this._inputWidget = this._store.add(this._instaService.createInstance(InlineChatInputWidget, editorObs));
134
167
  const sessionOverlayWidget = this._store.add(
135
168
  this._instaService.createInstance(InlineChatSessionOverlayWidget, editorObs)
136
169
  );
137
- this._gutterIndicator = this._store.add(
170
+ this.inputOverlayWidget = this._store.add(
138
171
  this._instaService.createInstance(InlineChatAffordance, this._editor, overlayWidget)
139
172
  );
140
173
  this._zone = ( new Lazy(() => {
@@ -240,7 +273,7 @@ let InlineChatController = class InlineChatController {
240
273
  }
241
274
  }));
242
275
  const defaultPlaceholderObs = ( visibleSessionObs.map((session, r) => {
243
- return session?.initialSelection.isEmpty() ? ( localize(8819, "Generate code")) : ( localize(8820, "Modify selected code"));
276
+ return session?.initialSelection.isEmpty() ? ( localize(9472, "Generate code")) : ( localize(9473, "Modify selected code"));
244
277
  }));
245
278
  this._store.add(autorun(r => {
246
279
  const session = visibleSessionObs.read(r);
@@ -270,14 +303,18 @@ let InlineChatController = class InlineChatController {
270
303
  const session = visibleSessionObs.read(r);
271
304
  const renderMode = this._renderMode.read(r);
272
305
  if (!session || renderMode !== "hover") {
306
+ ctxPendingConfirmation.set(false);
273
307
  sessionOverlayWidget.hide();
274
308
  return;
275
309
  }
276
310
  const lastRequest = session.chatModel.lastRequestObs.read(r);
277
311
  const isInProgress = lastRequest?.response?.isInProgress.read(r);
312
+ const isPendingConfirmation = !!lastRequest?.response?.isPendingConfirmation.read(r);
313
+ const isError = !!lastRequest?.response?.result?.errorDetails;
314
+ ctxPendingConfirmation.set(isPendingConfirmation);
278
315
  const entry = session.editingSession.readEntry(session.uri, r);
279
316
  const isNotSettled = entry ? entry.state.read(r) === ModifiedFileEntryState.Modified : false;
280
- if (isInProgress || isNotSettled) {
317
+ if (isInProgress || isNotSettled || isPendingConfirmation || isError) {
281
318
  sessionOverlayWidget.show(session);
282
319
  } else {
283
320
  sessionOverlayWidget.hide();
@@ -342,7 +379,7 @@ let InlineChatController = class InlineChatController {
342
379
  if (lastProgress) {
343
380
  placeholder = renderAsPlaintext(lastProgress.content);
344
381
  }
345
- this._zone.rawValue?.widget.chatWidget.setInputPlaceholder(placeholder || ( localize(8821, "Working...")));
382
+ this._zone.rawValue?.widget.chatWidget.setInputPlaceholder(placeholder || ( localize(9474, "Working...")));
346
383
  }
347
384
  }));
348
385
  this._store.add(autorun(r => {
@@ -395,26 +432,29 @@ let InlineChatController = class InlineChatController {
395
432
  await existingSession.editingSession.accept();
396
433
  existingSession.dispose();
397
434
  }
398
- if (!arg?.message && this._configurationService.getValue(InlineChatConfigKeys.RenderMode) === "hover") {
399
- await this._gutterIndicator.showMenuAtSelection();
400
- return true;
401
- }
402
435
  this._isActiveController.set(true, undefined);
403
436
  const session = this._inlineChatSessionService.createSession(this._editor);
404
437
  const sessionStore = ( new DisposableStore());
405
438
  try {
406
439
  await this._applyModelDefaults(session, sessionStore);
407
- const entries = [];
408
- for (const [range, marker] of this._markerDecorationsService.getLiveMarkers(uri)) {
409
- if (range.intersectRanges(this._editor.getSelection())) {
410
- const filter = IDiagnosticVariableEntryFilterData.fromMarker(marker);
411
- entries.push(IDiagnosticVariableEntryFilterData.toEntry(filter));
412
- }
440
+ if (arg) {
441
+ arg.attachDiagnostics ??= this._configurationService.getValue(InlineChatConfigKeys.RenderMode) === "zone";
413
442
  }
414
- if (entries.length > 0) {
415
- this._zone.value.widget.chatWidget.attachmentModel.addContext(...entries);
416
- this._zone.value.widget.chatWidget.input.setValue(entries.length > 1 ? ( localize(8822, "Fix the attached problems")) : ( localize(8823, "Fix the attached problem")), true);
417
- this._zone.value.widget.chatWidget.inputEditor.setSelection(( new Selection(1, 1, Number.MAX_SAFE_INTEGER, 1)));
443
+ if (arg?.attachDiagnostics) {
444
+ const entries = [];
445
+ for (const [range, marker] of this._markerDecorationsService.getLiveMarkers(uri)) {
446
+ if (range.intersectRanges(this._editor.getSelection())) {
447
+ const filter = IDiagnosticVariableEntryFilterData.fromMarker(marker);
448
+ entries.push(IDiagnosticVariableEntryFilterData.toEntry(filter));
449
+ }
450
+ }
451
+ if (entries.length > 0) {
452
+ this._zone.value.widget.chatWidget.attachmentModel.addContext(...entries);
453
+ const msg = entries.length > 1 ? ( localize(9475, "Fix the attached problems")) : ( localize(9476, "Fix the attached problem"));
454
+ this._zone.value.widget.chatWidget.input.setValue(msg, true);
455
+ arg.message = msg;
456
+ this._zone.value.widget.chatWidget.inputEditor.setSelection(( new Selection(1, 1, Number.MAX_SAFE_INTEGER, 1)));
457
+ }
418
458
  }
419
459
  if (arg && InlineChatRunOptions.isInlineChatRunOptions(arg)) {
420
460
  if (arg.initialRange) {
@@ -481,6 +521,7 @@ let InlineChatController = class InlineChatController {
481
521
  if (!session) {
482
522
  return;
483
523
  }
524
+ this._chatService.cancelCurrentRequestForSession(session.chatModel.sessionResource, "inlineChatReject");
484
525
  await session.editingSession.reject();
485
526
  session.dispose();
486
527
  }
@@ -557,14 +598,14 @@ let InlineChatController = class InlineChatController {
557
598
  return undefined;
558
599
  }
559
600
  };
560
- InlineChatController = InlineChatController_1 = ( __decorate([( __param(1, IInstantiationService)), ( __param(2, INotebookEditorService)), ( __param(3, IInlineChatSessionService)), ( __param(4, ICodeEditorService)), ( __param(5, IContextKeyService)), ( __param(6, IConfigurationService)), ( __param(7, ISharedWebContentExtractorService)), ( __param(8, IFileService)), ( __param(9, IChatAttachmentResolveService)), ( __param(10, IEditorService)), ( __param(11, IMarkerDecorationsService)), ( __param(12, ILanguageModelsService)), ( __param(13, ILogService))], InlineChatController));
601
+ InlineChatController = InlineChatController_1 = ( __decorate([( __param(1, IInstantiationService)), ( __param(2, INotebookEditorService)), ( __param(3, IInlineChatSessionService)), ( __param(4, ICodeEditorService)), ( __param(5, IContextKeyService)), ( __param(6, IConfigurationService)), ( __param(7, ISharedWebContentExtractorService)), ( __param(8, IFileService)), ( __param(9, IChatAttachmentResolveService)), ( __param(10, IEditorService)), ( __param(11, IMarkerDecorationsService)), ( __param(12, ILanguageModelsService)), ( __param(13, ILogService)), ( __param(14, IChatEditingService)), ( __param(15, IChatService))], InlineChatController));
561
602
  async function reviewEdits(accessor, editor, stream, token, applyCodeBlockSuggestionId) {
562
603
  if (!editor.hasModel()) {
563
604
  return false;
564
605
  }
565
606
  const chatService = accessor.get(IChatService);
566
607
  const uri = editor.getModel().uri;
567
- const chatModelRef = chatService.startSession(ChatAgentLocation.EditorInline);
608
+ const chatModelRef = chatService.startNewLocalSession(ChatAgentLocation.EditorInline);
568
609
  const chatModel = chatModelRef.object;
569
610
  chatModel.startEditingSession(true);
570
611
  const store = ( new DisposableStore());
@@ -626,7 +667,7 @@ async function reviewNotebookEdits(accessor, uri, stream, token) {
626
667
  const chatService = accessor.get(IChatService);
627
668
  const notebookService = accessor.get(INotebookService);
628
669
  const isNotebook = notebookService.hasSupportedNotebooks(uri);
629
- const chatModelRef = chatService.startSession(ChatAgentLocation.EditorInline);
670
+ const chatModelRef = chatService.startNewLocalSession(ChatAgentLocation.EditorInline);
630
671
  const chatModel = chatModelRef.object;
631
672
  chatModel.startEditingSession(true);
632
673
  const store = ( new DisposableStore());
@@ -1,5 +1,6 @@
1
1
  import { IDimension } from "@codingame/monaco-vscode-api/vscode/vs/base/browser/dom";
2
2
  import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
3
+ import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
3
4
  import { ICodeEditor, IContentWidget, IContentWidgetPosition } from "@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorBrowser";
4
5
  import { Selection } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/core/selection";
5
6
  import { IObservable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/observable";
@@ -15,10 +16,14 @@ export declare class InlineChatEditorAffordance extends Disposable implements IC
15
16
  private readonly _domNode;
16
17
  private _position;
17
18
  private _isVisible;
19
+ private readonly _onDidRunAction;
20
+ readonly onDidRunAction: Event<string>;
18
21
  readonly allowEditorOverflow = true;
19
22
  readonly suppressMouseDown = false;
20
23
  constructor(_editor: ICodeEditor, selection: IObservable<Selection | undefined>, instantiationService: IInstantiationService);
21
24
  private _show;
25
+ private _showAtSelection;
26
+ private _showAtLineStart;
22
27
  private _hide;
23
28
  getId(): string;
24
29
  getDomNode(): HTMLElement;
@@ -2,13 +2,15 @@
2
2
  import { registerCss } from '@codingame/monaco-vscode-api/css';
3
3
  import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
4
4
  import * as inlineChatEditorAffordance from './media/inlineChatEditorAffordance.css';
5
- import { $ } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
5
+ import { reset, $ } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
6
6
  import { MutableDisposable, DisposableStore, Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
7
+ import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
7
8
  import { ContentWidgetPositionPreference } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorBrowser';
8
9
  import { EditorOption } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/config/editorOptions';
9
10
  import { SelectionDirection } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/selection';
11
+ import { computeIndentLevel } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/model/utils';
10
12
  import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
11
- import { MenuId, MenuItemAction } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
13
+ import { MenuItemAction, MenuId } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
12
14
  import { MenuWorkbenchToolBar, HiddenItemStrategy } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/toolbar';
13
15
  import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
14
16
  import { quickFixCommandId } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/codeAction/browser/codeAction';
@@ -22,6 +24,8 @@ import { IThemeService } from '@codingame/monaco-vscode-api/vscode/vs/platform/t
22
24
  import { IContextMenuService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextview/browser/contextView.service';
23
25
  import { IAccessibilityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/accessibility/common/accessibility.service';
24
26
  import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
27
+ import { ACTION_START, ACTION_ASK_IN_CHAT } from '../common/inlineChat.js';
28
+ import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
25
29
  import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
26
30
 
27
31
  var InlineChatEditorAffordance_1;
@@ -35,13 +39,44 @@ let QuickFixActionViewItem = class QuickFixActionViewItem extends MenuEntryActio
35
39
  contextKeyService,
36
40
  themeService,
37
41
  contextMenuService,
38
- accessibilityService
42
+ accessibilityService,
43
+ commandService
39
44
  ) {
40
- super(action, {
45
+ const wrappedAction = new (class extends MenuItemAction {
46
+ constructor() {
47
+ super(
48
+ action.item,
49
+ action.alt?.item,
50
+ {},
51
+ action.hideActions,
52
+ action.menuKeybinding,
53
+ contextKeyService,
54
+ commandService
55
+ );
56
+ this.elementGetter = () => undefined;
57
+ }
58
+ async run(...args) {
59
+ const controller = CodeActionController.get(_editor);
60
+ const info = controller?.lightBulbState.get();
61
+ const element = this.elementGetter();
62
+ if (controller && info && element) {
63
+ const {
64
+ bottom,
65
+ left
66
+ } = element.getBoundingClientRect();
67
+ await controller.showCodeActions(info.trigger, info.actions, {
68
+ x: left,
69
+ y: bottom
70
+ });
71
+ }
72
+ }
73
+ })();
74
+ super(wrappedAction, {
41
75
  draggable: false
42
76
  }, keybindingService, notificationService, contextKeyService, themeService, contextMenuService, accessibilityService);
43
77
  this._editor = _editor;
44
78
  this._lightBulbStore = this._store.add(( new MutableDisposable()));
79
+ wrappedAction.elementGetter = () => this.element;
45
80
  }
46
81
  render(container) {
47
82
  super.render(container);
@@ -63,14 +98,42 @@ let QuickFixActionViewItem = class QuickFixActionViewItem extends MenuEntryActio
63
98
  const icon = info?.icon ?? Codicon.lightBulb;
64
99
  const iconClasses = ThemeIcon.asClassNameArray(icon);
65
100
  this.label.className = "";
66
- this.label.classList.add("codicon", ...iconClasses);
101
+ this.label.classList.add("codicon", "action-label", ...iconClasses);
67
102
  }
68
103
  this._currentTitle = info?.title;
69
104
  this.updateTooltip();
70
105
  }));
71
106
  }
72
107
  };
73
- QuickFixActionViewItem = ( __decorate([( __param(2, IKeybindingService)), ( __param(3, INotificationService)), ( __param(4, IContextKeyService)), ( __param(5, IThemeService)), ( __param(6, IContextMenuService)), ( __param(7, IAccessibilityService))], QuickFixActionViewItem));
108
+ QuickFixActionViewItem = ( __decorate([( __param(2, IKeybindingService)), ( __param(3, INotificationService)), ( __param(4, IContextKeyService)), ( __param(5, IThemeService)), ( __param(6, IContextMenuService)), ( __param(7, IAccessibilityService)), ( __param(8, ICommandService))], QuickFixActionViewItem));
109
+ let LabelWithKeybindingActionViewItem = class LabelWithKeybindingActionViewItem extends MenuEntryActionViewItem {
110
+ constructor(
111
+ action,
112
+ keybindingService,
113
+ notificationService,
114
+ contextKeyService,
115
+ themeService,
116
+ contextMenuService,
117
+ accessibilityService
118
+ ) {
119
+ super(action, {
120
+ draggable: false
121
+ }, keybindingService, notificationService, contextKeyService, themeService, contextMenuService, accessibilityService);
122
+ this.options.label = true;
123
+ this.options.icon = false;
124
+ this._kbLabel = keybindingService.lookupKeybinding(action.id)?.getLabel() ?? undefined;
125
+ }
126
+ updateLabel() {
127
+ if (this.label) {
128
+ reset(
129
+ this.label,
130
+ this.action.label,
131
+ ...(this._kbLabel ? [$("span.inline-chat-keybinding", undefined, this._kbLabel)] : [])
132
+ );
133
+ }
134
+ }
135
+ };
136
+ LabelWithKeybindingActionViewItem = ( __decorate([( __param(1, IKeybindingService)), ( __param(2, INotificationService)), ( __param(3, IContextKeyService)), ( __param(4, IThemeService)), ( __param(5, IContextMenuService)), ( __param(6, IAccessibilityService))], LabelWithKeybindingActionViewItem));
74
137
  let InlineChatEditorAffordance = class InlineChatEditorAffordance extends Disposable {
75
138
  static {
76
139
  InlineChatEditorAffordance_1 = this;
@@ -84,10 +147,12 @@ let InlineChatEditorAffordance = class InlineChatEditorAffordance extends Dispos
84
147
  this._id = `inline-chat-content-widget-${InlineChatEditorAffordance_1._idPool++}`;
85
148
  this._position = null;
86
149
  this._isVisible = false;
150
+ this._onDidRunAction = this._store.add(( new Emitter()));
151
+ this.onDidRunAction = this._onDidRunAction.event;
87
152
  this.allowEditorOverflow = true;
88
153
  this.suppressMouseDown = false;
89
154
  this._domNode = $(".inline-chat-content-widget");
90
- this._store.add(
155
+ const toolbar = this._store.add(
91
156
  instantiationService.createInstance(MenuWorkbenchToolBar, this._domNode, MenuId.InlineChatEditorAffordance, {
92
157
  telemetrySource: "inlineChatEditorAffordance",
93
158
  hiddenItemStrategy: HiddenItemStrategy.Ignore,
@@ -95,16 +160,24 @@ let InlineChatEditorAffordance = class InlineChatEditorAffordance extends Dispos
95
160
  renderShortTitle: true
96
161
  },
97
162
  toolbarOptions: {
98
- primaryGroup: () => true
163
+ primaryGroup: () => true,
164
+ useSeparatorsInPrimaryActions: true
99
165
  },
100
166
  actionViewItemProvider: action => {
101
167
  if (action instanceof MenuItemAction && action.id === quickFixCommandId) {
102
168
  return instantiationService.createInstance(QuickFixActionViewItem, action, this._editor);
103
169
  }
170
+ if (action instanceof MenuItemAction && (action.id === ACTION_START || action.id === ACTION_ASK_IN_CHAT || action.id === "inlineChat.fixDiagnostics")) {
171
+ return instantiationService.createInstance(LabelWithKeybindingActionViewItem, action);
172
+ }
104
173
  return undefined;
105
174
  }
106
175
  })
107
176
  );
177
+ this._store.add(toolbar.actionRunner.onDidRun(e => {
178
+ this._onDidRunAction.fire(e.action.id);
179
+ this._hide();
180
+ }));
108
181
  this._store.add(autorun(r => {
109
182
  const sel = selection.read(r);
110
183
  if (sel) {
@@ -115,6 +188,19 @@ let InlineChatEditorAffordance = class InlineChatEditorAffordance extends Dispos
115
188
  }));
116
189
  }
117
190
  _show(selection) {
191
+ if (selection.isEmpty()) {
192
+ this._showAtLineStart(selection.getPosition().lineNumber);
193
+ } else {
194
+ this._showAtSelection(selection);
195
+ }
196
+ if (this._isVisible) {
197
+ this._editor.layoutContentWidget(this);
198
+ } else {
199
+ this._editor.addContentWidget(this);
200
+ this._isVisible = true;
201
+ }
202
+ }
203
+ _showAtSelection(selection) {
118
204
  const cursorPosition = selection.getPosition();
119
205
  const direction = selection.getDirection();
120
206
  const preference = direction === SelectionDirection.RTL ? ContentWidgetPositionPreference.ABOVE : ContentWidgetPositionPreference.BELOW;
@@ -122,12 +208,38 @@ let InlineChatEditorAffordance = class InlineChatEditorAffordance extends Dispos
122
208
  position: cursorPosition,
123
209
  preference: [preference]
124
210
  };
125
- if (this._isVisible) {
126
- this._editor.layoutContentWidget(this);
127
- } else {
128
- this._editor.addContentWidget(this);
129
- this._isVisible = true;
211
+ }
212
+ _showAtLineStart(lineNumber) {
213
+ const model = this._editor.getModel();
214
+ if (!model) {
215
+ return;
216
+ }
217
+ const tabSize = model.getOptions().tabSize;
218
+ const fontInfo = this._editor.getOptions().get(EditorOption.fontInfo);
219
+ const lineContent = model.getLineContent(lineNumber);
220
+ const indent = computeIndentLevel(lineContent, tabSize);
221
+ const lineHasSpace = indent < 0 ? true : fontInfo.spaceWidth * indent > 22;
222
+ let effectiveLineNumber = lineNumber;
223
+ if (!lineHasSpace) {
224
+ const isLineEmptyOrIndented = ln => {
225
+ const content = model.getLineContent(ln);
226
+ return /^\s*$|^\s+/.test(content);
227
+ };
228
+ const lineCount = model.getLineCount();
229
+ if (lineNumber > 1 && isLineEmptyOrIndented(lineNumber - 1)) {
230
+ effectiveLineNumber = lineNumber - 1;
231
+ } else if (lineNumber < lineCount && isLineEmptyOrIndented(lineNumber + 1)) {
232
+ effectiveLineNumber = lineNumber + 1;
233
+ }
130
234
  }
235
+ const effectiveColumnNumber = /^\S\s*$/.test(model.getLineContent(effectiveLineNumber)) ? 2 : 1;
236
+ this._position = {
237
+ position: {
238
+ lineNumber: effectiveLineNumber,
239
+ column: effectiveColumnNumber
240
+ },
241
+ preference: [ContentWidgetPositionPreference.EXACT]
242
+ };
131
243
  }
132
244
  _hide() {
133
245
  if (this._isVisible) {
@@ -1,21 +1,18 @@
1
- import { IObservable, ISettableObservable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/observable";
1
+ import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
2
+ import { IObservable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/observable";
2
3
  import { ObservableCodeEditor } from "@codingame/monaco-vscode-api/vscode/vs/editor/browser/observableCodeEditor";
3
4
  import { Selection } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/core/selection";
4
5
  import { InlineEditsGutterIndicator } from "@codingame/monaco-vscode-api/vscode/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView";
5
6
  import { IAccessibilityService } from "@codingame/monaco-vscode-api/vscode/vs/platform/accessibility/common/accessibility.service";
7
+ import { IMenuService } from "@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions.service";
8
+ import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service";
6
9
  import { HoverService } from "@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hoverService";
7
10
  import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
8
11
  import { IKeybindingService } from "@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding.service";
9
12
  import { IThemeService } from "@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service";
13
+ import { IUserInteractionService } from "@codingame/monaco-vscode-api/vscode/vs/platform/userInteraction/browser/userInteractionService.service";
10
14
  export declare class InlineChatGutterAffordance extends InlineEditsGutterIndicator {
11
- private readonly _myEditorObs;
12
- private readonly _hover;
13
- private readonly _keybindingService;
14
- constructor(_myEditorObs: ObservableCodeEditor, selection: IObservable<Selection | undefined>, _hover: ISettableObservable<{
15
- rect: DOMRect;
16
- above: boolean;
17
- lineNumber: number;
18
- } | undefined>, _keybindingService: IKeybindingService, hoverService: HoverService, instantiationService: IInstantiationService, accessibilityService: IAccessibilityService, themeService: IThemeService);
19
- protected _showHover(): void;
20
- private _doShowHover;
15
+ private readonly _onDidRunAction;
16
+ readonly onDidRunAction: Event<string>;
17
+ constructor(myEditorObs: ObservableCodeEditor, selection: IObservable<Selection | undefined>, _keybindingService: IKeybindingService, hoverService: HoverService, instantiationService: IInstantiationService, accessibilityService: IAccessibilityService, themeService: IThemeService, userInteractionService: IUserInteractionService, menuService: IMenuService, contextKeyService: IContextKeyService);
21
18
  }