nushell/crates/nu-plugin-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
..
interface Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
plugin_custom_value_with_source Split the plugin crate (#12563) 2024-04-27 12:08:12 -05:00
util Split the plugin crate (#12563) 2024-04-27 12:08:12 -05:00
context.rs Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
declaration.rs Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
gc.rs Split the plugin crate (#12563) 2024-04-27 12:08:12 -05:00
init.rs Allow plugins to report their own version and store it in the registry (#12883) 2024-06-21 06:27:09 -05:00
lib.rs Split the plugin crate (#12563) 2024-04-27 12:08:12 -05:00
persistent.rs Allow plugins to report their own version and store it in the registry (#12883) 2024-06-21 06:27:09 -05:00
process.rs Split the plugin crate (#12563) 2024-04-27 12:08:12 -05:00
source.rs Split the plugin crate (#12563) 2024-04-27 12:08:12 -05:00
test_util.rs Split the plugin crate (#12563) 2024-04-27 12:08:12 -05:00