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. */
| 1500 | /* True if some CALLS edge's TARGET node carries `label` and a QN ending with |
| 1501 | * `qn_suffix` — i.e. the call resolved to that specific definition. */ |
| 1502 | static int calls_edge_targets(cbm_store_t *store, const char *project, const char *label, |
| 1503 | const char *qn_suffix) { |
| 1504 | cbm_edge_t *edges = NULL; |
| 1505 | int n = 0; |
| 1506 | if (cbm_store_find_edges_by_type(store, project, "CALLS", &edges, &n) != CBM_STORE_OK) |
| 1507 | return 0; |
| 1508 | int found = 0; |
| 1509 | size_t sl = strlen(qn_suffix); |
| 1510 | for (int i = 0; i < n && !found; i++) { |
| 1511 | cbm_node_t tgt; |
| 1512 | if (cbm_store_find_node_by_id(store, edges[i].target_id, &tgt) != CBM_STORE_OK) |
| 1513 | continue; |
| 1514 | const char *qn = tgt.qualified_name; |
| 1515 | if (qn && tgt.label && strcmp(tgt.label, label) == 0) { |
| 1516 | size_t ql = strlen(qn); |
| 1517 | if (ql >= sl && strcmp(qn + ql - sl, qn_suffix) == 0) |
| 1518 | found = 1; |
| 1519 | } |
| 1520 | cbm_node_free_fields(&tgt); |
| 1521 | } |
| 1522 | cbm_store_free_edges(edges, n); |
| 1523 | return found; |
| 1524 | } |
| 1525 | |
| 1526 | /* #988: `from m import f as g; g()` produced NO CALLS edge — the Python LSP |
| 1527 | * bound the alias as MODULE("m.f") (the from-style heuristic keys on the |
no test coverage detected