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

Function process_field_decl

internal/cbm/lsp/java_lsp.c:1473–1493  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1471/* ── Top-level walk ───────────────────────────────────────────────── */
1472
1473static void process_field_decl(JavaLSPContext *ctx, TSNode node) {
1474 /* Handled at class-registration time for inner-class scope. Still bind
1475 * declared variables with initializers so static-init blocks resolve
1476 * correctly. */
1477 TSNode type_node = ts_node_child_by_field_name(node, "type", 4);
1478 const CBMType *static_type =
1479 ts_node_is_null(type_node) ? cbm_type_unknown() : java_parse_type_node(ctx, type_node);
1480 uint32_t n = ts_node_named_child_count(node);
1481 for (uint32_t i = 0; i < n; i++) {
1482 TSNode c = ts_node_named_child(node, i);
1483 if (strcmp(ts_node_type(c), "variable_declarator") != 0)
1484 continue;
1485 TSNode name_node = ts_node_child_by_field_name(c, "name", 4);
1486 if (ts_node_is_null(name_node))
1487 continue;
1488 char *fname = java_node_text(ctx, name_node);
1489 if (!fname)
1490 continue;
1491 cbm_scope_bind(ctx->current_scope, fname, static_type);
1492 }
1493}
1494
1495static void process_method_decl(JavaLSPContext *ctx, TSNode node, const char *class_qn,
1496 const char *super_qn) {

Callers 1

java_process_class_declFunction · 0.85

Calls 4

cbm_type_unknownFunction · 0.85
java_parse_type_nodeFunction · 0.85
java_node_textFunction · 0.85
cbm_scope_bindFunction · 0.85

Tested by

no test coverage detected