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

Function cbm_extract_definitions

internal/cbm/extract_defs.c:6372–6398  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6370}
6371
6372void cbm_extract_definitions(CBMExtractCtx *ctx) {
6373 const CBMLangSpec *spec = cbm_lang_spec(ctx->language);
6374 if (!spec) {
6375 return;
6376 }
6377
6378 CBMArena *a = ctx->arena;
6379
6380 // Create module node (always first definition)
6381 CBMDefinition mod;
6382 memset(&mod, 0, sizeof(mod));
6383 mod.name = ctx->rel_path; // will be refined by Go layer
6384 mod.qualified_name = ctx->module_qn;
6385 mod.label = "Module";
6386 mod.file_path = ctx->rel_path;
6387 mod.start_line = FIRST_LINE;
6388 mod.end_line = ts_node_end_point(ctx->root).row + TS_LINE_OFFSET;
6389 mod.is_exported = true;
6390 mod.is_test = ctx->result->is_test_file;
6391 cbm_defs_push(&ctx->result->defs, a, mod);
6392
6393 // Walk AST for function/class definitions
6394 walk_defs(ctx, ctx->root, spec, 0);
6395
6396 // Extract module-level variables
6397 extract_variables(ctx, ctx->root, spec);
6398}

Callers 1

cbm_extract_file_implFunction · 0.85

Calls 4

cbm_lang_specFunction · 0.85
cbm_defs_pushFunction · 0.85
walk_defsFunction · 0.85
extract_variablesFunction · 0.85

Tested by

no test coverage detected