aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty
diff options
context:
space:
mode:
authorKirill Bulatov <[email protected]>2020-07-27 21:56:57 +0100
committerKirill Bulatov <[email protected]>2020-08-11 13:09:08 +0100
commit21184a1b2a4bea57a7666432749b171414136c60 (patch)
treef009a6df8b59ee88952f722534312b9567930c51 /crates/ra_hir_ty
parentcb0b13a583c0c20b57fd3529e2c01ab42bd8f04d (diff)
Restore accidentally removed public method
Diffstat (limited to 'crates/ra_hir_ty')
-rw-r--r--crates/ra_hir_ty/src/diagnostics.rs14
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)]
263mod tests { 263mod 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() {