aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/references
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide/src/references')
-rw-r--r--crates/ra_ide/src/references/rename.rs2
-rw-r--r--crates/ra_ide/src/references/search_scope.rs5
2 files changed, 6 insertions, 1 deletions
diff --git a/crates/ra_ide/src/references/rename.rs b/crates/ra_ide/src/references/rename.rs
index b804d5f6d..1abf20215 100644
--- a/crates/ra_ide/src/references/rename.rs
+++ b/crates/ra_ide/src/references/rename.rs
@@ -88,7 +88,7 @@ fn rename_mod(
88 file_system_edits.push(move_file); 88 file_system_edits.push(move_file);
89 } 89 }
90 } 90 }
91 ModuleSource::Module(..) => {} 91 ModuleSource::Module(..) | ModuleSource::Block(..) => {}
92 } 92 }
93 } 93 }
94 94
diff --git a/crates/ra_ide/src/references/search_scope.rs b/crates/ra_ide/src/references/search_scope.rs
index f5c9589f4..92eb2015b 100644
--- a/crates/ra_ide/src/references/search_scope.rs
+++ b/crates/ra_ide/src/references/search_scope.rs
@@ -96,6 +96,10 @@ impl NameDefinition {
96 let range = Some(m.syntax().text_range()); 96 let range = Some(m.syntax().text_range());
97 res.insert(file_id, range); 97 res.insert(file_id, range);
98 } 98 }
99 ModuleSource::Block(b) => {
100 let range = Some(b.syntax().text_range());
101 res.insert(file_id, range);
102 }
99 ModuleSource::SourceFile(_) => { 103 ModuleSource::SourceFile(_) => {
100 res.insert(file_id, None); 104 res.insert(file_id, None);
101 res.extend(parent_module.children(db).map(|m| { 105 res.extend(parent_module.children(db).map(|m| {
@@ -137,6 +141,7 @@ impl NameDefinition {
137 let mut res = FxHashMap::default(); 141 let mut res = FxHashMap::default();
138 let range = match module_src.value { 142 let range = match module_src.value {
139 ModuleSource::Module(m) => Some(m.syntax().text_range()), 143 ModuleSource::Module(m) => Some(m.syntax().text_range()),
144 ModuleSource::Block(b) => Some(b.syntax().text_range()),
140 ModuleSource::SourceFile(_) => None, 145 ModuleSource::SourceFile(_) => None,
141 }; 146 };
142 res.insert(file_id, range); 147 res.insert(file_id, range);