(files: Record<string, string>)
| 24 | }); |
| 25 | |
| 26 | async function index(files: Record<string, string>): Promise<CodeGraph> { |
| 27 | root = fs.mkdtempSync(path.join(os.tmpdir(), 'cg-rust-method-path-')); |
| 28 | for (const [rel, content] of Object.entries({ 'Cargo.toml': '[package]\nname = "app"\nversion = "0.1.0"\nedition = "2021"\n', ...files })) { |
| 29 | fs.mkdirSync(path.dirname(path.join(root, rel)), { recursive: true }); |
| 30 | fs.writeFileSync(path.join(root, rel), content); |
| 31 | } |
| 32 | cg = await CodeGraph.init(root, { index: true }); |
| 33 | return cg; |
| 34 | } |
| 35 | |
| 36 | /** What `fn` references or calls, as `<kind> <file>:<qualified name>`, sorted. */ |
| 37 | function outOf(graph: CodeGraph, fn: string): string[] { |
no test coverage detected