chore(vscode): update to 1.55.2

This commit is contained in:
Akash Satheesan
2021-04-09 11:32:27 +05:30
1102 changed files with 39988 additions and 23544 deletions

View File

@@ -0,0 +1,30 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { createHash } from 'crypto';
import { listenStream } from 'vs/base/common/stream';
import { URI } from 'vs/base/common/uri';
import { IChecksumService } from 'vs/platform/checksum/common/checksumService';
import { IFileService } from 'vs/platform/files/common/files';
export class ChecksumService implements IChecksumService {
declare readonly _serviceBrand: undefined;
constructor(@IFileService private readonly fileService: IFileService) { }
checksum(resource: URI): Promise<string> {
return new Promise<string>(async (resolve, reject) => {
const hash = createHash('md5');
const stream = (await this.fileService.readFileStream(resource)).value;
listenStream(stream, {
onData: data => hash.update(data.buffer),
onError: error => reject(error),
onEnd: () => resolve(hash.digest('base64').replace(/=+$/, ''))
});
});
}
}