fix(kotlin): read a function's signature positionally - #1687
fix(kotlin): read a function's signature positionally#1687danusha2345 wants to merge 16 commits into
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.
…ture # Conflicts: # CHANGELOG.md
…ture # Conflicts: # CHANGELOG.md
|
Merged current |
…ture # Conflicts: # CHANGELOG.md
|
Merged current |
…ture # Conflicts: # CHANGELOG.md
|
Merged current |
…ture # Conflicts: # CHANGELOG.md
|
Merged current |
…ture # Conflicts: # CHANGELOG.md
|
Merged current |
…ture # Conflicts: # CHANGELOG.md
|
Merged current |
…ture # Conflicts: # CHANGELOG.md
|
Merged current |
…ture # Conflicts: # CHANGELOG.md
|
Merged current |
…ture # Conflicts: # CHANGELOG.md
|
Merged current |
…ture # Conflicts: # CHANGELOG.md
|
Merged current |
…ture # Conflicts: # CHANGELOG.md
|
Merged current |
…ture # Conflicts: # CHANGELOG.md
|
Merged current |
…ture # Conflicts: # CHANGELOG.md
|
Merged current |
…ture # Conflicts: # CHANGELOG.md
|
Merged current |
|
Thanks @danusha2345 — this fix is landed via Forge PR #1807 (commit |
Land upstream PR #1687 by danusha2345 (fix commit 6e9bbb2), using the PR tip implementation with only a Rust doc-comment placement cleanup. Read parameter lists and return types positionally in the wasm extractor and native kernel in lockstep, preserving verbatim signature text. Verified on Linux x64 with Node 22.19.0: reproduced three undefined signatures in both backends before the fix, then confirmed all three expected signatures and exact wasm/kernel parity after rebuilding TypeScript and the linux-x64 kernel. All 31 focused tests pass: 15 Kotlin extraction, 6 Kotlin parity, and 10 kernel scaffold checks, with CODEGRAPH_KERNEL_EXPECT=1 for the native suites. Add the upstream #1495 changelog bullet while preserving all other Unreleased entries. Keep EXTRACTION_VERSION unchanged for this bug fix. Co-authored-by: Colby McHenry <colbymchenry@users.noreply.github.com>
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