mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
Diagnose files that aren't in the module tree
This commit is contained in:
parent
6c32e2d8a0
commit
7b1a0d5fb7
1 changed files with 13 additions and 3 deletions
|
@ -197,9 +197,19 @@ pub(crate) fn diagnostics(
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
if let Some(m) = sema.to_module_def(file_id) {
|
match sema.to_module_def(file_id) {
|
||||||
m.diagnostics(db, &mut sink);
|
Some(m) => m.diagnostics(db, &mut sink),
|
||||||
};
|
None => {
|
||||||
|
res.borrow_mut().push(
|
||||||
|
Diagnostic::hint(
|
||||||
|
parse.tree().syntax().text_range(),
|
||||||
|
"file not included in module tree".to_string(),
|
||||||
|
)
|
||||||
|
.with_unused(true),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
drop(sink);
|
drop(sink);
|
||||||
res.into_inner()
|
res.into_inner()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue