From cd3317866abcd3bbfc8075a66b91c78cab5a74de Mon Sep 17 00:00:00 2001 From: xiongjianxu <6457197+xiongjianxu@users.noreply.github.com> Date: Mon, 7 Sep 2026 20:10:58 +0800 Subject: [PATCH] refactor(go): gate the declaration index by interop family, as the shared resolver does (cherry picked from commit 39bcf385f269d2f915824b5af254957c636df9dc) --- graphify/extract.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/graphify/extract.py b/graphify/extract.py index 1c6b97792..bf47e541b 100644 --- a/graphify/extract.py +++ b/graphify/extract.py @@ -6838,13 +6838,13 @@ def _resolve_go_member_calls( # A Go type node id folds in the package directory, so two packages declaring the # same name stay two entries and the single-definition guard below bails: without # import evidence neither one is the answer. - # Only `.go` declarations count: `_callable_class` is corpus-wide, so a same-named - # Java class would both answer a Go receiver and hide that nothing local declares it. + # Only Go declarations count: `_callable_class` is corpus-wide, so a same-named Java + # class would both answer a Go receiver and hide that nothing local declares it. type_def_nids: dict[str, list[str]] = {} node_by_id: dict[str, dict] = {} for n in all_nodes: node_by_id[n.get("id")] = n - if n.get("_callable_class") and str(n.get("source_file", "")).endswith(".go"): + if n.get("_callable_class") and _lang_family(n.get("source_file")) == "go": type_def_nids.setdefault(_key(n.get("label", "")), []).append(n["id"]) method_index: dict[tuple[str, str], list[str]] = {}