nushell/crates/nu-protocol/src/ast
Solomon dd56c813f9
preserve variable capture spans in blocks (#15334)
Closes #15160

# User-Facing Changes

Certain "variable not found" errors no longer highlight the surrounding
block.

Before:

```nushell
do {
  match foo {
    _ => $in
  }
}

Error: nu:🐚:variable_not_found

  × Variable not found
   ╭─[entry #1:1:1]
 1 │ ╭─▶ do {
 2 │ │     match foo {
 3 │ │       _ => $in
 4 │ │     }
 5 │ ├─▶ }
   · ╰──── variable not found
```

After:

```nushell
Error: nu:🐚:variable_not_found

  × Variable not found
   ╭─[entry #1:3:10]
 2 │   match foo {
 3 │     _ => $in
   ·          ─┬─
   ·           ╰── variable not found
```
2025-03-20 14:20:28 -04:00
..
attribute.rs Custom command attributes (#14906) 2025-02-11 06:34:51 -06:00
block.rs preserve variable capture spans in blocks (#15334) 2025-03-20 14:20:28 -04:00
call.rs refactor(completion): AST traverse to find the inner-most expression to complete (#14973) 2025-02-06 06:49:13 -06:00
cell_path.rs feat(lsp): show value on hover for const variables and CellPaths (#14940) 2025-01-28 06:17:07 -06:00
expr.rs Custom command attributes (#14906) 2025-02-11 06:34:51 -06:00
expression.rs preserve variable capture spans in blocks (#15334) 2025-03-20 14:20:28 -04:00
import_pattern.rs Document public types in nu-protocol (#12906) 2024-07-11 13:30:12 +02:00
keyword.rs Shrink the size of Expr (#12610) 2024-04-24 15:46:35 +00:00
match_pattern.rs Change how and and or operations are compiled to IR to support custom values (#14653) 2024-12-25 06:12:53 -06:00
mod.rs Custom command attributes (#14906) 2025-02-11 06:34:51 -06:00
operator.rs fix(completion): edge cases of operator completions (#15169) 2025-02-28 19:39:59 +01:00
pipeline.rs Overhaul $in expressions (#13357) 2024-07-17 16:02:42 -05:00
range.rs Shrink the size of Expr (#12610) 2024-04-24 15:46:35 +00:00
table.rs Shrink the size of Expr (#12610) 2024-04-24 15:46:35 +00:00
traverse.rs Custom command attributes (#14906) 2025-02-11 06:34:51 -06:00
unit.rs Add Filesize type (#14369) 2024-11-29 21:24:17 +00:00
value_with_unit.rs Shrink the size of Expr (#12610) 2024-04-24 15:46:35 +00:00