MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / extract_jsx_component_ref

Function extract_jsx_component_ref

internal/cbm/extract_calls.c:1608–1624  ·  view source on GitHub ↗

Extract JSX component refs (uppercase tags) as CALLS edges.

Source from the content-addressed store, hash-verified

1606
1607// Extract JSX component refs (uppercase tags) as CALLS edges.
1608static void extract_jsx_component_ref(CBMExtractCtx *ctx, TSNode node, const char *kind,
1609 const char *enclosing_func_qn) {
1610 if (strcmp(kind, "jsx_self_closing_element") != 0 && strcmp(kind, "jsx_opening_element") != 0) {
1611 return;
1612 }
1613 TSNode name_node = ts_node_child_by_field_name(node, TS_FIELD("name"));
1614 if (ts_node_is_null(name_node)) {
1615 return;
1616 }
1617 char *name = cbm_node_text(ctx->arena, name_node, ctx->source);
1618 if (name && name[0] >= 'A' && name[0] <= 'Z') {
1619 CBMCall call = {0};
1620 call.callee_name = name;
1621 call.enclosing_func_qn = enclosing_func_qn;
1622 cbm_calls_push(&ctx->result->calls, ctx->arena, call);
1623 }
1624}
1625
1626// Kotlin: `a OP b` desugars to an operator-method call `a.<method>(b)`. The
1627// generic call walk keys on call_expression nodes and so never sees these

Callers 1

handle_callsFunction · 0.85

Calls 2

cbm_node_textFunction · 0.85
cbm_calls_pushFunction · 0.85

Tested by

no test coverage detected