nushell/crates/nu-engine/src
Devyn Cairns f65bc97a54
Update config directly at assignment (#13332)
# Description

Allows `Stack` to have a modified local `Config`, which is updated
immediately when `$env.config` is assigned to. This means that even
within a script, commands that come after `$env.config` changes will
always see those changes in `Stack::get_config()`.

Also fixed a lot of cases where `engine_state.get_config()` was used
even when `Stack` was available.

Closes #13324.

# User-Facing Changes
- Config changes apply immediately after the assignment is executed,
rather than whenever config is read by a command that needs it.
- Potentially slower performance when executing a lot of lines that
change `$env.config` one after another. Recommended to get `$env.config`
into a `mut` variable first and do modifications, then assign it back.
- Much faster performance when executing a script that made
modifications to `$env.config`, as the changes are only parsed once.

# Tests + Formatting
All passing.

# After Submitting
- [ ] release notes
2024-07-11 06:09:33 -07:00
..
compile Internal representation (IR) compiler and evaluator (#13330) 2024-07-10 17:33:59 -07:00
call_ext.rs Internal representation (IR) compiler and evaluator (#13330) 2024-07-10 17:33:59 -07:00
closure_eval.rs Use Arc for environment variables on the stack (#13333) 2024-07-10 17:34:50 -07:00
column.rs Use Record's public API in a bunch of places (#10927) 2023-11-08 14:24:00 +01:00
command_prelude.rs Internal representation (IR) compiler and evaluator (#13330) 2024-07-10 17:33:59 -07:00
documentation.rs Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
env.rs Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
eval_helpers.rs Internal representation (IR) compiler and evaluator (#13330) 2024-07-10 17:33:59 -07:00
eval_ir.rs quick fix up for ir pr as_refs (#13340) 2024-07-11 09:19:06 +08:00
eval.rs Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
glob_from.rs Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
lib.rs Internal representation (IR) compiler and evaluator (#13330) 2024-07-10 17:33:59 -07:00
scope.rs Use CommandType in more places (#12832) 2024-05-18 23:37:31 +00:00