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

Function indexProject

__tests__/function-ref-project-imports.test.ts:30–38  ·  view source on GitHub ↗
(files: Record<string, string>)

Source from the content-addressed store, hash-verified

28});
29
30async function indexProject(files: Record<string, string>): Promise<CodeGraph> {
31 const root = fs.mkdtempSync(path.join(os.tmpdir(), 'cg-fnref-project-'));
32 roots.push(root);
33 for (const [rel, content] of Object.entries(files)) {
34 fs.mkdirSync(path.dirname(path.join(root, rel)), { recursive: true });
35 fs.writeFileSync(path.join(root, rel), content);
36 }
37 return CodeGraph.init(root, { index: true });
38}
39
40/** `<value name> -> <target file>:<target qualified name>` for each function-as-value edge leaving `file`. */
41function fnRefsFrom(cg: CodeGraph, file: string): string[] {

Calls 3

pushMethod · 0.80
joinMethod · 0.45
initMethod · 0.45

Tested by

no test coverage detected