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

Function py_node_text

internal/cbm/lsp/py_lsp.c:807–821  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

805/* ── helpers: text + emit ─────────────────────────────────────── */
806
807static char *py_node_text(PyLSPContext *ctx, TSNode node) {
808 if (!ctx || ts_node_is_null(node))
809 return NULL;
810 uint32_t start = ts_node_start_byte(node);
811 uint32_t end = ts_node_end_byte(node);
812 if (end <= start || (int)end > ctx->source_len)
813 return NULL;
814 size_t len = (size_t)(end - start);
815 char *out = (char *)cbm_arena_alloc(ctx->arena, len + 1);
816 if (!out)
817 return NULL;
818 memcpy(out, ctx->source + start, len);
819 out[len] = '\0';
820 return out;
821}
822
823/* ── lambda + dict-literal-dispatch registries ────────────────── */
824

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