(files: Record<string, string>)
| 23 | }); |
| 24 | |
| 25 | async function index(files: Record<string, string>): Promise<CodeGraph> { |
| 26 | tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'codegraph-2581-conv-')); |
| 27 | for (const [rel, source] of Object.entries({ 'go.mod': GO_MOD, ...files })) { |
| 28 | fs.mkdirSync(path.dirname(path.join(tempDir, rel)), { recursive: true }); |
| 29 | fs.writeFileSync(path.join(tempDir, rel), source); |
| 30 | } |
| 31 | cg = await CodeGraph.init(tempDir, { index: true }); |
| 32 | cg.resolveReferences(); |
| 33 | return cg; |
| 34 | } |
| 35 | |
| 36 | /** `<kind> <target kind> <target> :<line>` of every edge out of the function `fromName`, sorted. */ |
| 37 | function edgesFrom(graph: CodeGraph, fromName: string): string[] { |
no test coverage detected