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

Function index

__tests__/rust-glob-module-paths.test.ts:26–39  ·  view source on GitHub ↗
(files: Record<string, string>, manifest = '')

Source from the content-addressed store, hash-verified

24});
25
26async function index(files: Record<string, string>, manifest = ''): Promise<CodeGraph> {
27 root = fs.mkdtempSync(path.join(os.tmpdir(), 'cg-rust-glob-mod-'));
28 const all: Record<string, string> = {
29 'Cargo.toml': `[package]\nname = "repro"\nversion = "0.1.0"\nedition = "2021"\n${manifest}`,
30 ...files,
31 };
32 for (const [rel, text] of Object.entries(all)) {
33 const dest = path.join(root, rel);
34 fs.mkdirSync(path.dirname(dest), { recursive: true });
35 fs.writeFileSync(dest, text);
36 }
37 cg = await CodeGraph.init(root, { index: true });
38 return cg;
39}
40
41/** The `calls` targets of function `fn` in `file`, as `<file>:<qualified name>`, sorted. */
42function callsOf(graph: CodeGraph, file: string, fn: string): string[] {

Callers 1

Calls 2

joinMethod · 0.45
initMethod · 0.45

Tested by

no test coverage detected