(uri: Uri, content: Uint8Array)
| 1252 | } |
| 1253 | |
| 1254 | async writeFile(uri: Uri, content: Uint8Array): Promise<void> { |
| 1255 | // Check if file exists before writing |
| 1256 | const existed = await this.exists(uri); |
| 1257 | |
| 1258 | // Ensure directory exists |
| 1259 | const dir = path.dirname(uri.fsPath); |
| 1260 | await fs.promises.mkdir(dir, { recursive: true }); |
| 1261 | await fs.promises.writeFile(uri.fsPath, content); |
| 1262 | |
| 1263 | // Fire watcher events |
| 1264 | for (const watcher of mockState.fileWatchers) { |
| 1265 | if (existed) { |
| 1266 | watcher._fireChange(uri); |
| 1267 | } else { |
| 1268 | watcher._fireCreate(uri); |
| 1269 | } |
| 1270 | } |
| 1271 | } |
| 1272 | |
| 1273 | private async exists(uri: Uri): Promise<boolean> { |
| 1274 | try { |
nothing calls this directly
no test coverage detected