Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

Downgrade tree-sitter to version 0.20.x

Maximilian Roos2cbff7600da0
diff --git a/Cargo.lock b/Cargo.lock
index 670a65711..dbbbf3780 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -212,13 +212,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5"
[[package]]
name = "cc"
-version = "1.2.44"
+version = "1.0.106"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "37521ac7aabe3d13122dc382493e20c9416f299d2ccd5b3a5340a2570cdeb0f3"
-dependencies = [
- "find-msvc-tools",
- "shlex",
-]
+checksum = "066fce287b1d4eafef758e89e09d724a24808a9196fe9756b8ca90e86d0719a2"
[[package]]
name = "cfg-if"
@@ -717,12 +713,6 @@ dependencies = [
"winapi",
]
-[[package]]
-name = "find-msvc-tools"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "52051878f80a721bb68ebfbc930e07b65ba72f2da88968ea5c06fd6ca3d3a127"
-
[[package]]
name = "fnv"
version = "1.0.7"
@@ -1546,7 +1536,6 @@ version = "1.0.145"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c"
dependencies = [
- "indexmap",
"itoa",
"memchr",
"ryu",
@@ -1616,12 +1605,6 @@ dependencies = [
"dirs",
]
-[[package]]
-name = "shlex"
-version = "1.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
-
[[package]]
name = "similar"
version = "2.7.0"
@@ -1634,12 +1617,6 @@ version = "0.4.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589"
-[[package]]
-name = "streaming-iterator"
-version = "0.1.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2b2231b7c3057d5e4ad0156fb3dc807d900806020c5ffa3ee6ff2c8c76fb8520"
-
[[package]]
name = "strsim"
version = "0.11.1"
@@ -1865,46 +1842,35 @@ checksum = "df8b2b54733674ad286d16267dcfc7a71ed5c776e4ac7aa3c3e2561f7c637bf2"
[[package]]
name = "tree-sitter"
-version = "0.25.10"
+version = "0.20.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "78f873475d258561b06f1c595d93308a7ed124d9977cb26b148c2084a4a3cc87"
+checksum = "e747b1f9b7b931ed39a548c1fae149101497de3c1fc8d9e18c62c1a66c683d3d"
dependencies = [
"cc",
"regex",
- "regex-syntax",
- "serde_json",
- "streaming-iterator",
- "tree-sitter-language",
]
[[package]]
name = "tree-sitter-bash"
-version = "0.25.0"
+version = "0.20.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "871b0606e667e98a1237ebdc1b0d7056e0aebfdc3141d12b399865d4cb6ed8a6"
+checksum = "57da2032c37eb2ce29fd18df7d3b94355fec8d6d854d8f80934955df542b5906"
dependencies = [
"cc",
- "tree-sitter-language",
+ "tree-sitter",
]
[[package]]
name = "tree-sitter-highlight"
-version = "0.25.10"
+version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "adc5f880ad8d8f94e88cb81c3557024cf1a8b75e3b504c50481ed4f5a6006ff3"
+checksum = "042342584c5a7a0b833d9fc4e2bdab3f9868ddc6c4b339a1e01451c6720868bc"
dependencies = [
"regex",
- "streaming-iterator",
- "thiserror 2.0.17",
+ "thiserror 1.0.69",
"tree-sitter",
]
-[[package]]
-name = "tree-sitter-language"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c4013970217383f67b18aef68f6fb2e8d409bc5755227092d32efb0422ba24b8"
-
[[package]]
name = "typeid"
version = "1.0.3"
diff --git a/Cargo.toml b/Cargo.toml
index 40623c3a2..e0837fa6c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -47,9 +47,12 @@ strum = { version = "0.27", features = ["derive"] }
synoptic = "2"
terminal_size = "0.4"
toml = { version = "0.9", features = ["preserve_order"] }
-tree-sitter = "0.25"
-tree-sitter-bash = "0.25"
-tree-sitter-highlight = "0.25"
+# Using 0.20.x due to linking issues in 0.25.x with le16toh/be16toh on some platforms
+# See: https://github.com/tree-sitter/tree-sitter/issues/4186
+# All three crates must use the same version series to avoid native library conflicts
+tree-sitter = "0.20"
+tree-sitter-bash = "0.20"
+tree-sitter-highlight = "0.20"
unicode-width = "0.2"
[build-dependencies]
diff --git a/src/styling.rs b/src/styling.rs
index 0ae4c5648..6d7b29de4 100644
--- a/src/styling.rs
+++ b/src/styling.rs
@@ -362,12 +362,11 @@ pub fn format_bash_with_gutter(content: &str, left_margin: &str) -> String {
"constant", // Constants/flags
];
- let bash_language = tree_sitter_bash::LANGUAGE;
+ let bash_language = tree_sitter_bash::language();
let bash_highlights = tree_sitter_bash::HIGHLIGHT_QUERY;
let mut config = HighlightConfiguration::new(
- bash_language.into(),
- "bash",
+ bash_language,
bash_highlights,
"", // injections query
"", // locals query
@@ -375,8 +374,7 @@ pub fn format_bash_with_gutter(content: &str, left_margin: &str) -> String {
.unwrap_or_else(|_| {
// Fallback: if tree-sitter fails, use plain gutter formatting
HighlightConfiguration::new(
- bash_language.into(),
- "bash",
+ bash_language,
"", // empty query
"",
"",