| 525 | } PyResolvedSiteCounts; |
| 526 | |
| 527 | static PyResolvedSiteCounts count_invocation_sites(const CBMResolvedCallArray *arr, |
| 528 | const char *caller_sub, const char *callee_sub, |
| 529 | uint32_t first_start, uint32_t first_end, |
| 530 | uint32_t second_start, uint32_t second_end) { |
| 531 | PyResolvedSiteCounts counts = {0}; |
| 532 | for (int i = 0; i < arr->count; i++) { |
| 533 | const CBMResolvedCall *rc = &arr->items[i]; |
| 534 | if (rc->kind != CBM_RESOLVED_INVOCATION || !rc->caller_qn || !rc->callee_qn || |
| 535 | !strstr(rc->caller_qn, caller_sub) || !strstr(rc->callee_qn, callee_sub)) { |
| 536 | continue; |
| 537 | } |
| 538 | counts.target_count++; |
| 539 | if (rc->site_start_byte == first_start && rc->site_end_byte == first_end) |
| 540 | counts.first_site_count++; |
| 541 | if (rc->site_start_byte == second_start && rc->site_end_byte == second_end) |
| 542 | counts.second_site_count++; |
| 543 | } |
| 544 | return counts; |
| 545 | } |
| 546 | |
| 547 | TEST(pylsp_crossfile_method_dispatch) { |
| 548 | /* file svc.py defines class RedisStore with Get(); file main.py calls |