mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
break/continue completion
This commit is contained in:
parent
80ab3433d3
commit
8f552ab352
5 changed files with 73 additions and 39 deletions
|
@ -593,6 +593,7 @@ impl<'a> AstNode<'a> for ForExpr<'a> {
|
|||
fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax }
|
||||
}
|
||||
|
||||
impl<'a> ast::LoopBodyOwner<'a> for ForExpr<'a> {}
|
||||
impl<'a> ForExpr<'a> {
|
||||
pub fn pat(self) -> Option<Pat<'a>> {
|
||||
super::child_opt(self)
|
||||
|
@ -601,10 +602,6 @@ impl<'a> ForExpr<'a> {
|
|||
pub fn iterable(self) -> Option<Expr<'a>> {
|
||||
super::child_opt(self)
|
||||
}
|
||||
|
||||
pub fn body(self) -> Option<Block<'a>> {
|
||||
super::child_opt(self)
|
||||
}
|
||||
}
|
||||
|
||||
// ForType
|
||||
|
@ -845,11 +842,8 @@ impl<'a> AstNode<'a> for LoopExpr<'a> {
|
|||
fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax }
|
||||
}
|
||||
|
||||
impl<'a> LoopExpr<'a> {
|
||||
pub fn body(self) -> Option<Block<'a>> {
|
||||
super::child_opt(self)
|
||||
}
|
||||
}
|
||||
impl<'a> ast::LoopBodyOwner<'a> for LoopExpr<'a> {}
|
||||
impl<'a> LoopExpr<'a> {}
|
||||
|
||||
// MatchArm
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
|
@ -2106,13 +2100,10 @@ impl<'a> AstNode<'a> for WhileExpr<'a> {
|
|||
fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax }
|
||||
}
|
||||
|
||||
impl<'a> ast::LoopBodyOwner<'a> for WhileExpr<'a> {}
|
||||
impl<'a> WhileExpr<'a> {
|
||||
pub fn condition(self) -> Option<Condition<'a>> {
|
||||
super::child_opt(self)
|
||||
}
|
||||
|
||||
pub fn body(self) -> Option<Block<'a>> {
|
||||
super::child_opt(self)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue