@codingame/monaco-vscode-katex-common 26.2.2 → 28.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.
- package/package.json +2 -2
- package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.d.ts +10 -4
- package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.js +37 -11
- package/vscode/src/vs/platform/actions/browser/buttonbar.d.ts +3 -0
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +15 -4
- package/vscode/src/vs/platform/mcp/common/modelContextProtocolApps.d.ts +576 -0
- package/vscode/src/vs/{workbench/contrib → platform}/mcp/common/modelContextProtocolApps.js +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityProvider.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +176 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +127 -64
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +12 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionApprovalModel.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionApprovalModel.js +106 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +105 -29
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.d.ts +13 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +69 -43
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.d.ts +35 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +187 -78
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsviewer.css +138 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.d.ts +23 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js +394 -87
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatImplicitContext.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatImplicitContext.js +28 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +38 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +113 -116
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +16 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingEditorOverlay.css +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingExplanationWidget.css +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.d.ts +30 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.js +250 -132
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController.d.ts +1 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController.js +4 -110
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatAgentHover.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAgentCommandContentPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAgentCommandContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAnonymousRateLimitedPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAnonymousRateLimitedPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.js +9 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.d.ts +2 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.js +7 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCodeCitationContentPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCodeCitationContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleContentPart.d.ts +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleContentPart.js +22 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleMarkdownContentPart.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleMarkdownContentPart.js +11 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCommandContentPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCommandContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationContentPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationContentPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentParts.d.ts +59 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentParts.js +29 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDiffBlockPart.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDiffBlockPart.js +0 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDisabledClaudeHooksContentPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDisabledClaudeHooksContentPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatElicitationContentPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatErrorConfirmationPart.d.ts +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatErrorConfirmationPart.js +6 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatErrorContentPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExtensionsContentPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExtensionsContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.js +7 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.js +26 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +53 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownTableScrolling.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownTableScrolling.js +55 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.js +8 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +24 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPullRequestContentPart.d.ts +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPullRequestContentPart.js +11 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.d.ts +62 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +414 -129
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.d.ts +4 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.js +19 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatResourceGroupWidget.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatResourceGroupWidget.js +263 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.d.ts +14 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.js +98 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTaskContentPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTaskContentPart.js +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.d.ts +11 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +252 -80
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.d.ts +29 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.js +246 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.js +39 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.d.ts +6 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.js +36 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolOutputContentSubPart.d.ts +3 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolOutputContentSubPart.js +6 -260
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTreeContentPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTreeContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatWorkspaceEditContentPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatWorkspaceEditContentPart.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.d.ts +5 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.js +42 -37
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatCodeBlockPill.css +12 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatConfirmationWidget.css +65 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatHookContentPart.css +9 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatInlineAnchorWidget.css +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatQuestionCarousel.css +356 -415
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTerminalToolProgressPart.css +14 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatThinkingContent.css +102 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTipContent.css +68 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/codeBlockPart.css +48 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.d.ts +5 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +47 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.d.ts +1 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.js +0 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.d.ts +8 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.js +57 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.js +24 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatResultListSubPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatSimpleToolProgressPart.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatSimpleToolProgressPart.js +103 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +15 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.d.ts +44 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +85 -89
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.d.ts +3 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +15 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.d.ts +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.js +41 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPartUtilities.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.js +6 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolProgressPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolProgressPart.js +13 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolStreamingSubPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolStreamingSubPart.js +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatDragAndDrop.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.d.ts +21 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +341 -88
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.d.ts +6 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.js +13 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatQuestionCarouselAutoReply.d.ts +35 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatQuestionCarouselAutoReply.js +440 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.d.ts +24 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +437 -241
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatFollowups.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.d.ts +77 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +521 -284
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPickerActionItem.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPickerActionItem.js +7 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.d.ts +71 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.js +664 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelSelectionLogic.d.ts +104 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelSelectionLogic.js +127 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.d.ts +12 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.js +57 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.d.ts +4 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +89 -49
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem2.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem2.js +87 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.js +213 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.js +15 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.js +7 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chat.css +563 -140
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chatViewWelcome.css +35 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.js +26 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.d.ts +26 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.js +145 -79
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatContextUsageDetails.css +36 -50
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatContextUsageWidget.css +35 -15
- package/vscode/src/vs/workbench/contrib/chat/common/widget/annotations.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/chat/common/widget/annotations.js +127 -30
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.js +20 -14
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.d.ts +6 -6
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.js +96 -34
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.d.ts +11 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +68 -27
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.js +125 -13
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatGutterAffordance.d.ts +8 -11
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatGutterAffordance.js +54 -45
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.d.ts +11 -10
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.js +172 -112
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +5 -5
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChat.css +2 -44
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatEditorAffordance.css +28 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatOverlayWidget.css +84 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.d.ts +9 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +58 -41
- package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.js +3 -3
- package/vscode/src/vs/workbench/contrib/mcp/common/modelContextProtocolApps.d.ts +1 -548
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminal/browser/chatTerminalCommandMirror.js +6 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.js +0 -187
|
@@ -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';
|
|
@@ -43,7 +46,7 @@ import { IOpenerService } from '@codingame/monaco-vscode-api/vscode/vs/platform/
|
|
|
43
46
|
import { FolderThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService';
|
|
44
47
|
import { IThemeService } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service';
|
|
45
48
|
import { fillEditorsDragData } from '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/dnd';
|
|
46
|
-
import {
|
|
49
|
+
import { StaticResourceContextKey } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/contextkeys';
|
|
47
50
|
import { SIDE_GROUP } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService';
|
|
48
51
|
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
49
52
|
import { IPreferencesService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/preferences/common/preferences.service';
|
|
@@ -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(
|
|
142
|
+
title: ( localize(5390, "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
|
-
|
|
233
|
+
5391,
|
|
220
234
|
"Attached file, {0}, line {1} to line {2}",
|
|
221
235
|
friendlyName,
|
|
222
236
|
range.startLineNumber,
|
|
223
237
|
range.endLineNumber
|
|
224
|
-
)) : ( localize(
|
|
238
|
+
)) : ( localize(5392, "Attached file, {0}", friendlyName));
|
|
225
239
|
if (attachment.omittedState === OmittedState.Full) {
|
|
226
|
-
ariaLabel = ( localize(
|
|
240
|
+
ariaLabel = ( localize(5393, "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
|
-
|
|
278
|
+
5394,
|
|
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(
|
|
315
|
+
const ariaLabel = ( localize(5395, "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
|
-
|
|
368
|
+
5396,
|
|
355
369
|
"Command: {0}, exit code: {1}",
|
|
356
370
|
attachment.command,
|
|
357
371
|
attachment.exitCode
|
|
358
|
-
)) : ( localize(
|
|
372
|
+
)) : ( localize(5397, "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(
|
|
377
|
+
const outputTitle = $("div", {}, ( localize(5398, "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(
|
|
439
|
+
ariaLabel = ( localize(5399, "Omitted this image: {0}", attachment.name));
|
|
424
440
|
} else if (attachment.omittedState === OmittedState.Partial) {
|
|
425
|
-
ariaLabel = ( localize(
|
|
441
|
+
ariaLabel = ( localize(5400, "Partially omitted this image: {0}", attachment.name));
|
|
426
442
|
} else {
|
|
427
|
-
ariaLabel = ( localize(
|
|
443
|
+
ariaLabel = ( localize(5401, "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 (
|
|
516
|
+
if (previewFeaturesDisabled) {
|
|
517
|
+
element.classList.add("warning");
|
|
518
|
+
hoverElement.textContent = ( localize(5402, "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
|
-
|
|
526
|
+
5403,
|
|
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(
|
|
562
|
+
omittedState === OmittedState.Partial ? ( localize(5404, "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(
|
|
611
|
+
const ariaLabel = ( localize(5405, "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
|
-
|
|
662
|
-
|
|
663
|
-
|
|
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(5405, "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
|
-
|
|
720
|
+
this.contextKeyService,
|
|
681
721
|
{
|
|
682
722
|
...attachment,
|
|
683
723
|
kind: attachment.symbolKind
|
|
@@ -693,6 +733,18 @@ let DefaultChatAttachmentWidget = class DefaultChatAttachmentWidget extends Abst
|
|
|
693
733
|
await chatContextService.executeChatContextItemCommand(contextItemHandle);
|
|
694
734
|
}));
|
|
695
735
|
}
|
|
736
|
+
if (attachment.kind === "debugEvents") {
|
|
737
|
+
this.element.style.cursor = "pointer";
|
|
738
|
+
this._register(addDisposableListener(this.element, EventType.CLICK, () => {
|
|
739
|
+
const d = ( new Date(attachment.snapshotTime));
|
|
740
|
+
const filter = `before:${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(d.getDate()).padStart(2, "0")}T${String(d.getHours()).padStart(2, "0")}:${String(d.getMinutes()).padStart(2, "0")}:${String(d.getSeconds()).padStart(2, "0")}`;
|
|
741
|
+
this.commandService.executeCommand(
|
|
742
|
+
"workbench.action.chat.openAgentDebugPanelForSession",
|
|
743
|
+
attachment.sessionResource,
|
|
744
|
+
filter
|
|
745
|
+
);
|
|
746
|
+
}));
|
|
747
|
+
}
|
|
696
748
|
if ((isStringVariableEntry(attachment) || attachment.kind === "generic") && attachment.tooltip) {
|
|
697
749
|
this._setupTooltipHover(attachment.tooltip);
|
|
698
750
|
}
|
|
@@ -709,7 +761,7 @@ let DefaultChatAttachmentWidget = class DefaultChatAttachmentWidget extends Abst
|
|
|
709
761
|
});
|
|
710
762
|
}
|
|
711
763
|
};
|
|
712
|
-
DefaultChatAttachmentWidget = ( __decorate([( __param(8, ICommandService)), ( __param(9, IOpenerService)), ( __param(10, IConfigurationService)), ( __param(11, IContextKeyService)), ( __param(12, IInstantiationService)), ( __param(13, IHoverService))], DefaultChatAttachmentWidget));
|
|
764
|
+
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
765
|
let PromptFileAttachmentWidget = class PromptFileAttachmentWidget extends AbstractChatAttachmentWidget {
|
|
714
766
|
constructor(
|
|
715
767
|
attachment,
|
|
@@ -750,8 +802,8 @@ let PromptFileAttachmentWidget = class PromptFileAttachmentWidget extends Abstra
|
|
|
750
802
|
const fileDirname = dirname(resource.path);
|
|
751
803
|
const friendlyName = `${fileBasename} ${fileDirname}`;
|
|
752
804
|
const isPrompt = attachment.id.startsWith(PromptFileVariableKind.PromptFile);
|
|
753
|
-
const ariaLabel = isPrompt ? ( localize(
|
|
754
|
-
const typeLabel = isPrompt ? ( localize(
|
|
805
|
+
const ariaLabel = isPrompt ? ( localize(5406, "Prompt file, {0}", friendlyName)) : ( localize(5407, "Instructions attachment, {0}", friendlyName));
|
|
806
|
+
const typeLabel = isPrompt ? ( localize(5408, "Prompt")) : ( localize(5409, "Instructions"));
|
|
755
807
|
const title = this.labelService.getUriLabel(resource) + (attachment.originLabel ? `\n${attachment.originLabel}` : "");
|
|
756
808
|
this.element.classList.remove("warning", "error");
|
|
757
809
|
const fileWithoutExtension = getCleanPromptName(resource);
|
|
@@ -811,7 +863,7 @@ let PromptTextAttachmentWidget = class PromptTextAttachmentWidget extends Abstra
|
|
|
811
863
|
})
|
|
812
864
|
);
|
|
813
865
|
}
|
|
814
|
-
this.label.setLabel(( localize(
|
|
866
|
+
this.label.setLabel(( localize(5410, "Additional Instructions")), undefined, undefined);
|
|
815
867
|
this._register(hoverService.setupDelayedHover(this.element, {
|
|
816
868
|
...commonHoverOptions,
|
|
817
869
|
content: attachment.value
|
|
@@ -858,18 +910,18 @@ let ToolSetOrToolItemAttachmentWidget = class ToolSetOrToolItemAttachmentWidget
|
|
|
858
910
|
}
|
|
859
911
|
this.label.setLabel(`$(${icon.id})\u00A0${name}`, undefined);
|
|
860
912
|
this.element.style.cursor = "pointer";
|
|
861
|
-
this.element.ariaLabel = ( localize(
|
|
913
|
+
this.element.ariaLabel = ( localize(5405, "Attached context, {0}", name));
|
|
862
914
|
let hoverContent;
|
|
863
915
|
if (isToolSet(toolOrToolSet)) {
|
|
864
916
|
hoverContent = ( localize(
|
|
865
|
-
|
|
917
|
+
5411,
|
|
866
918
|
"{0} - {1}",
|
|
867
919
|
toolOrToolSet.description ?? toolOrToolSet.referenceName,
|
|
868
920
|
toolOrToolSet.source.label
|
|
869
921
|
));
|
|
870
922
|
} else if (toolOrToolSet) {
|
|
871
923
|
hoverContent = ( localize(
|
|
872
|
-
|
|
924
|
+
5412,
|
|
873
925
|
"{0} - {1}",
|
|
874
926
|
toolOrToolSet.userDescription ?? toolOrToolSet.modelDescription,
|
|
875
927
|
toolOrToolSet.source.label
|
|
@@ -898,7 +950,8 @@ let NotebookCellOutputChatAttachmentWidget = class NotebookCellOutputChatAttachm
|
|
|
898
950
|
hoverService,
|
|
899
951
|
languageModelsService,
|
|
900
952
|
notebookService,
|
|
901
|
-
instantiationService
|
|
953
|
+
instantiationService,
|
|
954
|
+
chatEntitlementService
|
|
902
955
|
) {
|
|
903
956
|
super(
|
|
904
957
|
attachment,
|
|
@@ -914,6 +967,7 @@ let NotebookCellOutputChatAttachmentWidget = class NotebookCellOutputChatAttachm
|
|
|
914
967
|
this.languageModelsService = languageModelsService;
|
|
915
968
|
this.notebookService = notebookService;
|
|
916
969
|
this.instantiationService = instantiationService;
|
|
970
|
+
this.chatEntitlementService = chatEntitlementService;
|
|
917
971
|
switch (attachment.mimeType) {
|
|
918
972
|
case "application/vnd.code.notebook.error":
|
|
919
973
|
{
|
|
@@ -940,7 +994,7 @@ let NotebookCellOutputChatAttachmentWidget = class NotebookCellOutputChatAttachm
|
|
|
940
994
|
this.addResourceOpenHandlers(resource, undefined);
|
|
941
995
|
}
|
|
942
996
|
getAriaLabel(attachment) {
|
|
943
|
-
return localize(
|
|
997
|
+
return localize(5413, "Attached Notebook output, {0}", attachment.name);
|
|
944
998
|
}
|
|
945
999
|
renderErrorOutput(resource, attachment) {
|
|
946
1000
|
const attachmentLabel = attachment.name;
|
|
@@ -968,9 +1022,9 @@ let NotebookCellOutputChatAttachmentWidget = class NotebookCellOutputChatAttachm
|
|
|
968
1022
|
renderImageOutput(resource, attachment) {
|
|
969
1023
|
let ariaLabel;
|
|
970
1024
|
if (attachment.omittedState === OmittedState.Full) {
|
|
971
|
-
ariaLabel = ( localize(
|
|
1025
|
+
ariaLabel = ( localize(5414, "Omitted this Notebook ouput: {0}", attachment.name));
|
|
972
1026
|
} else if (attachment.omittedState === OmittedState.Partial) {
|
|
973
|
-
ariaLabel = ( localize(
|
|
1027
|
+
ariaLabel = ( localize(5415, "Partially omitted this Notebook output: {0}", attachment.name));
|
|
974
1028
|
} else {
|
|
975
1029
|
ariaLabel = this.getAriaLabel(attachment);
|
|
976
1030
|
}
|
|
@@ -992,7 +1046,8 @@ let NotebookCellOutputChatAttachmentWidget = class NotebookCellOutputChatAttachm
|
|
|
992
1046
|
currentLanguageModelName,
|
|
993
1047
|
clickHandler,
|
|
994
1048
|
this.currentLanguageModel,
|
|
995
|
-
attachment.omittedState
|
|
1049
|
+
attachment.omittedState,
|
|
1050
|
+
this.chatEntitlementService.previewFeaturesDisabled
|
|
996
1051
|
));
|
|
997
1052
|
}
|
|
998
1053
|
getOutputItem(resource, attachment) {
|
|
@@ -1012,7 +1067,7 @@ let NotebookCellOutputChatAttachmentWidget = class NotebookCellOutputChatAttachm
|
|
|
1012
1067
|
return output?.outputs.find(o => o.mime === attachment.mimeType);
|
|
1013
1068
|
}
|
|
1014
1069
|
};
|
|
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));
|
|
1070
|
+
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
1071
|
let ElementChatAttachmentWidget = class ElementChatAttachmentWidget extends AbstractChatAttachmentWidget {
|
|
1017
1072
|
constructor(
|
|
1018
1073
|
attachment,
|
|
@@ -1023,7 +1078,8 @@ let ElementChatAttachmentWidget = class ElementChatAttachmentWidget extends Abst
|
|
|
1023
1078
|
commandService,
|
|
1024
1079
|
openerService,
|
|
1025
1080
|
configurationService,
|
|
1026
|
-
editorService
|
|
1081
|
+
editorService,
|
|
1082
|
+
hoverService
|
|
1027
1083
|
) {
|
|
1028
1084
|
super(
|
|
1029
1085
|
attachment,
|
|
@@ -1035,28 +1091,261 @@ let ElementChatAttachmentWidget = class ElementChatAttachmentWidget extends Abst
|
|
|
1035
1091
|
openerService,
|
|
1036
1092
|
configurationService
|
|
1037
1093
|
);
|
|
1038
|
-
|
|
1094
|
+
this.editorService = editorService;
|
|
1095
|
+
this.hoverService = hoverService;
|
|
1096
|
+
const ariaLabel = ( localize(5416, "Attached element, {0}", attachment.name));
|
|
1039
1097
|
this.element.ariaLabel = ariaLabel;
|
|
1040
1098
|
this.element.style.position = "relative";
|
|
1041
1099
|
this.element.style.cursor = "pointer";
|
|
1042
1100
|
const attachmentLabel = attachment.name;
|
|
1043
1101
|
const withIcon = attachment.icon?.id ? `$(${attachment.icon.id})\u00A0${attachmentLabel}` : attachmentLabel;
|
|
1044
1102
|
this.label.setLabel(withIcon, undefined, {
|
|
1045
|
-
title: ( localize(
|
|
1103
|
+
title: ( localize(5417, "Click to view the contents of: {0}", attachmentLabel))
|
|
1046
1104
|
});
|
|
1105
|
+
this._register(this.hoverService.setupDelayedHover(
|
|
1106
|
+
this.element,
|
|
1107
|
+
this.getHoverContent(attachment),
|
|
1108
|
+
commonHoverLifecycleOptions
|
|
1109
|
+
));
|
|
1047
1110
|
this._register(addDisposableListener(this.element, EventType.CLICK, async () => {
|
|
1048
|
-
|
|
1049
|
-
await editorService.openEditor({
|
|
1050
|
-
resource: undefined,
|
|
1051
|
-
contents: content,
|
|
1052
|
-
options: {
|
|
1053
|
-
pinned: true
|
|
1054
|
-
}
|
|
1055
|
-
});
|
|
1111
|
+
await this.openElementAttachment(attachment);
|
|
1056
1112
|
}));
|
|
1057
1113
|
}
|
|
1114
|
+
getHoverContent(attachment) {
|
|
1115
|
+
if (!this.shouldRenderRichElementHover(attachment)) {
|
|
1116
|
+
return this.getSimpleHoverContent(attachment);
|
|
1117
|
+
}
|
|
1118
|
+
const hoverElement = $("div.chat-attached-context-hover.chat-element-hover");
|
|
1119
|
+
const scrollableContent = $("div.chat-element-hover-content");
|
|
1120
|
+
const innerScrollables = [];
|
|
1121
|
+
{
|
|
1122
|
+
const section = $("div.chat-element-hover-section");
|
|
1123
|
+
const header = $("div.chat-element-hover-header", {}, ( localize(5418, "ELEMENT")));
|
|
1124
|
+
section.appendChild(header);
|
|
1125
|
+
const elementPre = $("pre.chat-element-hover-code");
|
|
1126
|
+
const elementCode = $("code");
|
|
1127
|
+
const tagDisplay = this.formatElementTag(attachment);
|
|
1128
|
+
elementCode.textContent = tagDisplay;
|
|
1129
|
+
elementPre.appendChild(elementCode);
|
|
1130
|
+
const elementScrollable = this._register(( new DomScrollableElement(elementPre, {
|
|
1131
|
+
horizontal: ScrollbarVisibility.Auto,
|
|
1132
|
+
vertical: ScrollbarVisibility.Hidden
|
|
1133
|
+
})));
|
|
1134
|
+
innerScrollables.push(elementScrollable);
|
|
1135
|
+
section.appendChild(elementScrollable.getDomNode());
|
|
1136
|
+
scrollableContent.appendChild(section);
|
|
1137
|
+
}
|
|
1138
|
+
const computedStyleEntries = this.getComputedStyleEntriesForHover(attachment.computedStyles);
|
|
1139
|
+
if (computedStyleEntries.length > 0) {
|
|
1140
|
+
const section = $("div.chat-element-hover-section");
|
|
1141
|
+
const header = $("div.chat-element-hover-header", {}, ( localize(5419, "KEY COMPUTED STYLES")));
|
|
1142
|
+
section.appendChild(header);
|
|
1143
|
+
const table = $("div.chat-element-hover-table");
|
|
1144
|
+
for (const [name, value] of computedStyleEntries) {
|
|
1145
|
+
const row = $("div.chat-element-hover-row");
|
|
1146
|
+
row.appendChild($("span.chat-element-hover-label", {}, `${name}:`));
|
|
1147
|
+
const valueContainer = $("span.chat-element-hover-value");
|
|
1148
|
+
if ((name === "color" || name === "background-color") && value) {
|
|
1149
|
+
const swatch = $("span.chat-element-hover-color-swatch");
|
|
1150
|
+
swatch.style.backgroundColor = value;
|
|
1151
|
+
valueContainer.appendChild(swatch);
|
|
1152
|
+
}
|
|
1153
|
+
valueContainer.appendChild(document.createTextNode(value));
|
|
1154
|
+
row.appendChild(valueContainer);
|
|
1155
|
+
table.appendChild(row);
|
|
1156
|
+
}
|
|
1157
|
+
section.appendChild(table);
|
|
1158
|
+
const showMoreButton = $("button.chat-element-hover-show-more", {
|
|
1159
|
+
type: "button"
|
|
1160
|
+
}, ( localize(5420, "Show More...")));
|
|
1161
|
+
this._register(
|
|
1162
|
+
addDisposableListener(showMoreButton, EventType.CLICK, async e => {
|
|
1163
|
+
EventHelper.stop(e, true);
|
|
1164
|
+
await this.openElementAttachment(attachment);
|
|
1165
|
+
})
|
|
1166
|
+
);
|
|
1167
|
+
section.appendChild(showMoreButton);
|
|
1168
|
+
scrollableContent.appendChild(section);
|
|
1169
|
+
}
|
|
1170
|
+
if (attachment.ancestors && attachment.ancestors.length > 1) {
|
|
1171
|
+
const section = $("div.chat-element-hover-section");
|
|
1172
|
+
const header = $("div.chat-element-hover-header", {}, ( localize(5421, "HTML PATH")));
|
|
1173
|
+
section.appendChild(header);
|
|
1174
|
+
const lines = [];
|
|
1175
|
+
for (let i = 0; i < attachment.ancestors.length; i++) {
|
|
1176
|
+
const ancestor = attachment.ancestors[i];
|
|
1177
|
+
const indent = " ".repeat(i);
|
|
1178
|
+
const tag = this.formatAncestorTag(ancestor);
|
|
1179
|
+
lines.push(`${indent}${tag}`);
|
|
1180
|
+
}
|
|
1181
|
+
const pathPre = $("pre.chat-element-hover-code");
|
|
1182
|
+
const pathCode = $("code");
|
|
1183
|
+
pathCode.textContent = lines.join("\n");
|
|
1184
|
+
pathPre.appendChild(pathCode);
|
|
1185
|
+
const pathScrollable = this._register(( new DomScrollableElement(pathPre, {
|
|
1186
|
+
horizontal: ScrollbarVisibility.Auto,
|
|
1187
|
+
vertical: ScrollbarVisibility.Hidden
|
|
1188
|
+
})));
|
|
1189
|
+
innerScrollables.push(pathScrollable);
|
|
1190
|
+
section.appendChild(pathScrollable.getDomNode());
|
|
1191
|
+
scrollableContent.appendChild(section);
|
|
1192
|
+
}
|
|
1193
|
+
if (attachment.attributes && ( Object.keys(attachment.attributes)).length > 0) {
|
|
1194
|
+
const section = $("div.chat-element-hover-section");
|
|
1195
|
+
const header = $("div.chat-element-hover-header", {}, ( localize(5422, "ATTRIBUTES")));
|
|
1196
|
+
section.appendChild(header);
|
|
1197
|
+
const table = $("div.chat-element-hover-table");
|
|
1198
|
+
for (const [name, value] of Object.entries(attachment.attributes)) {
|
|
1199
|
+
const row = $("div.chat-element-hover-row");
|
|
1200
|
+
row.appendChild($("span.chat-element-hover-label", {}, `${name}:`));
|
|
1201
|
+
row.appendChild($("span.chat-element-hover-value", {}, value));
|
|
1202
|
+
table.appendChild(row);
|
|
1203
|
+
}
|
|
1204
|
+
section.appendChild(table);
|
|
1205
|
+
scrollableContent.appendChild(section);
|
|
1206
|
+
}
|
|
1207
|
+
if (attachment.dimensions) {
|
|
1208
|
+
const section = $("div.chat-element-hover-section");
|
|
1209
|
+
const header = $("div.chat-element-hover-header", {}, ( localize(5423, "POSITION & SIZE")));
|
|
1210
|
+
section.appendChild(header);
|
|
1211
|
+
const table = $("div.chat-element-hover-table");
|
|
1212
|
+
const dims = [
|
|
1213
|
+
["top:", attachment.dimensions.top],
|
|
1214
|
+
["left:", attachment.dimensions.left],
|
|
1215
|
+
["width:", attachment.dimensions.width],
|
|
1216
|
+
["height:", attachment.dimensions.height]
|
|
1217
|
+
];
|
|
1218
|
+
for (const [label, val] of dims) {
|
|
1219
|
+
const row = $("div.chat-element-hover-row");
|
|
1220
|
+
row.appendChild($("span.chat-element-hover-label", {}, label));
|
|
1221
|
+
row.appendChild($("span.chat-element-hover-value", {}, `${Math.round(val)}px`));
|
|
1222
|
+
table.appendChild(row);
|
|
1223
|
+
}
|
|
1224
|
+
section.appendChild(table);
|
|
1225
|
+
scrollableContent.appendChild(section);
|
|
1226
|
+
}
|
|
1227
|
+
if (attachment.innerText) {
|
|
1228
|
+
const section = $("div.chat-element-hover-section");
|
|
1229
|
+
const header = $("div.chat-element-hover-header", {}, ( localize(5424, "INNER TEXT")));
|
|
1230
|
+
section.appendChild(header);
|
|
1231
|
+
section.appendChild($("div.chat-element-hover-text", {}, attachment.innerText));
|
|
1232
|
+
scrollableContent.appendChild(section);
|
|
1233
|
+
}
|
|
1234
|
+
const scrollableElement = this._register(( new DomScrollableElement(scrollableContent, {
|
|
1235
|
+
vertical: ScrollbarVisibility.Auto,
|
|
1236
|
+
horizontal: ScrollbarVisibility.Hidden,
|
|
1237
|
+
consumeMouseWheelIfScrollbarIsNeeded: true
|
|
1238
|
+
})));
|
|
1239
|
+
const scrollableDomNode = scrollableElement.getDomNode();
|
|
1240
|
+
scrollableDomNode.classList.add("chat-element-hover-scrollable");
|
|
1241
|
+
hoverElement.appendChild(scrollableDomNode);
|
|
1242
|
+
return {
|
|
1243
|
+
...commonHoverOptions,
|
|
1244
|
+
content: hoverElement,
|
|
1245
|
+
additionalClasses: ["chat-element-data-hover"],
|
|
1246
|
+
onDidShow: () => {
|
|
1247
|
+
for (const s of innerScrollables) {
|
|
1248
|
+
s.scanDomNode();
|
|
1249
|
+
}
|
|
1250
|
+
scrollableElement.scanDomNode();
|
|
1251
|
+
}
|
|
1252
|
+
};
|
|
1253
|
+
}
|
|
1254
|
+
shouldRenderRichElementHover(attachment) {
|
|
1255
|
+
if (attachment.dimensions || attachment.innerText) {
|
|
1256
|
+
return true;
|
|
1257
|
+
}
|
|
1258
|
+
if (attachment.ancestors && attachment.ancestors.length > 0) {
|
|
1259
|
+
return true;
|
|
1260
|
+
}
|
|
1261
|
+
if (attachment.attributes && ( Object.keys(attachment.attributes)).length > 0) {
|
|
1262
|
+
return true;
|
|
1263
|
+
}
|
|
1264
|
+
if (attachment.computedStyles && ( Object.keys(attachment.computedStyles)).length > 0) {
|
|
1265
|
+
return true;
|
|
1266
|
+
}
|
|
1267
|
+
return false;
|
|
1268
|
+
}
|
|
1269
|
+
getSimpleHoverContent(attachment) {
|
|
1270
|
+
const content = attachment.value?.toString() ?? "";
|
|
1271
|
+
const hoverContent = ( new MarkdownString());
|
|
1272
|
+
hoverContent.appendText(attachment.fullName ?? attachment.name);
|
|
1273
|
+
if (content.trim().length > 0) {
|
|
1274
|
+
hoverContent.appendMarkdown("\n\n");
|
|
1275
|
+
hoverContent.appendCodeblock("text", content);
|
|
1276
|
+
}
|
|
1277
|
+
return {
|
|
1278
|
+
...commonHoverOptions,
|
|
1279
|
+
content: hoverContent
|
|
1280
|
+
};
|
|
1281
|
+
}
|
|
1282
|
+
getComputedStyleEntriesForHover(computedStyles) {
|
|
1283
|
+
if (!computedStyles) {
|
|
1284
|
+
return [];
|
|
1285
|
+
}
|
|
1286
|
+
const keyEntries = [];
|
|
1287
|
+
for (const property of KEY_ELEMENT_HOVER_COMPUTED_STYLE_PROPERTIES) {
|
|
1288
|
+
if (property === "margin" || property === "padding") {
|
|
1289
|
+
const shorthand = this.getBoxShorthandValue(computedStyles, property);
|
|
1290
|
+
if (typeof shorthand === "string") {
|
|
1291
|
+
keyEntries.push([property, shorthand]);
|
|
1292
|
+
continue;
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
const value = computedStyles[property];
|
|
1296
|
+
if (typeof value === "string") {
|
|
1297
|
+
keyEntries.push([property, value]);
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
if (keyEntries.length > 0) {
|
|
1301
|
+
return keyEntries;
|
|
1302
|
+
}
|
|
1303
|
+
return Object.entries(computedStyles).slice(0, KEY_ELEMENT_HOVER_COMPUTED_STYLE_PROPERTIES.length);
|
|
1304
|
+
}
|
|
1305
|
+
getBoxShorthandValue(computedStyles, propertyName) {
|
|
1306
|
+
const top = computedStyles[`${propertyName}-top`];
|
|
1307
|
+
const right = computedStyles[`${propertyName}-right`];
|
|
1308
|
+
const bottom = computedStyles[`${propertyName}-bottom`];
|
|
1309
|
+
const left = computedStyles[`${propertyName}-left`];
|
|
1310
|
+
if (typeof top === "string" && typeof right === "string" && typeof bottom === "string" && typeof left === "string") {
|
|
1311
|
+
return `${top} ${right} ${bottom} ${left}`;
|
|
1312
|
+
}
|
|
1313
|
+
return computedStyles[propertyName];
|
|
1314
|
+
}
|
|
1315
|
+
async openElementAttachment(attachment) {
|
|
1316
|
+
const content = attachment.value?.toString() || "";
|
|
1317
|
+
await this.editorService.openEditor({
|
|
1318
|
+
resource: undefined,
|
|
1319
|
+
contents: content,
|
|
1320
|
+
options: {
|
|
1321
|
+
pinned: true
|
|
1322
|
+
}
|
|
1323
|
+
});
|
|
1324
|
+
}
|
|
1325
|
+
formatElementTag(attachment) {
|
|
1326
|
+
const content = attachment.value?.toString() ?? "";
|
|
1327
|
+
const htmlMatch = content.match(/\n\n(<[^>]+>)/);
|
|
1328
|
+
if (htmlMatch) {
|
|
1329
|
+
return htmlMatch[1];
|
|
1330
|
+
}
|
|
1331
|
+
const fallback = content.match(/<([^>]+)>/);
|
|
1332
|
+
if (fallback) {
|
|
1333
|
+
return `<${fallback[1]}>`;
|
|
1334
|
+
}
|
|
1335
|
+
return `<${attachment.name}>`;
|
|
1336
|
+
}
|
|
1337
|
+
formatAncestorTag(ancestor) {
|
|
1338
|
+
const parts = [`<${ancestor.tagName}`];
|
|
1339
|
+
if (ancestor.classNames?.length) {
|
|
1340
|
+
parts.push(` class="${ancestor.classNames.join(" ")}"`);
|
|
1341
|
+
}
|
|
1342
|
+
if (ancestor.id) {
|
|
1343
|
+
parts.push(` id="${ancestor.id}"`);
|
|
1344
|
+
}
|
|
1345
|
+
return parts.join("") + ">";
|
|
1346
|
+
}
|
|
1058
1347
|
};
|
|
1059
|
-
ElementChatAttachmentWidget = ( __decorate([( __param(5, ICommandService)), ( __param(6, IOpenerService)), ( __param(7, IConfigurationService)), ( __param(8, IEditorService))], ElementChatAttachmentWidget));
|
|
1348
|
+
ElementChatAttachmentWidget = ( __decorate([( __param(5, ICommandService)), ( __param(6, IOpenerService)), ( __param(7, IConfigurationService)), ( __param(8, IEditorService)), ( __param(9, IHoverService))], ElementChatAttachmentWidget));
|
|
1060
1349
|
let SCMHistoryItemAttachmentWidget = class SCMHistoryItemAttachmentWidget extends AbstractChatAttachmentWidget {
|
|
1061
1350
|
constructor(
|
|
1062
1351
|
attachment,
|
|
@@ -1083,7 +1372,7 @@ let SCMHistoryItemAttachmentWidget = class SCMHistoryItemAttachmentWidget extend
|
|
|
1083
1372
|
);
|
|
1084
1373
|
this.label.setLabel(attachment.name, undefined);
|
|
1085
1374
|
this.element.style.cursor = "pointer";
|
|
1086
|
-
this.element.ariaLabel = ( localize(
|
|
1375
|
+
this.element.ariaLabel = ( localize(5405, "Attached context, {0}", attachment.name));
|
|
1087
1376
|
const {
|
|
1088
1377
|
content,
|
|
1089
1378
|
disposables
|
|
@@ -1145,7 +1434,7 @@ let SCMHistoryItemChangeAttachmentWidget = class SCMHistoryItemChangeAttachmentW
|
|
|
1145
1434
|
hidePath: true,
|
|
1146
1435
|
nameSuffix
|
|
1147
1436
|
});
|
|
1148
|
-
this.element.ariaLabel = ( localize(
|
|
1437
|
+
this.element.ariaLabel = ( localize(5405, "Attached context, {0}", attachment.name));
|
|
1149
1438
|
const {
|
|
1150
1439
|
content,
|
|
1151
1440
|
disposables
|
|
@@ -1201,7 +1490,7 @@ let SCMHistoryItemChangeRangeAttachmentWidget = class SCMHistoryItemChangeRangeA
|
|
|
1201
1490
|
hidePath: true,
|
|
1202
1491
|
nameSuffix
|
|
1203
1492
|
});
|
|
1204
|
-
this.element.ariaLabel = ( localize(
|
|
1493
|
+
this.element.ariaLabel = ( localize(5405, "Attached context, {0}", attachment.name));
|
|
1205
1494
|
this.addResourceOpenHandlers(attachment.value, undefined);
|
|
1206
1495
|
}
|
|
1207
1496
|
async openResource(resource, options, isDirectory, range) {
|
|
@@ -1230,7 +1519,7 @@ function hookUpResourceAttachmentDragAndContextMenu(accessor, widget, resource)
|
|
|
1230
1519
|
const instantiationService = accessor.get(IInstantiationService);
|
|
1231
1520
|
const store = ( new DisposableStore());
|
|
1232
1521
|
const scopedContextKeyService = store.add(contextKeyService.createScoped(widget));
|
|
1233
|
-
|
|
1522
|
+
setResourceContext(accessor, scopedContextKeyService, resource);
|
|
1234
1523
|
widget.draggable = true;
|
|
1235
1524
|
store.add(addDisposableListener(widget, "dragstart", e => {
|
|
1236
1525
|
instantiationService.invokeFunction(accessor => fillEditorsDragData(accessor, [resource], e));
|
|
@@ -1245,16 +1534,13 @@ function hookUpResourceAttachmentDragAndContextMenu(accessor, widget, resource)
|
|
|
1245
1534
|
));
|
|
1246
1535
|
return store;
|
|
1247
1536
|
}
|
|
1248
|
-
function hookUpSymbolAttachmentDragAndContextMenu(accessor, widget,
|
|
1537
|
+
function hookUpSymbolAttachmentDragAndContextMenu(accessor, widget, parentContextKeyService, attachment, contextMenuId) {
|
|
1249
1538
|
const instantiationService = accessor.get(IInstantiationService);
|
|
1250
1539
|
const languageFeaturesService = accessor.get(ILanguageFeaturesService);
|
|
1251
1540
|
const textModelService = accessor.get(ITextModelService);
|
|
1541
|
+
const contextMenuService = accessor.get(IContextMenuService);
|
|
1542
|
+
const menuService = accessor.get(IMenuService);
|
|
1252
1543
|
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
1544
|
widget.draggable = true;
|
|
1259
1545
|
store.add(addDisposableListener(widget, "dragstart", e => {
|
|
1260
1546
|
instantiationService.invokeFunction(accessor => fillEditorsDragData(accessor, [{
|
|
@@ -1269,20 +1555,29 @@ function hookUpSymbolAttachmentDragAndContextMenu(accessor, widget, scopedContex
|
|
|
1269
1555
|
}], e);
|
|
1270
1556
|
e.dataTransfer?.setDragImage(widget, 0, 0);
|
|
1271
1557
|
}));
|
|
1272
|
-
const
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1558
|
+
const scopedContextKeyService = store.add(parentContextKeyService.createScoped(widget));
|
|
1559
|
+
chatAttachmentResourceContextKey.bindTo(scopedContextKeyService).set(( attachment.value.uri.toString()));
|
|
1560
|
+
setResourceContext(accessor, scopedContextKeyService, attachment.value.uri);
|
|
1561
|
+
let providerContexts;
|
|
1562
|
+
const ensureProviderContexts = () => {
|
|
1563
|
+
if (!providerContexts) {
|
|
1564
|
+
providerContexts = [[
|
|
1565
|
+
EditorContextKeys.hasDefinitionProvider.bindTo(scopedContextKeyService),
|
|
1566
|
+
languageFeaturesService.definitionProvider
|
|
1567
|
+
], [
|
|
1568
|
+
EditorContextKeys.hasReferenceProvider.bindTo(scopedContextKeyService),
|
|
1569
|
+
languageFeaturesService.referenceProvider
|
|
1570
|
+
], [
|
|
1571
|
+
EditorContextKeys.hasImplementationProvider.bindTo(scopedContextKeyService),
|
|
1572
|
+
languageFeaturesService.implementationProvider
|
|
1573
|
+
], [
|
|
1574
|
+
EditorContextKeys.hasTypeDefinitionProvider.bindTo(scopedContextKeyService),
|
|
1575
|
+
languageFeaturesService.typeDefinitionProvider
|
|
1576
|
+
]];
|
|
1577
|
+
}
|
|
1578
|
+
};
|
|
1285
1579
|
const updateContextKeys = async () => {
|
|
1580
|
+
ensureProviderContexts();
|
|
1286
1581
|
const modelRef = await textModelService.createModelReference(attachment.value.uri);
|
|
1287
1582
|
try {
|
|
1288
1583
|
const model = modelRef.object.textEditorModel;
|
|
@@ -1293,23 +1588,35 @@ function hookUpSymbolAttachmentDragAndContextMenu(accessor, widget, scopedContex
|
|
|
1293
1588
|
modelRef.dispose();
|
|
1294
1589
|
}
|
|
1295
1590
|
};
|
|
1296
|
-
store.add(
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1591
|
+
store.add(
|
|
1592
|
+
addDisposableListener(widget, EventType.CONTEXT_MENU, async domEvent => {
|
|
1593
|
+
const event = ( new StandardMouseEvent(getWindow(domEvent), domEvent));
|
|
1594
|
+
EventHelper.stop(domEvent, true);
|
|
1595
|
+
try {
|
|
1596
|
+
await updateContextKeys();
|
|
1597
|
+
} catch (e) {
|
|
1598
|
+
console.error(e);
|
|
1599
|
+
}
|
|
1600
|
+
contextMenuService.showContextMenu({
|
|
1601
|
+
contextKeyService: scopedContextKeyService,
|
|
1602
|
+
getAnchor: () => event,
|
|
1603
|
+
getActions: () => {
|
|
1604
|
+
const menu = menuService.getMenuActions(contextMenuId, scopedContextKeyService, {
|
|
1605
|
+
arg: attachment.value
|
|
1606
|
+
});
|
|
1607
|
+
return getFlatContextMenuActions(menu);
|
|
1608
|
+
}
|
|
1609
|
+
});
|
|
1610
|
+
})
|
|
1611
|
+
);
|
|
1304
1612
|
return store;
|
|
1305
1613
|
}
|
|
1306
1614
|
function setResourceContext(accessor, scopedContextKeyService, resource) {
|
|
1307
1615
|
const fileService = accessor.get(IFileService);
|
|
1308
1616
|
const languageService = accessor.get(ILanguageService);
|
|
1309
1617
|
const modelService = accessor.get(IModelService);
|
|
1310
|
-
const resourceContextKey = ( new
|
|
1618
|
+
const resourceContextKey = ( new StaticResourceContextKey(scopedContextKeyService, fileService, languageService, modelService));
|
|
1311
1619
|
resourceContextKey.set(resource);
|
|
1312
|
-
return resourceContextKey;
|
|
1313
1620
|
}
|
|
1314
1621
|
function addBasicContextMenu(accessor, widget, scopedContextKeyService, menuId, arg, updateContextKeys) {
|
|
1315
1622
|
const contextMenuService = accessor.get(IContextMenuService);
|
|
@@ -1337,7 +1644,7 @@ function addBasicContextMenu(accessor, widget, scopedContextKeyService, menuId,
|
|
|
1337
1644
|
const chatAttachmentResourceContextKey = ( new RawContextKey("chatAttachmentResource", undefined, {
|
|
1338
1645
|
type: "URI",
|
|
1339
1646
|
description: ( localize(
|
|
1340
|
-
|
|
1647
|
+
5425,
|
|
1341
1648
|
"The full value of the chat attachment resource, including scheme and path"
|
|
1342
1649
|
))
|
|
1343
1650
|
}));
|