Store patterns desugared from destructuring assignments in source map

And few more fixups.

I was worried this will lead to more memory usage since `ExprOrPatId` is double the size of `ExprId`, but this does not regress `analysis-stats .`. If this turns out to be a problem, we can easily use the high bit to encode this information.
This commit is contained in:
Chayim Refael Friedman 2024-10-06 22:52:56 +03:00
parent 61f162a43d
commit 2d4d6b678f
16 changed files with 280 additions and 174 deletions

View file

@ -198,7 +198,10 @@ impl TestDB {
.filter_map(|node| {
let block = ast::BlockExpr::cast(node)?;
let expr = ast::Expr::from(block);
let expr_id = source_map.node_expr(InFile::new(position.file_id.into(), &expr))?;
let expr_id = source_map
.node_expr(InFile::new(position.file_id.into(), &expr))?
.as_expr()
.unwrap();
let scope = scopes.scope_for(expr_id).unwrap();
Some(scope)
});