#tree-sitter #kotlin #incremental-parser

tree-sitter-kotlin-updated

Kotlin grammar for the tree-sitter parsing library

1 unstable release

0.1.0 Sep 11, 2025

#52 in #kotlin

Download history 1/week @ 2025-12-20 23/week @ 2026-01-10 7/week @ 2026-01-17 5/week @ 2026-01-24 99/week @ 2026-01-31 47/week @ 2026-02-07 3/week @ 2026-02-14 15/week @ 2026-02-21 18/week @ 2026-02-28 50/week @ 2026-03-07 28/week @ 2026-03-14 23/week @ 2026-03-21 15/week @ 2026-03-28 23/week @ 2026-04-04

90 downloads per month

MIT license

32MB
1M SLoC

C 1M SLoC // 0.0% comments JavaScript 1K SLoC // 0.1% comments Scheme 294 SLoC // 0.1% comments Rust 37 SLoC // 0.3% comments

This crate provides kotlin language support for the tree-sitter parsing library.

Typically, you will use the language function to add this language to a tree-sitter Parser, and then use the parser to parse some code:

let code = "";
let mut parser = tree_sitter::Parser::new();
parser.set_language(&tree_sitter_kotlin::language()).expect("Error loading kotlin grammar");
let tree = parser.parse(code, None).unwrap();

Kotlin Grammar for Tree-sitter

This crate provides a Kotlin grammar for the tree-sitter parsing library. To use this crate, add it to the [dependencies] section of your Cargo.toml file:

tree-sitter = "0.23"
tree-sitter-kotlin = "0.3.9"

Typically, you will use the language function to add this grammar to a tree-sitter Parser, and then use the parser to parse some code:

let code = r#"
  data class Point(
    val x: Int,
    val y: Int
  )
"#;
let mut parser = Parser::new();
parser.set_language(&tree_sitter_kotlin::language()).expect("Error loading Kotlin grammar");
let parsed = parser.parse(code, None);

Dependencies

~2.6–4MB
~77K SLoC