( absPath: string, language: Language, sites: readonly CallSite[] )
| 614 | |
| 615 | /** Both halves of every site, keyed by {@link siteKey}, from one cached tree. */ |
| 616 | export async function callSitesForFile( |
| 617 | absPath: string, |
| 618 | language: Language, |
| 619 | sites: readonly CallSite[] |
| 620 | ): Promise<Map<string, CallSiteText>> { |
| 621 | const out = new Map<string, CallSiteText>(); |
| 622 | if (!supportsBranchGuards(language) || sites.length === 0) return out; |
| 623 | const cached = await treeFor(absPath, language); |
| 624 | if (!cached) return out; |
| 625 | for (const site of sites) { |
| 626 | const key = siteKey(site); |
| 627 | if (out.has(key)) continue; |
| 628 | const found = callSiteInTree(cached.tree.rootNode, cached.source, site.line, site.column ?? null, site.callee); |
| 629 | if (found !== null) out.set(key, found); |
| 630 | } |
| 631 | return out; |
| 632 | } |
| 633 | |
| 634 | /** {@link callSitesForFile} over source text — the test surface. */ |
| 635 | export async function callSiteInSource( |
no test coverage detected