From e8fa82b65fa98df5510d6790e08e781f2d47de41 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Fri, 29 Sep 2023 13:20:41 +0200 Subject: [PATCH] debt - await progress message (#194475) --- src/vs/workbench/api/browser/mainThreadInlineChat.ts | 2 +- src/vs/workbench/api/common/extHostInlineChat.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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) });