(files: Record<string, string>)
| 21 | }); |
| 22 | |
| 23 | async function indexProject(files: Record<string, string>): Promise<CodeGraph> { |
| 24 | const root = fs.mkdtempSync(path.join(os.tmpdir(), 'cg-default-member-')); |
| 25 | roots.push(root); |
| 26 | for (const [rel, content] of Object.entries(files)) { |
| 27 | fs.mkdirSync(path.dirname(path.join(root, rel)), { recursive: true }); |
| 28 | fs.writeFileSync(path.join(root, rel), content); |
| 29 | } |
| 30 | const cg = await CodeGraph.init(root, { index: true }); |
| 31 | graphs.push(cg); |
| 32 | return cg; |
| 33 | } |
| 34 | |
| 35 | /** What each line of `fn` calls: `<line> <file>:<qualified name>`, sorted. */ |
| 36 | function callsOf(cg: CodeGraph, fn: string): string[] { |
no test coverage detected