* Invalidate a single file and its cross-file edges
(filePath: string)
| 1416 | * Invalidate a single file and its cross-file edges |
| 1417 | */ |
| 1418 | async invalidateFile(filePath: string): Promise<void> { |
| 1419 | await this.initPromise; |
| 1420 | |
| 1421 | // Normalize path to full path (cache keys are always full paths) |
| 1422 | const normalizedPath = this.toRelativePath(filePath); |
| 1423 | |
| 1424 | // Remove file cache |
| 1425 | delete this.files[normalizedPath]; |
| 1426 | |
| 1427 | // Remove cross-file edges involving this file |
| 1428 | this.crossFileEdges = this.crossFileEdges.filter( |
| 1429 | e => e.sourceFile !== normalizedPath && e.targetFile !== normalizedPath |
| 1430 | ); |
| 1431 | |
| 1432 | this.scheduleSave(); |
| 1433 | } |
| 1434 | |
| 1435 | /** |
| 1436 | * Clear all cache |
no test coverage detected