Skip to content

Commit

Permalink
Rename eqwalizer_diagnostics to eqwalizer_diagnostics_by_project
Browse files Browse the repository at this point in the history
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
  • Loading branch information
alanz authored and facebook-github-bot committed Feb 19, 2024
1 parent e09e01b commit 1e0720a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crates/ide/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion crates/ide/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,9 @@ impl Analysis {
project_id: ProjectId,
file_ids: Vec<FileId>,
) -> Cancellable<Arc<EqwalizerDiagnostics>> {
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(
Expand Down
6 changes: 3 additions & 3 deletions crates/ide_db/src/eqwalizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ pub trait EqwalizerDatabase:
+ EqwalizerLoader
+ ErlAstDatabase
{
fn eqwalizer_diagnostics(
fn eqwalizer_diagnostics_by_project(
&self,
project_id: ProjectId,
file_ids: Vec<FileId>,
Expand All @@ -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<FileId>,
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 1e0720a

Please sign in to comment.