* Build indexes on demand (lazy)
()
| 84 | * Build indexes on demand (lazy) |
| 85 | */ |
| 86 | async buildIndexes(): Promise<void> { |
| 87 | if (this.indexesBuilt) return; |
| 88 | |
| 89 | const files = this.app.vault.getMarkdownFiles(); |
| 90 | |
| 91 | for (const file of files) { |
| 92 | if (!this.isValidFile(file.path)) { |
| 93 | continue; |
| 94 | } |
| 95 | |
| 96 | const metadata = this.app.metadataCache.getFileCache(file); |
| 97 | if (!metadata?.frontmatter || !this.isTaskFileCallback(metadata.frontmatter)) { |
| 98 | continue; |
| 99 | } |
| 100 | |
| 101 | this.indexTaskFile(file.path, metadata.frontmatter); |
| 102 | } |
| 103 | |
| 104 | this.indexesBuilt = true; |
| 105 | this.trigger(EVENT_DEPENDENCY_CACHE_CHANGED); |
| 106 | } |
| 107 | |
| 108 | /** |
| 109 | * Setup event listeners |
no test coverage detected