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

Method buildIndexesSync

src/utils/DependencyCache.ts:692–712  ·  view source on GitHub ↗

* Build indexes synchronously (for lazy initialization)

()

Source from the content-addressed store, hash-verified

690 * Build indexes synchronously (for lazy initialization)
691 */
692 private buildIndexesSync(): void {
693 if (this.indexesBuilt) return;
694
695 const files = this.app.vault.getMarkdownFiles();
696
697 for (const file of files) {
698 if (!this.isValidFile(file.path)) {
699 continue;
700 }
701
702 const metadata = this.app.metadataCache.getFileCache(file);
703 if (!metadata?.frontmatter || !this.isTaskFileCallback(metadata.frontmatter)) {
704 continue;
705 }
706
707 this.indexTaskFile(file.path, metadata.frontmatter);
708 }
709
710 this.indexesBuilt = true;
711 this.trigger(EVENT_DEPENDENCY_CACHE_CHANGED);
712 }
713
714 updateConfig(settings: TaskNotesSettings): void {
715 this.settings = settings;

Callers 5

getBlockingTaskPathsMethod · 0.95
getBlockedTaskPathsMethod · 0.95
isTaskBlockedMethod · 0.95
isFileUsedAsProjectMethod · 0.95

Calls 5

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

Tested by

no test coverage detected