| 633 | |
| 634 | /** {@link callSitesForFile} over source text — the test surface. */ |
| 635 | export async function callSiteInSource( |
| 636 | source: string, |
| 637 | language: Language, |
| 638 | line: number, |
| 639 | column: number | null |
| 640 | ): Promise<CallSiteText | null> { |
| 641 | if (!supportsBranchGuards(language)) return null; |
| 642 | const tree = await parse(source, language); |
| 643 | if (!tree) return null; |
| 644 | try { |
| 645 | return callSiteInTree(tree.rootNode, source, line, column); |
| 646 | } finally { |
| 647 | tree.delete(); |
| 648 | } |
| 649 | } |
| 650 | |
| 651 | /** The node holding a call's arguments: the `arguments` field, a container child, or Swift's `call_suffix` contents. */ |
| 652 | function argumentsOf(call: SyntaxNode): SyntaxNode | null { |