Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/services/files/browser/elevatedFileService.ts
3296 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { VSBuffer, VSBufferReadable, VSBufferReadableStream } from '../../../../base/common/buffer.js';
7
import { URI } from '../../../../base/common/uri.js';
8
import { IFileStatWithMetadata, IWriteFileOptions } from '../../../../platform/files/common/files.js';
9
import { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js';
10
import { IElevatedFileService } from '../common/elevatedFileService.js';
11
12
export class BrowserElevatedFileService implements IElevatedFileService {
13
14
readonly _serviceBrand: undefined;
15
16
isSupported(resource: URI): boolean {
17
// Saving elevated is currently not supported in web for as
18
// long as we have no generic support from the file service
19
// (https://github.com/microsoft/vscode/issues/48659)
20
return false;
21
}
22
23
async writeFileElevated(resource: URI, value: VSBuffer | VSBufferReadable | VSBufferReadableStream, options?: IWriteFileOptions): Promise<IFileStatWithMetadata> {
24
throw new Error('Unsupported');
25
}
26
}
27
28
registerSingleton(IElevatedFileService, BrowserElevatedFileService, InstantiationType.Delayed);
29
30