From dc52700a607b1c470c4a35ea30c7d554ef3b7c45 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Tue, 23 Nov 2021 09:45:52 +0100 Subject: [PATCH] make sure to await remote file reading in vscode.workspace.fs.readFile so that error handling is correct. --- src/vs/workbench/api/common/extHostFileSystemConsumer.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/api/common/extHostFileSystemConsumer.ts b/src/vs/workbench/api/common/extHostFileSystemConsumer.ts index cc8805a700b..6d750ef77a5 100644 --- a/src/vs/workbench/api/common/extHostFileSystemConsumer.ts +++ b/src/vs/workbench/api/common/extHostFileSystemConsumer.ts @@ -80,7 +80,8 @@ export class ExtHostConsumerFileSystem { await that._proxy.$ensureActivation(uri.scheme); return (await provider.readFile(uri)).slice(); // safe-copy } else { - return that._proxy.$readFile(uri).then(buff => buff.buffer); + const buff = await that._proxy.$readFile(uri); + return buff.buffer; } } catch (err) { return ExtHostConsumerFileSystem._handleError(err);