feat(cli): Set TREE_SITTER_DEBUG env var on 'tree-sitter parse -d'

This commit is contained in:
Andrew Hlynskyi 2021-06-20 12:14:01 +03:00
parent 4d6701519a
commit 60f0953b65

View file

@ -282,6 +282,11 @@ fn run() -> Result<()> {
.map_or(Vec::new(), |e| e.collect());
let cancellation_flag = util::cancel_on_stdin();
if debug {
// For augmenting debug logging in external scanners
env::set_var("TREE_SITTER_DEBUG", "1");
}
let timeout = matches
.value_of("timeout")
.map_or(0, |t| u64::from_str_radix(t, 10).unwrap());