MCPcopy Create free account
hub / github.com/Houseofmvps/codesight / extractBrightScriptGraphqlCalls

Function extractBrightScriptGraphqlCalls

src/ast/extract-brightscript.ts:214–234  ·  view source on GitHub ↗
(content: string)

Source from the content-addressed store, hash-verified

212 * Also catches bare CreateObject("roUrlTransfer").
213 */
214export function extractBrightScriptGraphqlCalls(content: string): GraphqlCallSite[] {
215 const out: GraphqlCallSite[] = [];
216 const lines = content.split("\n");
217 const gqlPattern = /\bmakeGraphqlCall\s*\(\s*([^,]+?)\s*,/gi;
218 const urlXferPattern = /\bCreateObject\s*\(\s*["']roUrlTransfer["']\s*\)/gi;
219
220 for (let i = 0; i < lines.length; i++) {
221 const line = lines[i];
222 let m: RegExpExecArray | null;
223 gqlPattern.lastIndex = 0;
224 while ((m = gqlPattern.exec(line)) !== null) {
225 out.push({ url: m[1].trim(), line: i + 1 });
226 }
227 urlXferPattern.lastIndex = 0;
228 while ((m = urlXferPattern.exec(line)) !== null) {
229 out.push({ url: "roUrlTransfer", line: i + 1 });
230 }
231 }
232
233 return out;
234}
235
236/**
237 * Extract m.global.AddField("name", "type", ...) registrations.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected