forked from microsoft/vscode-pull-request-github
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreadonlyFileSystemProvider.ts
More file actions
50 lines (39 loc) · 1.5 KB
/
Copy pathreadonlyFileSystemProvider.ts
File metadata and controls
50 lines (39 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as vscode from 'vscode';
export abstract class ReadonlyFileSystemProvider implements vscode.FileSystemProvider {
protected _onDidChangeFile = new vscode.EventEmitter<vscode.FileChangeEvent[]>();
onDidChangeFile = this._onDidChangeFile.event;
constructor() {}
watch(_uri: vscode.Uri, _options: { recursive: boolean; excludes: string[]; }): vscode.Disposable {
/** no op */
return { dispose: () => {} };
}
stat(_uri: any): vscode.FileStat {
/** mock stat as they are not necessarily needed */
return {
type: vscode.FileType.File,
ctime: 0,
mtime: 0,
size: 0
};
}
readDirectory(_uri: vscode.Uri): [string, vscode.FileType][] {
return [];
}
createDirectory(_uri: vscode.Uri): void {
/** no op */
}
abstract readFile(_uri: vscode.Uri): Promise<Uint8Array>;
writeFile(_uri: vscode.Uri, _content: Uint8Array, _options: { create: boolean; overwrite: boolean; }): void {
/** no op */
}
delete(_uri: vscode.Uri, _options: { recursive: boolean; }): void {
/** no op */
}
rename(_oldUri: vscode.Uri, _newUri: vscode.Uri, _options: { overwrite: boolean; }): void {
/** no op */
}
}