Merge pull request #1186 from ahlinc/feat/debug-env-var

feat(cli): Set TREE_SITTER_DEBUG env var on 'tree-sitter parse -d'
This commit is contained in:
Max Brunsfeld 2021-06-30 08:58:53 -07:00 committed by GitHub
commit 23fdbf0e72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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());