@codingame/monaco-vscode-katex-common 26.2.2 → 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 +51 -20
  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 +241 -78
  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 +61 -66
  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
@@ -7,6 +7,7 @@ import { Button } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/b
7
7
  import { HoverStyle } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/hover/hover';
8
8
  import { createInstantHoverDelegate } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/hover/hoverDelegateFactory';
9
9
  import { HoverPosition } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/hover/hoverWidget';
10
+ import { DomScrollableElement } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/scrollbar/scrollableElement';
10
11
  import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
11
12
  import { Emitter, Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
12
13
  import { MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
@@ -15,11 +16,13 @@ import { KeyCode } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keyC
15
16
  import { Disposable, DisposableStore, MutableDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
16
17
  import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
17
18
  import { basename, dirname } from '@codingame/monaco-vscode-api/vscode/vs/base/common/path';
19
+ import { ScrollbarVisibility } from '@codingame/monaco-vscode-api/vscode/vs/base/common/scrollable';
18
20
  import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
19
21
  import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
20
22
  import { EditorContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/editorContextKeys';
21
23
  import { ILanguageService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language.service';
22
24
  import { ILanguageFeaturesService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/languageFeatures.service';
25
+ import { getIconClasses } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/getIconClasses';
23
26
  import { IModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model.service';
24
27
  import { ITextModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/resolverService.service';
25
28
  import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
@@ -55,6 +58,7 @@ import { getHistoryItemEditorTitle } from '@codingame/monaco-vscode-api/vscode/v
55
58
  import { ITerminalService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal.service';
56
59
  import { OmittedState, isStringVariableEntry, PromptFileVariableKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/attachments/chatVariableEntries';
57
60
  import { ILanguageModelsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModels.service';
61
+ import { IChatEntitlementService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/chat/common/chatEntitlementService.service';
58
62
  import { isToolSet } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService';
59
63
  import { ILanguageModelToolsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService.service';
60
64
  import { getCleanPromptName } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/config/promptFileLocations';
@@ -70,6 +74,16 @@ const commonHoverOptions = {
70
74
  const commonHoverLifecycleOptions = {
71
75
  groupId: "chat-attachments"
72
76
  };
77
+ const KEY_ELEMENT_HOVER_COMPUTED_STYLE_PROPERTIES = [
78
+ "display",
79
+ "position",
80
+ "margin",
81
+ "padding",
82
+ "font-size",
83
+ "font-family",
84
+ "color",
85
+ "background-color"
86
+ ];
73
87
  let AbstractChatAttachmentWidget = class AbstractChatAttachmentWidget extends Disposable {
74
88
  get onDidDelete() {
75
89
  return this._onDidDelete.event;
@@ -125,7 +139,7 @@ let AbstractChatAttachmentWidget = class AbstractChatAttachmentWidget extends Di
125
139
  const clearButton = ( new Button(this.element, {
126
140
  supportIcons: true,
127
141
  hoverDelegate: createInstantHoverDelegate(),
128
- title: ( localize(5082, "Remove from context"))
142
+ title: ( localize(5325, "Remove from context"))
129
143
  }));
130
144
  clearButton.element.tabIndex = -1;
131
145
  clearButton.icon = Codicon.close;
@@ -216,14 +230,14 @@ let FileAttachmentWidget = class FileAttachmentWidget extends AbstractChatAttach
216
230
  const fileDirname = dirname(resource.path);
217
231
  const friendlyName = `${fileBasename} ${fileDirname}`;
218
232
  let ariaLabel = range ? ( localize(
219
- 5083,
233
+ 5326,
220
234
  "Attached file, {0}, line {1} to line {2}",
221
235
  friendlyName,
222
236
  range.startLineNumber,
223
237
  range.endLineNumber
224
- )) : ( localize(5084, "Attached file, {0}", friendlyName));
238
+ )) : ( localize(5327, "Attached file, {0}", friendlyName));
225
239
  if (attachment.omittedState === OmittedState.Full) {
226
- ariaLabel = ( localize(5085, "Omitted this file: {0}", attachment.name));
240
+ ariaLabel = ( localize(5328, "Omitted this file: {0}", attachment.name));
227
241
  this.renderOmittedWarning(friendlyName, ariaLabel);
228
242
  } else {
229
243
  const fileOptions = {
@@ -261,7 +275,7 @@ let FileAttachmentWidget = class FileAttachmentWidget extends AbstractChatAttach
261
275
  hoverElement.setAttribute("aria-label", ariaLabel);
262
276
  this.element.classList.add("warning");
263
277
  hoverElement.textContent = ( localize(
264
- 5086,
278
+ 5329,
265
279
  "{0} does not support this file type.",
266
280
  this.currentLanguageModel ? this.languageModelsService.lookupLanguageModel(this.currentLanguageModel.identifier)?.name : this.currentLanguageModel ?? "This model"
267
281
  ));
@@ -298,7 +312,7 @@ let TerminalCommandAttachmentWidget = class TerminalCommandAttachmentWidget exte
298
312
  );
299
313
  this.hoverService = hoverService;
300
314
  this.terminalService = terminalService;
301
- const ariaLabel = ( localize(5087, "Terminal command, {0}", attachment.command));
315
+ const ariaLabel = ( localize(5330, "Terminal command, {0}", attachment.command));
302
316
  const clickHandler = () => this.openResource(attachment.resource, {
303
317
  editorOptions: {
304
318
  preserveFocus: true
@@ -351,16 +365,16 @@ function getHoverContent(ariaLabel, attachment) {
351
365
  const hoverElement = $("div.chat-attached-context-hover");
352
366
  hoverElement.setAttribute("aria-label", ariaLabel);
353
367
  const commandTitle = $("div", {}, typeof attachment.exitCode === "number" ? ( localize(
354
- 5088,
368
+ 5331,
355
369
  "Command: {0}, exit code: {1}",
356
370
  attachment.command,
357
371
  attachment.exitCode
358
- )) : ( localize(5089, "Command")));
372
+ )) : ( localize(5332, "Command")));
359
373
  commandTitle.classList.add("attachment-additional-info");
360
374
  const commandBlock = $("pre.chat-terminal-command-block");
361
375
  hoverElement.append(commandTitle, commandBlock);
362
376
  if (attachment.output && attachment.output.trim().length > 0) {
363
- const outputTitle = $("div", {}, ( localize(5090, "Output:")));
377
+ const outputTitle = $("div", {}, ( localize(5333, "Output:")));
364
378
  outputTitle.classList.add("attachment-additional-info");
365
379
  const outputBlock = $("pre.chat-terminal-command-output");
366
380
  const fullOutputLines = attachment.output.split("\n");
@@ -403,7 +417,8 @@ let ImageAttachmentWidget = class ImageAttachmentWidget extends AbstractChatAtta
403
417
  hoverService,
404
418
  languageModelsService,
405
419
  instantiationService,
406
- labelService
420
+ labelService,
421
+ chatEntitlementService
407
422
  ) {
408
423
  super(
409
424
  attachment,
@@ -418,13 +433,14 @@ let ImageAttachmentWidget = class ImageAttachmentWidget extends AbstractChatAtta
418
433
  this.hoverService = hoverService;
419
434
  this.languageModelsService = languageModelsService;
420
435
  this.labelService = labelService;
436
+ this.chatEntitlementService = chatEntitlementService;
421
437
  let ariaLabel;
422
438
  if (attachment.omittedState === OmittedState.Full) {
423
- ariaLabel = ( localize(5091, "Omitted this image: {0}", attachment.name));
439
+ ariaLabel = ( localize(5334, "Omitted this image: {0}", attachment.name));
424
440
  } else if (attachment.omittedState === OmittedState.Partial) {
425
- ariaLabel = ( localize(5092, "Partially omitted this image: {0}", attachment.name));
441
+ ariaLabel = ( localize(5335, "Partially omitted this image: {0}", attachment.name));
426
442
  } else {
427
- ariaLabel = ( localize(5093, "Attached image, {0}", attachment.name));
443
+ ariaLabel = ( localize(5336, "Attached image, {0}", attachment.name));
428
444
  }
429
445
  const ref = attachment.references?.[0]?.reference;
430
446
  resource = ref && URI.isUri(ref) ? ref : undefined;
@@ -450,7 +466,8 @@ let ImageAttachmentWidget = class ImageAttachmentWidget extends AbstractChatAtta
450
466
  currentLanguageModelName,
451
467
  clickHandler,
452
468
  this.currentLanguageModel,
453
- attachment.omittedState
469
+ attachment.omittedState,
470
+ this.chatEntitlementService.previewFeaturesDisabled
454
471
  ));
455
472
  if (resource) {
456
473
  this.addResourceOpenHandlers(resource, undefined);
@@ -462,7 +479,7 @@ let ImageAttachmentWidget = class ImageAttachmentWidget extends AbstractChatAtta
462
479
  }
463
480
  }
464
481
  };
465
- ImageAttachmentWidget = ( __decorate([( __param(6, ICommandService)), ( __param(7, IOpenerService)), ( __param(8, IConfigurationService)), ( __param(9, IHoverService)), ( __param(10, ILanguageModelsService)), ( __param(11, IInstantiationService)), ( __param(12, ILabelService))], ImageAttachmentWidget));
482
+ ImageAttachmentWidget = ( __decorate([( __param(6, ICommandService)), ( __param(7, IOpenerService)), ( __param(8, IConfigurationService)), ( __param(9, IHoverService)), ( __param(10, ILanguageModelsService)), ( __param(11, IInstantiationService)), ( __param(12, ILabelService)), ( __param(13, IChatEntitlementService))], ImageAttachmentWidget));
466
483
  function createImageElements(
467
484
  resource,
468
485
  name,
@@ -474,7 +491,8 @@ function createImageElements(
474
491
  currentLanguageModelName,
475
492
  clickHandler,
476
493
  currentLanguageModel,
477
- omittedState
494
+ omittedState,
495
+ previewFeaturesDisabled
478
496
  ) {
479
497
  const disposable = ( new DisposableStore());
480
498
  if (omittedState === OmittedState.Partial) {
@@ -488,17 +506,24 @@ function createImageElements(
488
506
  }
489
507
  const supportsVision = modelSupportsVision(currentLanguageModel);
490
508
  const pillIcon = $("div.chat-attached-context-pill", {}, $(
491
- supportsVision ? "span.codicon.codicon-file-media" : "span.codicon.codicon-warning"
509
+ (supportsVision && !previewFeaturesDisabled) ? "span.codicon.codicon-file-media" : "span.codicon.codicon-warning"
492
510
  ));
493
511
  const textLabel = $("span.chat-attached-context-custom-text", {}, name);
494
512
  element.appendChild(pillIcon);
495
513
  element.appendChild(textLabel);
496
514
  const hoverElement = $("div.chat-attached-context-hover");
497
515
  hoverElement.setAttribute("aria-label", ariaLabel);
498
- if ((!supportsVision && currentLanguageModel) || omittedState === OmittedState.Full) {
516
+ if (previewFeaturesDisabled) {
517
+ element.classList.add("warning");
518
+ hoverElement.textContent = ( localize(5337, "Vision is disabled by your organization."));
519
+ disposable.add(hoverService.setupDelayedHover(element, {
520
+ content: hoverElement,
521
+ style: HoverStyle.Pointer
522
+ }));
523
+ } else if ((!supportsVision && currentLanguageModel) || omittedState === OmittedState.Full) {
499
524
  element.classList.add("warning");
500
525
  hoverElement.textContent = ( localize(
501
- 5094,
526
+ 5338,
502
527
  "{0} does not support images.",
503
528
  currentLanguageModelName ?? "This model"
504
529
  ));
@@ -534,7 +559,7 @@ function createImageElements(
534
559
  const urlContainer = $(
535
560
  "a.chat-attached-context-url",
536
561
  {},
537
- omittedState === OmittedState.Partial ? ( localize(5095, "This GIF was partially omitted - current frame will be sent.")) : fullName
562
+ omittedState === OmittedState.Partial ? ( localize(5339, "This GIF was partially omitted - current frame will be sent.")) : fullName
538
563
  );
539
564
  const separator = $("div.chat-attached-context-url-separator");
540
565
  disposable.add(addDisposableListener(urlContainer, "click", () => clickHandler()));
@@ -583,7 +608,7 @@ let PasteAttachmentWidget = class PasteAttachmentWidget extends AbstractChatAtta
583
608
  );
584
609
  this.hoverService = hoverService;
585
610
  this.instantiationService = instantiationService;
586
- const ariaLabel = ( localize(5096, "Attached context, {0}", attachment.name));
611
+ const ariaLabel = ( localize(5340, "Attached context, {0}", attachment.name));
587
612
  this.element.ariaLabel = ariaLabel;
588
613
  const classNames = ["file-icon", `${attachment.language}-lang-file-icon`];
589
614
  let resource;
@@ -641,7 +666,9 @@ let DefaultChatAttachmentWidget = class DefaultChatAttachmentWidget extends Abst
641
666
  configurationService,
642
667
  contextKeyService,
643
668
  instantiationService,
644
- hoverService
669
+ hoverService,
670
+ modelService,
671
+ languageService
645
672
  ) {
646
673
  super(
647
674
  attachment,
@@ -656,11 +683,25 @@ let DefaultChatAttachmentWidget = class DefaultChatAttachmentWidget extends Abst
656
683
  this.contextKeyService = contextKeyService;
657
684
  this.instantiationService = instantiationService;
658
685
  this.hoverService = hoverService;
686
+ this.modelService = modelService;
687
+ this.languageService = languageService;
659
688
  this._tooltipHover = this._register(( new MutableDisposable()));
660
689
  const attachmentLabel = attachment.fullName ?? attachment.name;
661
- const withIcon = attachment.icon?.id ? `$(${attachment.icon.id})\u00A0${attachmentLabel}` : attachmentLabel;
662
- this.label.setLabel(withIcon, correspondingContentReference?.options?.status?.description);
663
- this.element.ariaLabel = ( localize(5096, "Attached context, {0}", attachment.name));
690
+ if (isStringVariableEntry(attachment) && attachment.icon && (ThemeIcon.isFile(attachment.icon) || ThemeIcon.isFolder(attachment.icon)) && attachment.resourceUri) {
691
+ const fileKind = ThemeIcon.isFolder(attachment.icon) ? FileKind.FOLDER : FileKind.FILE;
692
+ const iconClasses = getIconClasses(this.modelService, this.languageService, attachment.resourceUri, fileKind);
693
+ this.label.setLabel(
694
+ attachmentLabel,
695
+ correspondingContentReference?.options?.status?.description,
696
+ {
697
+ extraClasses: iconClasses
698
+ }
699
+ );
700
+ } else {
701
+ const withIcon = attachment.icon?.id ? `$(${attachment.icon.id})\u00A0${attachmentLabel}` : attachmentLabel;
702
+ this.label.setLabel(withIcon, correspondingContentReference?.options?.status?.description);
703
+ }
704
+ this.element.ariaLabel = ( localize(5340, "Attached context, {0}", attachment.name));
664
705
  if (attachment.kind === "diagnostic") {
665
706
  if (attachment.filterUri) {
666
707
  resource = attachment.filterUri ? URI.revive(attachment.filterUri) : undefined;
@@ -673,11 +714,10 @@ let DefaultChatAttachmentWidget = class DefaultChatAttachmentWidget extends Abst
673
714
  }
674
715
  }
675
716
  if (attachment.kind === "symbol") {
676
- const scopedContextKeyService = this._register(this.contextKeyService.createScoped(this.element));
677
717
  this._register(this.instantiationService.invokeFunction(
678
718
  hookUpSymbolAttachmentDragAndContextMenu,
679
719
  this.element,
680
- scopedContextKeyService,
720
+ this.contextKeyService,
681
721
  {
682
722
  ...attachment,
683
723
  kind: attachment.symbolKind
@@ -709,7 +749,7 @@ let DefaultChatAttachmentWidget = class DefaultChatAttachmentWidget extends Abst
709
749
  });
710
750
  }
711
751
  };
712
- DefaultChatAttachmentWidget = ( __decorate([( __param(8, ICommandService)), ( __param(9, IOpenerService)), ( __param(10, IConfigurationService)), ( __param(11, IContextKeyService)), ( __param(12, IInstantiationService)), ( __param(13, IHoverService))], DefaultChatAttachmentWidget));
752
+ DefaultChatAttachmentWidget = ( __decorate([( __param(8, ICommandService)), ( __param(9, IOpenerService)), ( __param(10, IConfigurationService)), ( __param(11, IContextKeyService)), ( __param(12, IInstantiationService)), ( __param(13, IHoverService)), ( __param(14, IModelService)), ( __param(15, ILanguageService))], DefaultChatAttachmentWidget));
713
753
  let PromptFileAttachmentWidget = class PromptFileAttachmentWidget extends AbstractChatAttachmentWidget {
714
754
  constructor(
715
755
  attachment,
@@ -750,8 +790,8 @@ let PromptFileAttachmentWidget = class PromptFileAttachmentWidget extends Abstra
750
790
  const fileDirname = dirname(resource.path);
751
791
  const friendlyName = `${fileBasename} ${fileDirname}`;
752
792
  const isPrompt = attachment.id.startsWith(PromptFileVariableKind.PromptFile);
753
- const ariaLabel = isPrompt ? ( localize(5097, "Prompt file, {0}", friendlyName)) : ( localize(5098, "Instructions attachment, {0}", friendlyName));
754
- const typeLabel = isPrompt ? ( localize(5099, "Prompt")) : ( localize(5100, "Instructions"));
793
+ const ariaLabel = isPrompt ? ( localize(5341, "Prompt file, {0}", friendlyName)) : ( localize(5342, "Instructions attachment, {0}", friendlyName));
794
+ const typeLabel = isPrompt ? ( localize(5343, "Prompt")) : ( localize(5344, "Instructions"));
755
795
  const title = this.labelService.getUriLabel(resource) + (attachment.originLabel ? `\n${attachment.originLabel}` : "");
756
796
  this.element.classList.remove("warning", "error");
757
797
  const fileWithoutExtension = getCleanPromptName(resource);
@@ -811,7 +851,7 @@ let PromptTextAttachmentWidget = class PromptTextAttachmentWidget extends Abstra
811
851
  })
812
852
  );
813
853
  }
814
- this.label.setLabel(( localize(5101, "Additional Instructions")), undefined, undefined);
854
+ this.label.setLabel(( localize(5345, "Additional Instructions")), undefined, undefined);
815
855
  this._register(hoverService.setupDelayedHover(this.element, {
816
856
  ...commonHoverOptions,
817
857
  content: attachment.value
@@ -858,18 +898,18 @@ let ToolSetOrToolItemAttachmentWidget = class ToolSetOrToolItemAttachmentWidget
858
898
  }
859
899
  this.label.setLabel(`$(${icon.id})\u00A0${name}`, undefined);
860
900
  this.element.style.cursor = "pointer";
861
- this.element.ariaLabel = ( localize(5096, "Attached context, {0}", name));
901
+ this.element.ariaLabel = ( localize(5340, "Attached context, {0}", name));
862
902
  let hoverContent;
863
903
  if (isToolSet(toolOrToolSet)) {
864
904
  hoverContent = ( localize(
865
- 5102,
905
+ 5346,
866
906
  "{0} - {1}",
867
907
  toolOrToolSet.description ?? toolOrToolSet.referenceName,
868
908
  toolOrToolSet.source.label
869
909
  ));
870
910
  } else if (toolOrToolSet) {
871
911
  hoverContent = ( localize(
872
- 5103,
912
+ 5347,
873
913
  "{0} - {1}",
874
914
  toolOrToolSet.userDescription ?? toolOrToolSet.modelDescription,
875
915
  toolOrToolSet.source.label
@@ -898,7 +938,8 @@ let NotebookCellOutputChatAttachmentWidget = class NotebookCellOutputChatAttachm
898
938
  hoverService,
899
939
  languageModelsService,
900
940
  notebookService,
901
- instantiationService
941
+ instantiationService,
942
+ chatEntitlementService
902
943
  ) {
903
944
  super(
904
945
  attachment,
@@ -914,6 +955,7 @@ let NotebookCellOutputChatAttachmentWidget = class NotebookCellOutputChatAttachm
914
955
  this.languageModelsService = languageModelsService;
915
956
  this.notebookService = notebookService;
916
957
  this.instantiationService = instantiationService;
958
+ this.chatEntitlementService = chatEntitlementService;
917
959
  switch (attachment.mimeType) {
918
960
  case "application/vnd.code.notebook.error":
919
961
  {
@@ -940,7 +982,7 @@ let NotebookCellOutputChatAttachmentWidget = class NotebookCellOutputChatAttachm
940
982
  this.addResourceOpenHandlers(resource, undefined);
941
983
  }
942
984
  getAriaLabel(attachment) {
943
- return localize(5104, "Attached Notebook output, {0}", attachment.name);
985
+ return localize(5348, "Attached Notebook output, {0}", attachment.name);
944
986
  }
945
987
  renderErrorOutput(resource, attachment) {
946
988
  const attachmentLabel = attachment.name;
@@ -968,9 +1010,9 @@ let NotebookCellOutputChatAttachmentWidget = class NotebookCellOutputChatAttachm
968
1010
  renderImageOutput(resource, attachment) {
969
1011
  let ariaLabel;
970
1012
  if (attachment.omittedState === OmittedState.Full) {
971
- ariaLabel = ( localize(5105, "Omitted this Notebook ouput: {0}", attachment.name));
1013
+ ariaLabel = ( localize(5349, "Omitted this Notebook ouput: {0}", attachment.name));
972
1014
  } else if (attachment.omittedState === OmittedState.Partial) {
973
- ariaLabel = ( localize(5106, "Partially omitted this Notebook output: {0}", attachment.name));
1015
+ ariaLabel = ( localize(5350, "Partially omitted this Notebook output: {0}", attachment.name));
974
1016
  } else {
975
1017
  ariaLabel = this.getAriaLabel(attachment);
976
1018
  }
@@ -992,7 +1034,8 @@ let NotebookCellOutputChatAttachmentWidget = class NotebookCellOutputChatAttachm
992
1034
  currentLanguageModelName,
993
1035
  clickHandler,
994
1036
  this.currentLanguageModel,
995
- attachment.omittedState
1037
+ attachment.omittedState,
1038
+ this.chatEntitlementService.previewFeaturesDisabled
996
1039
  ));
997
1040
  }
998
1041
  getOutputItem(resource, attachment) {
@@ -1012,7 +1055,7 @@ let NotebookCellOutputChatAttachmentWidget = class NotebookCellOutputChatAttachm
1012
1055
  return output?.outputs.find(o => o.mime === attachment.mimeType);
1013
1056
  }
1014
1057
  };
1015
- NotebookCellOutputChatAttachmentWidget = ( __decorate([( __param(6, ICommandService)), ( __param(7, IOpenerService)), ( __param(8, IConfigurationService)), ( __param(9, IHoverService)), ( __param(10, ILanguageModelsService)), ( __param(11, INotebookService)), ( __param(12, IInstantiationService))], NotebookCellOutputChatAttachmentWidget));
1058
+ NotebookCellOutputChatAttachmentWidget = ( __decorate([( __param(6, ICommandService)), ( __param(7, IOpenerService)), ( __param(8, IConfigurationService)), ( __param(9, IHoverService)), ( __param(10, ILanguageModelsService)), ( __param(11, INotebookService)), ( __param(12, IInstantiationService)), ( __param(13, IChatEntitlementService))], NotebookCellOutputChatAttachmentWidget));
1016
1059
  let ElementChatAttachmentWidget = class ElementChatAttachmentWidget extends AbstractChatAttachmentWidget {
1017
1060
  constructor(
1018
1061
  attachment,
@@ -1023,7 +1066,8 @@ let ElementChatAttachmentWidget = class ElementChatAttachmentWidget extends Abst
1023
1066
  commandService,
1024
1067
  openerService,
1025
1068
  configurationService,
1026
- editorService
1069
+ editorService,
1070
+ hoverService
1027
1071
  ) {
1028
1072
  super(
1029
1073
  attachment,
@@ -1035,28 +1079,261 @@ let ElementChatAttachmentWidget = class ElementChatAttachmentWidget extends Abst
1035
1079
  openerService,
1036
1080
  configurationService
1037
1081
  );
1038
- const ariaLabel = ( localize(5107, "Attached element, {0}", attachment.name));
1082
+ this.editorService = editorService;
1083
+ this.hoverService = hoverService;
1084
+ const ariaLabel = ( localize(5351, "Attached element, {0}", attachment.name));
1039
1085
  this.element.ariaLabel = ariaLabel;
1040
1086
  this.element.style.position = "relative";
1041
1087
  this.element.style.cursor = "pointer";
1042
1088
  const attachmentLabel = attachment.name;
1043
1089
  const withIcon = attachment.icon?.id ? `$(${attachment.icon.id})\u00A0${attachmentLabel}` : attachmentLabel;
1044
1090
  this.label.setLabel(withIcon, undefined, {
1045
- title: ( localize(5108, "Click to view the contents of: {0}", attachmentLabel))
1091
+ title: ( localize(5352, "Click to view the contents of: {0}", attachmentLabel))
1046
1092
  });
1093
+ this._register(this.hoverService.setupDelayedHover(
1094
+ this.element,
1095
+ this.getHoverContent(attachment),
1096
+ commonHoverLifecycleOptions
1097
+ ));
1047
1098
  this._register(addDisposableListener(this.element, EventType.CLICK, async () => {
1048
- const content = attachment.value?.toString() || "";
1049
- await editorService.openEditor({
1050
- resource: undefined,
1051
- contents: content,
1052
- options: {
1053
- pinned: true
1054
- }
1055
- });
1099
+ await this.openElementAttachment(attachment);
1056
1100
  }));
1057
1101
  }
1102
+ getHoverContent(attachment) {
1103
+ if (!this.shouldRenderRichElementHover(attachment)) {
1104
+ return this.getSimpleHoverContent(attachment);
1105
+ }
1106
+ const hoverElement = $("div.chat-attached-context-hover.chat-element-hover");
1107
+ const scrollableContent = $("div.chat-element-hover-content");
1108
+ const innerScrollables = [];
1109
+ {
1110
+ const section = $("div.chat-element-hover-section");
1111
+ const header = $("div.chat-element-hover-header", {}, ( localize(5353, "ELEMENT")));
1112
+ section.appendChild(header);
1113
+ const elementPre = $("pre.chat-element-hover-code");
1114
+ const elementCode = $("code");
1115
+ const tagDisplay = this.formatElementTag(attachment);
1116
+ elementCode.textContent = tagDisplay;
1117
+ elementPre.appendChild(elementCode);
1118
+ const elementScrollable = this._register(( new DomScrollableElement(elementPre, {
1119
+ horizontal: ScrollbarVisibility.Auto,
1120
+ vertical: ScrollbarVisibility.Hidden
1121
+ })));
1122
+ innerScrollables.push(elementScrollable);
1123
+ section.appendChild(elementScrollable.getDomNode());
1124
+ scrollableContent.appendChild(section);
1125
+ }
1126
+ const computedStyleEntries = this.getComputedStyleEntriesForHover(attachment.computedStyles);
1127
+ if (computedStyleEntries.length > 0) {
1128
+ const section = $("div.chat-element-hover-section");
1129
+ const header = $("div.chat-element-hover-header", {}, ( localize(5354, "KEY COMPUTED STYLES")));
1130
+ section.appendChild(header);
1131
+ const table = $("div.chat-element-hover-table");
1132
+ for (const [name, value] of computedStyleEntries) {
1133
+ const row = $("div.chat-element-hover-row");
1134
+ row.appendChild($("span.chat-element-hover-label", {}, `${name}:`));
1135
+ const valueContainer = $("span.chat-element-hover-value");
1136
+ if ((name === "color" || name === "background-color") && value) {
1137
+ const swatch = $("span.chat-element-hover-color-swatch");
1138
+ swatch.style.backgroundColor = value;
1139
+ valueContainer.appendChild(swatch);
1140
+ }
1141
+ valueContainer.appendChild(document.createTextNode(value));
1142
+ row.appendChild(valueContainer);
1143
+ table.appendChild(row);
1144
+ }
1145
+ section.appendChild(table);
1146
+ const showMoreButton = $("button.chat-element-hover-show-more", {
1147
+ type: "button"
1148
+ }, ( localize(5355, "Show More...")));
1149
+ this._register(
1150
+ addDisposableListener(showMoreButton, EventType.CLICK, async e => {
1151
+ EventHelper.stop(e, true);
1152
+ await this.openElementAttachment(attachment);
1153
+ })
1154
+ );
1155
+ section.appendChild(showMoreButton);
1156
+ scrollableContent.appendChild(section);
1157
+ }
1158
+ if (attachment.ancestors && attachment.ancestors.length > 1) {
1159
+ const section = $("div.chat-element-hover-section");
1160
+ const header = $("div.chat-element-hover-header", {}, ( localize(5356, "HTML PATH")));
1161
+ section.appendChild(header);
1162
+ const lines = [];
1163
+ for (let i = 0; i < attachment.ancestors.length; i++) {
1164
+ const ancestor = attachment.ancestors[i];
1165
+ const indent = " ".repeat(i);
1166
+ const tag = this.formatAncestorTag(ancestor);
1167
+ lines.push(`${indent}${tag}`);
1168
+ }
1169
+ const pathPre = $("pre.chat-element-hover-code");
1170
+ const pathCode = $("code");
1171
+ pathCode.textContent = lines.join("\n");
1172
+ pathPre.appendChild(pathCode);
1173
+ const pathScrollable = this._register(( new DomScrollableElement(pathPre, {
1174
+ horizontal: ScrollbarVisibility.Auto,
1175
+ vertical: ScrollbarVisibility.Hidden
1176
+ })));
1177
+ innerScrollables.push(pathScrollable);
1178
+ section.appendChild(pathScrollable.getDomNode());
1179
+ scrollableContent.appendChild(section);
1180
+ }
1181
+ if (attachment.attributes && ( Object.keys(attachment.attributes)).length > 0) {
1182
+ const section = $("div.chat-element-hover-section");
1183
+ const header = $("div.chat-element-hover-header", {}, ( localize(5357, "ATTRIBUTES")));
1184
+ section.appendChild(header);
1185
+ const table = $("div.chat-element-hover-table");
1186
+ for (const [name, value] of Object.entries(attachment.attributes)) {
1187
+ const row = $("div.chat-element-hover-row");
1188
+ row.appendChild($("span.chat-element-hover-label", {}, `${name}:`));
1189
+ row.appendChild($("span.chat-element-hover-value", {}, value));
1190
+ table.appendChild(row);
1191
+ }
1192
+ section.appendChild(table);
1193
+ scrollableContent.appendChild(section);
1194
+ }
1195
+ if (attachment.dimensions) {
1196
+ const section = $("div.chat-element-hover-section");
1197
+ const header = $("div.chat-element-hover-header", {}, ( localize(5358, "POSITION & SIZE")));
1198
+ section.appendChild(header);
1199
+ const table = $("div.chat-element-hover-table");
1200
+ const dims = [
1201
+ ["top:", attachment.dimensions.top],
1202
+ ["left:", attachment.dimensions.left],
1203
+ ["width:", attachment.dimensions.width],
1204
+ ["height:", attachment.dimensions.height]
1205
+ ];
1206
+ for (const [label, val] of dims) {
1207
+ const row = $("div.chat-element-hover-row");
1208
+ row.appendChild($("span.chat-element-hover-label", {}, label));
1209
+ row.appendChild($("span.chat-element-hover-value", {}, `${Math.round(val)}px`));
1210
+ table.appendChild(row);
1211
+ }
1212
+ section.appendChild(table);
1213
+ scrollableContent.appendChild(section);
1214
+ }
1215
+ if (attachment.innerText) {
1216
+ const section = $("div.chat-element-hover-section");
1217
+ const header = $("div.chat-element-hover-header", {}, ( localize(5359, "INNER TEXT")));
1218
+ section.appendChild(header);
1219
+ section.appendChild($("div.chat-element-hover-text", {}, attachment.innerText));
1220
+ scrollableContent.appendChild(section);
1221
+ }
1222
+ const scrollableElement = this._register(( new DomScrollableElement(scrollableContent, {
1223
+ vertical: ScrollbarVisibility.Auto,
1224
+ horizontal: ScrollbarVisibility.Hidden,
1225
+ consumeMouseWheelIfScrollbarIsNeeded: true
1226
+ })));
1227
+ const scrollableDomNode = scrollableElement.getDomNode();
1228
+ scrollableDomNode.classList.add("chat-element-hover-scrollable");
1229
+ hoverElement.appendChild(scrollableDomNode);
1230
+ return {
1231
+ ...commonHoverOptions,
1232
+ content: hoverElement,
1233
+ additionalClasses: ["chat-element-data-hover"],
1234
+ onDidShow: () => {
1235
+ for (const s of innerScrollables) {
1236
+ s.scanDomNode();
1237
+ }
1238
+ scrollableElement.scanDomNode();
1239
+ }
1240
+ };
1241
+ }
1242
+ shouldRenderRichElementHover(attachment) {
1243
+ if (attachment.dimensions || attachment.innerText) {
1244
+ return true;
1245
+ }
1246
+ if (attachment.ancestors && attachment.ancestors.length > 0) {
1247
+ return true;
1248
+ }
1249
+ if (attachment.attributes && ( Object.keys(attachment.attributes)).length > 0) {
1250
+ return true;
1251
+ }
1252
+ if (attachment.computedStyles && ( Object.keys(attachment.computedStyles)).length > 0) {
1253
+ return true;
1254
+ }
1255
+ return false;
1256
+ }
1257
+ getSimpleHoverContent(attachment) {
1258
+ const content = attachment.value?.toString() ?? "";
1259
+ const hoverContent = ( new MarkdownString());
1260
+ hoverContent.appendText(attachment.fullName ?? attachment.name);
1261
+ if (content.trim().length > 0) {
1262
+ hoverContent.appendMarkdown("\n\n");
1263
+ hoverContent.appendCodeblock("text", content);
1264
+ }
1265
+ return {
1266
+ ...commonHoverOptions,
1267
+ content: hoverContent
1268
+ };
1269
+ }
1270
+ getComputedStyleEntriesForHover(computedStyles) {
1271
+ if (!computedStyles) {
1272
+ return [];
1273
+ }
1274
+ const keyEntries = [];
1275
+ for (const property of KEY_ELEMENT_HOVER_COMPUTED_STYLE_PROPERTIES) {
1276
+ if (property === "margin" || property === "padding") {
1277
+ const shorthand = this.getBoxShorthandValue(computedStyles, property);
1278
+ if (typeof shorthand === "string") {
1279
+ keyEntries.push([property, shorthand]);
1280
+ continue;
1281
+ }
1282
+ }
1283
+ const value = computedStyles[property];
1284
+ if (typeof value === "string") {
1285
+ keyEntries.push([property, value]);
1286
+ }
1287
+ }
1288
+ if (keyEntries.length > 0) {
1289
+ return keyEntries;
1290
+ }
1291
+ return Object.entries(computedStyles).slice(0, KEY_ELEMENT_HOVER_COMPUTED_STYLE_PROPERTIES.length);
1292
+ }
1293
+ getBoxShorthandValue(computedStyles, propertyName) {
1294
+ const top = computedStyles[`${propertyName}-top`];
1295
+ const right = computedStyles[`${propertyName}-right`];
1296
+ const bottom = computedStyles[`${propertyName}-bottom`];
1297
+ const left = computedStyles[`${propertyName}-left`];
1298
+ if (typeof top === "string" && typeof right === "string" && typeof bottom === "string" && typeof left === "string") {
1299
+ return `${top} ${right} ${bottom} ${left}`;
1300
+ }
1301
+ return computedStyles[propertyName];
1302
+ }
1303
+ async openElementAttachment(attachment) {
1304
+ const content = attachment.value?.toString() || "";
1305
+ await this.editorService.openEditor({
1306
+ resource: undefined,
1307
+ contents: content,
1308
+ options: {
1309
+ pinned: true
1310
+ }
1311
+ });
1312
+ }
1313
+ formatElementTag(attachment) {
1314
+ const content = attachment.value?.toString() ?? "";
1315
+ const htmlMatch = content.match(/\n\n(<[^>]+>)/);
1316
+ if (htmlMatch) {
1317
+ return htmlMatch[1];
1318
+ }
1319
+ const fallback = content.match(/<([^>]+)>/);
1320
+ if (fallback) {
1321
+ return `<${fallback[1]}>`;
1322
+ }
1323
+ return `<${attachment.name}>`;
1324
+ }
1325
+ formatAncestorTag(ancestor) {
1326
+ const parts = [`<${ancestor.tagName}`];
1327
+ if (ancestor.classNames?.length) {
1328
+ parts.push(` class="${ancestor.classNames.join(" ")}"`);
1329
+ }
1330
+ if (ancestor.id) {
1331
+ parts.push(` id="${ancestor.id}"`);
1332
+ }
1333
+ return parts.join("") + ">";
1334
+ }
1058
1335
  };
1059
- ElementChatAttachmentWidget = ( __decorate([( __param(5, ICommandService)), ( __param(6, IOpenerService)), ( __param(7, IConfigurationService)), ( __param(8, IEditorService))], ElementChatAttachmentWidget));
1336
+ ElementChatAttachmentWidget = ( __decorate([( __param(5, ICommandService)), ( __param(6, IOpenerService)), ( __param(7, IConfigurationService)), ( __param(8, IEditorService)), ( __param(9, IHoverService))], ElementChatAttachmentWidget));
1060
1337
  let SCMHistoryItemAttachmentWidget = class SCMHistoryItemAttachmentWidget extends AbstractChatAttachmentWidget {
1061
1338
  constructor(
1062
1339
  attachment,
@@ -1083,7 +1360,7 @@ let SCMHistoryItemAttachmentWidget = class SCMHistoryItemAttachmentWidget extend
1083
1360
  );
1084
1361
  this.label.setLabel(attachment.name, undefined);
1085
1362
  this.element.style.cursor = "pointer";
1086
- this.element.ariaLabel = ( localize(5096, "Attached context, {0}", attachment.name));
1363
+ this.element.ariaLabel = ( localize(5340, "Attached context, {0}", attachment.name));
1087
1364
  const {
1088
1365
  content,
1089
1366
  disposables
@@ -1145,7 +1422,7 @@ let SCMHistoryItemChangeAttachmentWidget = class SCMHistoryItemChangeAttachmentW
1145
1422
  hidePath: true,
1146
1423
  nameSuffix
1147
1424
  });
1148
- this.element.ariaLabel = ( localize(5096, "Attached context, {0}", attachment.name));
1425
+ this.element.ariaLabel = ( localize(5340, "Attached context, {0}", attachment.name));
1149
1426
  const {
1150
1427
  content,
1151
1428
  disposables
@@ -1201,7 +1478,7 @@ let SCMHistoryItemChangeRangeAttachmentWidget = class SCMHistoryItemChangeRangeA
1201
1478
  hidePath: true,
1202
1479
  nameSuffix
1203
1480
  });
1204
- this.element.ariaLabel = ( localize(5096, "Attached context, {0}", attachment.name));
1481
+ this.element.ariaLabel = ( localize(5340, "Attached context, {0}", attachment.name));
1205
1482
  this.addResourceOpenHandlers(attachment.value, undefined);
1206
1483
  }
1207
1484
  async openResource(resource, options, isDirectory, range) {
@@ -1245,16 +1522,13 @@ function hookUpResourceAttachmentDragAndContextMenu(accessor, widget, resource)
1245
1522
  ));
1246
1523
  return store;
1247
1524
  }
1248
- function hookUpSymbolAttachmentDragAndContextMenu(accessor, widget, scopedContextKeyService, attachment, contextMenuId) {
1525
+ function hookUpSymbolAttachmentDragAndContextMenu(accessor, widget, parentContextKeyService, attachment, contextMenuId) {
1249
1526
  const instantiationService = accessor.get(IInstantiationService);
1250
1527
  const languageFeaturesService = accessor.get(ILanguageFeaturesService);
1251
1528
  const textModelService = accessor.get(ITextModelService);
1529
+ const contextMenuService = accessor.get(IContextMenuService);
1530
+ const menuService = accessor.get(IMenuService);
1252
1531
  const store = ( new DisposableStore());
1253
- store.add(
1254
- setResourceContext(accessor, scopedContextKeyService, attachment.value.uri)
1255
- );
1256
- const chatResourceContext = chatAttachmentResourceContextKey.bindTo(scopedContextKeyService);
1257
- chatResourceContext.set(( attachment.value.uri.toString()));
1258
1532
  widget.draggable = true;
1259
1533
  store.add(addDisposableListener(widget, "dragstart", e => {
1260
1534
  instantiationService.invokeFunction(accessor => fillEditorsDragData(accessor, [{
@@ -1269,20 +1543,31 @@ function hookUpSymbolAttachmentDragAndContextMenu(accessor, widget, scopedContex
1269
1543
  }], e);
1270
1544
  e.dataTransfer?.setDragImage(widget, 0, 0);
1271
1545
  }));
1272
- const providerContexts = [[
1273
- EditorContextKeys.hasDefinitionProvider.bindTo(scopedContextKeyService),
1274
- languageFeaturesService.definitionProvider
1275
- ], [
1276
- EditorContextKeys.hasReferenceProvider.bindTo(scopedContextKeyService),
1277
- languageFeaturesService.referenceProvider
1278
- ], [
1279
- EditorContextKeys.hasImplementationProvider.bindTo(scopedContextKeyService),
1280
- languageFeaturesService.implementationProvider
1281
- ], [
1282
- EditorContextKeys.hasTypeDefinitionProvider.bindTo(scopedContextKeyService),
1283
- languageFeaturesService.typeDefinitionProvider
1284
- ]];
1546
+ const scopedContextKeyService = store.add(parentContextKeyService.createScoped(widget));
1547
+ chatAttachmentResourceContextKey.bindTo(scopedContextKeyService).set(( attachment.value.uri.toString()));
1548
+ store.add(
1549
+ setResourceContext(accessor, scopedContextKeyService, attachment.value.uri)
1550
+ );
1551
+ let providerContexts;
1552
+ const ensureProviderContexts = () => {
1553
+ if (!providerContexts) {
1554
+ providerContexts = [[
1555
+ EditorContextKeys.hasDefinitionProvider.bindTo(scopedContextKeyService),
1556
+ languageFeaturesService.definitionProvider
1557
+ ], [
1558
+ EditorContextKeys.hasReferenceProvider.bindTo(scopedContextKeyService),
1559
+ languageFeaturesService.referenceProvider
1560
+ ], [
1561
+ EditorContextKeys.hasImplementationProvider.bindTo(scopedContextKeyService),
1562
+ languageFeaturesService.implementationProvider
1563
+ ], [
1564
+ EditorContextKeys.hasTypeDefinitionProvider.bindTo(scopedContextKeyService),
1565
+ languageFeaturesService.typeDefinitionProvider
1566
+ ]];
1567
+ }
1568
+ };
1285
1569
  const updateContextKeys = async () => {
1570
+ ensureProviderContexts();
1286
1571
  const modelRef = await textModelService.createModelReference(attachment.value.uri);
1287
1572
  try {
1288
1573
  const model = modelRef.object.textEditorModel;
@@ -1293,14 +1578,27 @@ function hookUpSymbolAttachmentDragAndContextMenu(accessor, widget, scopedContex
1293
1578
  modelRef.dispose();
1294
1579
  }
1295
1580
  };
1296
- store.add(addBasicContextMenu(
1297
- accessor,
1298
- widget,
1299
- scopedContextKeyService,
1300
- contextMenuId,
1301
- attachment.value,
1302
- updateContextKeys
1303
- ));
1581
+ store.add(
1582
+ addDisposableListener(widget, EventType.CONTEXT_MENU, async domEvent => {
1583
+ const event = ( new StandardMouseEvent(getWindow(domEvent), domEvent));
1584
+ EventHelper.stop(domEvent, true);
1585
+ try {
1586
+ await updateContextKeys();
1587
+ } catch (e) {
1588
+ console.error(e);
1589
+ }
1590
+ contextMenuService.showContextMenu({
1591
+ contextKeyService: scopedContextKeyService,
1592
+ getAnchor: () => event,
1593
+ getActions: () => {
1594
+ const menu = menuService.getMenuActions(contextMenuId, scopedContextKeyService, {
1595
+ arg: attachment.value
1596
+ });
1597
+ return getFlatContextMenuActions(menu);
1598
+ }
1599
+ });
1600
+ })
1601
+ );
1304
1602
  return store;
1305
1603
  }
1306
1604
  function setResourceContext(accessor, scopedContextKeyService, resource) {
@@ -1337,7 +1635,7 @@ function addBasicContextMenu(accessor, widget, scopedContextKeyService, menuId,
1337
1635
  const chatAttachmentResourceContextKey = ( new RawContextKey("chatAttachmentResource", undefined, {
1338
1636
  type: "URI",
1339
1637
  description: ( localize(
1340
- 5109,
1638
+ 5360,
1341
1639
  "The full value of the chat attachment resource, including scheme and path"
1342
1640
  ))
1343
1641
  }));