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

Function resolve_arrow_func_name

internal/cbm/extract_defs.c:4554–4571  ·  view source on GitHub ↗

Arrow function: name on parent variable_declarator/field_definition, or the key of an object-literal property — the Zustand "actions returned from a factory" pattern, `{ addItem: (...) => {...} }` (#341).

Source from the content-addressed store, hash-verified

4552// key of an object-literal property — the Zustand "actions returned from a
4553// factory" pattern, `{ addItem: (...) => {...} }` (#341).
4554static TSNode resolve_arrow_func_name(TSNode child) {
4555 TSNode parent = ts_node_parent(child);
4556 if (!ts_node_is_null(parent)) {
4557 const char *pk = ts_node_type(parent);
4558 if (strcmp(pk, "field_definition") == 0) {
4559 return ts_node_child_by_field_name(parent, TS_FIELD("property"));
4560 }
4561 if (strcmp(pk, "public_field_definition") == 0 || strcmp(pk, "variable_declarator") == 0) {
4562 return ts_node_child_by_field_name(parent, TS_FIELD("name"));
4563 }
4564 if (strcmp(pk, "pair") == 0) {
4565 // Object-literal property `key: () => {...}` → name is the key.
4566 return ts_node_child_by_field_name(parent, TS_FIELD("key"));
4567 }
4568 }
4569 TSNode null_node = {0};
4570 return null_node;
4571}
4572
4573// Try to extract method name from a node, with language-specific fallbacks.
4574static TSNode resolve_method_name(TSNode child, CBMLanguage lang) {

Callers 1

resolve_method_nameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected