diff options
author | Aleksey Kladov <[email protected]> | 2018-11-04 17:21:20 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-11-05 09:36:38 +0000 |
commit | 88a15d10d543c09ef66a9f105c3dcdb5011abbee (patch) | |
tree | 773470eb035991ba0e137cc8b863179674d9b94f /crates/ra_analysis/src/imp.rs | |
parent | cd878658d3072ee0741cd04c16d330e7d5907f94 (diff) |
use module_for_source
Diffstat (limited to 'crates/ra_analysis/src/imp.rs')
-rw-r--r-- | crates/ra_analysis/src/imp.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs index 4f337d163..823ac9bdd 100644 --- a/crates/ra_analysis/src/imp.rs +++ b/crates/ra_analysis/src/imp.rs | |||
@@ -224,7 +224,7 @@ impl AnalysisImpl { | |||
224 | let module_tree = self.module_tree(file_id)?; | 224 | let module_tree = self.module_tree(file_id)?; |
225 | 225 | ||
226 | let res = module_tree | 226 | let res = module_tree |
227 | .modules_for_file(file_id) | 227 | .modules_for_source(ModuleSource::File(file_id)) |
228 | .into_iter() | 228 | .into_iter() |
229 | .filter_map(|module_id| { | 229 | .filter_map(|module_id| { |
230 | let link = module_id.parent_link(&module_tree)?; | 230 | let link = module_id.parent_link(&module_tree)?; |
@@ -252,7 +252,7 @@ impl AnalysisImpl { | |||
252 | let module_tree = self.module_tree(file_id)?; | 252 | let module_tree = self.module_tree(file_id)?; |
253 | let crate_graph = self.db.crate_graph(); | 253 | let crate_graph = self.db.crate_graph(); |
254 | let res = module_tree | 254 | let res = module_tree |
255 | .modules_for_file(file_id) | 255 | .modules_for_source(ModuleSource::File(file_id)) |
256 | .into_iter() | 256 | .into_iter() |
257 | .map(|it| it.root(&module_tree)) | 257 | .map(|it| it.root(&module_tree)) |
258 | .filter_map(|it| it.source(&module_tree).as_file()) | 258 | .filter_map(|it| it.source(&module_tree).as_file()) |
@@ -376,7 +376,7 @@ impl AnalysisImpl { | |||
376 | fix: None, | 376 | fix: None, |
377 | }) | 377 | }) |
378 | .collect::<Vec<_>>(); | 378 | .collect::<Vec<_>>(); |
379 | if let Some(m) = module_tree.any_module_for_file(file_id) { | 379 | if let Some(m) = module_tree.any_module_for_source(ModuleSource::File(file_id)) { |
380 | for (name_node, problem) in m.problems(&module_tree, &*self.db) { | 380 | for (name_node, problem) in m.problems(&module_tree, &*self.db) { |
381 | let diag = match problem { | 381 | let diag = match problem { |
382 | Problem::UnresolvedModule { candidate } => { | 382 | Problem::UnresolvedModule { candidate } => { |
@@ -539,7 +539,7 @@ impl AnalysisImpl { | |||
539 | Some(name) => name.text(), | 539 | Some(name) => name.text(), |
540 | None => return Vec::new(), | 540 | None => return Vec::new(), |
541 | }; | 541 | }; |
542 | let module_id = match module_tree.any_module_for_file(file_id) { | 542 | let module_id = match module_tree.any_module_for_source(ModuleSource::File(file_id)) { |
543 | Some(id) => id, | 543 | Some(id) => id, |
544 | None => return Vec::new(), | 544 | None => return Vec::new(), |
545 | }; | 545 | }; |