Skip to content

fix(kotlin): read a function's signature positionally - #1687

Open
danusha2345 wants to merge 1 commit into
colbymchenry:mainfrom
danusha2345:fix/1495-kotlin-signature
Open

fix(kotlin): read a function's signature positionally#1687
danusha2345 wants to merge 1 commit into
colbymchenry:mainfrom
danusha2345:fix/1495-kotlin-signature

Conversation

@danusha2345

Copy link
Copy Markdown
Contributor

Fixes #1495.

Problem

tree-sitter-kotlin exposes no field names, so getSignature's getChildByField(node, 'function_value_parameters') / 'type' reads always missed and every Kotlin function and method was indexed with no signature — codegraph_explore, node and the viewer showed bare names.

Change

Find the parameter list and the return type positionally, the way extractKotlinReturnType already does: the function_value_parameters child, then the user_type / nullable_type / function_type that follows it before the body. The kernel (kotlin.rs) gets the same signature_of, so both arms emit (params): ReturnType verbatim and parity pins it.

Verification

  • kernel-kotlin-parity, kernel-scaffold, extraction: 638 passed with the rebuilt kernel.
  • Full suite: 236 files, 4229 passed, 11 skipped.

Re-index Kotlin projects after upgrading.

🤖 Generated with Claude Code

)

tree-sitter-kotlin exposes no field names, so getSignature's
getChildByField reads always missed and every Kotlin function and method
was indexed without a signature. Find the parameter list and the return
type by position, the way extractKotlinReturnType already does — in the
wasm extractor and the kernel together.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Kotlin] getSignature returns undefined due to getChildByField on fieldless grammar

1 participant