@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.
- 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 +35 -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 +548 -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 +168 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +67 -51
- 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/agentSessionHoverWidget.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +42 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.d.ts +12 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +63 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.d.ts +7 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +77 -73
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsviewer.css +69 -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 +381 -83
- 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 +109 -113
- 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/chatSessions/chatSessionPickerActionItem.js +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.d.ts +28 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.js +226 -123
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatAgentHover.js +2 -2
- 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.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 +1 -3
- 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.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleContentPart.d.ts +3 -1
- 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 +2 -1
- 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.js +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.js +1 -1
- 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.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatErrorConfirmationPart.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatErrorConfirmationPart.js +6 -3
- 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 +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.js +5 -4
- 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 +3 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +51 -20
- 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.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +20 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPullRequestContentPart.d.ts +3 -3
- 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 +36 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +166 -45
- 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 +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.js +16 -11
- 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.js +1 -0
- 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 +10 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +241 -78
- 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 +252 -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 +5 -3
- 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.js +5 -5
- 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.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 +48 -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 +351 -422
- 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 +69 -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 +4 -1
- 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.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.d.ts +0 -1
- 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.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.js +7 -7
- 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.js +15 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +61 -66
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +7 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.d.ts +3 -1
- 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.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 +1 -1
- 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.js +13 -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 +17 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +310 -79
- 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 +441 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.d.ts +24 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +392 -86
- 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 +52 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +271 -187
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.d.ts +68 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.js +668 -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 +2 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +78 -45
- 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 +86 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.js +9 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.js +4 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chat.css +393 -134
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chatViewWelcome.css +36 -17
- 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 +20 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.d.ts +25 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.js +141 -79
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatContextUsageWidget.css +18 -13
- 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 +108 -27
- 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 +4 -6
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.js +74 -32
- 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 +0 -42
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatEditorAffordance.css +27 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatOverlayWidget.css +83 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.d.ts +8 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +58 -33
- 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/chat/browser/widget/input/modelPickerActionItem.js +0 -187
- /package/vscode/src/vs/{workbench/contrib → platform}/mcp/common/modelContextProtocolApps.js +0 -0
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import { registerCss } from '@codingame/monaco-vscode-api/css';
|
|
3
3
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
4
4
|
import * as inlineChatOverlayWidget from './media/inlineChatOverlayWidget.css';
|
|
5
|
-
import { $, append,
|
|
6
|
-
import {
|
|
5
|
+
import { $, append, setVisibility, DisposableResizeObserver, getTotalWidth, addDisposableListener, isAncestorOfActiveElement, trackFocus, createElement } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
6
|
+
import { DEFAULT_FONT_FAMILY } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/fonts';
|
|
7
7
|
import { StandardKeyboardEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/keyboardEvent';
|
|
8
|
-
import {
|
|
8
|
+
import { renderAsPlaintext } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/markdownRenderer';
|
|
9
9
|
import { ActionBar, ActionsOrientation } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/actionbar/actionbar';
|
|
10
10
|
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
11
11
|
import { KeyCode } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keyCodes';
|
|
@@ -19,43 +19,40 @@ import { CodeEditorWidget } from '@codingame/monaco-vscode-api/vscode/vs/editor/
|
|
|
19
19
|
import { IModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model.service';
|
|
20
20
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
21
21
|
import { MenuWorkbenchToolBar, HiddenItemStrategy } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/toolbar';
|
|
22
|
+
import { getFlatActionBarActions } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/menuEntryActionViewItem';
|
|
22
23
|
import { MenuId } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
|
|
23
24
|
import { IMenuService } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions.service';
|
|
24
25
|
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
25
26
|
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
26
27
|
import { ChatEditingAcceptRejectActionViewItem } from '../../chat/browser/chatEditing/chatEditingEditorOverlay.js';
|
|
27
|
-
import {
|
|
28
|
+
import { CTX_INLINE_CHAT_INPUT_HAS_TEXT, CTX_INLINE_CHAT_INPUT_WIDGET_FOCUSED } from '../common/inlineChat.js';
|
|
28
29
|
import { StickyScrollController } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/stickyScroll/browser/stickyScrollController';
|
|
29
30
|
import { IKeybindingService } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding.service';
|
|
30
|
-
import {
|
|
31
|
+
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
31
32
|
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
32
33
|
import { getSimpleEditorOptions } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/codeEditor/browser/simpleEditorOptions';
|
|
33
34
|
import { PlaceholderTextContribution } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/placeholderText/browser/placeholderTextContribution';
|
|
34
|
-
import { Position } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/position';
|
|
35
|
-
import { CancelChatActionId } from '../../chat/browser/actions/chatExecuteActions.js';
|
|
36
35
|
import { assertType } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
37
36
|
import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
|
|
38
37
|
import { observableFromEvent, observableFromEventOpts } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableFromEvent';
|
|
39
38
|
import { constObservable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/constObservable';
|
|
40
|
-
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
41
39
|
import { derived } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/derived';
|
|
40
|
+
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
42
41
|
|
|
43
42
|
registerCss(inlineChatOverlayWidget);
|
|
44
43
|
let InlineChatInputWidget = class InlineChatInputWidget extends Disposable {
|
|
45
44
|
constructor(
|
|
46
45
|
_editorObs,
|
|
47
|
-
_keybindingService,
|
|
48
|
-
_menuService,
|
|
49
46
|
_contextKeyService,
|
|
47
|
+
_menuService,
|
|
50
48
|
instantiationService,
|
|
51
49
|
modelService,
|
|
52
50
|
configurationService
|
|
53
51
|
) {
|
|
54
52
|
super();
|
|
55
53
|
this._editorObs = _editorObs;
|
|
56
|
-
this._keybindingService = _keybindingService;
|
|
57
|
-
this._menuService = _menuService;
|
|
58
54
|
this._contextKeyService = _contextKeyService;
|
|
55
|
+
this._menuService = _menuService;
|
|
59
56
|
this._position = observableValue(this, null);
|
|
60
57
|
this.position = this._position;
|
|
61
58
|
this._showStore = this._store.add(( new DisposableStore()));
|
|
@@ -63,14 +60,30 @@ let InlineChatInputWidget = class InlineChatInputWidget extends Disposable {
|
|
|
63
60
|
this._anchorLeft = 0;
|
|
64
61
|
this._anchorAbove = false;
|
|
65
62
|
this._domNode = $(".inline-chat-gutter-menu");
|
|
66
|
-
this.
|
|
67
|
-
this._inputContainer
|
|
68
|
-
this.
|
|
69
|
-
this.
|
|
70
|
-
this.
|
|
71
|
-
|
|
63
|
+
this._container = append(this._domNode, $(".inline-chat-gutter-container"));
|
|
64
|
+
this._inputContainer = append(this._container, $(".input"));
|
|
65
|
+
this._toolbarContainer = append(this._container, $(".toolbar"));
|
|
66
|
+
const actionsContainer = append(this._domNode, $(".inline-chat-gutter-actions"));
|
|
67
|
+
const actionBar = this._store.add(( new ActionBar(actionsContainer, {
|
|
68
|
+
orientation: ActionsOrientation.VERTICAL,
|
|
69
|
+
preventLoopNavigation: true
|
|
70
|
+
})));
|
|
71
|
+
const actionsMenu = this._store.add(
|
|
72
|
+
this._menuService.createMenu(MenuId.ChatEditorInlineMenu, this._contextKeyService)
|
|
73
|
+
);
|
|
74
|
+
const updateActions = () => {
|
|
75
|
+
const actions = getFlatActionBarActions(actionsMenu.getActions({
|
|
76
|
+
shouldForwardArgs: true
|
|
77
|
+
}));
|
|
78
|
+
actionBar.clear();
|
|
79
|
+
actionBar.push(actions);
|
|
80
|
+
setVisibility(actions.length > 0, actionsContainer);
|
|
81
|
+
};
|
|
82
|
+
this._store.add(actionsMenu.onDidChange(updateActions));
|
|
83
|
+
updateActions();
|
|
72
84
|
const options = getSimpleEditorOptions(configurationService);
|
|
73
|
-
options.wordWrap = "
|
|
85
|
+
options.wordWrap = "off";
|
|
86
|
+
options.wrappingStrategy = "advanced";
|
|
74
87
|
options.lineNumbers = "off";
|
|
75
88
|
options.glyphMargin = false;
|
|
76
89
|
options.lineDecorationsWidth = 0;
|
|
@@ -80,12 +93,19 @@ let InlineChatInputWidget = class InlineChatInputWidget extends Disposable {
|
|
|
80
93
|
enabled: false
|
|
81
94
|
};
|
|
82
95
|
options.scrollbar = {
|
|
83
|
-
vertical: "
|
|
96
|
+
vertical: "hidden",
|
|
84
97
|
horizontal: "hidden",
|
|
85
|
-
alwaysConsumeMouseWheel: true
|
|
86
|
-
verticalSliderSize: 6
|
|
98
|
+
alwaysConsumeMouseWheel: true
|
|
87
99
|
};
|
|
88
100
|
options.renderLineHighlight = "none";
|
|
101
|
+
options.fontFamily = DEFAULT_FONT_FAMILY;
|
|
102
|
+
options.fontSize = 13;
|
|
103
|
+
options.lineHeight = 20;
|
|
104
|
+
options.cursorWidth = 1;
|
|
105
|
+
options.padding = {
|
|
106
|
+
top: 2,
|
|
107
|
+
bottom: 2
|
|
108
|
+
};
|
|
89
109
|
const codeEditorWidgetOptions = {
|
|
90
110
|
isSimpleWidget: true,
|
|
91
111
|
contributions: EditorExtensionsRegistry.getSomeEditorContributions([PlaceholderTextContribution.ID])
|
|
@@ -95,78 +115,131 @@ let InlineChatInputWidget = class InlineChatInputWidget extends Disposable {
|
|
|
95
115
|
);
|
|
96
116
|
const model = this._store.add(modelService.createModel("", null, ( URI.parse(`gutter-input:${Date.now()}`)), true));
|
|
97
117
|
this._input.setModel(model);
|
|
118
|
+
const toolbar = this._store.add(
|
|
119
|
+
instantiationService.createInstance(MenuWorkbenchToolBar, this._toolbarContainer, MenuId.InlineChatInput, {
|
|
120
|
+
telemetrySource: "inlineChatInput.toolbar",
|
|
121
|
+
hiddenItemStrategy: HiddenItemStrategy.NoHide,
|
|
122
|
+
toolbarOptions: {
|
|
123
|
+
primaryGroup: () => true
|
|
124
|
+
},
|
|
125
|
+
menuOptions: {
|
|
126
|
+
shouldForwardArgs: true
|
|
127
|
+
}
|
|
128
|
+
})
|
|
129
|
+
);
|
|
98
130
|
const stickyScrollController = StickyScrollController.get(this._editorObs.editor);
|
|
99
131
|
this._stickyScrollHeight = stickyScrollController ? observableFromEvent(
|
|
100
132
|
stickyScrollController.onDidChangeStickyScrollHeight,
|
|
101
133
|
() => stickyScrollController.stickyScrollWidgetHeight
|
|
102
134
|
) : constObservable(0);
|
|
135
|
+
const toolbarWidth = observableValue(this, 0);
|
|
136
|
+
const resizeObserver = new DisposableResizeObserver(() => {
|
|
137
|
+
toolbarWidth.set(getTotalWidth(toolbar.getElement()), undefined);
|
|
138
|
+
});
|
|
139
|
+
this._store.add(resizeObserver);
|
|
140
|
+
this._store.add(resizeObserver.observe(toolbar.getElement()));
|
|
141
|
+
const contentWidth = observableFromEvent(
|
|
142
|
+
this,
|
|
143
|
+
this._input.onDidChangeModelContent,
|
|
144
|
+
() => this._input.getContentWidth()
|
|
145
|
+
);
|
|
146
|
+
const contentHeight = observableFromEvent(
|
|
147
|
+
this,
|
|
148
|
+
this._input.onDidContentSizeChange,
|
|
149
|
+
() => this._input.getContentHeight()
|
|
150
|
+
);
|
|
151
|
+
this._layoutData = derived(r => {
|
|
152
|
+
const editorPad = 6;
|
|
153
|
+
const totalWidth = contentWidth.read(r) + editorPad + toolbarWidth.read(r);
|
|
154
|
+
const minWidth = 220;
|
|
155
|
+
const maxWidth = 600;
|
|
156
|
+
const clampedWidth = this._input.getOption(EditorOption.wordWrap) === "on" ? maxWidth : Math.max(minWidth, Math.min(totalWidth, maxWidth));
|
|
157
|
+
const lineHeight = this._input.getOption(EditorOption.lineHeight);
|
|
158
|
+
const clampedHeight = Math.min(contentHeight.read(r), (3 * lineHeight));
|
|
159
|
+
if (totalWidth > clampedWidth) {
|
|
160
|
+
this._input.updateOptions({
|
|
161
|
+
wordWrap: "on"
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
return {
|
|
165
|
+
editorPad,
|
|
166
|
+
toolbarWidth: toolbarWidth.read(r),
|
|
167
|
+
totalWidth: clampedWidth,
|
|
168
|
+
height: clampedHeight
|
|
169
|
+
};
|
|
170
|
+
});
|
|
103
171
|
this._store.add(autorun(r => {
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
172
|
+
const {
|
|
173
|
+
editorPad,
|
|
174
|
+
toolbarWidth,
|
|
175
|
+
totalWidth,
|
|
176
|
+
height
|
|
177
|
+
} = this._layoutData.read(r);
|
|
178
|
+
const inputWidth = totalWidth - toolbarWidth - editorPad;
|
|
179
|
+
this._container.style.width = `${totalWidth}px`;
|
|
180
|
+
this._inputContainer.style.width = `${inputWidth}px`;
|
|
181
|
+
this._input.layout({
|
|
182
|
+
width: inputWidth,
|
|
183
|
+
height
|
|
109
184
|
});
|
|
110
185
|
}));
|
|
111
|
-
this._store.add(
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
186
|
+
this._store.add(
|
|
187
|
+
this._input.onDidFocusEditorText(() => this._container.classList.add("focused"))
|
|
188
|
+
);
|
|
189
|
+
this._store.add(
|
|
190
|
+
this._input.onDidBlurEditorText(() => this._container.classList.remove("focused"))
|
|
191
|
+
);
|
|
192
|
+
this._store.add(this._input.onDidScrollChange(e => {
|
|
193
|
+
this._toolbarContainer.classList.toggle("fake-scroll-decoration", e.scrollTop > 0);
|
|
194
|
+
}));
|
|
195
|
+
const inputHasText = CTX_INLINE_CHAT_INPUT_HAS_TEXT.bindTo(this._contextKeyService);
|
|
196
|
+
this._store.add(this._input.onDidChangeModelContent(() => {
|
|
197
|
+
inputHasText.set(this._input.getModel().getValue().trim().length > 0);
|
|
115
198
|
}));
|
|
199
|
+
this._store.add(toDisposable(() => inputHasText.reset()));
|
|
200
|
+
const inputWidgetFocused = CTX_INLINE_CHAT_INPUT_WIDGET_FOCUSED.bindTo(this._contextKeyService);
|
|
201
|
+
this._store.add(this._input.onDidFocusEditorText(() => inputWidgetFocused.set(true)));
|
|
202
|
+
this._store.add(this._input.onDidBlurEditorText(() => inputWidgetFocused.set(false)));
|
|
203
|
+
this._store.add(toDisposable(() => inputWidgetFocused.reset()));
|
|
116
204
|
this._store.add(this._input.onKeyDown(e => {
|
|
117
|
-
if (e.keyCode === KeyCode.
|
|
118
|
-
const
|
|
119
|
-
if (this._inlineStartAction && value) {
|
|
120
|
-
e.preventDefault();
|
|
121
|
-
e.stopPropagation();
|
|
122
|
-
this._actionBar.actionRunner.run(this._inlineStartAction, {
|
|
123
|
-
message: value,
|
|
124
|
-
autoSend: true
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
} else if (e.keyCode === KeyCode.Escape) {
|
|
128
|
-
const value = this._input.getModel().getValue() ?? "";
|
|
129
|
-
if (!value) {
|
|
130
|
-
e.preventDefault();
|
|
131
|
-
e.stopPropagation();
|
|
132
|
-
this._hide();
|
|
133
|
-
}
|
|
134
|
-
} else if (e.keyCode === KeyCode.DownArrow) {
|
|
135
|
-
const inputModel = this._input.getModel();
|
|
205
|
+
if (e.keyCode === KeyCode.DownArrow && !actionBar.isEmpty()) {
|
|
206
|
+
const model = this._input.getModel();
|
|
136
207
|
const position = this._input.getPosition();
|
|
137
|
-
|
|
138
|
-
const lastLineMaxColumn = inputModel.getLineMaxColumn(lastLineNumber);
|
|
139
|
-
if (Position.equals(position, ( new Position(lastLineNumber, lastLineMaxColumn)))) {
|
|
208
|
+
if (position && position.lineNumber === model.getLineCount()) {
|
|
140
209
|
e.preventDefault();
|
|
141
210
|
e.stopPropagation();
|
|
142
|
-
|
|
211
|
+
actionBar.focus(0);
|
|
143
212
|
}
|
|
144
213
|
}
|
|
145
214
|
}));
|
|
146
|
-
this.
|
|
147
|
-
orientation: ActionsOrientation.VERTICAL,
|
|
148
|
-
preventLoopNavigation: true
|
|
149
|
-
})));
|
|
150
|
-
this._store.add(addDisposableListener(this._actionBar.domNode, "keydown", e => {
|
|
215
|
+
this._store.add(addDisposableListener(actionBar.domNode, "keydown", e => {
|
|
151
216
|
const event = ( new StandardKeyboardEvent(e));
|
|
152
|
-
if (event.
|
|
153
|
-
this._actionBar.viewItems.findIndex(item => item.action.id !== Separator.ID)
|
|
154
|
-
)) {
|
|
217
|
+
if (event.keyCode === KeyCode.Escape) {
|
|
155
218
|
event.preventDefault();
|
|
156
219
|
event.stopPropagation();
|
|
157
|
-
this.
|
|
220
|
+
this.hide();
|
|
221
|
+
} else if (event.keyCode === KeyCode.UpArrow) {
|
|
222
|
+
const firstItem = actionBar.viewItems[0];
|
|
223
|
+
if (firstItem?.element && isAncestorOfActiveElement(firstItem.element)) {
|
|
224
|
+
event.preventDefault();
|
|
225
|
+
event.stopPropagation();
|
|
226
|
+
this._input.focus();
|
|
227
|
+
}
|
|
158
228
|
}
|
|
159
229
|
}, true));
|
|
160
230
|
const focusTracker = this._store.add(trackFocus(this._domNode));
|
|
161
|
-
this._store.add(focusTracker.onDidBlur(() => this.
|
|
162
|
-
this._store.add(this._actionBar.onDidCancel(() => this._hide()));
|
|
163
|
-
this._store.add(this._actionBar.onWillRun(() => this._hide()));
|
|
231
|
+
this._store.add(focusTracker.onDidBlur(() => this.hide()));
|
|
164
232
|
}
|
|
165
|
-
|
|
233
|
+
get value() {
|
|
234
|
+
return this._input.getModel().getValue().trim();
|
|
235
|
+
}
|
|
236
|
+
show(lineNumber, left, anchorAbove, placeholder) {
|
|
166
237
|
this._showStore.clear();
|
|
238
|
+
this._input.updateOptions({
|
|
239
|
+
wordWrap: "off",
|
|
240
|
+
placeholder
|
|
241
|
+
});
|
|
167
242
|
this._input.getModel().setValue("");
|
|
168
|
-
this._updateInputHeight(this._input.getContentHeight());
|
|
169
|
-
this._refreshActions();
|
|
170
243
|
this._anchorLineNumber = lineNumber;
|
|
171
244
|
this._anchorLeft = left;
|
|
172
245
|
this._anchorAbove = anchorAbove;
|
|
@@ -187,7 +260,7 @@ let InlineChatInputWidget = class InlineChatInputWidget extends Disposable {
|
|
|
187
260
|
));
|
|
188
261
|
const hasContent = !!this._input.getModel().getValue();
|
|
189
262
|
if (!isLineVisible && !hasContent) {
|
|
190
|
-
this.
|
|
263
|
+
this.hide();
|
|
191
264
|
} else {
|
|
192
265
|
this._updatePosition();
|
|
193
266
|
}
|
|
@@ -221,54 +294,24 @@ let InlineChatInputWidget = class InlineChatInputWidget extends Disposable {
|
|
|
221
294
|
stackOrdinal: 10000
|
|
222
295
|
}, undefined);
|
|
223
296
|
}
|
|
224
|
-
|
|
297
|
+
hide() {
|
|
225
298
|
const editorDomNode = this._editorObs.editor.getDomNode();
|
|
226
299
|
if (editorDomNode && isAncestorOfActiveElement(editorDomNode)) {
|
|
227
300
|
this._editorObs.editor.focus();
|
|
228
301
|
}
|
|
229
302
|
this._position.set(null, undefined);
|
|
303
|
+
this._input.getModel().setValue("");
|
|
230
304
|
this._showStore.clear();
|
|
231
305
|
}
|
|
232
|
-
_refreshActions() {
|
|
233
|
-
this._actionBar.clear();
|
|
234
|
-
this._inlineStartAction = undefined;
|
|
235
|
-
const actions = getFlatActionBarActions(
|
|
236
|
-
this._menuService.getMenuActions(MenuId.ChatEditorInlineGutter, this._contextKeyService, {
|
|
237
|
-
shouldForwardArgs: true
|
|
238
|
-
})
|
|
239
|
-
);
|
|
240
|
-
for (const action of actions) {
|
|
241
|
-
if (action.id === ACTION_START) {
|
|
242
|
-
this._inlineStartAction = action;
|
|
243
|
-
continue;
|
|
244
|
-
}
|
|
245
|
-
const keybinding = this._keybindingService.lookupKeybinding(action.id)?.getLabel();
|
|
246
|
-
this._actionBar.push(action, {
|
|
247
|
-
icon: false,
|
|
248
|
-
label: true,
|
|
249
|
-
keybinding
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
_updateInputHeight(contentHeight) {
|
|
254
|
-
const lineHeight = this._input.getOption(EditorOption.lineHeight);
|
|
255
|
-
const maxHeight = 3 * lineHeight;
|
|
256
|
-
const clampedHeight = Math.min(contentHeight, maxHeight);
|
|
257
|
-
const containerPadding = 8;
|
|
258
|
-
this._inputContainer.style.height = `${clampedHeight + containerPadding}px`;
|
|
259
|
-
this._input.layout({
|
|
260
|
-
width: 200,
|
|
261
|
-
height: clampedHeight
|
|
262
|
-
});
|
|
263
|
-
}
|
|
264
306
|
};
|
|
265
|
-
InlineChatInputWidget = ( __decorate([( __param(1,
|
|
307
|
+
InlineChatInputWidget = ( __decorate([( __param(1, IContextKeyService)), ( __param(2, IMenuService)), ( __param(3, IInstantiationService)), ( __param(4, IModelService)), ( __param(5, IConfigurationService))], InlineChatInputWidget));
|
|
266
308
|
let InlineChatSessionOverlayWidget = class InlineChatSessionOverlayWidget extends Disposable {
|
|
267
|
-
constructor(_editorObs, _instaService, _keybindingService) {
|
|
309
|
+
constructor(_editorObs, _instaService, _keybindingService, _logService) {
|
|
268
310
|
super();
|
|
269
311
|
this._editorObs = _editorObs;
|
|
270
312
|
this._instaService = _instaService;
|
|
271
313
|
this._keybindingService = _keybindingService;
|
|
314
|
+
this._logService = _logService;
|
|
272
315
|
this._domNode = createElement("div");
|
|
273
316
|
this._showStore = this._store.add(( new DisposableStore()));
|
|
274
317
|
this._position = observableValue(this, null);
|
|
@@ -302,7 +345,7 @@ let InlineChatSessionOverlayWidget = class InlineChatSessionOverlayWidget extend
|
|
|
302
345
|
const response = chatModel.lastRequestObs.read(r)?.response;
|
|
303
346
|
if (!response) {
|
|
304
347
|
return {
|
|
305
|
-
message: ( localize(
|
|
348
|
+
message: ( localize(9479, "Working...")),
|
|
306
349
|
icon: ThemeIcon.modify(Codicon.loading, "spin")
|
|
307
350
|
};
|
|
308
351
|
}
|
|
@@ -310,16 +353,23 @@ let InlineChatSessionOverlayWidget = class InlineChatSessionOverlayWidget extend
|
|
|
310
353
|
const result = response.result;
|
|
311
354
|
if (result?.errorDetails) {
|
|
312
355
|
return {
|
|
313
|
-
message: ( localize(
|
|
356
|
+
message: ( localize(9480, "Sorry, your request failed")),
|
|
314
357
|
icon: Codicon.error
|
|
315
358
|
};
|
|
316
359
|
}
|
|
317
360
|
const changes = entry.read(r)?.changesCount.read(r) ?? 0;
|
|
318
361
|
return {
|
|
319
|
-
message: changes === 0 ? ( localize(
|
|
362
|
+
message: changes === 0 ? ( localize(9481, "Done")) : changes === 1 ? ( localize(9482, "Done, 1 change")) : ( localize(9483, "Done, {0} changes", changes)),
|
|
320
363
|
icon: Codicon.check
|
|
321
364
|
};
|
|
322
365
|
}
|
|
366
|
+
const pendingConfirmation = response.isPendingConfirmation.read(r);
|
|
367
|
+
if (pendingConfirmation) {
|
|
368
|
+
return {
|
|
369
|
+
message: ( localize(9484, "Sorry, but an expected error happened")),
|
|
370
|
+
icon: Codicon.error
|
|
371
|
+
};
|
|
372
|
+
}
|
|
323
373
|
const lastPart = observableFromEventOpts({
|
|
324
374
|
equalsFn: () => false
|
|
325
375
|
}, response.onDidChange, () => response.response.value).read(r).filter(part => part.kind === "progressMessage" || part.kind === "toolInvocation").at(-1);
|
|
@@ -335,7 +385,7 @@ let InlineChatSessionOverlayWidget = class InlineChatSessionOverlayWidget extend
|
|
|
335
385
|
};
|
|
336
386
|
} else {
|
|
337
387
|
return {
|
|
338
|
-
message: ( localize(
|
|
388
|
+
message: ( localize(9479, "Working...")),
|
|
339
389
|
icon: ThemeIcon.modify(Codicon.loading, "spin")
|
|
340
390
|
};
|
|
341
391
|
}
|
|
@@ -351,6 +401,13 @@ let InlineChatSessionOverlayWidget = class InlineChatSessionOverlayWidget extend
|
|
|
351
401
|
this._icon.className = "";
|
|
352
402
|
}
|
|
353
403
|
}));
|
|
404
|
+
this._showStore.add(autorun(r => {
|
|
405
|
+
const response = session.chatModel.lastRequestObs.read(r)?.response;
|
|
406
|
+
const pending = response?.isPendingConfirmation.read(r);
|
|
407
|
+
if (pending) {
|
|
408
|
+
this._logService.info(`[InlineChat] UNEXPECTED approval needed: ${pending.detail ?? "unknown"}`);
|
|
409
|
+
}
|
|
410
|
+
}));
|
|
354
411
|
this._container.appendChild(this._toolbarNode);
|
|
355
412
|
this._showStore.add(toDisposable(() => this._toolbarNode.remove()));
|
|
356
413
|
const that = this;
|
|
@@ -366,12 +423,15 @@ let InlineChatSessionOverlayWidget = class InlineChatSessionOverlayWidget extend
|
|
|
366
423
|
renderShortTitle: true
|
|
367
424
|
},
|
|
368
425
|
actionViewItemProvider: (action, options) => {
|
|
369
|
-
const primaryActions = [
|
|
426
|
+
const primaryActions = ["inlineChat2.cancel", "inlineChat2.keep", "inlineChat2.close"];
|
|
370
427
|
const labeledActions = primaryActions.concat(["inlineChat2.undo"]);
|
|
371
428
|
if (!labeledActions.includes(action.id)) {
|
|
372
429
|
return undefined;
|
|
373
430
|
}
|
|
374
|
-
return ( new ChatEditingAcceptRejectActionViewItem(action,
|
|
431
|
+
return ( new ChatEditingAcceptRejectActionViewItem(action, {
|
|
432
|
+
...options,
|
|
433
|
+
keybinding: undefined
|
|
434
|
+
}, entry, undefined, that._keybindingService, primaryActions));
|
|
375
435
|
}
|
|
376
436
|
})
|
|
377
437
|
);
|
|
@@ -411,6 +471,6 @@ let InlineChatSessionOverlayWidget = class InlineChatSessionOverlayWidget extend
|
|
|
411
471
|
this._showStore.clear();
|
|
412
472
|
}
|
|
413
473
|
};
|
|
414
|
-
InlineChatSessionOverlayWidget = ( __decorate([( __param(1, IInstantiationService)), ( __param(2, IKeybindingService))], InlineChatSessionOverlayWidget));
|
|
474
|
+
InlineChatSessionOverlayWidget = ( __decorate([( __param(1, IInstantiationService)), ( __param(2, IKeybindingService)), ( __param(3, ILogService))], InlineChatSessionOverlayWidget));
|
|
415
475
|
|
|
416
476
|
export { InlineChatInputWidget, InlineChatSessionOverlayWidget };
|
|
@@ -248,7 +248,7 @@ let InlineChatWidget = class InlineChatWidget {
|
|
|
248
248
|
);
|
|
249
249
|
this._store.add(this._chatService.onDidPerformUserAction(e => {
|
|
250
250
|
if (isEqual(e.sessionResource, this._chatWidget.viewModel?.model.sessionResource) && e.action.kind === "vote") {
|
|
251
|
-
this.updateStatus(( localize(
|
|
251
|
+
this.updateStatus(( localize(9493, "Thank you for your feedback!")), {
|
|
252
252
|
resetAfter: 1250
|
|
253
253
|
});
|
|
254
254
|
}
|
|
@@ -261,11 +261,11 @@ let InlineChatWidget = class InlineChatWidget {
|
|
|
261
261
|
if (this._configurationService.getValue(AccessibilityVerbositySettingId.InlineChat)) {
|
|
262
262
|
const kbLabel = this._keybindingService.lookupKeybinding(AccessibilityCommandId.OpenAccessibilityHelp)?.getLabel();
|
|
263
263
|
label = kbLabel ? ( localize(
|
|
264
|
-
|
|
264
|
+
9494,
|
|
265
265
|
"Inline Chat Input, Use {0} for Inline Chat Accessibility Help.",
|
|
266
266
|
kbLabel
|
|
267
267
|
)) : ( localize(
|
|
268
|
-
|
|
268
|
+
9495,
|
|
269
269
|
"Inline Chat Input, Run the Inline Chat Accessibility Help command for more information."
|
|
270
270
|
));
|
|
271
271
|
}
|
|
@@ -286,7 +286,7 @@ let InlineChatWidget = class InlineChatWidget {
|
|
|
286
286
|
this._elements.disclaimerLabel.classList.toggle("hidden", !showDisclaimer);
|
|
287
287
|
if (showDisclaimer) {
|
|
288
288
|
const renderedMarkdown = disposables.add(this._markdownRendererService.render(( new MarkdownString(( localize(
|
|
289
|
-
|
|
289
|
+
9496,
|
|
290
290
|
"By continuing with {0} Copilot, you agree to {1}'s [Terms]({2}) and [Privacy Statement]({3})",
|
|
291
291
|
product.defaultChatAgent?.provider?.default?.name ?? "",
|
|
292
292
|
product.defaultChatAgent?.provider?.default?.name ?? "",
|
|
@@ -495,7 +495,7 @@ let InlineChatWidget = class InlineChatWidget {
|
|
|
495
495
|
}
|
|
496
496
|
};
|
|
497
497
|
InlineChatWidget = ( __decorate([( __param(2, IInstantiationService)), ( __param(3, IContextKeyService)), ( __param(4, IKeybindingService)), ( __param(5, IAccessibilityService)), ( __param(6, IConfigurationService)), ( __param(7, IAccessibleViewService)), ( __param(8, ITextModelService)), ( __param(9, IChatService)), ( __param(10, IHoverService)), ( __param(11, IChatEntitlementService)), ( __param(12, IMarkdownRendererService))], InlineChatWidget));
|
|
498
|
-
const defaultAriaLabel = ( localize(
|
|
498
|
+
const defaultAriaLabel = ( localize(9497, "Inline Chat Input"));
|
|
499
499
|
let EditorBasedInlineChatWidget = class EditorBasedInlineChatWidget extends InlineChatWidget {
|
|
500
500
|
constructor(
|
|
501
501
|
location,
|
|
@@ -240,7 +240,7 @@ let InlineChatZoneWidget = class InlineChatZoneWidget extends ZoneWidget {
|
|
|
240
240
|
this._ctxCursorPosition.reset();
|
|
241
241
|
this.widget.chatWidget.setVisible(false);
|
|
242
242
|
super.hide();
|
|
243
|
-
status(( localize(
|
|
243
|
+
status(( localize(9498, "Closed inline chat widget")));
|
|
244
244
|
scrollState.restore(this.editor);
|
|
245
245
|
}
|
|
246
246
|
};
|
|
@@ -321,45 +321,3 @@
|
|
|
321
321
|
.monaco-workbench .inline-chat .chat-attached-context {
|
|
322
322
|
padding: 2px 0px;
|
|
323
323
|
}
|
|
324
|
-
|
|
325
|
-
/* Gutter menu overlay widget */
|
|
326
|
-
.inline-chat-gutter-menu {
|
|
327
|
-
background: var(--vscode-menu-background);
|
|
328
|
-
border: 1px solid var(--vscode-menu-border, var(--vscode-widget-border));
|
|
329
|
-
border-radius: 4px;
|
|
330
|
-
box-shadow: 0 2px 8px var(--vscode-widget-shadow);
|
|
331
|
-
padding: 4px 0;
|
|
332
|
-
min-width: 160px;
|
|
333
|
-
z-index: 10000;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
.inline-chat-gutter-menu .input {
|
|
337
|
-
padding: 0 8px;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
.inline-chat-gutter-menu .monaco-action-bar.vertical .action-item {
|
|
341
|
-
display: flex;
|
|
342
|
-
justify-content: space-between;
|
|
343
|
-
border-radius: 3px;
|
|
344
|
-
margin: 0 4px;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
.inline-chat-gutter-menu .monaco-action-bar.vertical .action-item .action-label {
|
|
348
|
-
font-size: 13px;
|
|
349
|
-
width: 100%;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
.inline-chat-gutter-menu .monaco-action-bar.vertical .action-item:not(.disabled):hover,
|
|
353
|
-
.inline-chat-gutter-menu .monaco-action-bar.vertical .action-item:not(.disabled):focus-within {
|
|
354
|
-
background-color: var(--vscode-list-activeSelectionBackground);
|
|
355
|
-
color: var(--vscode-list-activeSelectionForeground);
|
|
356
|
-
outline: 1px solid var(--vscode-menu-selectionBorder, transparent);
|
|
357
|
-
outline-offset: -1px;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
.inline-chat-gutter-menu .monaco-action-bar.vertical .action-item:not(.disabled):hover .action-label,
|
|
361
|
-
.inline-chat-gutter-menu .monaco-action-bar.vertical .action-item:not(.disabled):focus-within .action-label {
|
|
362
|
-
color: var(--vscode-list-activeSelectionForeground);
|
|
363
|
-
outline: 1px solid var(--vscode-menu-selectionBorder, transparent);
|
|
364
|
-
outline-offset: -1px;
|
|
365
|
-
}
|
package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatEditorAffordance.css
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
|
|
6
6
|
.inline-chat-content-widget {
|
|
7
|
-
background-color: var(--vscode-
|
|
8
|
-
padding:
|
|
7
|
+
background-color: var(--vscode-panel-background);
|
|
8
|
+
padding: 0 1px;
|
|
9
9
|
border-radius: 8px;
|
|
10
10
|
display: flex;
|
|
11
11
|
align-items: center;
|
|
@@ -14,9 +14,33 @@
|
|
|
14
14
|
min-width: var(--vscode-inline-chat-affordance-height);
|
|
15
15
|
min-height: var(--vscode-inline-chat-affordance-height);
|
|
16
16
|
line-height: var(--vscode-inline-chat-affordance-height);
|
|
17
|
+
border: 1px solid var(--vscode-input-border, transparent);
|
|
18
|
+
z-index: 100;
|
|
17
19
|
}
|
|
18
20
|
|
|
19
|
-
.inline-chat-content-widget .
|
|
21
|
+
.inline-chat-content-widget .action-label.codicon.codicon-light-bulb,
|
|
22
|
+
.inline-chat-content-widget .action-label.codicon.codicon-lightbulb-sparkle,
|
|
23
|
+
.inline-edits-view-gutter-indicator .codicon.codicon-light-bulb,
|
|
24
|
+
.inline-edits-view-gutter-indicator .codicon.codicon-lightbulb-sparkle {
|
|
20
25
|
margin: 0;
|
|
21
26
|
color: var(--vscode-editorLightBulb-foreground);
|
|
22
27
|
}
|
|
28
|
+
|
|
29
|
+
.inline-chat-content-widget .action-label.codicon.codicon-lightbulb-autofix,
|
|
30
|
+
.inline-chat-content-widget .action-label.codicon.codicon-lightbulb-sparkle-autofix,
|
|
31
|
+
.inline-edits-view-gutter-indicator .codicon.codicon-lightbulb-autofix,
|
|
32
|
+
.inline-edits-view-gutter-indicator .codicon.codicon-lightbulb-sparkle-autofix {
|
|
33
|
+
margin: 0;
|
|
34
|
+
color: var(--vscode-editorLightBulbAutoFix-foreground, var(--vscode-editorLightBulb-foreground));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.inline-chat-content-widget .action-label.codicon.codicon-sparkle-filled,
|
|
38
|
+
.inline-edits-view-gutter-indicator .codicon.codicon-sparkle-filled {
|
|
39
|
+
margin: 0;
|
|
40
|
+
color: var(--vscode-editorLightBulbAi-foreground, var(--vscode-icon-foreground));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.inline-chat-content-widget .inline-chat-keybinding {
|
|
44
|
+
opacity: 0.7;
|
|
45
|
+
margin-left: 4px;
|
|
46
|
+
}
|