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 <noreply@anthropic.com>
This commit is contained in:
ayushcodes10andClaude Sonnet 5 committed 2026-09-16 14:19:12 +05:30
1 parent 91550dd055
commit 7728d99295
1 file changed
+17
+17
View File
@@ -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