Unresolved refs by row id.
(ids: number[])
| 5652 | |
| 5653 | /** Unresolved refs by row id. */ |
| 5654 | getUnresolvedReferencesByIds(ids: number[]): UnresolvedReference[] { |
| 5655 | const rows: UnresolvedRefRow[] = []; |
| 5656 | for (let i = 0; i < ids.length; i += SQLITE_PARAM_CHUNK_SIZE) { |
| 5657 | const chunk = ids.slice(i, i + SQLITE_PARAM_CHUNK_SIZE); |
| 5658 | const placeholders = chunk.map(() => '?').join(','); |
| 5659 | const chunkRows = this.db |
| 5660 | .prepare(`SELECT * FROM unresolved_refs WHERE id IN (${placeholders})`) |
| 5661 | .all(...chunk) as UnresolvedRefRow[]; |
| 5662 | for (const row of chunkRows) rows.push(row); |
| 5663 | } |
| 5664 | return rows.map((row) => ({ |
| 5665 | fromNodeId: row.from_node_id, |
| 5666 | referenceName: row.reference_name, |
| 5667 | referenceKind: row.reference_kind as EdgeKind, |
| 5668 | line: row.line, |
| 5669 | column: row.col, |
| 5670 | candidates: row.candidates ? safeJsonParse(row.candidates, undefined) : undefined, |
| 5671 | filePath: row.file_path, |
| 5672 | language: row.language as Language, |
| 5673 | rowId: row.id, |
| 5674 | })); |
| 5675 | } |
| 5676 | |
| 5677 | /** |
| 5678 | * The python files with an edge of one of `kinds` into a node of `filePath` |