mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
use module_for_source
This commit is contained in:
parent
cd878658d3
commit
88a15d10d5
3 changed files with 8 additions and 12 deletions
|
@ -224,7 +224,7 @@ impl AnalysisImpl {
|
|||
let module_tree = self.module_tree(file_id)?;
|
||||
|
||||
let res = module_tree
|
||||
.modules_for_file(file_id)
|
||||
.modules_for_source(ModuleSource::File(file_id))
|
||||
.into_iter()
|
||||
.filter_map(|module_id| {
|
||||
let link = module_id.parent_link(&module_tree)?;
|
||||
|
@ -252,7 +252,7 @@ impl AnalysisImpl {
|
|||
let module_tree = self.module_tree(file_id)?;
|
||||
let crate_graph = self.db.crate_graph();
|
||||
let res = module_tree
|
||||
.modules_for_file(file_id)
|
||||
.modules_for_source(ModuleSource::File(file_id))
|
||||
.into_iter()
|
||||
.map(|it| it.root(&module_tree))
|
||||
.filter_map(|it| it.source(&module_tree).as_file())
|
||||
|
@ -376,7 +376,7 @@ impl AnalysisImpl {
|
|||
fix: None,
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
if let Some(m) = module_tree.any_module_for_file(file_id) {
|
||||
if let Some(m) = module_tree.any_module_for_source(ModuleSource::File(file_id)) {
|
||||
for (name_node, problem) in m.problems(&module_tree, &*self.db) {
|
||||
let diag = match problem {
|
||||
Problem::UnresolvedModule { candidate } => {
|
||||
|
@ -539,7 +539,7 @@ impl AnalysisImpl {
|
|||
Some(name) => name.text(),
|
||||
None => return Vec::new(),
|
||||
};
|
||||
let module_id = match module_tree.any_module_for_file(file_id) {
|
||||
let module_id = match module_tree.any_module_for_source(ModuleSource::File(file_id)) {
|
||||
Some(id) => id,
|
||||
None => return Vec::new(),
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue