| 101 | } |
| 102 | |
| 103 | class FileSystemProvider |
| 104 | extends BufferContentProvider |
| 105 | implements IContentProvider |
| 106 | { |
| 107 | constructor( |
| 108 | key: string, |
| 109 | readonly filePath: string, |
| 110 | watch: (callback: () => void) => () => void, |
| 111 | ) { |
| 112 | super(key); |
| 113 | this.disposeList.push(watch(() => this.update())); |
| 114 | } |
| 115 | |
| 116 | async update() { |
| 117 | const content = await readFile(this.filePath, 'utf8'); |
| 118 | this.setContent(content); |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | function sha256(input: string) { |
| 123 | return createHash('sha256').update(input, 'utf8').digest('hex').slice(0, 7); |
nothing calls this directly
no outgoing calls
no test coverage detected