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

Function push_base_text

internal/cbm/extract_defs.c:3957–3979  ·  view source on GitHub ↗

Append a base name (generic args stripped) to out[] if non-empty.

Source from the content-addressed store, hash-verified

3955
3956// Append a base name (generic args stripped) to out[] if non-empty.
3957static void push_base_text(CBMArena *a, TSNode n, const char *source, const char **out, int out_cap,
3958 int *count) {
3959 if (*count >= out_cap) {
3960 return;
3961 }
3962 char *t = cbm_node_text(a, n, source);
3963 if (!t) {
3964 return;
3965 }
3966 char *angle = strchr(t, '<');
3967 if (angle) {
3968 *angle = '\0';
3969 }
3970 /* PHP qualified base may be backslash-prefixed (e.g. `\RuntimeException`);
3971 * keep the bare class name so it matches the unqualified declaration. */
3972 char *last_bs = strrchr(t, '\\');
3973 if (last_bs) {
3974 t = last_bs + 1;
3975 }
3976 if (t[0]) {
3977 out[(*count)++] = t;
3978 }
3979}
3980
3981/* TypeScript/TSX: bases live in a `class_heritage` (class) or directly in an
3982 * `extends_type_clause` (interface). The extractor previously captured the

Callers 4

collect_ts_basesFunction · 0.85
extract_php_basesFunction · 0.85
extract_kotlin_basesFunction · 0.85

Calls 1

cbm_node_textFunction · 0.85

Tested by

no test coverage detected