You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(extract): Go struct fields are never extracted — find_class_body stops one level above field_declaration_list
Status: fix open — PR #1940 (descend struct_type → field_declaration_list before extract_class_fields() iterates + skip blank-identifier _ padding; stacked on #1937). Measured: 0 → 4533 Go Field nodes, each with its declared type in return_type. Ordering: must land with #1937 (cross-language refs) and#1944 (bare-ref-vs-Field, found while validating this) under it — see below.
What happens
go_field_types[] = {"field_declaration"} is registered in lang_specs.c; the extractor just never reaches those nodes. find_class_body() returns type_spec's type child:
interface: interface_type holds its method specs directly → always worked;
struct: struct_type's only named child is a field_declaration_list, one level above the field_declarations the member loop matches → every field silently skipped. parse_partial flags nothing (the file parses clean).
Damage measured (~1150-file Go repo)
source
graph
Go struct field declarations
~5055 (4846 named, 208 embedded)
0
Field nodes in the whole graph
—
850, all C/C++
Go interface method declarations
342
present
No Config.Timeout, no Event.PID; trace_path data-flow stops at the struct; nothing exists for a declared-type resolver (#1927's guard rationale) to consult; func-typed-field call dispatch has no node to reach — probed with type Router struct{ fn func(int) error }: r.fn(4) binds Router.fn once fields exist, and without them the call is dropped or free to be hijacked by an unrelated same-named symbol.
Actual: Struct Config, Interface Reader, both interface Methods — no node for Name/Timeout/Nested. After the fix: three Field nodes with return_typestring/int/*Config; interface members unchanged.
Detection recipe
SELECT CASE WHEN file_path LIKE'%.go' THEN 'go' ELSE 'other' END, count(*)
FROM nodes WHERE label='Field'GROUP BY1;
Zero go rows on a struct-bearing Go repo is this bug.
Why this must not land alone (measured, twice)
Recovering ~4.5k nodes named err/ctx/path/_ exposes the reference resolvers:
With both guards under it the full stack ends below main's reference totals (USAGE 29198 → 21035, WRITES 2681 → 774) while adding the nodes. Embedded fields (~208) stay unrepresented by construction (no name child) — separate follow-up; lsp_embed_dispatch unaffected. Blank _ padding fields are skipped (55 nodes, 241 collision edges otherwise).
Related: #451 (same feature, Python), #1939 (field-chain dispatch, consumes these nodes); tracked in #1932.
fix(extract): Go struct fields are never extracted —
find_class_bodystops one level abovefield_declaration_listStatus: fix open — PR #1940 (descend
struct_type→field_declaration_listbeforeextract_class_fields()iterates + skip blank-identifier_padding; stacked on #1937). Measured: 0 → 4533 GoFieldnodes, each with its declared type inreturn_type. Ordering: must land with #1937 (cross-language refs) and #1944 (bare-ref-vs-Field, found while validating this) under it — see below.What happens
go_field_types[] = {"field_declaration"}is registered inlang_specs.c; the extractor just never reaches those nodes.find_class_body()returnstype_spec'stypechild:interface_typeholds its method specs directly → always worked;struct_type's only named child is afield_declaration_list, one level above thefield_declarations the member loop matches → every field silently skipped.parse_partialflags nothing (the file parses clean).Damage measured (~1150-file Go repo)
Fieldnodes in the whole graphNo
Config.Timeout, noEvent.PID;trace_pathdata-flow stops at the struct; nothing exists for a declared-type resolver (#1927's guard rationale) to consult; func-typed-field call dispatch has no node to reach — probed withtype Router struct{ fn func(int) error }:r.fn(4)bindsRouter.fnonce fields exist, and without them the call is dropped or free to be hijacked by an unrelated same-named symbol.Minimal reproduction
Actual:
Struct Config,Interface Reader, both interfaceMethods — no node forName/Timeout/Nested. After the fix: threeFieldnodes withreturn_typestring/int/*Config; interface members unchanged.Detection recipe
Zero
gorows on a struct-bearing Go repo is this bug.Why this must not land alone (measured, twice)
Recovering ~4.5k nodes named
err/ctx/path/_exposes the reference resolvers:Twith 3013 edges. A bare identifier can never denote a Go field (selector-only access), so fix(pipeline): a bare Go reference never binds a struct Field #1944 vetoes those binds.With both guards under it the full stack ends below main's reference totals (USAGE 29198 → 21035, WRITES 2681 → 774) while adding the nodes. Embedded fields (~208) stay unrepresented by construction (no
namechild) — separate follow-up;lsp_embed_dispatchunaffected. Blank_padding fields are skipped (55 nodes, 241 collision edges otherwise).Related: #451 (same feature, Python), #1939 (field-chain dispatch, consumes these nodes); tracked in #1932.