( absPath: string, language: Language, sites: readonly CallSite[] )
| 396 | * A site that is not inside a call, or a language without rules, is absent. |
| 397 | */ |
| 398 | export 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. */ |
| 417 | export async function callArgumentsInSource( |
no test coverage detected