True if some CALLS edge's TARGET node carries `label` and a QN ending with * `qn_suffix` — i.e. the call resolved to that specific definition. */
| 1604 | /* True if some CALLS edge's TARGET node carries `label` and a QN ending with |
| 1605 | * `qn_suffix` — i.e. the call resolved to that specific definition. */ |
| 1606 | static int calls_edge_targets(cbm_store_t *store, const char *project, const char *label, |
| 1607 | const char *qn_suffix) { |
| 1608 | cbm_edge_t *edges = NULL; |
| 1609 | int n = 0; |
| 1610 | if (cbm_store_find_edges_by_type(store, project, "CALLS", &edges, &n) != CBM_STORE_OK) |
| 1611 | return 0; |
| 1612 | int found = 0; |
| 1613 | size_t sl = strlen(qn_suffix); |
| 1614 | for (int i = 0; i < n && !found; i++) { |
| 1615 | cbm_node_t tgt; |
| 1616 | if (cbm_store_find_node_by_id(store, edges[i].target_id, &tgt) != CBM_STORE_OK) |
| 1617 | continue; |
| 1618 | const char *qn = tgt.qualified_name; |
| 1619 | if (qn && tgt.label && strcmp(tgt.label, label) == 0) { |
| 1620 | size_t ql = strlen(qn); |
| 1621 | if (ql >= sl && strcmp(qn + ql - sl, qn_suffix) == 0) |
| 1622 | found = 1; |
| 1623 | } |
| 1624 | cbm_node_free_fields(&tgt); |
| 1625 | } |
| 1626 | cbm_store_free_edges(edges, n); |
| 1627 | return found; |
| 1628 | } |
| 1629 | |
| 1630 | /* #988: `from m import f as g; g()` produced NO CALLS edge — the Python LSP |
| 1631 | * bound the alias as MODULE("m.f") (the from-style heuristic keys on the |
no test coverage detected