Path: blob/main/src/vs/workbench/services/files/browser/elevatedFileService.ts
3296 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { VSBuffer, VSBufferReadable, VSBufferReadableStream } from '../../../../base/common/buffer.js';6import { URI } from '../../../../base/common/uri.js';7import { IFileStatWithMetadata, IWriteFileOptions } from '../../../../platform/files/common/files.js';8import { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js';9import { IElevatedFileService } from '../common/elevatedFileService.js';1011export class BrowserElevatedFileService implements IElevatedFileService {1213readonly _serviceBrand: undefined;1415isSupported(resource: URI): boolean {16// Saving elevated is currently not supported in web for as17// long as we have no generic support from the file service18// (https://github.com/microsoft/vscode/issues/48659)19return false;20}2122async writeFileElevated(resource: URI, value: VSBuffer | VSBufferReadable | VSBufferReadableStream, options?: IWriteFileOptions): Promise<IFileStatWithMetadata> {23throw new Error('Unsupported');24}25}2627registerSingleton(IElevatedFileService, BrowserElevatedFileService, InstantiationType.Delayed);282930