fix(parser): span of keyword expression (#14928)

# Description

This PR fixes #14816 , so that expression-contains-position check won't
need special treatment for keyword expressions.
e.g.

```nushell
overlay use foo as bar
                  # |_______ cursor here

if true { } else { }
                # |_______ here
```

as mentioned in #14924

# User-Facing Changes

# Tests + Formatting

# After Submitting
This commit is contained in:
zc he
2025-01-27 23:13:48 +08:00
committed by GitHub
parent 5ca4e903c8
commit b53271b86a
3 changed files with 19 additions and 8 deletions

View File

@ -919,7 +919,7 @@ pub fn parse_multispan_value(
Expression::new(
working_set,
Expr::Keyword(Box::new(keyword.clone())),
arg_span,
keyword.span.merge(keyword.expr.span),
keyword.expr.ty,
)
}