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:8269–8286  ·  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

8267// key of an object-literal property — the Zustand "actions returned from a
8268// factory" pattern, `{ addItem: (...) => {...} }` (#341).
8269static TSNode resolve_arrow_func_name(TSNode child) {
8270 TSNode parent = ts_node_parent(child);
8271 if (!ts_node_is_null(parent)) {
8272 const char *pk = ts_node_type(parent);
8273 if (strcmp(pk, "field_definition") == 0) {
8274 return ts_node_child_by_field_name(parent, TS_FIELD("property"));
8275 }
8276 if (strcmp(pk, "public_field_definition") == 0 || strcmp(pk, "variable_declarator") == 0) {
8277 return ts_node_child_by_field_name(parent, TS_FIELD("name"));
8278 }
8279 if (strcmp(pk, "pair") == 0) {
8280 // Object-literal property `key: () => {...}` → name is the key.
8281 return ts_node_child_by_field_name(parent, TS_FIELD("key"));
8282 }
8283 }
8284 TSNode null_node = {0};
8285 return null_node;
8286}
8287
8288// Try to extract method name from a node, with language-specific fallbacks.
8289static 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