Skip to content

Commit

Permalink
debt - await progress message (microsoft#194475)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken authored Sep 29, 2023
1 parent 5eafb0a commit e8fa82b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/vs/workbench/api/browser/mainThreadInlineChat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class MainThreadInlineChat implements MainThreadInlineChatShape {
}

async $handleProgressChunk(requestId: string, chunk: { message?: string | undefined; edits?: TextEdit[] | undefined }): Promise<void> {
this._progresses.get(requestId)?.report(chunk);
await Promise.resolve(this._progresses.get(requestId)?.report(chunk));
}

async $unregisterInteractiveEditorProvider(handle: number): Promise<void> {
Expand Down
4 changes: 2 additions & 2 deletions src/vs/workbench/api/common/extHostInlineChat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export class ExtHostInteractiveEditor implements ExtHostInlineChatShape {

let done = false;
const progress: vscode.Progress<{ message?: string; edits?: vscode.TextEdit[] }> = {
report: value => {
report: async value => {
if (!request.live) {
throw new Error('Progress reporting is only supported for live sessions');
}
Expand All @@ -163,7 +163,7 @@ export class ExtHostInteractiveEditor implements ExtHostInlineChatShape {
if (!value.message && !value.edits) {
return;
}
this._proxy.$handleProgressChunk(request.requestId, {
await this._proxy.$handleProgressChunk(request.requestId, {
message: value.message,
edits: value.edits?.map(typeConvert.TextEdit.from)
});
Expand Down

0 comments on commit e8fa82b

Please sign in to comment.