Extract JSX component refs (uppercase tags) as CALLS edges.
| 2117 | |
| 2118 | // Extract JSX component refs (uppercase tags) as CALLS edges. |
| 2119 | static void extract_jsx_component_ref(CBMExtractCtx *ctx, TSNode node, const char *kind, |
| 2120 | const char *enclosing_func_qn) { |
| 2121 | if (strcmp(kind, "jsx_self_closing_element") != 0 && strcmp(kind, "jsx_opening_element") != 0) { |
| 2122 | return; |
| 2123 | } |
| 2124 | TSNode name_node = ts_node_child_by_field_name(node, TS_FIELD("name")); |
| 2125 | if (ts_node_is_null(name_node)) { |
| 2126 | return; |
| 2127 | } |
| 2128 | char *name = cbm_node_text(ctx->arena, name_node, ctx->source); |
| 2129 | if (name && name[0] >= 'A' && name[0] <= 'Z') { |
| 2130 | CBMCall call = {0}; |
| 2131 | call.callee_name = name; |
| 2132 | call.enclosing_func_qn = enclosing_func_qn; |
| 2133 | call.site_start_byte = ts_node_start_byte(node); |
| 2134 | call.site_end_byte = ts_node_end_byte(node); |
| 2135 | /* An uppercase tag is only a component invocation when the TS resolver |
| 2136 | * proves which lexical value owns it. In particular, a parameter or |
| 2137 | * local named like a module component must not fall through to the |
| 2138 | * textual call resolver. */ |
| 2139 | call.requires_lsp_resolution = true; |
| 2140 | cbm_calls_push(&ctx->result->calls, ctx->arena, call); |
| 2141 | } |
| 2142 | } |
| 2143 | |
| 2144 | static bool kotlin_direct_unnamed_token(TSNode node, const char *token) { |
| 2145 | uint32_t count = ts_node_child_count(node); |
no test coverage detected