aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/completion/completion_context.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-02-08 11:49:43 +0000
committerAleksey Kladov <[email protected]>2019-02-08 11:49:43 +0000
commit12e3b4c70b5ef23b2fdfc197296d483680e125f9 (patch)
tree71baa0e0a62f9f6b61450501c5f821f67badf9e4 /crates/ra_ide_api/src/completion/completion_context.rs
parent5cb1d41a30d25cbe136402644bf5434dd667f1e5 (diff)
reformat the world
Diffstat (limited to 'crates/ra_ide_api/src/completion/completion_context.rs')
-rw-r--r--crates/ra_ide_api/src/completion/completion_context.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/crates/ra_ide_api/src/completion/completion_context.rs b/crates/ra_ide_api/src/completion/completion_context.rs
index 8abab0221..82bd4d606 100644
--- a/crates/ra_ide_api/src/completion/completion_context.rs
+++ b/crates/ra_ide_api/src/completion/completion_context.rs
@@ -108,12 +108,8 @@ impl<'a> CompletionContext<'a> {
108 } 108 }
109 fn classify_name_ref(&mut self, original_file: &'a SourceFile, name_ref: &ast::NameRef) { 109 fn classify_name_ref(&mut self, original_file: &'a SourceFile, name_ref: &ast::NameRef) {
110 let name_range = name_ref.syntax().range(); 110 let name_range = name_ref.syntax().range();
111 let top_node = name_ref 111 let top_node =
112 .syntax() 112 name_ref.syntax().ancestors().take_while(|it| it.range() == name_range).last().unwrap();
113 .ancestors()
114 .take_while(|it| it.range() == name_range)
115 .last()
116 .unwrap();
117 113
118 match top_node.parent().map(|it| it.kind()) { 114 match top_node.parent().map(|it| it.kind()) {
119 Some(SOURCE_FILE) | Some(ITEM_LIST) => { 115 Some(SOURCE_FILE) | Some(ITEM_LIST) => {