diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-10-30 18:32:24 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-10-30 18:32:24 +0000 |
commit | 46cce4f8f1b71458029ebfd391c37e27cc6c5c9c (patch) | |
tree | 95344947f1957d03edcbcd6ef8a2786cc1b9142d /crates/ra_editor | |
parent | bc4de7128f474f75a9eff6591923657025099b74 (diff) | |
parent | 1643d94a65a66f32b9278829dd3af00883f3852b (diff) |
Merge #169
169: Syntax ptr r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_editor')
-rw-r--r-- | crates/ra_editor/src/completion.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/crates/ra_editor/src/completion.rs b/crates/ra_editor/src/completion.rs index 0a3675255..a0b168bc6 100644 --- a/crates/ra_editor/src/completion.rs +++ b/crates/ra_editor/src/completion.rs | |||
@@ -3,7 +3,6 @@ use rustc_hash::{FxHashMap, FxHashSet}; | |||
3 | use ra_syntax::{ | 3 | use ra_syntax::{ |
4 | algo::visit::{visitor, visitor_ctx, Visitor, VisitorCtx}, | 4 | algo::visit::{visitor, visitor_ctx, Visitor, VisitorCtx}, |
5 | ast::{self, AstChildren, LoopBodyOwner, ModuleItemOwner}, | 5 | ast::{self, AstChildren, LoopBodyOwner, ModuleItemOwner}, |
6 | text_utils::is_subrange, | ||
7 | AstNode, File, | 6 | AstNode, File, |
8 | SyntaxKind::*, | 7 | SyntaxKind::*, |
9 | SyntaxNodeRef, TextUnit, | 8 | SyntaxNodeRef, TextUnit, |
@@ -191,7 +190,7 @@ fn is_in_loop_body(name_ref: ast::NameRef) -> bool { | |||
191 | .visit::<ast::LoopExpr, _>(LoopBodyOwner::loop_body) | 190 | .visit::<ast::LoopExpr, _>(LoopBodyOwner::loop_body) |
192 | .accept(node); | 191 | .accept(node); |
193 | if let Some(Some(body)) = loop_body { | 192 | if let Some(Some(body)) = loop_body { |
194 | if is_subrange(body.syntax().range(), name_ref.syntax().range()) { | 193 | if name_ref.syntax().range().is_subrange(&body.syntax().range()) { |
195 | return true; | 194 | return true; |
196 | } | 195 | } |
197 | } | 196 | } |