(path: string)
| 93 | function createHost(tree: Tree): workspaces.WorkspaceHost { |
| 94 | return { |
| 95 | async readFile(path: string): Promise<string> { |
| 96 | const data = tree.read(path) as unknown as virtualFs.FileBuffer; |
| 97 | if (!data) { |
| 98 | throw new Error('File not found.'); |
| 99 | } |
| 100 | |
| 101 | return virtualFs.fileBufferToString(data); |
| 102 | }, |
| 103 | async writeFile(path: string, data: string): Promise<void> { |
| 104 | return tree.overwrite(path, data); |
| 105 | }, |