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

Function indexProject

__tests__/workspace-browser-and-nested-roots.test.ts:25–35  ·  view source on GitHub ↗
(files: Record<string, string>)

Source from the content-addressed store, hash-verified

23});
24
25async function indexProject(files: Record<string, string>): Promise<CodeGraph> {
26 const root = fs.mkdtempSync(path.join(os.tmpdir(), 'cg-ws-browser-'));
27 roots.push(root);
28 for (const [rel, content] of Object.entries(files)) {
29 fs.mkdirSync(path.dirname(path.join(root, rel)), { recursive: true });
30 fs.writeFileSync(path.join(root, rel), content);
31 }
32 const cg = await CodeGraph.init(root, { index: true });
33 graphs.push(cg);
34 return cg;
35}
36
37/** Where a function's calls land: `<file>:<qualified name>`, sorted. */
38function callsOf(cg: CodeGraph, fn: string): string[] {

Calls 3

pushMethod · 0.80
joinMethod · 0.45
initMethod · 0.45

Tested by

no test coverage detected