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

Function is_definition_name

internal/cbm/extract_usages.c:78–87  ·  view source on GitHub ↗

Check if a reference node is a definition name (the "name" field of its parent).

Source from the content-addressed store, hash-verified

76
77// Check if a reference node is a definition name (the "name" field of its parent).
78static bool is_definition_name(TSNode node) {
79 TSNode parent = ts_node_parent(node);
80 if (ts_node_is_null(parent)) {
81 return false;
82 }
83 TSNode name_field = ts_node_child_by_field_name(parent, TS_FIELD("name"));
84 return !ts_node_is_null(name_field) &&
85 ts_node_start_byte(name_field) == ts_node_start_byte(node) &&
86 ts_node_end_byte(name_field) == ts_node_end_byte(node);
87}
88
89// Try to emit a usage for a reference node. Returns early if the node should be skipped.
90static void try_emit_usage(CBMExtractCtx *ctx, TSNode node, const CBMLangSpec *spec) {

Callers 1

try_emit_usageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected