Skip to main content

Kotlin extractor

The Kotlin extractor maps tree-sitter Kotlin CST nodes to canonical concepts. The Kotlin grammar declares no field names at all, so every name is recovered from the first identifier-like child: class names from type_identifier, function and variable names from simple_identifier.

Detected concepts

Example

Renaming a function:
Running differens old.kt new.kt:

Known limitations

  • The grammar’s missing field names mean label recovery is positional: a declaration with two identifier children can mislabel in exotic syntax.
  • Extension functions report as functions; the receiver type is part of the structure, not the name.