* Clear a file from all indexes (both forward and reverse dependencies) * Used when a file is deleted or becomes a non-task
(path: string)
| 529 | * Used when a file is deleted or becomes a non-task |
| 530 | */ |
| 531 | private clearFileFromIndexes(path: string): void { |
| 532 | // Clear from dependency sources |
| 533 | const blockingTasks = this.dependencySources.get(path); |
| 534 | if (blockingTasks) { |
| 535 | // Remove from targets |
| 536 | for (const blockingTask of blockingTasks) { |
| 537 | const targets = this.dependencyTargets.get(blockingTask); |
| 538 | if (targets) { |
| 539 | targets.delete(path); |
| 540 | if (targets.size === 0) { |
| 541 | this.dependencyTargets.delete(blockingTask); |
| 542 | } |
| 543 | } |
| 544 | this.removeActiveDependencyLink(path, blockingTask); |
| 545 | } |
| 546 | this.dependencySources.delete(path); |
| 547 | } |
| 548 | this.activeDependencySources.delete(path); |
| 549 | |
| 550 | // Clear from dependency targets |
| 551 | const blockedTasks = this.dependencyTargets.get(path); |
| 552 | if (blockedTasks) { |
| 553 | // Remove from sources |
| 554 | for (const blockedTask of blockedTasks) { |
| 555 | const sources = this.dependencySources.get(blockedTask); |
| 556 | if (sources) { |
| 557 | sources.delete(path); |
| 558 | if (sources.size === 0) { |
| 559 | this.dependencySources.delete(blockedTask); |
| 560 | } |
| 561 | } |
| 562 | this.removeActiveDependencyLink(blockedTask, path); |
| 563 | } |
| 564 | this.dependencyTargets.delete(path); |
| 565 | } |
| 566 | this.activeDependencyTargets.delete(path); |
| 567 | |
| 568 | // Clear project references declared by this file |
| 569 | const referencedProjects = this.projectReferenceSources.get(path); |
| 570 | if (referencedProjects) { |
| 571 | for (const project of referencedProjects) { |
| 572 | const taskSet = this.projectReferences.get(project); |
| 573 | if (taskSet) { |
| 574 | taskSet.delete(path); |
| 575 | if (taskSet.size === 0) { |
| 576 | this.projectReferences.delete(project); |
| 577 | } |
| 578 | } |
| 579 | } |
| 580 | this.projectReferenceSources.delete(path); |
| 581 | } |
| 582 | |
| 583 | // Clear this file as a project target |
| 584 | const referencingTasks = this.projectReferences.get(path); |
| 585 | if (referencingTasks) { |
| 586 | for (const taskPath of referencingTasks) { |
| 587 | const taskProjects = this.projectReferenceSources.get(taskPath); |
| 588 | if (taskProjects) { |
no test coverage detected