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

Function cbm_extract_definitions

internal/cbm/extract_defs.c:7439–7465  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7437}
7438
7439void cbm_extract_definitions(CBMExtractCtx *ctx) {
7440 const CBMLangSpec *spec = cbm_lang_spec(ctx->language);
7441 if (!spec) {
7442 return;
7443 }
7444
7445 CBMArena *a = ctx->arena;
7446
7447 // Create module node (always first definition)
7448 CBMDefinition mod;
7449 memset(&mod, 0, sizeof(mod));
7450 mod.name = ctx->rel_path; // will be refined by Go layer
7451 mod.qualified_name = ctx->module_qn;
7452 mod.label = "Module";
7453 mod.file_path = ctx->rel_path;
7454 mod.start_line = FIRST_LINE;
7455 mod.end_line = ts_node_end_point(ctx->root).row + TS_LINE_OFFSET;
7456 mod.is_exported = true;
7457 mod.is_test = ctx->result->is_test_file;
7458 cbm_defs_push(&ctx->result->defs, a, mod);
7459
7460 // Walk AST for function/class definitions
7461 walk_defs(ctx, ctx->root, spec, 0);
7462
7463 // Extract module-level variables
7464 extract_variables(ctx, ctx->root, spec);
7465}

Callers 1

cbm_extract_file_exFunction · 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