Skip to content

Commit

Permalink
Fix problem with yielding too quickly from the mapCode method
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdima committed Sep 16, 2024
1 parent 10dd5c6 commit c3eed3f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vs/workbench/api/browser/mainThreadChatCodeMapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class MainThreadChatCodemapper extends Disposable implements MainThreadCo

$registerCodeMapperProvider(handle: number): void {
const impl: ICodeMapperProvider = {
mapCode: (uiRequest: ICodeMapperRequest, response: ICodeMapperResponse, token: CancellationToken) => {
mapCode: async (uiRequest: ICodeMapperRequest, response: ICodeMapperResponse, token: CancellationToken) => {
const requestId = String(MainThreadChatCodemapper._requestHandlePool++);
this._responseMap.set(requestId, response);
const extHostRequest: ICodeMapperRequestDto = {
Expand All @@ -36,7 +36,7 @@ export class MainThreadChatCodemapper extends Disposable implements MainThreadCo
conversation: uiRequest.conversation
};
try {
return this._proxy.$mapCode(handle, extHostRequest, token).then((result) => result ?? undefined);
return await this._proxy.$mapCode(handle, extHostRequest, token).then((result) => result ?? undefined);
} finally {
this._responseMap.delete(requestId);
}
Expand Down

0 comments on commit c3eed3f

Please sign in to comment.