aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/src/imp.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_analysis/src/imp.rs')
-rw-r--r--crates/ra_analysis/src/imp.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs
index fe1dfefea..ab6d111c2 100644
--- a/crates/ra_analysis/src/imp.rs
+++ b/crates/ra_analysis/src/imp.rs
@@ -214,7 +214,7 @@ impl AnalysisImpl {
214 { 214 {
215 let scope = fn_descr.scope(&*self.db); 215 let scope = fn_descr.scope(&*self.db);
216 // First try to resolve the symbol locally 216 // First try to resolve the symbol locally
217 return if let Some(entry) = scope.resolve_local_name(name_ref) { 217 if let Some(entry) = scope.resolve_local_name(name_ref) {
218 let mut vec = vec![]; 218 let mut vec = vec![];
219 vec.push(( 219 vec.push((
220 position.file_id, 220 position.file_id,
@@ -224,12 +224,11 @@ impl AnalysisImpl {
224 kind: NAME, 224 kind: NAME,
225 }, 225 },
226 )); 226 ));
227 Ok(vec) 227 return Ok(vec);
228 } else {
229 // If that fails try the index based approach.
230 self.index_resolve(name_ref)
231 }; 228 };
232 } 229 }
230 // If that fails try the index based approach.
231 return self.index_resolve(name_ref);
233 } 232 }
234 if let Some(name) = find_node_at_offset::<ast::Name>(syntax, position.offset) { 233 if let Some(name) = find_node_at_offset::<ast::Name>(syntax, position.offset) {
235 if let Some(module) = name.syntax().parent().and_then(ast::Module::cast) { 234 if let Some(module) = name.syntax().parent().and_then(ast::Module::cast) {