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

Function templateEdges

__tests__/cpp-template-instantiations.test.ts:64–73  ·  view source on GitHub ↗

Every edge the pass made, as text, in insertion order.

(cg: CodeGraph)

Source from the content-addressed store, hash-verified

62
63/** Every edge the pass made, as text, in insertion order. */
64function templateEdges(cg: CodeGraph): Row[] {
65 const db = (cg as unknown as { db: { db: { prepare(sql: string): { all(): Row[] } } } }).db.db;
66 return db.prepare(
67 `SELECT s.qualified_name source, t.qualified_name target, t.kind targetKind, e.kind kind, e.line line, e.provenance provenance,
68 json_extract(e.metadata, '$.via') via, json_extract(e.metadata, '$.argument') argument, json_extract(e.metadata, '$.registeredAt') registeredAt,
69 json_extract(e.metadata, '$.fnRef') fnRef
70 FROM edges e JOIN nodes s ON s.id = e.source JOIN nodes t ON t.id = e.target
71 WHERE json_extract(e.metadata, '$.synthesizedBy') = 'cpp-template-argument' ORDER BY e.id`
72 ).all();
73}
74
75/** The targets the pass linked from `source`, sorted. */
76function reached(cg: CodeGraph, source: string): string[] {

Callers 3

reachedFunction · 0.70
asTextFunction · 0.70

Calls 2

allMethod · 0.65
prepareMethod · 0.65

Tested by

no test coverage detected