MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / loopsInSource

Function loopsInSource

src/graph/branch-guards.ts:953–962  ·  view source on GitHub ↗
(source: string, language: Language, line: number, column: number | null = null)

Source from the content-addressed store, hash-verified

951
952/** Loops for one site in source text — the test seam; production reads files. */
953export async function loopsInSource(source: string, language: Language, line: number, column: number | null = null): Promise<SiteLoop[]> {
954 if (!supportsBranchGuards(language)) return [];
955 const tree = await parse(source, language);
956 if (!tree) return [];
957 try {
958 return loopsInTree(tree.rootNode, source, language, line, column);
959 } finally {
960 tree.delete();
961 }
962}
963
964/** A loop a site is written inside: its header as written, and where the loop starts. */
965export interface SiteLoop {

Callers 2

loopsAtFunction · 0.90

Calls 4

supportsBranchGuardsFunction · 0.85
loopsInTreeFunction · 0.85
parseFunction · 0.70
deleteMethod · 0.65

Tested by 1

loopsAtFunction · 0.72