@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
|
@@ -3,6 +3,12 @@ import { IRange } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/cor
|
|
|
3
3
|
import { IChatProgressRenderableResponseContent, IChatProgressResponseContent } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatModel";
|
|
4
4
|
export declare const contentRefUrl = "http://_vscodecontentref_";
|
|
5
5
|
export declare function annotateSpecialMarkdownContent(response: Iterable<IChatProgressResponseContent>): IChatProgressRenderableResponseContent[];
|
|
6
|
+
/**
|
|
7
|
+
* Checks whether the end of a markdown string is inside a code context
|
|
8
|
+
* (fenced code block or inline code span) where markdown link syntax
|
|
9
|
+
* would be rendered as literal text.
|
|
10
|
+
*/
|
|
11
|
+
export declare function isInsideCodeContext(text: string): boolean;
|
|
6
12
|
export interface IMarkdownVulnerability {
|
|
7
13
|
readonly title: string;
|
|
8
14
|
readonly description: string;
|
|
@@ -16,6 +22,7 @@ export declare function extractCodeblockUrisFromText(text: string): {
|
|
|
16
22
|
} | undefined;
|
|
17
23
|
export declare function extractSubAgentInvocationIdFromText(text: string): string | undefined;
|
|
18
24
|
export declare function hasCodeblockUriTag(text: string): boolean;
|
|
25
|
+
export declare function hasEditCodeblockUriTag(text: string): boolean;
|
|
19
26
|
export declare function extractVulnerabilitiesFromText(text: string): {
|
|
20
27
|
newText: string;
|
|
21
28
|
vulnerabilities: IMarkdownVulnerability[];
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
import { findLastIdx } from '@codingame/monaco-vscode-api/vscode/vs/base/common/arraysFind';
|
|
3
2
|
import { MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
|
|
4
3
|
import { basename } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
5
4
|
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
@@ -11,7 +10,7 @@ function annotateSpecialMarkdownContent(response) {
|
|
|
11
10
|
let refIdPool = 0;
|
|
12
11
|
const result = [];
|
|
13
12
|
for (const item of response) {
|
|
14
|
-
const previousItemIndex =
|
|
13
|
+
const previousItemIndex = result.findLastIndex(p => p.kind !== "textEditGroup" && p.kind !== "undoStop");
|
|
15
14
|
const previousItem = result[previousItemIndex];
|
|
16
15
|
if (item.kind === "inlineReference") {
|
|
17
16
|
let label = item.name;
|
|
@@ -24,30 +23,46 @@ function annotateSpecialMarkdownContent(response) {
|
|
|
24
23
|
label = item.inlineReference.name;
|
|
25
24
|
}
|
|
26
25
|
}
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
...annotationMetadata,
|
|
42
|
-
...(previousItem.inlineReferences || {})
|
|
43
|
-
}
|
|
44
|
-
};
|
|
26
|
+
const previousText = previousItem?.kind === "markdownContent" ? previousItem.content.value : "";
|
|
27
|
+
if (isInsideCodeContext(previousText)) {
|
|
28
|
+
if (previousItem?.kind === "markdownContent") {
|
|
29
|
+
const merged = appendMarkdownString(previousItem.content, ( new MarkdownString(label)));
|
|
30
|
+
result[previousItemIndex] = {
|
|
31
|
+
...previousItem,
|
|
32
|
+
content: merged
|
|
33
|
+
};
|
|
34
|
+
} else {
|
|
35
|
+
result.push({
|
|
36
|
+
content: ( new MarkdownString(label)),
|
|
37
|
+
kind: "markdownContent"
|
|
38
|
+
});
|
|
39
|
+
}
|
|
45
40
|
} else {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
kind: "markdownContent"
|
|
41
|
+
const refId = refIdPool++;
|
|
42
|
+
const printUri = ( URI.parse(contentRefUrl)).with({
|
|
43
|
+
path: String(refId)
|
|
50
44
|
});
|
|
45
|
+
const markdownText = `[${label}](${( printUri.toString())})`;
|
|
46
|
+
const annotationMetadata = {
|
|
47
|
+
[refId]: item
|
|
48
|
+
};
|
|
49
|
+
if (previousItem?.kind === "markdownContent") {
|
|
50
|
+
const merged = appendMarkdownString(previousItem.content, ( new MarkdownString(markdownText)));
|
|
51
|
+
result[previousItemIndex] = {
|
|
52
|
+
...previousItem,
|
|
53
|
+
content: merged,
|
|
54
|
+
inlineReferences: {
|
|
55
|
+
...annotationMetadata,
|
|
56
|
+
...(previousItem.inlineReferences || {})
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
} else {
|
|
60
|
+
result.push({
|
|
61
|
+
content: ( new MarkdownString(markdownText)),
|
|
62
|
+
inlineReferences: annotationMetadata,
|
|
63
|
+
kind: "markdownContent"
|
|
64
|
+
});
|
|
65
|
+
}
|
|
51
66
|
}
|
|
52
67
|
} else if (item.kind === "markdownContent" && previousItem?.kind === "markdownContent" && canMergeMarkdownStrings(previousItem.content, item.content)) {
|
|
53
68
|
const merged = appendMarkdownString(previousItem.content, item.content);
|
|
@@ -88,6 +103,72 @@ function annotateSpecialMarkdownContent(response) {
|
|
|
88
103
|
}
|
|
89
104
|
return result;
|
|
90
105
|
}
|
|
106
|
+
function isInsideCodeContext(text) {
|
|
107
|
+
const lines = text.split("\n");
|
|
108
|
+
let inFencedBlock = false;
|
|
109
|
+
let fenceChar = "";
|
|
110
|
+
let fenceLength = 0;
|
|
111
|
+
const unfencedLines = [];
|
|
112
|
+
for (const line of lines) {
|
|
113
|
+
const trimmed = line.trimStart();
|
|
114
|
+
if (inFencedBlock) {
|
|
115
|
+
const closeLength = countLeadingChar(trimmed, fenceChar);
|
|
116
|
+
if (closeLength >= fenceLength && trimmed.substring(closeLength).trim() === "") {
|
|
117
|
+
inFencedBlock = false;
|
|
118
|
+
unfencedLines.length = 0;
|
|
119
|
+
}
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
const firstChar = trimmed[0];
|
|
123
|
+
if (firstChar === "`" || firstChar === "~") {
|
|
124
|
+
const openLength = countLeadingChar(trimmed, firstChar);
|
|
125
|
+
if (openLength >= 3 && (firstChar === "~" || !trimmed.substring(openLength).includes("`"))) {
|
|
126
|
+
inFencedBlock = true;
|
|
127
|
+
fenceChar = firstChar;
|
|
128
|
+
fenceLength = openLength;
|
|
129
|
+
unfencedLines.length = 0;
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
unfencedLines.push(line);
|
|
134
|
+
}
|
|
135
|
+
return inFencedBlock || hasUnclosedInlineCode(unfencedLines.join("\n"));
|
|
136
|
+
}
|
|
137
|
+
function countLeadingChar(text, char) {
|
|
138
|
+
let count = 0;
|
|
139
|
+
while (count < text.length && text[count] === char) {
|
|
140
|
+
count++;
|
|
141
|
+
}
|
|
142
|
+
return count;
|
|
143
|
+
}
|
|
144
|
+
function hasUnclosedInlineCode(text) {
|
|
145
|
+
let i = 0;
|
|
146
|
+
while (i < text.length) {
|
|
147
|
+
if (text[i] !== "`") {
|
|
148
|
+
i++;
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
const openLen = countLeadingChar(text.substring(i), "`");
|
|
152
|
+
i += openLen;
|
|
153
|
+
let found = false;
|
|
154
|
+
while (i < text.length) {
|
|
155
|
+
if (text[i] !== "`") {
|
|
156
|
+
i++;
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
const closeLen = countLeadingChar(text.substring(i), "`");
|
|
160
|
+
i += closeLen;
|
|
161
|
+
if (closeLen === openLen) {
|
|
162
|
+
found = true;
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
if (!found) {
|
|
167
|
+
return true;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return false;
|
|
171
|
+
}
|
|
91
172
|
function extractCodeblockUrisFromText(text) {
|
|
92
173
|
const match = /<vscode_codeblock_uri( isEdit)?( subAgentInvocationId="([^"]*)")?>([\s\S]*?)<\/vscode_codeblock_uri>/ms.exec(text);
|
|
93
174
|
if (match) {
|
|
@@ -124,8 +205,8 @@ function extractSubAgentInvocationIdFromText(text) {
|
|
|
124
205
|
}
|
|
125
206
|
return undefined;
|
|
126
207
|
}
|
|
127
|
-
function
|
|
128
|
-
return text.includes("<vscode_codeblock_uri");
|
|
208
|
+
function hasEditCodeblockUriTag(text) {
|
|
209
|
+
return text.includes("<vscode_codeblock_uri isEdit");
|
|
129
210
|
}
|
|
130
211
|
function extractVulnerabilitiesFromText(text) {
|
|
131
212
|
const vulnerabilities = [];
|
|
@@ -167,4 +248,4 @@ function extractVulnerabilitiesFromText(text) {
|
|
|
167
248
|
};
|
|
168
249
|
}
|
|
169
250
|
|
|
170
|
-
export { annotateSpecialMarkdownContent, contentRefUrl, extractCodeblockUrisFromText, extractSubAgentInvocationIdFromText, extractVulnerabilitiesFromText,
|
|
251
|
+
export { annotateSpecialMarkdownContent, contentRefUrl, extractCodeblockUrisFromText, extractSubAgentInvocationIdFromText, extractVulnerabilitiesFromText, hasEditCodeblockUriTag, isInsideCodeContext };
|
|
@@ -13,44 +13,50 @@ import { badgeBackground, badgeForeground } from '@codingame/monaco-vscode-api/v
|
|
|
13
13
|
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/quickpickColors';
|
|
14
14
|
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/searchColors';
|
|
15
15
|
|
|
16
|
+
registerColor("agentStatusIndicator.background", {
|
|
17
|
+
dark: ( Color.white.transparent(0.05)),
|
|
18
|
+
light: ( Color.black.transparent(0.05)),
|
|
19
|
+
hcDark: null,
|
|
20
|
+
hcLight: null
|
|
21
|
+
}, ( localize(7222, "Background color of the agent status indicator in the titlebar.")));
|
|
16
22
|
registerColor("chat.requestBorder", {
|
|
17
23
|
dark: ( new Color(( new RGBA(255, 255, 255, 0.10)))),
|
|
18
24
|
light: ( new Color(( new RGBA(0, 0, 0, 0.10)))),
|
|
19
25
|
hcDark: contrastBorder,
|
|
20
26
|
hcLight: contrastBorder
|
|
21
|
-
}, ( localize(
|
|
27
|
+
}, ( localize(7223, "The border color of a chat request.")));
|
|
22
28
|
const chatRequestBackground = registerColor("chat.requestBackground", {
|
|
23
29
|
dark: ( transparent(editorBackground, 0.62)),
|
|
24
30
|
light: ( transparent(editorBackground, 0.62)),
|
|
25
31
|
hcDark: editorWidgetBackground,
|
|
26
32
|
hcLight: null
|
|
27
|
-
}, ( localize(
|
|
33
|
+
}, ( localize(7224, "The background color of a chat request.")));
|
|
28
34
|
const chatSlashCommandBackground = registerColor("chat.slashCommandBackground", {
|
|
29
35
|
dark: "#26477866",
|
|
30
36
|
light: "#adceff7a",
|
|
31
37
|
hcDark: Color.white,
|
|
32
38
|
hcLight: badgeBackground
|
|
33
|
-
}, ( localize(
|
|
39
|
+
}, ( localize(7225, "The background color of a chat slash command.")));
|
|
34
40
|
const chatSlashCommandForeground = registerColor("chat.slashCommandForeground", {
|
|
35
41
|
dark: "#85b6ff",
|
|
36
42
|
light: "#26569e",
|
|
37
43
|
hcDark: Color.black,
|
|
38
44
|
hcLight: badgeForeground
|
|
39
|
-
}, ( localize(
|
|
45
|
+
}, ( localize(7226, "The foreground color of a chat slash command.")));
|
|
40
46
|
registerColor("chat.avatarBackground", {
|
|
41
47
|
dark: "#1f1f1f",
|
|
42
48
|
light: "#f2f2f2",
|
|
43
49
|
hcDark: Color.black,
|
|
44
50
|
hcLight: Color.white
|
|
45
|
-
}, ( localize(
|
|
46
|
-
registerColor("chat.avatarForeground", foreground, ( localize(
|
|
51
|
+
}, ( localize(7227, "The background color of a chat avatar.")));
|
|
52
|
+
registerColor("chat.avatarForeground", foreground, ( localize(7228, "The foreground color of a chat avatar.")));
|
|
47
53
|
registerColor("chat.editedFileForeground", {
|
|
48
54
|
light: "#895503",
|
|
49
55
|
dark: "#E2C08D",
|
|
50
56
|
hcDark: "#E2C08D",
|
|
51
57
|
hcLight: "#895503"
|
|
52
58
|
}, ( localize(
|
|
53
|
-
|
|
59
|
+
7229,
|
|
54
60
|
"The foreground color of a chat edited file in the edited file list."
|
|
55
61
|
)));
|
|
56
62
|
registerColor("chat.requestCodeBorder", {
|
|
@@ -58,42 +64,42 @@ registerColor("chat.requestCodeBorder", {
|
|
|
58
64
|
light: "#0e639c40",
|
|
59
65
|
hcDark: null,
|
|
60
66
|
hcLight: null
|
|
61
|
-
}, ( localize(
|
|
67
|
+
}, ( localize(7230, "Border color of code blocks within the chat request bubble.")), true);
|
|
62
68
|
registerColor("chat.requestBubbleBackground", {
|
|
63
69
|
light: ( transparent(editorSelectionBackground, 0.3)),
|
|
64
70
|
dark: ( transparent(editorSelectionBackground, 0.3)),
|
|
65
71
|
hcDark: null,
|
|
66
72
|
hcLight: null
|
|
67
|
-
}, ( localize(
|
|
73
|
+
}, ( localize(7231, "Background color of the chat request bubble.")), true);
|
|
68
74
|
registerColor("chat.requestBubbleHoverBackground", {
|
|
69
75
|
dark: ( transparent(editorSelectionBackground, 0.6)),
|
|
70
76
|
light: ( transparent(editorSelectionBackground, 0.6)),
|
|
71
77
|
hcDark: null,
|
|
72
78
|
hcLight: null
|
|
73
|
-
}, ( localize(
|
|
79
|
+
}, ( localize(7232, "Background color of the chat request bubble on hover.")), true);
|
|
74
80
|
registerColor("chat.checkpointSeparator", {
|
|
75
81
|
dark: "#585858",
|
|
76
82
|
light: "#a9a9a9",
|
|
77
83
|
hcDark: "#a9a9a9",
|
|
78
84
|
hcLight: "#a5a5a5"
|
|
79
|
-
}, ( localize(
|
|
85
|
+
}, ( localize(7233, "Chat checkpoint separator color.")));
|
|
80
86
|
registerColor("chat.linesAddedForeground", {
|
|
81
87
|
dark: "#54B054",
|
|
82
88
|
light: "#107C10",
|
|
83
89
|
hcDark: "#54B054",
|
|
84
90
|
hcLight: "#107C10"
|
|
85
|
-
}, ( localize(
|
|
91
|
+
}, ( localize(7234, "Foreground color of lines added in chat code block pill.")), true);
|
|
86
92
|
registerColor("chat.linesRemovedForeground", {
|
|
87
93
|
dark: "#FC6A6A",
|
|
88
94
|
light: "#BC2F32",
|
|
89
95
|
hcDark: "#F48771",
|
|
90
96
|
hcLight: "#B5200D"
|
|
91
|
-
}, ( localize(
|
|
97
|
+
}, ( localize(7235, "Foreground color of lines removed in chat code block pill.")), true);
|
|
92
98
|
registerColor("chat.thinkingShimmer", {
|
|
93
99
|
dark: "#ffffff",
|
|
94
100
|
light: "#000000",
|
|
95
101
|
hcDark: "#ffffff",
|
|
96
102
|
hcLight: "#000000"
|
|
97
|
-
}, ( localize(
|
|
103
|
+
}, ( localize(7236, "Shimmer highlight for thinking/working labels.")), true);
|
|
98
104
|
|
|
99
105
|
export { chatRequestBackground, chatSlashCommandBackground, chatSlashCommandForeground };
|
|
@@ -5,11 +5,9 @@ import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/pl
|
|
|
5
5
|
import { IChatEntitlementService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/chat/common/chatEntitlementService.service";
|
|
6
6
|
import { InlineChatInputWidget } from "./inlineChatOverlayWidget.js";
|
|
7
7
|
import { IInlineChatSessionService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.service";
|
|
8
|
+
import { ITelemetryService } from "@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service";
|
|
8
9
|
export declare class InlineChatAffordance extends Disposable {
|
|
9
|
-
private
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
private _menuData;
|
|
13
|
-
constructor(_editor: ICodeEditor, _inputWidget: InlineChatInputWidget, _instantiationService: IInstantiationService, configurationService: IConfigurationService, chatEntiteldService: IChatEntitlementService, inlineChatSessionService: IInlineChatSessionService);
|
|
14
|
-
showMenuAtSelection(): Promise<void>;
|
|
10
|
+
#private;
|
|
11
|
+
constructor(editor: ICodeEditor, inputWidget: InlineChatInputWidget, instantiationService: IInstantiationService, configurationService: IConfigurationService, chatEntiteldService: IChatEntitlementService, inlineChatSessionService: IInlineChatSessionService, telemetryService: ITelemetryService);
|
|
12
|
+
showMenuAtSelection(placeholder: string): Promise<void>;
|
|
15
13
|
}
|
|
@@ -15,6 +15,10 @@ import { SelectionDirection } from '@codingame/monaco-vscode-api/vscode/vs/edito
|
|
|
15
15
|
import { assertType } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
16
16
|
import { CursorChangeReason } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/cursorEvents';
|
|
17
17
|
import { IInlineChatSessionService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.service';
|
|
18
|
+
import { CodeActionController } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/codeAction/browser/codeActionController';
|
|
19
|
+
import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
20
|
+
import { generateUuid } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uuid';
|
|
21
|
+
import { Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
18
22
|
import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
|
|
19
23
|
import { debouncedObservable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/utils/utils';
|
|
20
24
|
import { runOnChange } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/utils/runOnChange';
|
|
@@ -24,24 +28,29 @@ import { observableSignalFromEvent } from '@codingame/monaco-vscode-api/vscode/v
|
|
|
24
28
|
import { waitForState } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/utils/utilsCancellation';
|
|
25
29
|
|
|
26
30
|
let InlineChatAffordance = class InlineChatAffordance extends Disposable {
|
|
31
|
+
#editor;
|
|
32
|
+
#inputWidget;
|
|
33
|
+
#instantiationService;
|
|
34
|
+
#menuData = observableValue(this, undefined);
|
|
27
35
|
constructor(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
36
|
+
editor,
|
|
37
|
+
inputWidget,
|
|
38
|
+
instantiationService,
|
|
31
39
|
configurationService,
|
|
32
40
|
chatEntiteldService,
|
|
33
|
-
inlineChatSessionService
|
|
41
|
+
inlineChatSessionService,
|
|
42
|
+
telemetryService
|
|
34
43
|
) {
|
|
35
44
|
super();
|
|
36
|
-
this
|
|
37
|
-
this
|
|
38
|
-
this
|
|
39
|
-
|
|
40
|
-
const editorObs = observableCodeEditor(this._editor);
|
|
45
|
+
this.#editor = editor;
|
|
46
|
+
this.#inputWidget = inputWidget;
|
|
47
|
+
this.#instantiationService = instantiationService;
|
|
48
|
+
const editorObs = observableCodeEditor(this.#editor);
|
|
41
49
|
const affordance = observableConfigValue(InlineChatConfigKeys.Affordance, "off", configurationService);
|
|
42
50
|
const debouncedSelection = debouncedObservable(editorObs.cursorSelection, 500);
|
|
43
51
|
const selectionData = observableValue(this, undefined);
|
|
44
52
|
let explicitSelection = false;
|
|
53
|
+
let affordanceId;
|
|
45
54
|
this._store.add(runOnChange(editorObs.selections, (value, _prev, events) => {
|
|
46
55
|
explicitSelection = events.every(e => e.reason === CursorChangeReason.Explicit);
|
|
47
56
|
if (!value || value.length !== 1 || value[0].isEmpty() || !explicitSelection) {
|
|
@@ -50,10 +59,20 @@ let InlineChatAffordance = class InlineChatAffordance extends Disposable {
|
|
|
50
59
|
}));
|
|
51
60
|
this._store.add(autorun(r => {
|
|
52
61
|
const value = debouncedSelection.read(r);
|
|
53
|
-
if (!value || value.isEmpty() || !explicitSelection ||
|
|
62
|
+
if (!value || value.isEmpty() || !explicitSelection || this.#editor.getModel()?.getValueInRange(value).match(/^\s+$/)) {
|
|
54
63
|
selectionData.set(undefined, undefined);
|
|
64
|
+
affordanceId = undefined;
|
|
55
65
|
return;
|
|
56
66
|
}
|
|
67
|
+
affordanceId = generateUuid();
|
|
68
|
+
const mode = affordance.read(undefined);
|
|
69
|
+
if (mode === "gutter" || mode === "editor") {
|
|
70
|
+
telemetryService.publicLog2("inlineChatAffordance/shown", {
|
|
71
|
+
mode,
|
|
72
|
+
id: affordanceId,
|
|
73
|
+
commandId: ""
|
|
74
|
+
});
|
|
75
|
+
}
|
|
57
76
|
selectionData.set(value, undefined);
|
|
58
77
|
}));
|
|
59
78
|
this._store.add(autorun(r => {
|
|
@@ -71,52 +90,75 @@ let InlineChatAffordance = class InlineChatAffordance extends Disposable {
|
|
|
71
90
|
selectionData.set(undefined, undefined);
|
|
72
91
|
}
|
|
73
92
|
}));
|
|
74
|
-
this._store.add(this.
|
|
93
|
+
this._store.add(this.#editor.onContextMenu(() => {
|
|
94
|
+
selectionData.set(undefined, undefined);
|
|
95
|
+
}));
|
|
96
|
+
const gutterAffordance = this._store.add(this.#instantiationService.createInstance(
|
|
75
97
|
InlineChatGutterAffordance,
|
|
76
98
|
editorObs,
|
|
77
|
-
derived(r => affordance.read(r) === "gutter" ? selectionData.read(r) : undefined)
|
|
78
|
-
this._menuData
|
|
99
|
+
derived(r => affordance.read(r) === "gutter" ? selectionData.read(r) : undefined)
|
|
79
100
|
));
|
|
80
|
-
this.
|
|
101
|
+
const editorAffordance = this.#instantiationService.createInstance(
|
|
81
102
|
InlineChatEditorAffordance,
|
|
82
|
-
this
|
|
103
|
+
this.#editor,
|
|
83
104
|
derived(r => affordance.read(r) === "editor" ? selectionData.read(r) : undefined)
|
|
84
|
-
)
|
|
105
|
+
);
|
|
106
|
+
this._store.add(editorAffordance);
|
|
107
|
+
this._store.add(
|
|
108
|
+
Event.any(editorAffordance.onDidRunAction, gutterAffordance.onDidRunAction)(commandId => {
|
|
109
|
+
if (affordanceId) {
|
|
110
|
+
telemetryService.publicLog2("inlineChatAffordance/selected", {
|
|
111
|
+
mode: affordance.get(),
|
|
112
|
+
id: affordanceId,
|
|
113
|
+
commandId
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
})
|
|
117
|
+
);
|
|
118
|
+
this._store.add(autorun(r => {
|
|
119
|
+
const mode = affordance.read(r);
|
|
120
|
+
const hideWithSelection = mode === "editor" || mode === "gutter";
|
|
121
|
+
const controller = CodeActionController.get(this.#editor);
|
|
122
|
+
if (controller) {
|
|
123
|
+
controller.onlyLightBulbWithEmptySelection = hideWithSelection;
|
|
124
|
+
}
|
|
125
|
+
}));
|
|
85
126
|
this._store.add(autorun(r => {
|
|
86
|
-
const data = this.
|
|
127
|
+
const data = this.#menuData.read(r);
|
|
87
128
|
if (!data) {
|
|
88
129
|
return;
|
|
89
130
|
}
|
|
90
|
-
this.
|
|
91
|
-
const editorDomNode = this.
|
|
131
|
+
this.#editor.revealLineInCenterIfOutsideViewport(data.lineNumber, ScrollType.Immediate);
|
|
132
|
+
const editorDomNode = this.#editor.getDomNode();
|
|
92
133
|
const editorRect = editorDomNode.getBoundingClientRect();
|
|
93
134
|
const left = data.rect.left - editorRect.left;
|
|
94
|
-
this.
|
|
135
|
+
this.#inputWidget.show(data.lineNumber, left, data.above, data.placeholder);
|
|
95
136
|
}));
|
|
96
137
|
this._store.add(autorun(r => {
|
|
97
|
-
const pos = this.
|
|
138
|
+
const pos = this.#inputWidget.position.read(r);
|
|
98
139
|
if (pos === null) {
|
|
99
|
-
this.
|
|
140
|
+
this.#menuData.set(undefined, undefined);
|
|
100
141
|
}
|
|
101
142
|
}));
|
|
102
143
|
}
|
|
103
|
-
async showMenuAtSelection() {
|
|
104
|
-
assertType(this.
|
|
105
|
-
const direction = this.
|
|
106
|
-
const position = this.
|
|
107
|
-
const editorDomNode = this.
|
|
108
|
-
const scrolledPosition = this.
|
|
144
|
+
async showMenuAtSelection(placeholder) {
|
|
145
|
+
assertType(this.#editor.hasModel());
|
|
146
|
+
const direction = this.#editor.getSelection().getDirection();
|
|
147
|
+
const position = this.#editor.getPosition();
|
|
148
|
+
const editorDomNode = this.#editor.getDomNode();
|
|
149
|
+
const scrolledPosition = this.#editor.getScrolledVisiblePosition(position);
|
|
109
150
|
const editorRect = editorDomNode.getBoundingClientRect();
|
|
110
151
|
const x = editorRect.left + scrolledPosition.left;
|
|
111
152
|
const y = editorRect.top + scrolledPosition.top;
|
|
112
|
-
this.
|
|
153
|
+
this.#menuData.set({
|
|
113
154
|
rect: ( new DOMRect(x, y, 0, scrolledPosition.height)),
|
|
114
155
|
above: direction === SelectionDirection.RTL,
|
|
115
|
-
lineNumber: position.lineNumber
|
|
156
|
+
lineNumber: position.lineNumber,
|
|
157
|
+
placeholder
|
|
116
158
|
}, undefined);
|
|
117
|
-
await waitForState(this.
|
|
159
|
+
await waitForState(this.#inputWidget.position, pos => pos === null);
|
|
118
160
|
}
|
|
119
161
|
};
|
|
120
|
-
InlineChatAffordance = ( __decorate([( __param(2, IInstantiationService)), ( __param(3, IConfigurationService)), ( __param(4, IChatEntitlementService)), ( __param(5, IInlineChatSessionService))], InlineChatAffordance));
|
|
162
|
+
InlineChatAffordance = ( __decorate([( __param(2, IInstantiationService)), ( __param(3, IConfigurationService)), ( __param(4, IChatEntitlementService)), ( __param(5, IInlineChatSessionService)), ( __param(6, ITelemetryService))], InlineChatAffordance));
|
|
121
163
|
|
|
122
164
|
export { InlineChatAffordance };
|
|
@@ -17,11 +17,15 @@ import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log
|
|
|
17
17
|
import { ISharedWebContentExtractorService } from "@codingame/monaco-vscode-api/vscode/vs/platform/webContentExtractor/common/webContentExtractor.service";
|
|
18
18
|
import { IEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service";
|
|
19
19
|
import { IChatAttachmentResolveService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.service";
|
|
20
|
+
import { IChatEditingService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/editing/chatEditingService.service";
|
|
21
|
+
import { IChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service";
|
|
20
22
|
import { IChatRequestVariableEntry } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/attachments/chatVariableEntries";
|
|
21
23
|
import { ILanguageModelChatSelector } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModels";
|
|
22
24
|
import { ILanguageModelsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModels.service";
|
|
23
25
|
import { INotebookEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/services/notebookEditorService.service";
|
|
24
26
|
import { ICellEditOperation } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon";
|
|
27
|
+
import { InlineChatAffordance } from "./inlineChatAffordance.js";
|
|
28
|
+
import { InlineChatInputWidget } from "./inlineChatOverlayWidget.js";
|
|
25
29
|
import { IInlineChatSessionService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.service";
|
|
26
30
|
import { EditorBasedInlineChatWidget } from "./inlineChatWidget.js";
|
|
27
31
|
export declare abstract class InlineChatRunOptions {
|
|
@@ -33,6 +37,7 @@ export declare abstract class InlineChatRunOptions {
|
|
|
33
37
|
position?: IPosition;
|
|
34
38
|
modelSelector?: ILanguageModelChatSelector;
|
|
35
39
|
resolveOnResponse?: boolean;
|
|
40
|
+
attachDiagnostics?: boolean;
|
|
36
41
|
static isInlineChatRunOptions(options: unknown): options is InlineChatRunOptions;
|
|
37
42
|
}
|
|
38
43
|
export declare class InlineChatController implements IEditorContribution {
|
|
@@ -48,6 +53,8 @@ export declare class InlineChatController implements IEditorContribution {
|
|
|
48
53
|
private readonly _markerDecorationsService;
|
|
49
54
|
private readonly _languageModelService;
|
|
50
55
|
private readonly _logService;
|
|
56
|
+
private readonly _chatEditingService;
|
|
57
|
+
private readonly _chatService;
|
|
51
58
|
static readonly ID = "editor.contrib.inlineChatController";
|
|
52
59
|
static get(editor: ICodeEditor): InlineChatController | undefined;
|
|
53
60
|
/**
|
|
@@ -59,11 +66,13 @@ export declare class InlineChatController implements IEditorContribution {
|
|
|
59
66
|
private readonly _isActiveController;
|
|
60
67
|
private readonly _renderMode;
|
|
61
68
|
private readonly _zone;
|
|
62
|
-
|
|
69
|
+
readonly inputOverlayWidget: InlineChatAffordance;
|
|
70
|
+
private readonly _inputWidget;
|
|
63
71
|
private readonly _currentSession;
|
|
64
72
|
get widget(): EditorBasedInlineChatWidget;
|
|
65
73
|
get isActive(): boolean;
|
|
66
|
-
|
|
74
|
+
get inputWidget(): InlineChatInputWidget;
|
|
75
|
+
constructor(_editor: ICodeEditor, _instaService: IInstantiationService, _notebookEditorService: INotebookEditorService, _inlineChatSessionService: IInlineChatSessionService, codeEditorService: ICodeEditorService, contextKeyService: IContextKeyService, _configurationService: IConfigurationService, _webContentExtractorService: ISharedWebContentExtractorService, _fileService: IFileService, _chatAttachmentResolveService: IChatAttachmentResolveService, _editorService: IEditorService, _markerDecorationsService: IMarkerDecorationsService, _languageModelService: ILanguageModelsService, _logService: ILogService, _chatEditingService: IChatEditingService, _chatService: IChatService);
|
|
67
76
|
dispose(): void;
|
|
68
77
|
getWidgetPosition(): Position | undefined;
|
|
69
78
|
focus(): void;
|