Skip to content
This repository was archived by the owner on Jan 25, 2024. It is now read-only.

Commit 4b6bce1

Browse files
authored
Merge pull request #26 from Ma27/at-expr
Add `var` from `{ a, b, c }@var` to scope
2 parents 7db9383 + b84630a commit 4b6bce1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/utils.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,20 @@ pub fn scope_for(file: &Rc<Url>, node: SyntaxNode) -> Option<HashMap<String, Var
270270
);
271271
}
272272
}
273+
if let Some(ident) = pattern.at() {
274+
if !scope.contains_key(ident.as_str()) {
275+
scope.insert(
276+
ident.as_str().into(),
277+
Var {
278+
file: Rc::clone(&file),
279+
set: lambda.node().to_owned(),
280+
key: ident.node().to_owned(),
281+
value: None,
282+
datatype: Datatype::Lambda,
283+
},
284+
);
285+
}
286+
}
273287
}
274288
_ => (),
275289
},

0 commit comments

Comments
 (0)