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

Function callArgumentsForFile

src/graph/branch-guards.ts:398–414  ·  view source on GitHub ↗
(
  absPath: string,
  language: Language,
  sites: readonly CallSite[]
)

Source from the content-addressed store, hash-verified

396 * A site that is not inside a call, or a language without rules, is absent.
397 */
398export async function callArgumentsForFile(
399 absPath: string,
400 language: Language,
401 sites: readonly CallSite[]
402): Promise<Map<string, string>> {
403 const out = new Map<string, string>();
404 if (!supportsBranchGuards(language) || sites.length === 0) return out;
405 const cached = await treeFor(absPath, language);
406 if (!cached) return out;
407 for (const site of sites) {
408 const key = siteKey(site);
409 if (out.has(key)) continue;
410 const text = callArgumentsInTree(cached.tree.rootNode, cached.source, site.line, site.column ?? null);
411 if (text !== null) out.set(key, text);
412 }
413 return out;
414}
415
416/** {@link callArgumentsForFile} over source text — the test surface. */
417export async function callArgumentsInSource(

Callers 1

argsFunction · 0.90

Calls 6

supportsBranchGuardsFunction · 0.85
treeForFunction · 0.85
siteKeyFunction · 0.85
callArgumentsInTreeFunction · 0.85
hasMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected