Skip to content

Commit fd30ec4

Browse files
committed
properly restrict diagnostics to a single file
1 parent ec6f715 commit fd30ec4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

crates/ra_hir/src/code_model.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,12 @@ impl Module {
259259
for decl in self.declarations(db) {
260260
match decl {
261261
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+
}
263268
_ => (),
264269
}
265270
}

0 commit comments

Comments
 (0)