properly restrict diagnostics to a single file

This commit is contained in:
Aleksey Kladov 2019-07-05 19:27:20 +03:00
parent ec6f71576a
commit fd30ec406b

View File

@ -259,7 +259,12 @@ impl Module {
for decl in self.declarations(db) {
match decl {
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)
}
}
_ => (),
}
}