Skip to content

Commit 7172fd9

Browse files
authored
Allow to disable progressive edits per progress chunk (microsoft#196424)
1 parent 8c315b5 commit 7172fd9

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

src/vs/workbench/api/common/extHostInlineChat.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ export class ExtHostInteractiveEditor implements ExtHostInlineChatShape {
165165
await this._proxy.$handleProgressChunk(request.requestId, {
166166
message: value.message,
167167
edits: value.edits?.map(typeConvert.TextEdit.from),
168+
editsShouldBeInstant: value.editsShouldBeInstant,
168169
slashCommand: value.slashCommand?.command,
169170
markdownFragment: extHostTypes.MarkdownString.isMarkdownString(value.content) ? value.content.value : value.content
170171
});

src/vs/workbench/contrib/inlineChat/browser/inlineChatController.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,10 @@ export class InlineChatController implements IEditorContribution {
582582
// making changes goes into a queue because otherwise the async-progress time will
583583
// influence the time it takes to receive the changes and progressive typing will
584584
// become infinitely fast
585-
await this._makeChanges(data.edits!, { duration: progressiveEditsAvgDuration.value, round: round++, token: requestCts.token });
585+
await this._makeChanges(data.edits!, data.editsShouldBeInstant
586+
? undefined
587+
: { duration: progressiveEditsAvgDuration.value, round: round++, token: requestCts.token }
588+
);
586589
this._showWidget(false);
587590
});
588591
}

src/vs/workbench/contrib/inlineChat/common/inlineChat.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ export interface IInlineChatMessageResponse {
8787
export interface IInlineChatProgressItem {
8888
markdownFragment?: string;
8989
edits?: TextEdit[];
90+
editsShouldBeInstant?: boolean;
9091
message?: string;
9192
slashCommand?: string;
9293
}

src/vscode-dts/vscode.proposed.interactive.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ declare module 'vscode' {
5252
export interface InteractiveEditorProgressItem {
5353
message?: string;
5454
edits?: TextEdit[];
55+
editsShouldBeInstant?: boolean;
5556
slashCommand?: InteractiveEditorSlashCommand;
5657
content?: string | MarkdownString;
5758
}

0 commit comments

Comments
 (0)