Skip to content

Commit

Permalink
Bump tree-sitter to 0.23.0
Browse files Browse the repository at this point in the history
Tree-sitter 0.23 introduces a breaking change in the generated rust
binding API: instead of exporting a `language()` function, they export a
`LANGUAGE` constant. This updates the base library and all the grammars
to match.
  • Loading branch information
gregoire-mullvad committed Sep 27, 2024
1 parent 2756090 commit 336aa5a
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 34 deletions.
57 changes: 34 additions & 23 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 8 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,24 @@ rust-version = "1.79.0"

[dependencies]
miette = { version = "7.2.0", features = ["fancy"] }
tree-sitter = "0.22.6"
tree-sitter-javascript = "0.21.2"
tree-sitter-python = "0.21.0"
tree-sitter = "0.23.0"
unic-ucd-name = "0.9.0"
toml = "0.8.14"
serde = { version = "1.0.203", features = ["derive"] }
walkdir = "2.5.0"
anyhow = "1.0.86"
glob = "0.3.1"
phf = { version = "0.11.2", features = ["macros"] }
tree-sitter-rust = "0.21.2"
clap = { version = "4.5.16", features = ["derive"] }
log = "0.4.22"
env_logger = "0.11.5"
tree-sitter-go = "0.21.2"
tree-sitter-swift = "0.5.0"

# Grammars
tree-sitter-go = "0.23.1"
tree-sitter-javascript = "0.23.0"
tree-sitter-python = "0.23.2"
tree-sitter-rust = "0.23.0"
tree-sitter-swift = "0.6.0"

[dev-dependencies]
trycmd = "0.15.5"
10 changes: 5 additions & 5 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ impl Language {

pub fn grammar(&self) -> tree_sitter::Language {
match self {
Language::Go => tree_sitter_go::language(),
Language::Javascript => tree_sitter_javascript::language(),
Language::Python => tree_sitter_python::language(),
Language::Rust => tree_sitter_rust::language(),
Language::Swift => tree_sitter_swift::language(),
Language::Go => tree_sitter_go::LANGUAGE.into(),
Language::Javascript => tree_sitter_javascript::LANGUAGE.into(),
Language::Python => tree_sitter_python::LANGUAGE.into(),
Language::Rust => tree_sitter_rust::LANGUAGE.into(),
Language::Swift => tree_sitter_swift::LANGUAGE.into(),
}
}
}
Expand Down

0 comments on commit 336aa5a

Please sign in to comment.