(file: TAbstractFile)
| 297 | } |
| 298 | |
| 299 | private getSearchText(file: TAbstractFile): string { |
| 300 | let text = `${file.name} ${file.path}`; |
| 301 | |
| 302 | if (file instanceof TFile) { |
| 303 | const cache = this.app.metadataCache.getFileCache(file); |
| 304 | if (cache?.frontmatter) { |
| 305 | // Add title |
| 306 | const titleField = this.plugin.fieldMapper.toUserField("title"); |
| 307 | const title = cache.frontmatter[titleField]; |
| 308 | if (title) { |
| 309 | text += ` ${title}`; |
| 310 | } |
| 311 | |
| 312 | // Add aliases |
| 313 | const aliases = parseFrontMatterAliases(cache.frontmatter); |
| 314 | if (aliases && aliases.length > 0) { |
| 315 | text += ` ${aliases.join(" ")}`; |
| 316 | } |
| 317 | } |
| 318 | } |
| 319 | |
| 320 | return text; |
| 321 | } |
| 322 | |
| 323 | renderSuggestion(file: TAbstractFile, el: HTMLElement): void { |
| 324 | const container = el.createDiv({ cls: "file-selector-suggestion" }); |
no test coverage detected