mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
properly restrict diagnostics to a single file
This commit is contained in:
parent
ec6f71576a
commit
fd30ec406b
1 changed files with 6 additions and 1 deletions
|
@ -259,7 +259,12 @@ impl Module {
|
||||||
for decl in self.declarations(db) {
|
for decl in self.declarations(db) {
|
||||||
match decl {
|
match decl {
|
||||||
crate::ModuleDef::Function(f) => f.diagnostics(db, sink),
|
crate::ModuleDef::Function(f) => f.diagnostics(db, sink),
|
||||||
crate::ModuleDef::Module(f) => f.diagnostics(db, sink),
|
crate::ModuleDef::Module(m) => {
|
||||||
|
// Only add diagnostics from inline modules
|
||||||
|
if let ModuleSource::Module(_) = m.definition_source(db).ast {
|
||||||
|
m.diagnostics(db, sink)
|
||||||
|
}
|
||||||
|
}
|
||||||
_ => (),
|
_ => (),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue