aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_editor
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-10-30 18:26:55 +0000
committerAleksey Kladov <[email protected]>2018-10-30 18:26:55 +0000
commit1643d94a65a66f32b9278829dd3af00883f3852b (patch)
tree95344947f1957d03edcbcd6ef8a2786cc1b9142d /crates/ra_editor
parent950e8b8182897da60bcece70d84e9f0b6dc88632 (diff)
switch to TextRange::subrange
Diffstat (limited to 'crates/ra_editor')
-rw-r--r--crates/ra_editor/src/completion.rs3
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};
3use ra_syntax::{ 3use 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 }