(path: string, cache: unknown)
| 383 | } |
| 384 | |
| 385 | private updateFilterIndexesForFile(path: string, cache: unknown): boolean { |
| 386 | if (!this.filterIndexesBuilt) { |
| 387 | return true; |
| 388 | } |
| 389 | |
| 390 | if (!this.isValidFile(path)) { |
| 391 | return this.removeFilterIndexEntry(path); |
| 392 | } |
| 393 | |
| 394 | const frontmatter = this.getFrontmatterFromCache(cache) ?? this.getFrontmatterForPath(path); |
| 395 | if (!frontmatter || !this.isTaskFile(frontmatter)) { |
| 396 | return this.removeFilterIndexEntry(path); |
| 397 | } |
| 398 | |
| 399 | const nextEntry = this.createFilterIndexEntry(path, frontmatter); |
| 400 | const previousEntry = this.taskFilterEntries.get(path); |
| 401 | if (previousEntry?.signature === nextEntry.signature) { |
| 402 | return false; |
| 403 | } |
| 404 | |
| 405 | if (previousEntry) { |
| 406 | this.removeFilterIndexEntry(path); |
| 407 | } |
| 408 | this.addFilterIndexEntry(nextEntry); |
| 409 | return true; |
| 410 | } |
| 411 | |
| 412 | private updateFilterIndexesFromTaskInfo(path: string, taskInfo: TaskInfo): boolean { |
| 413 | if (!this.filterIndexesBuilt) { |
no test coverage detected