mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
Fix body selection in while loops
This commit is contained in:
parent
a2cc1d6b7b
commit
87c4a4104d
4 changed files with 34 additions and 3 deletions
|
@ -769,6 +769,15 @@ impl ast::HasLoopBody for ast::ForExpr {
|
|||
}
|
||||
}
|
||||
|
||||
impl ast::HasLoopBody for ast::WhileExpr {
|
||||
fn loop_body(&self) -> Option<ast::BlockExpr> {
|
||||
let mut exprs = support::children(self.syntax());
|
||||
let first = exprs.next();
|
||||
let second = exprs.next();
|
||||
second.or(first)
|
||||
}
|
||||
}
|
||||
|
||||
impl ast::HasAttrs for ast::AnyHasDocComments {}
|
||||
|
||||
impl From<ast::Adt> for ast::Item {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue