MCPcopy
hub / github.com/colbymchenry/codegraph / indexAndQuery

Function indexAndQuery

__tests__/extension-mapping.test.ts:121–133  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

119 fs.writeFileSync(p, body);
120 };
121 const indexAndQuery = async () => {
122 const cg = await CodeGraph.init(dir, { silent: true });
123 await cg.indexAll();
124 const db = (cg as any).db.db;
125 const nodes = db
126 .prepare('SELECT name, kind, file_path, language FROM nodes WHERE file_path = ?')
127 .all('widget.foo');
128 const files = db
129 .prepare('SELECT path, language FROM files WHERE path = ?')
130 .all('widget.foo');
131 cg.close?.();
132 return { nodes, files };
133 };
134
135 const SOURCE = 'export function widgetHandler(x: number): number { return x + 1; }\n';
136

Callers 1

Calls 5

initMethod · 0.80
allMethod · 0.65
prepareMethod · 0.65
closeMethod · 0.65
indexAllMethod · 0.45

Tested by

no test coverage detected