mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
fix hir for new block syntax
This commit is contained in:
parent
dcf8e89503
commit
5e3f291195
14 changed files with 72 additions and 57 deletions
|
@ -119,10 +119,10 @@ where
|
|||
expr_id: crate::expr::ExprId,
|
||||
) -> Option<Source<ast::Expr>> {
|
||||
let source_map = self.body_source_map(db);
|
||||
let expr_syntax = source_map.expr_syntax(expr_id)?;
|
||||
let expr_syntax = source_map.expr_syntax(expr_id)?.a()?;
|
||||
let source = self.source(db);
|
||||
let node = expr_syntax.to_node(&source.ast.syntax());
|
||||
ast::Expr::cast(node).map(|ast| Source { file_id: source.file_id, ast })
|
||||
let ast = expr_syntax.to_node(&source.ast.syntax());
|
||||
Some(Source { file_id: source.file_id, ast })
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue