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
{{ message }}
Repository navigation
Commit cb1e370
Browse filesBrowse the repository at this point in the historyBrowse files
fix(kotlin): give companion-object functions graph nodes as class methods
A function declared in a Kotlin `companion object` had no graph node:
the companion minted no definition, so every caller of a class's
factory or parser was lost. Companion functions are now methods of the
enclosing class (`Outer.fn`), the name callers write (`Outer.fn()`, a
bare `fn()` inside the class). The definition walk, the call-scope walk
and the Kotlin LSP all scope them under the class, so the LSP binds
`Outer.fn()` and bare calls and calls made inside the companion source
from the function itself. A named companion is flattened the same way.
Two guards keep the new nodes from collecting wrong callers:
- the Kotlin LSP no longer takes a constructor call `Outer(x)` made
inside the class for a this-dispatch to the secondary constructor;
- the registry applies its receiver-chain guard on the import-filtered
multi-candidate path too, as it already did on the unique-name and
no-import paths: `Uri.parse(s)` no longer binds a project `X.parse`.
Tests: kotlin_typed_calls gains a companion fixture (anonymous and
named companion, cross-file, bare and in-companion calls, two
same-named companion functions) on both resolvers; doc_mentions_jvm
expectations follow the companion members' new node names.
Signed-off-by: chidev <[email protected]>
0 commit comments