diff options
-rw-r--r-- | crates/ra_hir/src/code_model.rs | 7 |
1 files changed, 6 insertions, 1 deletions
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 { | |||
259 | for decl in self.declarations(db) { | 259 | for decl in self.declarations(db) { |
260 | match decl { | 260 | match decl { |
261 | crate::ModuleDef::Function(f) => f.diagnostics(db, sink), | 261 | crate::ModuleDef::Function(f) => f.diagnostics(db, sink), |
262 | crate::ModuleDef::Module(f) => f.diagnostics(db, sink), | 262 | crate::ModuleDef::Module(m) => { |
263 | // Only add diagnostics from inline modules | ||
264 | if let ModuleSource::Module(_) = m.definition_source(db).ast { | ||
265 | m.diagnostics(db, sink) | ||
266 | } | ||
267 | } | ||
263 | _ => (), | 268 | _ => (), |
264 | } | 269 | } |
265 | } | 270 | } |