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

Function index

__tests__/explore-empty-diagnostics.test.ts:11–19  ·  view source on GitHub ↗
(files: Record<string, string> = {})

Source from the content-addressed store, hash-verified

9let cg: CodeGraph;
10
11async function index(files: Record<string, string> = {}) {
12 dir = fs.mkdtempSync(path.join(os.tmpdir(), 'codegraph-empty-explore-'));
13 for (const [name, source] of Object.entries(files)) {
14 fs.mkdirSync(path.dirname(path.join(dir, name)), { recursive: true });
15 fs.writeFileSync(path.join(dir, name), source);
16 }
17 cg = CodeGraph.initSync(dir);
18 await cg.indexAll();
19}
20
21async function explore(query: string) {
22 const result = await new ToolHandler(cg).execute('codegraph_explore', { query });

Calls 3

initSyncMethod · 0.80
joinMethod · 0.45
indexAllMethod · 0.45

Tested by

no test coverage detected