allow for $in to affect environment (#6649)

* allow for `$in` to affect environment

* fix for vars, overlays, env_hidden

* fmt

* carry over variables properly

* add test

* modify name, remove redundant

* fmt
This commit is contained in:
pwygab
2022-10-13 17:04:34 +08:00
committed by GitHub
parent d40a73aafe
commit 90ba39184a
3 changed files with 51 additions and 6 deletions

View File

@ -5367,6 +5367,15 @@ fn wrap_expr_with_collect(working_set: &mut StateWorkingSet, expr: &Expression)
custom_completion: None,
}));
output.push(Argument::Named((
Spanned {
item: "keep-env".to_string(),
span: Span::new(0, 0),
},
None,
None,
)));
// The containing, synthetic call to `collect`.
// We don't want to have a real span as it will confuse flattening
// The args are where we'll get the real info