mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 22:50:14 +02:00
feat(overlay): expose constants with overlay use
(#15081)
# Description `overlay use` now imports constants exported from modules, just like `use`. ```nushell # foo.nu export const a = 1 export const b = 2 ``` - `overlay use foo.nu` being equivalent to `use foo.nu *` and exposing constants `$a = 1` and `$b = 2` - `overlay use foo.nu -p` being equivalent to `use foo.nu` and exposing the constant `$foo = {a: 1, b: 2}` # User-Facing Changes `overlay use` now imports constants just like `use`. # Tests + Formatting - 🟢 toolkit fmt - 🟢 toolkit clippy - 🟢 toolkit test - 🟢 toolkit test stdlib # After Submitting N/A
This commit is contained in:
@ -2977,8 +2977,7 @@ pub fn parse_overlay_new(working_set: &mut StateWorkingSet, call: Box<Call>) ->
|
||||
working_set.add_overlay(
|
||||
overlay_name.as_bytes().to_vec(),
|
||||
module_id,
|
||||
vec![],
|
||||
vec![],
|
||||
ResolvedImportPattern::new(vec![], vec![], vec![], vec![]),
|
||||
false,
|
||||
);
|
||||
|
||||
@ -3192,8 +3191,7 @@ pub fn parse_overlay_use(working_set: &mut StateWorkingSet, call: Box<Call>) ->
|
||||
working_set.add_overlay(
|
||||
final_overlay_name.as_bytes().to_vec(),
|
||||
origin_module_id,
|
||||
definitions.decls,
|
||||
definitions.modules,
|
||||
definitions,
|
||||
has_prefix,
|
||||
);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user