Unresolved refs by row id.
(ids: number[])
| 5763 | |
| 5764 | /** Unresolved refs by row id. */ |
| 5765 | getUnresolvedReferencesByIds(ids: number[]): UnresolvedReference[] { |
| 5766 | const rows: UnresolvedRefRow[] = []; |
| 5767 | for (let i = 0; i < ids.length; i += SQLITE_PARAM_CHUNK_SIZE) { |
| 5768 | const chunk = ids.slice(i, i + SQLITE_PARAM_CHUNK_SIZE); |
| 5769 | const placeholders = chunk.map(() => '?').join(','); |
| 5770 | const chunkRows = this.db |
| 5771 | .prepare(`SELECT * FROM unresolved_refs WHERE id IN (${placeholders})`) |
| 5772 | .all(...chunk) as UnresolvedRefRow[]; |
| 5773 | for (const row of chunkRows) rows.push(row); |
| 5774 | } |
| 5775 | return rows.map((row) => ({ |
| 5776 | fromNodeId: row.from_node_id, |
| 5777 | referenceName: row.reference_name, |
| 5778 | referenceKind: row.reference_kind as EdgeKind, |
| 5779 | line: row.line, |
| 5780 | column: row.col, |
| 5781 | candidates: row.candidates ? safeJsonParse(row.candidates, undefined) : undefined, |
| 5782 | filePath: row.file_path, |
| 5783 | language: row.language as Language, |
| 5784 | rowId: row.id, |
| 5785 | })); |
| 5786 | } |
| 5787 | |
| 5788 | /** |
| 5789 | * The python files with an edge of one of `kinds` into a node of `filePath` |