( language: string, file: string, line: number )
| 544 | } |
| 545 | |
| 546 | function getSourceComment( |
| 547 | language: string, |
| 548 | file: string, |
| 549 | line: number |
| 550 | ): string { |
| 551 | // Normalize path separators to forward slashes to avoid issues |
| 552 | // (e.g., Java interprets \u as a unicode escape sequence) |
| 553 | const normalizedFile = file.replace(/\\/g, "/"); |
| 554 | const location = `Source: ${normalizedFile}:${line}`; |
| 555 | switch (language) { |
| 556 | case "typescript": |
| 557 | case "go": |
| 558 | case "csharp": |
| 559 | return `// ${location}`; |
| 560 | case "python": |
| 561 | return `# ${location}`; |
| 562 | default: |
| 563 | return `// ${location}`; |
| 564 | } |
| 565 | } |
| 566 | |
| 567 | main().catch((err) => { |
| 568 | console.error("Extraction failed:", err); |
no outgoing calls
no test coverage detected
searching dependent graphs…