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

Function py_bind_module_class

internal/cbm/lsp/py_lsp.c:4758–4776  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4756#endif
4757
4758static void py_bind_module_class(PyLSPContext *ctx, TSNode class_node) {
4759 if (!ctx || ts_node_is_null(class_node) || !ctx->module_qn)
4760 return;
4761 TSNode name_node = ts_node_child_by_field_name(class_node, "name", 4);
4762 char *name = py_node_text(ctx, name_node);
4763 if (!name || !name[0]) {
4764 py_disable_callable_value_proof(ctx);
4765 return;
4766 }
4767 const char *qn = cbm_arena_sprintf(ctx->arena, "%s.%s", ctx->module_qn, name);
4768 if (!qn) {
4769 py_disable_callable_value_proof(ctx);
4770 py_scope_bind(ctx, name, cbm_type_unknown());
4771 return;
4772 }
4773 const CBMRegisteredType *type = cbm_registry_lookup_type(ctx->registry, qn);
4774 py_scope_bind(ctx, name,
4775 type ? cbm_type_named(ctx->arena, type->qualified_name) : cbm_type_unknown());
4776}
4777
4778/* Preserve the historical registry fallback for an unshadowed function: it
4779 * keeps ordinary direct-call resolution stable. When a definition actually

Callers 1

py_lsp_process_fileFunction · 0.85

Calls 7

py_node_textFunction · 0.85
py_scope_bindFunction · 0.85
cbm_type_unknownFunction · 0.85
cbm_registry_lookup_typeFunction · 0.85
cbm_type_namedFunction · 0.85
cbm_arena_sprintfFunction · 0.50

Tested by

no test coverage detected