diff options
Diffstat (limited to 'crates/ide')
-rw-r--r-- | crates/ide/src/diagnostics.rs | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/crates/ide/src/diagnostics.rs b/crates/ide/src/diagnostics.rs index fe32f39b6..760c84780 100644 --- a/crates/ide/src/diagnostics.rs +++ b/crates/ide/src/diagnostics.rs | |||
@@ -197,9 +197,19 @@ pub(crate) fn diagnostics( | |||
197 | ); | 197 | ); |
198 | }); | 198 | }); |
199 | 199 | ||
200 | if let Some(m) = sema.to_module_def(file_id) { | 200 | match sema.to_module_def(file_id) { |
201 | m.diagnostics(db, &mut sink); | 201 | Some(m) => m.diagnostics(db, &mut sink), |
202 | }; | 202 | None => { |
203 | res.borrow_mut().push( | ||
204 | Diagnostic::hint( | ||
205 | parse.tree().syntax().text_range(), | ||
206 | "file not included in module tree".to_string(), | ||
207 | ) | ||
208 | .with_unused(true), | ||
209 | ); | ||
210 | } | ||
211 | } | ||
212 | |||
203 | drop(sink); | 213 | drop(sink); |
204 | res.into_inner() | 214 | res.into_inner() |
205 | } | 215 | } |