fix(lsp): when desugaring and/or chains we should use the whole span of the chain for the generated BinOp locations

This commit is contained in:
rvcas 2023-11-28 19:19:56 -05:00
parent 7015a9badc
commit 832ca81a8c
No known key found for this signature in database
GPG Key ID: C09B64E263F7D68C
2 changed files with 3 additions and 2 deletions

View File

@ -365,7 +365,8 @@ impl TypedExpr {
TypedExpr::BinOp { left, right, .. } => left TypedExpr::BinOp { left, right, .. } => left
.find_node(byte_index) .find_node(byte_index)
.or_else(|| right.find_node(byte_index)), .or_else(|| right.find_node(byte_index))
.or(Some(Located::Expression(self))),
TypedExpr::Assignment { value, pattern, .. } => pattern TypedExpr::Assignment { value, pattern, .. } => pattern
.find_node(byte_index, &value.tipo()) .find_node(byte_index, &value.tipo())

View File

@ -1661,7 +1661,7 @@ impl<'a, 'b> ExprTyper<'a, 'b> {
.into_iter() .into_iter()
.rev() .rev()
.reduce(|acc, typed_expression| TypedExpr::BinOp { .reduce(|acc, typed_expression| TypedExpr::BinOp {
location: Span::empty(), location,
tipo: bool(), tipo: bool(),
name, name,
left: typed_expression.into(), left: typed_expression.into(),