Skip to content

Commit

Permalink
Allow to disable progressive edits per progress chunk (microsoft#196424)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken authored and Alex0007 committed Oct 26, 2023
1 parent bb3c6ee commit a09a079
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/vs/workbench/api/common/extHostInlineChat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ export class ExtHostInteractiveEditor implements ExtHostInlineChatShape {
await this._proxy.$handleProgressChunk(request.requestId, {
message: value.message,
edits: value.edits?.map(typeConvert.TextEdit.from),
editsShouldBeInstant: value.editsShouldBeInstant,
slashCommand: value.slashCommand?.command,
markdownFragment: extHostTypes.MarkdownString.isMarkdownString(value.content) ? value.content.value : value.content
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,10 @@ export class InlineChatController implements IEditorContribution {
// making changes goes into a queue because otherwise the async-progress time will
// influence the time it takes to receive the changes and progressive typing will
// become infinitely fast
await this._makeChanges(data.edits!, { duration: progressiveEditsAvgDuration.value, round: round++, token: requestCts.token });
await this._makeChanges(data.edits!, data.editsShouldBeInstant
? undefined
: { duration: progressiveEditsAvgDuration.value, round: round++, token: requestCts.token }
);
this._showWidget(false);
});
}
Expand Down
1 change: 1 addition & 0 deletions src/vs/workbench/contrib/inlineChat/common/inlineChat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export interface IInlineChatMessageResponse {
export interface IInlineChatProgressItem {
markdownFragment?: string;
edits?: TextEdit[];
editsShouldBeInstant?: boolean;
message?: string;
slashCommand?: string;
}
Expand Down
1 change: 1 addition & 0 deletions src/vscode-dts/vscode.proposed.interactive.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ declare module 'vscode' {
export interface InteractiveEditorProgressItem {
message?: string;
edits?: TextEdit[];
editsShouldBeInstant?: boolean;
slashCommand?: InteractiveEditorSlashCommand;
content?: string | MarkdownString;
}
Expand Down

0 comments on commit a09a079

Please sign in to comment.