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

Function push_base_text

internal/cbm/extract_defs.c:2201–2223  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

2199
2200// Append a base name (generic args stripped) to out[] if non-empty.
2201static void push_base_text(CBMArena *a, TSNode n, const char *source, const char **out, int out_cap,
2202 int *count) {
2203 if (*count >= out_cap) {
2204 return;
2205 }
2206 char *t = cbm_node_text(a, n, source);
2207 if (!t) {
2208 return;
2209 }
2210 char *angle = strchr(t, '<');
2211 if (angle) {
2212 *angle = '\0';
2213 }
2214 /* PHP qualified base may be backslash-prefixed (e.g. `\RuntimeException`);
2215 * keep the bare class name so it matches the unqualified declaration. */
2216 char *last_bs = strrchr(t, '\\');
2217 if (last_bs) {
2218 t = last_bs + 1;
2219 }
2220 if (t[0]) {
2221 out[(*count)++] = t;
2222 }
2223}
2224
2225/* TypeScript/TSX: bases live in a `class_heritage` (class) or directly in an
2226 * `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