fix(kotlin): read a function's signature positionally (#1495) - #1807
Merged
Conversation
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.
This was referenced Sep 9, 2026
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.
Summary
Lands upstream #1687 (
danusha2345:fix/1495-kotlin-signature) onto currentmainas a Forge PR authored by Colby McHenry. Prefer landing over reinventing.Problem
tree-sitter-kotlinexposes no field names, sogetSignature'sgetChildByField(node, 'function_value_parameters')/'type'reads always missed and every Kotlin function/method was indexed withsignature: undefined.Fix
Find the parameter list and return type positionally (same approach as
extractKotlinReturnType) in both:src/extraction/languages/kotlin.ts(wasm)codegraph-kernel/src/kotlin.rs(signature_of, lockstep)Only Forge delta vs #1687 tip: Rust doc-comment placement so
signature_of/return_type_ofkeep their own docs.Linux verify (fail → pass)
Repro fixture (class method + top-level fun):
greet(name: String): StringnoReturn(x: Int)topLevel(a: Int, b: Int): IntUndefined signatures: 3 → 0. Wasm/kernel parity PASS. Focused tests: 31 passed (Kotlin extraction + kernel-kotlin-parity + kernel-scaffold) with
CODEGRAPH_KERNEL_EXPECT=1.Credits
Thanks @danusha2345 for #1687. This PR supersedes it once merged (agency pattern: do not merge that fork tip directly).