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

Function py_node_text

internal/cbm/lsp/py_lsp.c:656–670  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

654/* ── helpers: text + emit ─────────────────────────────────────── */
655
656static char *py_node_text(PyLSPContext *ctx, TSNode node) {
657 if (!ctx || ts_node_is_null(node))
658 return NULL;
659 uint32_t start = ts_node_start_byte(node);
660 uint32_t end = ts_node_end_byte(node);
661 if (end <= start || (int)end > ctx->source_len)
662 return NULL;
663 size_t len = (size_t)(end - start);
664 char *out = (char *)cbm_arena_alloc(ctx->arena, len + 1);
665 if (!out)
666 return NULL;
667 memcpy(out, ctx->source + start, len);
668 out[len] = '\0';
669 return out;
670}
671
672/* ── lambda + dict-literal-dispatch registries ────────────────── */
673

Callers 15

py_string_literal_valueFunction · 0.85
py_register_dict_literalFunction · 0.85
py_bind_for_targetFunction · 0.85
py_process_statementFunction · 0.85
py_emit_call_forFunction · 0.85
py_match_isinstanceFunction · 0.85
py_underlying_identFunction · 0.85
py_match_is_noneFunction · 0.85
py_bind_walrus_inFunction · 0.85

Calls 1

cbm_arena_allocFunction · 0.50

Tested by

no test coverage detected