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

Function index

__tests__/go-conversion-references.test.ts:25–34  ·  view source on GitHub ↗
(files: Record<string, string>)

Source from the content-addressed store, hash-verified

23});
24
25async function index(files: Record<string, string>): Promise<CodeGraph> {
26 tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'codegraph-2581-conv-'));
27 for (const [rel, source] of Object.entries({ 'go.mod': GO_MOD, ...files })) {
28 fs.mkdirSync(path.dirname(path.join(tempDir, rel)), { recursive: true });
29 fs.writeFileSync(path.join(tempDir, rel), source);
30 }
31 cg = await CodeGraph.init(tempDir, { index: true });
32 cg.resolveReferences();
33 return cg;
34}
35
36/** `<kind> <target kind> <target> :<line>` of every edge out of the function `fromName`, sorted. */
37function edgesFrom(graph: CodeGraph, fromName: string): string[] {

Calls 3

resolveReferencesMethod · 0.80
joinMethod · 0.45
initMethod · 0.45

Tested by

no test coverage detected