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

Function splitTopLevelCommasMulti

scripts/codegen/python.ts:650–665  ·  view source on GitHub ↗
(s: string)

Source from the content-addressed store, hash-verified

648}
649
650function splitTopLevelCommasMulti(s: string): string[] {
651 const parts: string[] = [];
652 let depth = 0;
653 let start = 0;
654 for (let i = 0; i < s.length; i++) {
655 const c = s[i];
656 if (c === "(" || c === "[" || c === "{") depth++;
657 else if (c === ")" || c === "]" || c === "}") depth--;
658 else if (c === "," && depth === 0) {
659 parts.push(s.slice(start, i));
660 start = i + 1;
661 }
662 }
663 parts.push(s.slice(start));
664 return parts.filter((p) => p.trim().length > 0);
665}
666
667function ensureClassVarImport(code: string): string {
668 // Already imported?

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…