fix(generate): add tree-sitter to the dev-dependencies of the Cargo.toml

(cherry picked from commit 4d3d1f0df2)
This commit is contained in:
Amaan Qureshi 2024-09-07 17:43:46 -04:00
parent 43e16dd75c
commit dce9bedc48

View file

@ -334,10 +334,12 @@ pub fn generate_grammar_files(
.ok_or_else(|| anyhow!("Failed to find the end of the `tree-sitter` version in Cargo.toml"))?;
let cargo_toml = format!(
"{}{}{}",
"{}{}{}\n{}\n{}",
&cargo_toml[..start_index],
"tree-sitter-language = \"0.1.0\"",
&cargo_toml[version_end_index + 1..],
"[dev-dependencies]",
"tree-sitter = \"0.23\"",
);
write_file(path, cargo_toml)?;