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

Function indexProject

__tests__/sync.test.ts:876–887  ·  view source on GitHub ↗
(files: Record<string, string>, include: string[])

Source from the content-addressed store, hash-verified

874 });
875
876 async function indexProject(files: Record<string, string>, include: string[]) {
877 const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'codegraph-2276-'));
878 dirs.push(dir);
879 for (const [rel, content] of Object.entries(files)) {
880 fs.mkdirSync(path.dirname(path.join(dir, rel)), { recursive: true });
881 fs.writeFileSync(path.join(dir, rel), content);
882 }
883 const cg = CodeGraph.initSync(dir, { config: { include, exclude: [] } });
884 graphs.push(cg);
885 await cg.indexAll();
886 return { dir, cg };
887 }
888
889 /** Every method named `name`, in file/line order, with its callers. */
890 function callersOf(cg: CodeGraph, name: string): string[] {

Callers 2

editAndSyncFunction · 0.70
sync.test.tsFile · 0.70

Calls 4

pushMethod · 0.80
initSyncMethod · 0.80
joinMethod · 0.45
indexAllMethod · 0.45

Tested by

no test coverage detected