( app: App, file: TFile, )
| 78 | * note has a runnable ```js fence. |
| 79 | */ |
| 80 | export async function noteScriptError( |
| 81 | app: App, |
| 82 | file: TFile, |
| 83 | ): Promise<string | null> { |
| 84 | const content = await app.vault.read(file); |
| 85 | const { code, error } = extractScriptFromMarkdown(content); |
| 86 | if (code !== null && code.length > 0) return null; |
| 87 | return error ?? "No ```js code block found in the note."; |
| 88 | } |
| 89 | |
| 90 | /** Suggester label: basename for .js (legacy), full path for notes. */ |
| 91 | export function candidateLabel(candidate: ScriptCandidate): string { |
no test coverage detected