"not found" (+ optional did-you-mean) when no exact symbol matches.
(symbol: string, fuzzyNames: string[])
| 427 | |
| 428 | /** "not found" (+ optional did-you-mean) when no exact symbol matches. */ |
| 429 | function formatSymbolNotFound(symbol: string, fuzzyNames: string[]): string { |
| 430 | const suggestions = [...new Set(fuzzyNames.filter((n) => n !== symbol))].slice(0, 3); |
| 431 | if (suggestions.length === 0) return `Symbol "${symbol}" not found`; |
| 432 | return `Symbol "${symbol}" not found — did you mean: ${suggestions.join(', ')}?`; |
| 433 | } |
| 434 | |
| 435 | /** Compact node shape retained by the CLI's existing JSON lists. */ |
| 436 | function cliNode(node: Node) { |