From 7728d99295e2b75ea693f6b5d013e653d73569f7 Mon Sep 17 00:00:00 2001 From: ayushcodes10 Date: Wed, 16 Sep 2026 14:19:12 +0530 Subject: [PATCH] Capture the receiver for a two segment Kotlin navigation call Still toward issue 1698, still no behavior change: the variable is computed but nothing reads it yet. A capitalized two segment receiver (MessageHelper in MessageHelper.isRoomClosed()) names an object singleton or a class or companion member, statically unambiguous in source. Captured separately from member_receiver so the existing in file bare name lookup and its capitalized receiver deferral guard are untouched; threading this into raw_calls for a dedicated cross file resolver lands next. Co-Authored-By: Claude Sonnet 5 --- graphify/extractors/engine.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/graphify/extractors/engine.py b/graphify/extractors/engine.py index d67df62ff..10671a9e8 100644 --- a/graphify/extractors/engine.py +++ b/graphify/extractors/engine.py @@ -5896,6 +5896,23 @@ def _extract_generic( segments = _kotlin_nav_identifier_segments(first, source) if segments is not None and len(segments) >= 3: kotlin_qualified_prefix = ".".join(segments[:-1]) + # #1698: the plain `Receiver.method()` shape (exactly + # two segments) is neither a fully qualified name nor + # eligible for member_receiver (same reasoning as + # above). A capitalized receiver here is an object + # singleton or a class/companion member reference — + # statically unambiguous, no type inference needed — + # captured separately so a dedicated cross-file pass + # can resolve it by declared-type name when the in + # file bare name lookup below finds nothing (the + # cross-file case this issue is about; the same-file + # case already resolves through that lookup and never + # reaches raw_calls at all). + elif ( + segments is not None and len(segments) == 2 + and segments[0][:1].isupper() + ): + kotlin_object_receiver = segments[0] elif config.ts_module == "tree_sitter_scala": # Scala: first child first = node.children[0] if node.children else None