(files: Record<string, string>, include: string[])
| 874 | }); |
| 875 | |
| 876 | async function indexProject(files: Record<string, string>, include: string[]) { |
| 877 | const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'codegraph-2276-')); |
| 878 | dirs.push(dir); |
| 879 | for (const [rel, content] of Object.entries(files)) { |
| 880 | fs.mkdirSync(path.dirname(path.join(dir, rel)), { recursive: true }); |
| 881 | fs.writeFileSync(path.join(dir, rel), content); |
| 882 | } |
| 883 | const cg = CodeGraph.initSync(dir, { config: { include, exclude: [] } }); |
| 884 | graphs.push(cg); |
| 885 | await cg.indexAll(); |
| 886 | return { dir, cg }; |
| 887 | } |
| 888 | |
| 889 | /** Every method named `name`, in file/line order, with its callers. */ |
| 890 | function callersOf(cg: CodeGraph, name: string): string[] { |
no test coverage detected