"not found" (+ optional did-you-mean) when no exact symbol matches.
(symbol: string, fuzzyNames: string[])
| 408 | |
| 409 | /** "not found" (+ optional did-you-mean) when no exact symbol matches. */ |
| 410 | function formatSymbolNotFound(symbol: string, fuzzyNames: string[]): string { |
| 411 | const suggestions = [...new Set(fuzzyNames.filter((n) => n !== symbol))].slice(0, 3); |
| 412 | if (suggestions.length === 0) return `Symbol "${symbol}" not found`; |
| 413 | return `Symbol "${symbol}" not found — did you mean: ${suggestions.join(', ')}?`; |
| 414 | } |
| 415 | |
| 416 | /** Compact node shape retained by the CLI's existing JSON lists. */ |
| 417 | function cliNode(node: Node) { |