diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-07-05 17:30:38 +0100 |
---|---|---|
committer | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-07-05 17:30:38 +0100 |
commit | 3775e5e27d39301770d396f320aac97b48cd47c0 (patch) | |
tree | 37a28b368727205f7b2827e654061323383cabef /crates | |
parent | feae74e02c4ed0a134b6d3f18dd5d79baff85c3d (diff) | |
parent | fd30ec406ba776e670dbd46b964de626f28e2857 (diff) |
Merge #1494
1494: properly restrict diagnostics to a single file r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates')
-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 | } |