MCPcopy
hub / github.com/callumalpass/tasknotes / ensureFilterIndexes

Method ensureFilterIndexes

src/utils/TaskManager.ts:363–383  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

361 }
362
363 private ensureFilterIndexes(): void {
364 if (this.filterIndexesBuilt) {
365 return;
366 }
367
368 this.clearFilterIndexes();
369
370 for (const file of this.app.vault.getMarkdownFiles()) {
371 if (!this.isValidFile(file.path)) {
372 continue;
373 }
374
375 const metadata = this.app.metadataCache.getFileCache(file);
376 if (metadata?.frontmatter && this.isTaskFile(metadata.frontmatter)) {
377 const entry = this.createFilterIndexEntry(file.path, metadata.frontmatter);
378 this.addFilterIndexEntry(entry);
379 }
380 }
381
382 this.filterIndexesBuilt = true;
383 }
384
385 private updateFilterIndexesForFile(path: string, cache: unknown): boolean {
386 if (!this.filterIndexesBuilt) {

Callers 12

getAllTaskPathsMethod · 0.95
getTasksForDateMethod · 0.95
getTaskPathsByStatusMethod · 0.95
getOverdueTaskPathsMethod · 0.95
getAllStatusesMethod · 0.95
getAllPrioritiesMethod · 0.95
getAllTagsMethod · 0.95
getAllContextsMethod · 0.95
getAllProjectsMethod · 0.95
getAllTimeEstimatesMethod · 0.95

Calls 7

clearFilterIndexesMethod · 0.95
isValidFileMethod · 0.95
isTaskFileMethod · 0.95
addFilterIndexEntryMethod · 0.95
getMarkdownFilesMethod · 0.80
getFileCacheMethod · 0.80

Tested by

no test coverage detected