mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +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
|
@ -34,7 +34,8 @@ fn prev_tokens(token: SyntaxToken) -> impl Iterator<Item = SyntaxToken> {
|
|||
successors(token.prev_token(), |token| token.prev_token())
|
||||
}
|
||||
|
||||
pub fn extract_trivial_expression(block: &ast::Block) -> Option<ast::Expr> {
|
||||
pub fn extract_trivial_expression(expr: &ast::BlockExpr) -> Option<ast::Expr> {
|
||||
let block = expr.block()?;
|
||||
let expr = block.expr()?;
|
||||
if expr.syntax().text().contains_char('\n') {
|
||||
return None;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue