* The references the resolver gave up on that are written exactly as one of * `names` (`binding.Query`), at most `limit`, in file and line order. One * probe of `idx_unresolved_name` per chunk.
(names: readonly string[], limit: number)
| 3625 | * probe of `idx_unresolved_name` per chunk. |
| 3626 | */ |
| 3627 | getFailedReferencesByNames(names: readonly string[], limit: number): UnresolvedReference[] { |
| 3628 | const unique = [...new Set(names)].filter((n) => n.length > 0); |
| 3629 | if (unique.length === 0 || limit <= 0) return []; |
| 3630 | const rows: UnresolvedRefRow[] = []; |
| 3631 | for (let i = 0; i < unique.length && rows.length < limit; i += SQLITE_PARAM_CHUNK_SIZE) { |
| 3632 | const chunk = unique.slice(i, i + SQLITE_PARAM_CHUNK_SIZE); |
| 3633 | const placeholders = chunk.map(() => '?').join(','); |
| 3634 | rows.push(...this.db |
| 3635 | .prepare( |
| 3636 | `SELECT * FROM unresolved_refs WHERE reference_name IN (${placeholders}) AND status = 'failed' |
| 3637 | ORDER BY file_path, line, col LIMIT ?` |
| 3638 | ) |
| 3639 | .all(...chunk, limit - rows.length) as UnresolvedRefRow[]); |
| 3640 | } |
| 3641 | return rows.map((row) => ({ |
| 3642 | fromNodeId: row.from_node_id, |
| 3643 | referenceName: row.reference_name, |
| 3644 | referenceKind: row.reference_kind as EdgeKind, |
| 3645 | line: row.line, |
| 3646 | column: row.col, |
| 3647 | filePath: row.file_path, |
| 3648 | language: row.language as Language, |
| 3649 | rowId: row.id, |
| 3650 | })); |
| 3651 | } |
| 3652 | |
| 3653 | /** |
| 3654 | * References recorded against a symbol that never resolved to a node — the |