Skip to content

Commit 60f0953

Browse files
committed
feat(cli): Set TREE_SITTER_DEBUG env var on 'tree-sitter parse -d'
1 parent 4d67015 commit 60f0953

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cli/src/main.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,11 @@ fn run() -> Result<()> {
282282
.map_or(Vec::new(), |e| e.collect());
283283
let cancellation_flag = util::cancel_on_stdin();
284284

285+
if debug {
286+
// For augmenting debug logging in external scanners
287+
env::set_var("TREE_SITTER_DEBUG", "1");
288+
}
289+
285290
let timeout = matches
286291
.value_of("timeout")
287292
.map_or(0, |t| u64::from_str_radix(t, 10).unwrap());

0 commit comments

Comments
 (0)