nushell/crates/nu-command/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
..
bytes Internal representation (IR) compiler and evaluator (#13330) 2024-07-10 17:33:59 -07:00
charting Add derive macros for FromValue and IntoValue to ease the use of Values in Rust code (#13031) 2024-06-17 16:05:11 -07:00
conversions Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
database Add and use new Signals struct (#13314) 2024-07-07 22:29:01 +00:00
date Add and use new Signals struct (#13314) 2024-07-07 22:29:01 +00:00
debug Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
env Internal representation (IR) compiler and evaluator (#13330) 2024-07-10 17:33:59 -07:00
experimental Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
filesystem Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
filters Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
formats Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
generators Internal representation (IR) compiler and evaluator (#13330) 2024-07-10 17:33:59 -07:00
hash Add and use new Signals struct (#13314) 2024-07-07 22:29:01 +00:00
help Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
math Internal representation (IR) compiler and evaluator (#13330) 2024-07-10 17:33:59 -07:00
misc Revert "Span ID Refactor (Step 2): Make Call SpanId-friendly (#13268)" (#13292) 2024-07-04 00:02:13 +03:00
network Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
path Path migration 1 (#13309) 2024-07-09 17:25:23 +08:00
platform Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
random Add and use new Signals struct (#13314) 2024-07-07 22:29:01 +00:00
removed Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
shells Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
stor Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
strings Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
system Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
viewers Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
default_context.rs Internal representation (IR) compiler and evaluator (#13330) 2024-07-10 17:33:59 -07:00
example_test.rs Initial --params implementation (#12249) 2024-03-24 15:40:21 -05:00
lib.rs Initial --params implementation (#12249) 2024-03-24 15:40:21 -05:00
progress_bar.rs Replace ExternalStream with new ByteStream type (#12774) 2024-05-16 07:11:18 -07:00
sort_utils.rs Add derive macros for FromValue and IntoValue to ease the use of Values in Rust code (#13031) 2024-06-17 16:05:11 -07:00