mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-04 15:45:25 +00:00
switch modules to new diagnostics
This commit is contained in:
parent
fcca35969d
commit
3fb88e95aa
8 changed files with 156 additions and 135 deletions
|
@ -1,8 +1,8 @@
|
|||
use ra_db::FileId;
|
||||
use ra_syntax::{ast, SyntaxNode, TreeArc, AstNode};
|
||||
use ra_syntax::{ast, TreeArc, AstNode};
|
||||
|
||||
use crate::{
|
||||
Module, ModuleSource, Problem, Name,
|
||||
Module, ModuleSource, Name,
|
||||
nameres::{CrateModuleId, ImportId},
|
||||
HirDatabase, DefDatabase,
|
||||
HirFileId, SourceItemId,
|
||||
|
@ -108,19 +108,4 @@ impl Module {
|
|||
let parent_id = def_map[self.module_id].parent?;
|
||||
Some(self.with_module_id(parent_id))
|
||||
}
|
||||
|
||||
pub(crate) fn problems_impl(
|
||||
&self,
|
||||
db: &impl HirDatabase,
|
||||
) -> Vec<(TreeArc<SyntaxNode>, Problem)> {
|
||||
let def_map = db.crate_def_map(self.krate);
|
||||
let (my_file_id, _) = self.definition_source(db);
|
||||
// FIXME: not entirely corret filterint by module
|
||||
def_map
|
||||
.problems()
|
||||
.iter()
|
||||
.filter(|(source_item_id, _problem)| my_file_id == source_item_id.file_id)
|
||||
.map(|(source_item_id, problem)| (db.file_item(*source_item_id), problem.clone()))
|
||||
.collect()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue