MCPcopy Create free account
hub / github.com/callumalpass/tasknotes / buildIndexes

Method buildIndexes

src/utils/DependencyCache.ts:86–106  ·  view source on GitHub ↗

* Build indexes on demand (lazy)

()

Source from the content-addressed store, hash-verified

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

Calls 5

isValidFileMethod · 0.95
indexTaskFileMethod · 0.95
getMarkdownFilesMethod · 0.80
getFileCacheMethod · 0.80
triggerMethod · 0.65

Tested by

no test coverage detected