src/vs/workbench/api/common/extHostFileSystemConsumer.ts/ExtHostConsumerFileSystem/constructor
class ExtHostConsumerFileSystem:	constructor(
		@IExtHostRpcService extHostRpc: IExtHostRpcService,
		@IExtHostFileSystemInfo fileSystemInfo: IExtHostFileSystemInfo,
	) {
		const proxy = extHostRpc.getProxy(MainContext.MainThreadFileSystem);

		this.value = Object.freeze({
			stat(uri: vscode.Uri): Promise<vscode.FileStat> {
				return proxy.$stat(uri).catch(ExtHostConsumerFileSystem._handleError);
			},
			readDirectory(uri: vscode.Uri): Promise<[string, vscode.FileType][]> {
				return proxy.$readdir(uri).catch(ExtHostConsumerFileSystem._handleError);
			},
			createDirectory(uri: vscode.Uri): Promise<void> {
				return proxy.$mkdir(uri).catch(ExtHostConsumerFileSystem._handleError);
			},
			async readFile(uri: vscode.Uri): Promise<Uint8Array> {
				return proxy.$readFile(uri).then(buff => buff.buffer).catch(ExtHostConsumerFileSystem._handleError);
			},
			writeFile(uri: vscode.Uri, content: Uint8Array): Promise<void> {
				return proxy.$writeFile(uri, VSBuffer.wrap(content)).catch(ExtHostConsumerFileSystem._handleError);
			},
			delete(uri: vscode.Uri, options?: { recursive?: boolean; useTrash?: boolean; }): Promise<void> {
				return proxy.$delete(uri, { ...{ recursive: false, useTrash: false }, ...options }).catch(ExtHostConsumerFileSystem._handleError);
			},
			rename(oldUri: vscode.Uri, newUri: vscode.Uri, options?: { overwrite?: boolean; }): Promise<void> {
				return proxy.$rename(oldUri, newUri, { ...{ overwrite: false }, ...options }).catch(ExtHostConsumerFileSystem._handleError);
			},
			copy(source: vscode.Uri, destination: vscode.Uri, options?: { overwrite?: boolean; }): Promise<void> {
				return proxy.$copy(source, destination, { ...{ overwrite: false }, ...options }).catch(ExtHostConsumerFileSystem._handleError);
			},
			isWritableFileSystem(scheme: string): boolean | undefined {
				const capabilities = fileSystemInfo.getCapabilities(scheme);
				if (typeof capabilities === 'number') {
					return !(capabilities & files.FileSystemProviderCapabilities.Readonly);
				}
				return undefined;
			}
		});
	}