MCPcopy Index your code
hub / github.com/github/copilot-sdk / getSourceComment

Function getSourceComment

scripts/docs-validation/extract.ts:546–565  ·  view source on GitHub ↗
(
  language: string,
  file: string,
  line: number
)

Source from the content-addressed store, hash-verified

544}
545
546function 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
567main().catch((err) => {
568 console.error("Extraction failed:", err);

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…