| 2377 | if (keyNorm.length < 3) return ''; |
| 2378 | const cands = new Map<string, Node>(); |
| 2379 | const consider = (n: Node | undefined | null) => { |
| 2380 | if (!n || n.id === selfId || !CALLABLE.has(n.kind) || cands.has(n.id)) return; |
| 2381 | const nameNorm = norm(n.name || ''); |
| 2382 | if (nameNorm.length < 3) return; |
| 2383 | if (!nameNorm.includes(keyNorm) && !keyNorm.includes(nameNorm)) return; |
| 2384 | cands.set(n.id, n); |
| 2385 | }; |
| 2386 | const cap = key.charAt(0).toUpperCase() + key.slice(1); |
| 2387 | const probes = keyIsType |
| 2388 | ? [`${key}Handler`, key] |