* Handle a file being re-added (e.g. after a delete-and-recreate). Cancels any * pending deletion grace timer and treats the event as a change.
(path: string)
| 306 | * pending deletion grace timer and treats the event as a change. |
| 307 | */ |
| 308 | function handleAdd(path: string): void { |
| 309 | const source = getSourceForPath(path) |
| 310 | if (!source) return |
| 311 | |
| 312 | // Cancel any pending deletion — the file is back |
| 313 | const pendingTimer = pendingDeletions.get(path) |
| 314 | if (pendingTimer) { |
| 315 | clearTimeout(pendingTimer) |
| 316 | pendingDeletions.delete(path) |
| 317 | logForDebugging(`Cancelled pending deletion of ${path} — file was re-added`) |
| 318 | } |
| 319 | |
| 320 | // Treat as a change (re-read settings) |
| 321 | handleChange(path) |
| 322 | } |
| 323 | |
| 324 | /** |
| 325 | * Handle a file being deleted. Uses a grace period to absorb delete-and-recreate |
nothing calls this directly
no test coverage detected