fix(kotlin): read a function's signature positionally - #1687
Open
danusha2345 wants to merge 1 commit into
Open
Conversation
) 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1495.
Problem
tree-sitter-kotlin exposes no field names, so
getSignature'sgetChildByField(node, 'function_value_parameters')/'type'reads always missed and every Kotlin function and method was indexed with no signature —codegraph_explore,nodeand the viewer showed bare names.Change
Find the parameter list and the return type positionally, the way
extractKotlinReturnTypealready does: thefunction_value_parameterschild, then theuser_type/nullable_type/function_typethat follows it before the body. The kernel (kotlin.rs) gets the samesignature_of, so both arms emit(params): ReturnTypeverbatim and parity pins it.Verification
kernel-kotlin-parity,kernel-scaffold,extraction: 638 passed with the rebuilt kernel.Re-index Kotlin projects after upgrading.
🤖 Generated with Claude Code