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

Function extractBrightScriptShowScreenCalls

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

Source from the content-addressed store, hash-verified

168 * `extractBrightScriptNavigationCalls` which takes a configurable name set.
169 */
170export function extractBrightScriptShowScreenCalls(content: string): ShowScreenCall[] {
171 const out: ShowScreenCall[] = [];
172 const lines = content.split("\n");
173
174 const showPattern = /\bShowScreen\s*\(\s*([^),]+?)\s*(?:,\s*(true|false|\w+))?\s*\)/gi;
175 const closePattern = /\bCloseScreen\s*\(\s*\)/gi;
176 const currentPattern = /\bGetCurrentScreen\s*\(\s*\)/gi;
177
178 for (let i = 0; i < lines.length; i++) {
179 const line = lines[i];
180 let m: RegExpExecArray | null;
181
182 showPattern.lastIndex = 0;
183 while ((m = showPattern.exec(line)) !== null) {
184 const target = m[1].trim();
185 const second = (m[2] ?? "").trim().toLowerCase();
186 out.push({
187 target,
188 modal: second === "true",
189 helper: "show",
190 line: i + 1,
191 });
192 }
193
194 closePattern.lastIndex = 0;
195 while ((m = closePattern.exec(line)) !== null) {
196 out.push({ target: "", modal: false, helper: "close", line: i + 1 });
197 }
198
199 currentPattern.lastIndex = 0;
200 while ((m = currentPattern.exec(line)) !== null) {
201 out.push({ target: "", modal: false, helper: "current", line: i + 1 });
202 }
203 }
204
205 return out;
206}
207
208/**
209 * Extract GraphQL + raw HTTP call sites.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected