mirror of
https://github.com/nushell/nushell.git
synced 2025-08-17 20:41:12 +02:00
Fix example result span (#16395)
Refs https://discord.com/channels/601130461678272522/614593951969574961/1403435414416654427 # Description Previously Example result values would have a test span, which would cause hard to understand errors for the code that uses `scope commands`. Now they will have the span that points to `scope commands` invocation. # User-Facing Changes Errors referencing example results will get slightly better. # Tests + Formatting All pass.
This commit is contained in:
@ -100,7 +100,7 @@ impl<'e, 's> ScopeData<'e, 's> {
|
||||
record! {
|
||||
"description" => Value::string(x.description, span),
|
||||
"example" => Value::string(x.example, span),
|
||||
"result" => x.result.unwrap_or(Value::nothing(span)),
|
||||
"result" => x.result.unwrap_or(Value::nothing(span)).with_span(span),
|
||||
},
|
||||
span,
|
||||
)
|
||||
|
Reference in New Issue
Block a user