From c3e29ec6ad6c8eff09760346734af3f923b42d61 Mon Sep 17 00:00:00 2001 From: Wilfred Hughes Date: Fri, 26 Nov 2021 23:18:17 -0800 Subject: [PATCH] Make build script more precise in its paths to watch --- build.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/build.rs b/build.rs index 895e3529c..42b759b7c 100644 --- a/build.rs +++ b/build.rs @@ -47,10 +47,6 @@ impl TreeSitterParser { } fn main() { - // Only rerun if files in the vendor/ directory change. - // TODO: use specific source directories instead. - println!("cargo:rerun-if-changed=vendor"); - let parsers = vec![ TreeSitterParser { name: "tree-sitter-bash".into(), @@ -159,5 +155,11 @@ fn main() { }, ]; + // Only rerun if relevant files in the vendor/ directory change. + println!("cargo:rerun-if-changed=vendor/highlights"); + for parser in &parsers { + println!("cargo:rerun-if-changed={}", parser.src_dir); + } + parsers.par_iter().for_each(|p| p.build()); }