feat(lsp): find_node should traverse tail of list
This commit is contained in:
parent
98bd61a0cd
commit
e02bc2a58a
|
@ -371,12 +371,17 @@ impl TypedExpr {
|
|||
|
||||
TypedExpr::Tuple {
|
||||
elems: elements, ..
|
||||
}
|
||||
| TypedExpr::List { elements, .. } => elements
|
||||
} => elements
|
||||
.iter()
|
||||
.find_map(|e| e.find_node(byte_index))
|
||||
.or(Some(Located::Expression(self))),
|
||||
|
||||
TypedExpr::List { elements, tail, .. } => elements
|
||||
.iter()
|
||||
.find_map(|e| e.find_node(byte_index))
|
||||
.or_else(|| tail.as_ref().and_then(|t| t.find_node(byte_index)))
|
||||
.or(Some(Located::Expression(self))),
|
||||
|
||||
TypedExpr::Call { fun, args, .. } => args
|
||||
.iter()
|
||||
.find_map(|arg| arg.find_node(byte_index))
|
||||
|
|
Loading…
Reference in New Issue