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

Function returnsInSource

src/graph/branch-guards.ts:2112–2121  ·  view source on GitHub ↗
(source: string, language: Language, line: number)

Source from the content-addressed store, hash-verified

2110
2111/** {@link returnsForFile} over source text — the test surface. */
2112export async function returnsInSource(source: string, language: Language, line: number): Promise<ReturnSite[]> {
2113 if (!supportsBranchGuards(language)) return [];
2114 const tree = await parse(source, language);
2115 if (!tree) return [];
2116 try {
2117 return returnsInTree(tree.rootNode, line);
2118 } finally {
2119 tree.delete();
2120 }
2121}
2122
2123export function returnsInTree(root: SyntaxNode, line: number): ReturnSite[] {
2124 const row = line - 1;

Calls 4

supportsBranchGuardsFunction · 0.85
returnsInTreeFunction · 0.85
parseFunction · 0.70
deleteMethod · 0.65

Tested by

no test coverage detected