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

Function occurrence_parent

internal/cbm/extract_usages.c:294–314  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

292}
293
294static bool occurrence_parent(TSTreeCursor *cursor, TSNode current, TSNode *parent,
295 const char **field) {
296 if (cursor) {
297 *field = ts_tree_cursor_current_field_name(cursor);
298 usage_field_lookup_test_note_work();
299 if (!ts_tree_cursor_goto_parent(cursor)) {
300 *parent = (TSNode){0};
301 return false;
302 }
303 *parent = ts_tree_cursor_current_node(cursor);
304 return true;
305 }
306
307 *parent = ts_node_parent(current);
308 if (ts_node_is_null(*parent)) {
309 *field = NULL;
310 return false;
311 }
312 *field = field_name_for_node(*parent, current);
313 return true;
314}
315
316static const char *field_name_for_walk_node(WalkState *state, TSNode parent, TSNode node) {
317 if (state && state->current_cursor &&

Calls 2

field_name_for_nodeFunction · 0.85

Tested by

no test coverage detected