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

Function go_normalize_struct_body

internal/cbm/extract_defs.c:8239–8245  ·  view source on GitHub ↗

Go structs keep their field_declaration nodes one level below the body that * find_class_body() returns: type_spec's `type` child is a struct_type whose * only named child is a field_declaration_list. Interfaces need no such step -- * interface_type holds its method specs directly, which is why interface members * extracted correctly while every struct field was silently skipped. Normalize *

Source from the content-addressed store, hash-verified

8237 * extracted correctly while every struct field was silently skipped. Normalize
8238 * here, the same way the Java enum_body_declarations step above does. */
8239static TSNode go_normalize_struct_body(TSNode body) {
8240 if (ts_node_is_null(body) || strcmp(ts_node_type(body), "struct_type") != 0) {
8241 return body;
8242 }
8243 TSNode list = cbm_find_child_by_kind(body, "field_declaration_list");
8244 return ts_node_is_null(list) ? body : list;
8245}
8246
8247// Dart: resolve method name from method_signature/function_signature.
8248static TSNode resolve_dart_method_name(TSNode child, const char *ck) {

Callers 1

extract_class_fieldsFunction · 0.85

Calls 1

cbm_find_child_by_kindFunction · 0.85

Tested by

no test coverage detected