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
bug(parsers/kotlin): annotations with arguments are recorded as function calls #1602
KOTLIN_QUERIES["calls"] (kotlin.py:24-30) captures (constructor_invocation). In the tree-sitter Kotlin grammar an annotation with arguments is annotation -> @ + constructor_invocation, so every such annotation is collected as a call from the annotated function:
function_calls for Foo yields Preview (line 3), Deprecated (line 4) and realCall (line 6).
Argument-less annotations (@Composable, @Test) are unaffected — no arguments means no constructor_invocation.
Consequences:
Phantom CALLS edges from any function carrying an annotation with arguments. On Android that is a large share of functions: @Preview(...), @Query(...), @Insert(...), @InstallIn(...), @SerialName(...).
A function whose name matches an annotation's simple name gains spurious inbound callers, which also makes it look alive to find_dead_code.
analyze call-chain / analyze callers traverse these edges, so the noise is user-visible.
Fix direction (untested, from the reporter): a constructor_invocation whose parent chain includes annotation/modifiers is an annotation, not a call — skipping those should filter them.
Activity
github-actions commentedon Aug 13, 2026
Hi! 👋 Join our CodeGraphContext Discord channel to collaborate: https://discord.gg/dR4QY32uYQ
fix(parsers/kotlin): stop recording annotations as function calls (Co…
fix(parsers/kotlin): stop recording annotations as function calls (Co…
feat(compose): flag composables and resolve @Preview into PREVIEWS ed…