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

Function annotateTypeScriptTypes

scripts/codegen/typescript.ts:145–154  ·  view source on GitHub ↗
(code: string, typeNames: Iterable<string>, annotation: string)

Source from the content-addressed store, hash-verified

143}
144
145function annotateTypeScriptTypes(code: string, typeNames: Iterable<string>, annotation: string): string {
146 let annotated = code;
147 for (const typeName of typeNames) {
148 annotated = annotated.replace(
149 new RegExp(`(^|\\n)(export (?:interface|type|enum) ${escapeRegExp(typeName)}\\b)`, "m"),
150 `$1${annotation}\n$2`
151 );
152 }
153 return annotated;
154}
155
156function appendUniqueExportBlocks(output: string[], compiled: string, seenBlocks: Map<string, string>): void {
157 for (const block of splitExportBlocks(compiled)) {

Callers 2

generateSessionEventsFunction · 0.85
generateRpcFunction · 0.85

Calls 1

escapeRegExpFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…