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

Class CBMFileResult

internal/cbm/cbm.h:472–529  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

470
471// Full extraction result for one file.
472typedef struct CBMFileResult {
473 CBMArena arena; // owns local memory; composites may also retain child arenas below
474
475 CBMDefArray defs;
476 CBMCallArray calls;
477 CBMImportArray imports;
478 CBMUsageArray usages;
479 CBMThrowArray throws;
480 CBMRWArray rw;
481 CBMTypeRefArray type_refs;
482 CBMEnvAccessArray env_accesses;
483 CBMTypeAssignArray type_assigns;
484 CBMImplTraitArray impl_traits; // Rust: impl Trait for Struct pairs
485 CBMResolvedCallArray resolved_calls; // LSP-resolved invocations/references (high confidence)
486 CBMStringRefArray string_refs; // URL/config string literals from AST
487 CBMInfraBindingArray infra_bindings; // topic→URL pairs from IaC configs
488 CBMChannelArray channels; // Socket.IO / EventEmitter pub/sub participation
489
490 const char *module_qn; // module qualified name
491 const char *namespace_name; // declared namespace/package (Java/Kotlin/C#/PHP), NULL if none
492 const char **exports; // NULL-terminated (NULL if none)
493 const char **constants; // NULL-terminated (NULL if none)
494 const char **global_vars; // NULL-terminated (NULL if none)
495 const char **macros; // NULL-terminated, C/C++ only (NULL if none)
496
497 bool has_error;
498 const char *error_msg;
499 /* Best-effort parse-coverage signal (experimental). parse_incomplete is true
500 * when the parse tree contains tree-sitter ERROR/MISSING nodes — constructs
501 * in those regions are silently absent from the graph. error_ranges is a
502 * compact "start-end,start-end" list of 1-based line ranges (arena-owned) or
503 * NULL. This only marks what we can DETECT: the absence of a flag is NOT a
504 * completeness guarantee. Callers should treat a flagged file as "prefer
505 * grep here", never treat an unflagged file as provably complete. */
506 bool parse_incomplete;
507 const char *error_ranges;
508 int error_region_count;
509 bool is_test_file;
510 int imports_count;
511 TSTree *cached_tree; // retained parse tree (caller frees via cbm_free_tree)
512 CBMLanguage cached_lang; // language of cached tree (for parser selection)
513
514 // Retained source bytes — copied into `arena` by the parallel
515 // extract pass so the fused cross-file LSP step in resolve_worker
516 // can run without re-reading the file from disk. NULL when the
517 // file exceeded the per-file (100 MB) or total (2 GB) retention
518 // cap; in that case the cross-file LSP step is skipped for this
519 // file (defs/calls already extracted are unaffected).
520 const char *source;
521 int source_len;
522
523 // Composite extraction results (currently ObjectScript Studio Export)
524 // retain their per-unit results so shallow-copied carrier strings remain
525 // valid for the composite's full lifetime. Owned and recursively released
526 // by cbm_free_result(); ordinary single-file results leave these zeroed.
527 struct CBMFileResult **owned_results;
528 int owned_result_count;
529} CBMFileResult;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected