MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / getUnresolvedReferencesByIds

Method getUnresolvedReferencesByIds

src/db/queries.ts:5654–5675  ·  view source on GitHub ↗

Unresolved refs by row id.

(ids: number[])

Source from the content-addressed store, hash-verified

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`

Callers 1

loadMethod · 0.80

Calls 6

safeJsonParseFunction · 0.90
mapMethod · 0.80
pushMethod · 0.80
allMethod · 0.65
prepareMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected