Skip to content

Commit 0c89e7c

Browse files
committed
more tweaks
1 parent 26f713d commit 0c89e7c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ export class ApplyCodeBlockOperation {
270270
let isOpen = true;
271271
const firstEdit = textEdits[0];
272272
editorToApply.revealLineInCenterIfOutsideViewport(firstEdit.range.startLineNumber);
273-
const promise = inlineChatController.reviewEdits(textEdits[0].range, AsyncIterableObject.fromArray(textEdits), tokenSource.token);
273+
const promise = inlineChatController.reviewEdits(textEdits[0].range, AsyncIterableObject.fromArray([textEdits]), tokenSource.token);
274274
promise.finally(() => {
275275
isOpen = false;
276276
tokenSource.dispose();

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,7 +1149,7 @@ export class InlineChatController implements IEditorContribution {
11491149
return this._currentRun;
11501150
}
11511151

1152-
async reviewEdits(anchor: IRange, stream: AsyncIterable<TextEdit>, token: CancellationToken) {
1152+
async reviewEdits(anchor: IRange, stream: AsyncIterable<TextEdit[]>, token: CancellationToken) {
11531153
if (!this._editor.hasModel()) {
11541154
return false;
11551155
}
@@ -1168,7 +1168,7 @@ export class InlineChatController implements IEditorContribution {
11681168
await Event.toPromise(Event.filter(this._onDidEnterState.event, candidate => candidate === State.SHOW_REQUEST));
11691169

11701170
for await (const chunk of stream) {
1171-
session.chatModel.acceptResponseProgress(request, { kind: 'textEdit', uri: this._editor.getModel()!.uri, edits: [chunk] });
1171+
session.chatModel.acceptResponseProgress(request, { kind: 'textEdit', uri: this._editor.getModel()!.uri, edits: chunk });
11721172
}
11731173

11741174
if (token.isCancellationRequested) {
@@ -1177,6 +1177,8 @@ export class InlineChatController implements IEditorContribution {
11771177
session.chatModel.completeResponse(request);
11781178
}
11791179

1180+
await Event.toPromise(Event.filter(this._onDidEnterState.event, candidate => candidate === State.WAIT_FOR_INPUT));
1181+
11801182
if (session.hunkData.pending === 0) {
11811183
// no real changes, just cancel
11821184
this.cancelSession();

0 commit comments

Comments
 (0)