aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/references/search_scope.rs
diff options
context:
space:
mode:
authorSeivan Heidari <[email protected]>2019-11-11 13:31:09 +0000
committerSeivan Heidari <[email protected]>2019-11-11 13:31:09 +0000
commit68a5ff050faf514e9d122212a66703ca8ce66ab7 (patch)
tree0c389d2680aae82c1805a52f8315312724134341 /crates/ra_ide_api/src/references/search_scope.rs
parent7cd075ff0beb97039cd1d1c6c021abf89339731b (diff)
parenta599147b4232c0d4f6b071a3a96e86f903f4cf52 (diff)
Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into feature/themes
Diffstat (limited to 'crates/ra_ide_api/src/references/search_scope.rs')
-rw-r--r--crates/ra_ide_api/src/references/search_scope.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_ide_api/src/references/search_scope.rs b/crates/ra_ide_api/src/references/search_scope.rs
index f2789e0b2..2907787c2 100644
--- a/crates/ra_ide_api/src/references/search_scope.rs
+++ b/crates/ra_ide_api/src/references/search_scope.rs
@@ -71,13 +71,13 @@ impl NameDefinition {
71 let module_src = self.container.definition_source(db); 71 let module_src = self.container.definition_source(db);
72 let file_id = module_src.file_id.original_file(db); 72 let file_id = module_src.file_id.original_file(db);
73 73
74 if let NameKind::Pat((def, _)) = self.kind { 74 if let NameKind::Local(var) = self.kind {
75 let mut res = FxHashMap::default(); 75 let range = match var.parent(db) {
76 let range = match def {
77 DefWithBody::Function(f) => f.source(db).ast.syntax().text_range(), 76 DefWithBody::Function(f) => f.source(db).ast.syntax().text_range(),
78 DefWithBody::Const(c) => c.source(db).ast.syntax().text_range(), 77 DefWithBody::Const(c) => c.source(db).ast.syntax().text_range(),
79 DefWithBody::Static(s) => s.source(db).ast.syntax().text_range(), 78 DefWithBody::Static(s) => s.source(db).ast.syntax().text_range(),
80 }; 79 };
80 let mut res = FxHashMap::default();
81 res.insert(file_id, Some(range)); 81 res.insert(file_id, Some(range));
82 return SearchScope::new(res); 82 return SearchScope::new(res);
83 } 83 }