mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 15:15:24 +00:00
better recovery for exprs
This commit is contained in:
parent
13110f48e9
commit
2fa90e736b
16 changed files with 263 additions and 27 deletions
|
@ -115,6 +115,15 @@ impl<'a> Module<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> LetStmt<'a> {
|
||||
pub fn has_semi(self) -> bool {
|
||||
match self.syntax().last_child() {
|
||||
None => false,
|
||||
Some(node) => node.kind() == SEMI,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> IfExpr<'a> {
|
||||
pub fn then_branch(self) -> Option<Block<'a>> {
|
||||
self.blocks().nth(0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue