From 1e0720a97aacf04ea6efa3414d4bd309407ef802 Mon Sep 17 00:00:00 2001 From: Alan Zimmerman Date: Mon, 19 Feb 2024 02:16:42 -0800 Subject: [PATCH] Rename eqwalizer_diagnostics to eqwalizer_diagnostics_by_project Summary: This is to avoid confusion when we introduce a new function that retrieves diagnostics by `FileId`. Reviewed By: robertoaloi Differential Revision: D53914372 fbshipit-source-id: 9bc16f21211188e168386a6762a700a4a7cec357 --- crates/ide/src/diagnostics.rs | 2 +- crates/ide/src/lib.rs | 4 +++- crates/ide_db/src/eqwalizer.rs | 6 +++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/crates/ide/src/diagnostics.rs b/crates/ide/src/diagnostics.rs index b67730ed15..b0e7bdac57 100644 --- a/crates/ide/src/diagnostics.rs +++ b/crates/ide/src/diagnostics.rs @@ -1187,7 +1187,7 @@ pub fn eqwalizer_diagnostics( return Some(vec![]); } - let diags = eqwalizer::eqwalizer_diagnostics(db, project_id, vec![file_id]); + let diags = eqwalizer::eqwalizer_diagnostics_by_project(db, project_id, vec![file_id]); match &*diags { EqwalizerDiagnostics::Diagnostics { errors, .. } => Some( errors diff --git a/crates/ide/src/lib.rs b/crates/ide/src/lib.rs index 92650b2555..a2ffeb9283 100644 --- a/crates/ide/src/lib.rs +++ b/crates/ide/src/lib.rs @@ -232,7 +232,9 @@ impl Analysis { project_id: ProjectId, file_ids: Vec, ) -> Cancellable> { - self.with_db(|db| elp_ide_db::eqwalizer::eqwalizer_diagnostics(db, project_id, file_ids)) + self.with_db(|db| { + elp_ide_db::eqwalizer::eqwalizer_diagnostics_by_project(db, project_id, file_ids) + }) } pub fn eqwalizer_stats( diff --git a/crates/ide_db/src/eqwalizer.rs b/crates/ide_db/src/eqwalizer.rs index 63125c3459..7764330eb9 100644 --- a/crates/ide_db/src/eqwalizer.rs +++ b/crates/ide_db/src/eqwalizer.rs @@ -84,7 +84,7 @@ pub trait EqwalizerDatabase: + EqwalizerLoader + ErlAstDatabase { - fn eqwalizer_diagnostics( + fn eqwalizer_diagnostics_by_project( &self, project_id: ProjectId, file_ids: Vec, @@ -105,7 +105,7 @@ pub trait EqwalizerDatabase: fn is_eqwalizer_enabled(&self, file_id: FileId, include_generated: bool) -> bool; } -pub fn eqwalizer_diagnostics( +pub fn eqwalizer_diagnostics_by_project( db: &dyn EqwalizerDatabase, project_id: ProjectId, file_ids: Vec, @@ -140,7 +140,7 @@ fn type_at_position( return None; } if let EqwalizerDiagnostics::Diagnostics { type_info, .. } = - &(*eqwalizer_diagnostics(db, project_id, vec![position.file_id])) + &(*eqwalizer_diagnostics_by_project(db, project_id, vec![position.file_id])) { let offset: u32 = position.offset.into(); let module_index = db.module_index(project_id);