Skip to content

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

Description

@hiyizhiyu

Bug Description

tree-sitter-kotlin does not use field names, but getSignature
calls getChildByField(node, 'function_value_parameters'),
which causes the signature of Kotlin methods to always resolve
to undefined.

Fix

The fix is consistent with extractKotlinReturnType:
replace getChildByField with iteration over namedChildren,
matching the target node by its type property.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions