aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/imp.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api/src/imp.rs')
-rw-r--r--crates/ra_ide_api/src/imp.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_ide_api/src/imp.rs b/crates/ra_ide_api/src/imp.rs
index ba4aa0fd5..98b507ab3 100644
--- a/crates/ra_ide_api/src/imp.rs
+++ b/crates/ra_ide_api/src/imp.rs
@@ -100,7 +100,7 @@ impl db::RootDatabase {
100impl db::RootDatabase { 100impl db::RootDatabase {
101 /// Returns `Vec` for the same reason as `parent_module` 101 /// Returns `Vec` for the same reason as `parent_module`
102 pub(crate) fn crate_for(&self, file_id: FileId) -> Cancelable<Vec<CrateId>> { 102 pub(crate) fn crate_for(&self, file_id: FileId) -> Cancelable<Vec<CrateId>> {
103 let module = match source_binder::module_from_file_id(self, file_id)? { 103 let module = match source_binder::module_from_file_id(self, file_id) {
104 Some(it) => it, 104 Some(it) => it,
105 None => return Ok(Vec::new()), 105 None => return Ok(Vec::new()),
106 }; 106 };
@@ -147,7 +147,7 @@ impl db::RootDatabase {
147 db, 147 db,
148 position.file_id, 148 position.file_id,
149 binding.syntax(), 149 binding.syntax(),
150 )?); 150 ));
151 return Ok(Some((binding, descr))); 151 return Ok(Some((binding, descr)));
152 }; 152 };
153 let name_ref = ctry!(find_node_at_offset::<ast::NameRef>(syntax, position.offset)); 153 let name_ref = ctry!(find_node_at_offset::<ast::NameRef>(syntax, position.offset));
@@ -155,7 +155,7 @@ impl db::RootDatabase {
155 db, 155 db,
156 position.file_id, 156 position.file_id,
157 name_ref.syntax(), 157 name_ref.syntax(),
158 )?); 158 ));
159 let scope = descr.scopes(db)?; 159 let scope = descr.scopes(db)?;
160 let resolved = ctry!(scope.resolve_local_name(name_ref)); 160 let resolved = ctry!(scope.resolve_local_name(name_ref));
161 let resolved = resolved.ptr().resolve(source_file); 161 let resolved = resolved.ptr().resolve(source_file);
@@ -179,7 +179,7 @@ impl db::RootDatabase {
179 fix: d.fix.map(|fix| SourceChange::from_local_edit(file_id, fix)), 179 fix: d.fix.map(|fix| SourceChange::from_local_edit(file_id, fix)),
180 }) 180 })
181 .collect::<Vec<_>>(); 181 .collect::<Vec<_>>();
182 if let Some(m) = source_binder::module_from_file_id(self, file_id)? { 182 if let Some(m) = source_binder::module_from_file_id(self, file_id) {
183 for (name_node, problem) in m.problems(self)? { 183 for (name_node, problem) in m.problems(self)? {
184 let source_root = self.file_source_root(file_id); 184 let source_root = self.file_source_root(file_id);
185 let diag = match problem { 185 let diag = match problem {