Skip to content

Commit 3775e5e

Browse files
bors[bot]matklad
andcommitted
Merge #1494
1494: properly restrict diagnostics to a single file r=matklad a=matklad Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 parents feae74e + fd30ec4 commit 3775e5e

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)