From 6838ca1e146f25c9fc016e3e7abe13aaff625bd6 Mon Sep 17 00:00:00 2001 From: Hythera <87016780+Hythera@users.noreply.github.com> Date: Thu, 2 Apr 2026 19:51:39 +0200 Subject: [PATCH] tree-sitter: 0.25.10 -> 0.26.8 changelog: https://github.com/tree-sitter/tree-sitter/releases/tag/v0.26.8 diff: https://github.com/tree-sitter/tree-sitter/compare/v0.25.10...v0.26.8 Co-authored-by: Eldritch Cookie --- .../tools/parsing/tree-sitter/default.nix | 7 +- .../tree-sitter/remove-web-interface.patch | 68 ++++++++++--------- 2 files changed, 40 insertions(+), 35 deletions(-) diff --git a/pkgs/development/tools/parsing/tree-sitter/default.nix b/pkgs/development/tools/parsing/tree-sitter/default.nix index b54f3967ead2..a0683acf66ad 100644 --- a/pkgs/development/tools/parsing/tree-sitter/default.nix +++ b/pkgs/development/tools/parsing/tree-sitter/default.nix @@ -112,17 +112,17 @@ let in rustPlatform.buildRustPackage (finalAttrs: { pname = "tree-sitter"; - version = "0.25.10"; + version = "0.26.8"; src = fetchFromGitHub { owner = "tree-sitter"; repo = "tree-sitter"; tag = "v${finalAttrs.version}"; - hash = "sha256-aHszbvLCLqCwAS4F4UmM3wbSb81QuG9FM7BDHTu1ZvM="; + hash = "sha256-fcFEfoALrbpBD6rWogxJ7FNVlvDQgswoX9ylRgko+8Q="; fetchSubmodules = true; }; - cargoHash = "sha256-4R5Y9yancbg/w3PhACtsWq0+gieUd2j8YnmEj/5eqkg="; + cargoHash = "sha256-9FeWnWWPUWmMF15Psmul8GxGv2JceHWc2WZPmOr81gw="; buildInputs = [ installShellFiles @@ -131,6 +131,7 @@ rustPlatform.buildRustPackage (finalAttrs: { openssl ]; nativeBuildInputs = [ + rustPlatform.bindgenHook which ] ++ lib.optionals webUISupport [ diff --git a/pkgs/development/tools/parsing/tree-sitter/remove-web-interface.patch b/pkgs/development/tools/parsing/tree-sitter/remove-web-interface.patch index 9f3504f33b53..7a3880a42806 100644 --- a/pkgs/development/tools/parsing/tree-sitter/remove-web-interface.patch +++ b/pkgs/development/tools/parsing/tree-sitter/remove-web-interface.patch @@ -1,9 +1,39 @@ -diff --git a/cli/src/lib.rs b/cli/src/lib.rs -index 4a00747e..e17d253b 100644 ---- a/cli/src/lib.rs -+++ b/cli/src/lib.rs -@@ -6,7 +6,6 @@ pub mod highlight; - pub mod init; +diff --git a/crates/cli/src/main.rs b/crates/cli/src/main.rs +index c6d845fc..d1aa1b1c 100644 +--- a/crates/cli/src/main.rs ++++ b/crates/cli/src/main.rs +@@ -24,7 +24,6 @@ use tree_sitter_cli::{ + input::{get_input, get_tmp_source_file, CliInput}, + logger, + parse::{self, ParseDebugType, ParseFileOptions, ParseOutput, ParseTheme}, +- playground, + query::{self, QueryFileOptions}, + tags::{self, TagsOptions}, + test::{self, TestOptions, TestStats, TestSummary}, +@@ -1933,16 +1932,8 @@ impl Tags { + + impl Playground { + fn run(self, current_dir: &Path) -> Result<()> { +- let grammar_path = self.grammar_path.as_deref().map_or(current_dir, Path::new); +- +- if let Some(export_path) = self.export { +- playground::export(grammar_path, &export_path)?; +- } else { +- let open_in_browser = !self.quiet; +- playground::serve(grammar_path, open_in_browser)?; +- } +- +- Ok(()) ++ println!("ERROR: web-ui is not available in this nixpkgs build; enable the webUISupport"); ++ std::process::exit(1); + } + } + +diff --git a/crates/cli/src/tree_sitter_cli.rs b/crates/cli/src/tree_sitter_cli.rs +index 3960d961..55f8e2e4 100644 +--- a/crates/cli/src/tree_sitter_cli.rs ++++ b/crates/cli/src/tree_sitter_cli.rs +@@ -6,7 +6,6 @@ pub mod init; pub mod input; pub mod logger; pub mod parse; @@ -11,29 +41,3 @@ index 4a00747e..e17d253b 100644 pub mod query; pub mod query_testing; pub mod tags; -diff --git a/cli/src/main.rs b/cli/src/main.rs -index 1758fada..4bc56cc2 100644 ---- a/cli/src/main.rs -+++ b/cli/src/main.rs -@@ -23,7 +23,7 @@ use tree_sitter_cli::{ - input::{get_input, get_tmp_source_file, CliInput}, - logger, - parse::{self, ParseDebugType, ParseFileOptions, ParseOutput, ParseTheme}, -- playground, query, -+ query, - tags::{self, TagsOptions}, - test::{self, TestOptions, TestStats}, - test_highlight, test_tags, util, version, wasm, -@@ -1614,10 +1614,8 @@ impl Tags { - - impl Playground { - fn run(self, current_dir: &Path) -> Result<()> { -- let open_in_browser = !self.quiet; -- let grammar_path = self.grammar_path.as_deref().map_or(current_dir, Path::new); -- playground::serve(grammar_path, open_in_browser)?; -- Ok(()) -+ println!("ERROR: web-ui is not available in this nixpkgs build; enable the webUISupport"); -+ std::process::exit(1); - } - } -