* Handle file rename
(file: TFile, oldPath: string)
| 215 | * Handle file rename |
| 216 | */ |
| 217 | private handleFileRenamed(file: TFile, oldPath: string): void { |
| 218 | // Get metadata for new path |
| 219 | const frontmatter = this.getFrontmatterForFile(file); |
| 220 | |
| 221 | // Clear old path |
| 222 | this.clearFileFromIndexes(oldPath); |
| 223 | |
| 224 | // Index new path if it's a task |
| 225 | if (this.isValidFile(file.path) && frontmatter && this.isTaskFileCallback(frontmatter)) { |
| 226 | this.indexTaskFile(file.path, frontmatter); |
| 227 | } |
| 228 | this.trigger(EVENT_DEPENDENCY_CACHE_CHANGED); |
| 229 | } |
| 230 | |
| 231 | private getFrontmatterForFile(file: TFile): Record<string, unknown> | null { |
| 232 | const metadata = this.app.metadataCache.getFileCache(file); |
no test coverage detected