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

Function cs_process_assignment

internal/cbm/lsp/cs_lsp.c:1934–1953  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1932}
1933
1934static void cs_process_assignment(CSLSPContext *ctx, TSNode node) {
1935 TSNode lhs = ts_node_child_by_field_name(node, "left", 4);
1936 TSNode rhs = ts_node_child_by_field_name(node, "right", 5);
1937 if (ts_node_is_null(lhs) || ts_node_is_null(rhs))
1938 return;
1939 if (!cs_node_is(lhs, "identifier"))
1940 return;
1941 char *vname = cs_node_text(ctx, lhs);
1942 if (!vname)
1943 return;
1944 const char *callable_qn = cs_resolve_callable_value(ctx, rhs, NULL);
1945 (void)cs_eval_expr_type(ctx, rhs);
1946 if (callable_qn) {
1947 cbm_scope_update_callable(ctx->current_scope, vname, callable_qn);
1948 } else {
1949 /* An ordinary or ambiguous reassignment clears stale callable identity
1950 * while retaining the best type already known for the variable. */
1951 cbm_scope_update_callable(ctx->current_scope, vname, NULL);
1952 }
1953}
1954
1955/* ── call resolution + emit ─────────────────────────────────────── */
1956

Callers 1

cs_resolve_calls_in_nodeFunction · 0.85

Calls 5

cs_node_isFunction · 0.85
cs_node_textFunction · 0.85
cs_eval_expr_typeFunction · 0.85

Tested by

no test coverage detected