diff options
Diffstat (limited to 'crates/ra_hir_ty')
-rw-r--r-- | crates/ra_hir_ty/src/diagnostics.rs | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/crates/ra_hir_ty/src/diagnostics.rs b/crates/ra_hir_ty/src/diagnostics.rs index 48b578fb0..9d29f3071 100644 --- a/crates/ra_hir_ty/src/diagnostics.rs +++ b/crates/ra_hir_ty/src/diagnostics.rs | |||
@@ -262,10 +262,7 @@ impl AstDiagnostic for MismatchedArgCount { | |||
262 | #[cfg(test)] | 262 | #[cfg(test)] |
263 | mod tests { | 263 | mod tests { |
264 | use hir_def::{db::DefDatabase, AssocItemId, ModuleDefId}; | 264 | use hir_def::{db::DefDatabase, AssocItemId, ModuleDefId}; |
265 | use hir_expand::{ | 265 | use hir_expand::diagnostics::{Diagnostic, DiagnosticSinkBuilder}; |
266 | db::AstDatabase, | ||
267 | diagnostics::{Diagnostic, DiagnosticSinkBuilder}, | ||
268 | }; | ||
269 | use ra_db::{fixture::WithFixture, FileId, SourceDatabase, SourceDatabaseExt}; | 266 | use ra_db::{fixture::WithFixture, FileId, SourceDatabase, SourceDatabaseExt}; |
270 | use ra_syntax::{TextRange, TextSize}; | 267 | use ra_syntax::{TextRange, TextSize}; |
271 | use rustc_hash::FxHashMap; | 268 | use rustc_hash::FxHashMap; |
@@ -310,12 +307,11 @@ mod tests { | |||
310 | 307 | ||
311 | let mut actual: FxHashMap<FileId, Vec<(TextRange, String)>> = FxHashMap::default(); | 308 | let mut actual: FxHashMap<FileId, Vec<(TextRange, String)>> = FxHashMap::default(); |
312 | db.diagnostics(|d| { | 309 | db.diagnostics(|d| { |
313 | // FXIME: macros... | 310 | // FIXME: macros... |
314 | let source = d.source(); | 311 | let file_id = d.source().file_id.original_file(&db); |
315 | let root = db.parse_or_expand(source.file_id).unwrap(); | 312 | let range = d.syntax_node(&db).text_range(); |
316 | let range = source.value.to_node(&root).text_range(); | ||
317 | let message = d.message().to_owned(); | 313 | let message = d.message().to_owned(); |
318 | actual.entry(source.file_id.original_file(&db)).or_default().push((range, message)); | 314 | actual.entry(file_id).or_default().push((range, message)); |
319 | }); | 315 | }); |
320 | 316 | ||
321 | for (file_id, diags) in actual.iter_mut() { | 317 | for (file_id, diags) in actual.iter_mut() { |