mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 22:50:14 +02:00
add $.extra_usage
to modules (#11649)
- should fix https://github.com/nushell/nushell/issues/11648 # Description this PR - adds a test that should pass but fails - adds `$.extra_usage` to the output of `scope modules`, fixing both the new test and the linked issue # User-Facing Changes `$.extra_usage` is now a column in the output of `scope modules` # Tests + Formatting a new test case has been added to `correct_scope_modules_fields` # After Submitting
This commit is contained in:
@ -504,10 +504,9 @@ impl<'e, 's> ScopeData<'e, 's> {
|
||||
|block_id| Value::block(block_id, span),
|
||||
);
|
||||
|
||||
let module_usage = self
|
||||
let (module_usage, module_extra_usage) = self
|
||||
.engine_state
|
||||
.build_module_usage(*module_id)
|
||||
.map(|(usage, _)| usage)
|
||||
.unwrap_or_default();
|
||||
|
||||
Value::record(
|
||||
@ -520,6 +519,7 @@ impl<'e, 's> ScopeData<'e, 's> {
|
||||
"constants" => Value::list(export_consts, span),
|
||||
"env_block" => export_env_block,
|
||||
"usage" => Value::string(module_usage, span),
|
||||
"extra_usage" => Value::string(module_extra_usage, span),
|
||||
"module_id" => Value::int(*module_id as i64, span),
|
||||
},
|
||||
span,
|
||||
|
Reference in New Issue
Block a user