From fd30ec406ba776e670dbd46b964de626f28e2857 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 5 Jul 2019 19:27:20 +0300 Subject: properly restrict diagnostics to a single file --- crates/ra_hir/src/code_model.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'crates/ra_hir/src') diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index b2fb5a563..6cf2c620d 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs @@ -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) + } + } _ => (), } } -- cgit v1.2.3