diff options
Diffstat (limited to 'helix-term/build.rs')
-rw-r--r-- | helix-term/build.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/helix-term/build.rs b/helix-term/build.rs index b5d62b28..526cdc41 100644 --- a/helix-term/build.rs +++ b/helix-term/build.rs @@ -1,3 +1,4 @@ +use helix_loader::grammar::{build_grammars, fetch_grammars}; use std::borrow::Cow; use std::process::Command; @@ -14,5 +15,12 @@ fn main() { None => env!("CARGO_PKG_VERSION").into(), }; + if std::env::var("HELIX_DISABLE_AUTO_GRAMMAR_BUILD").is_err() { + fetch_grammars().expect("Failed to fetch tree-sitter grammars"); + build_grammars().expect("Failed to compile tree-sitter grammars"); + } + + println!("cargo:rerun-if-changed=../runtime/grammars/"); + println!("cargo:rustc-env=VERSION_AND_GIT_HASH={}", version); } |