Problem
Kotlin function extraction drops extension functions whose receiver type is generic:
| source |
extracted |
fun String.a(): Int { … } |
a ✓ |
public fun Collection<CodeBlock>.joinToCode(separator: CharSequence = ", "): CodeBlock { … } |
nothing |
fun <T> List<T>.b(): Int { … } |
nothing |
fun Map<String, Int>.c() = 1 |
nothing |
Direct StructuralExtractor("kotlin", LANGUAGE_DEFINITIONS).splice(...) on each shape.
Impact
Fix direction
The receiver type in func_start needs to accept a bounded generic argument list (<…>, nesting ≤ 2) before the .name(, plus an optional type-parameter list after fun. Follow gitgalaxy/standards/how_to_add_a_language.md (ReDoS rules), add valid/invalid/pathological cases to tests/extraction/languages/test_kotlin.py, and verify with tree_sitter_accuracy_audit.py --lang kotlin.
Problem
Kotlin function extraction drops extension functions whose receiver type is generic:
fun String.a(): Int { … }a✓public fun Collection<CodeBlock>.joinToCode(separator: CharSequence = ", "): CodeBlock { … }fun <T> List<T>.b(): Int { … }fun Map<String, Int>.c() = 1Direct
StructuralExtractor("kotlin", LANGUAGE_DEFINITIONS).splice(...)on each shape.Impact
joinToCode,asClassName-style helpers.import com.squareup.kotlinpoet.joinToCodefound only a test function of the same name.Fix direction
The receiver type in
func_startneeds to accept a bounded generic argument list (<…>, nesting ≤ 2) before the.name(, plus an optional type-parameter list afterfun. Followgitgalaxy/standards/how_to_add_a_language.md(ReDoS rules), add valid/invalid/pathological cases totests/extraction/languages/test_kotlin.py, and verify withtree_sitter_accuracy_audit.py --lang kotlin.