Skip to content

Commit 7d671a2

Browse files
runonthespotclaude
andcommitted
chore(deps): bump tree-sitter-dart to 0.2.0 and update grammar bindings
The 0.2.0 release drops the legacy `language()` factory (use the `LANGUAGE` constant like the other modern bindings) and renames grammar nodes. Update ck-chunk's Dart tree-sitter query accordingly: class_definition -> class_declaration, class_member_definition -> method_declaration, local_variable_declaration -> top_level_variable_declaration, plus function/constructor captures. Supersedes dependabot PR #144. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 61e44fb commit 7d671a2

4 files changed

Lines changed: 12 additions & 17 deletions

File tree

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ tree-sitter-c = "0.24"
5858
tree-sitter-cpp = "0.23"
5959
tree-sitter-c-sharp = "0.23"
6060
tree-sitter-zig = "1.1"
61-
tree-sitter-dart = "0.0.4"
61+
tree-sitter-dart = "0.2.0"
6262
tree-sitter-elixir = "0.3"
6363
tree-sitter-md = "0.5.3"
6464
fastembed = { version = "5.13", default-features = false, features = ["hf-hub-rustls-tls", "ort-download-binaries"] }

ck-chunk/queries/dart/tags.scm

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
; Dart chunk definitions using tree-sitter queries
2+
; Node names follow tree-sitter-dart 0.2.0's grammar.
23

34
; Classes, Mixins, Enums
4-
(class_definition) @definition.class
5+
(class_declaration) @definition.class
56
(mixin_declaration) @definition.class
67
(enum_declaration) @definition.class
78

89
; Functions, Methods, Constructors
9-
(lambda_expression) @definition.function
10-
(class_member_definition) @definition.method
11-
; (constructor_signature) @definition.method
10+
(function_declaration) @definition.function
11+
(method_declaration) @definition.method
12+
(constructor_signature) @definition.method
1213

1314
; Top-level variables and constants (module-level)
14-
(local_variable_declaration) @module.text
15+
(top_level_variable_declaration) @module.text

ck-chunk/src/lib.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -371,12 +371,6 @@ fn chunk_generic_with_token_config(text: &str, model_name: Option<&str>) -> Resu
371371
}
372372

373373
pub(crate) fn tree_sitter_language(language: ParseableLanguage) -> Result<tree_sitter::Language> {
374-
// tree-sitter-dart v0.0.4 uses an older API that returns Language directly,
375-
// while newer bindings (v0.24+) require calling .into() on a factory struct.
376-
if language == ParseableLanguage::Dart {
377-
return Ok(tree_sitter_dart::language());
378-
}
379-
380374
if language == ParseableLanguage::Markdown {
381375
return Ok(tree_sitter_md::LANGUAGE.into());
382376
}
@@ -395,7 +389,7 @@ pub(crate) fn tree_sitter_language(language: ParseableLanguage) -> Result<tree_s
395389
ParseableLanguage::CSharp => tree_sitter_c_sharp::LANGUAGE,
396390
ParseableLanguage::Zig => tree_sitter_zig::LANGUAGE,
397391

398-
ParseableLanguage::Dart => unreachable!("Handled above via early return"),
392+
ParseableLanguage::Dart => tree_sitter_dart::LANGUAGE,
399393

400394
ParseableLanguage::Elixir => tree_sitter_elixir::LANGUAGE,
401395

0 commit comments

Comments
 (0)