diff options
Diffstat (limited to 'crates/libeditor/src/scope')
-rw-r--r-- | crates/libeditor/src/scope/fn_scope.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/libeditor/src/scope/fn_scope.rs b/crates/libeditor/src/scope/fn_scope.rs index de38b33f0..4b643237f 100644 --- a/crates/libeditor/src/scope/fn_scope.rs +++ b/crates/libeditor/src/scope/fn_scope.rs | |||
@@ -5,7 +5,7 @@ use std::{ | |||
5 | 5 | ||
6 | use libsyntax2::{ | 6 | use libsyntax2::{ |
7 | SyntaxNodeRef, SyntaxNode, SmolStr, AstNode, | 7 | SyntaxNodeRef, SyntaxNode, SmolStr, AstNode, |
8 | ast::{self, NameOwner}, | 8 | ast::{self, NameOwner, LoopBodyOwner}, |
9 | algo::{ancestors, generate, walk::preorder} | 9 | algo::{ancestors, generate, walk::preorder} |
10 | }; | 10 | }; |
11 | 11 | ||
@@ -144,7 +144,7 @@ fn compute_expr_scopes(expr: ast::Expr, scopes: &mut FnScopes, scope: ScopeId) { | |||
144 | let cond_scope = e.condition().and_then(|cond| { | 144 | let cond_scope = e.condition().and_then(|cond| { |
145 | compute_cond_scopes(cond, scopes, scope) | 145 | compute_cond_scopes(cond, scopes, scope) |
146 | }); | 146 | }); |
147 | if let Some(block) = e.body() { | 147 | if let Some(block) = e.loop_body() { |
148 | compute_block_scopes(block, scopes, cond_scope.unwrap_or(scope)); | 148 | compute_block_scopes(block, scopes, cond_scope.unwrap_or(scope)); |
149 | } | 149 | } |
150 | }, | 150 | }, |
@@ -162,7 +162,7 @@ fn compute_expr_scopes(expr: ast::Expr, scopes: &mut FnScopes, scope: ScopeId) { | |||
162 | scope = scopes.new_scope(scope); | 162 | scope = scopes.new_scope(scope); |
163 | scopes.add_bindings(scope, pat); | 163 | scopes.add_bindings(scope, pat); |
164 | } | 164 | } |
165 | if let Some(block) = e.body() { | 165 | if let Some(block) = e.loop_body() { |
166 | compute_block_scopes(block, scopes, scope); | 166 | compute_block_scopes(block, scopes, scope); |
167 | } | 167 | } |
168 | }, | 168 | }, |
@@ -181,7 +181,7 @@ fn compute_expr_scopes(expr: ast::Expr, scopes: &mut FnScopes, scope: ScopeId) { | |||
181 | .for_each(|expr| compute_expr_scopes(expr, scopes, scope)); | 181 | .for_each(|expr| compute_expr_scopes(expr, scopes, scope)); |
182 | } | 182 | } |
183 | ast::Expr::LoopExpr(e) => { | 183 | ast::Expr::LoopExpr(e) => { |
184 | if let Some(block) = e.body() { | 184 | if let Some(block) = e.loop_body() { |
185 | compute_block_scopes(block, scopes, scope); | 185 | compute_block_scopes(block, scopes, scope); |
186 | } | 186 | } |
187 | } | 187 | } |