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

Function occurrence_parent

internal/cbm/extract_usages.c:324–344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

322}
323
324static bool occurrence_parent(TSTreeCursor *cursor, TSNode current, TSNode *parent,
325 const char **field) {
326 if (cursor) {
327 *field = ts_tree_cursor_current_field_name(cursor);
328 usage_field_lookup_test_note_work();
329 if (!ts_tree_cursor_goto_parent(cursor)) {
330 *parent = (TSNode){0};
331 return false;
332 }
333 *parent = ts_tree_cursor_current_node(cursor);
334 return true;
335 }
336
337 *parent = ts_node_parent(current);
338 if (ts_node_is_null(*parent)) {
339 *field = NULL;
340 return false;
341 }
342 *field = field_name_for_node(*parent, current);
343 return true;
344}
345
346static const char *field_name_for_walk_node(WalkState *state, TSNode parent, TSNode node) {
347 if (state && state->current_cursor &&

Calls 2

field_name_for_nodeFunction · 0.85

Tested by

no test coverage detected