diff --git a/src/vs/workbench/api/browser/mainThreadInlineChat.ts b/src/vs/workbench/api/browser/mainThreadInlineChat.ts index 2bb8ed5e5fe..8cefa7a83a7 100644 --- a/src/vs/workbench/api/browser/mainThreadInlineChat.ts +++ b/src/vs/workbench/api/browser/mainThreadInlineChat.ts @@ -69,7 +69,7 @@ export class MainThreadInlineChat implements MainThreadInlineChatShape { } async $handleProgressChunk(requestId: string, chunk: { message?: string | undefined; edits?: TextEdit[] | undefined }): Promise { - this._progresses.get(requestId)?.report(chunk); + await Promise.resolve(this._progresses.get(requestId)?.report(chunk)); } async $unregisterInteractiveEditorProvider(handle: number): Promise { diff --git a/src/vs/workbench/api/common/extHostInlineChat.ts b/src/vs/workbench/api/common/extHostInlineChat.ts index c1683d51fe8..7e341e06a5f 100644 --- a/src/vs/workbench/api/common/extHostInlineChat.ts +++ b/src/vs/workbench/api/common/extHostInlineChat.ts @@ -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'); } @@ -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) });