Skip to content

Commit

Permalink
Dedupping parser diagnostics on file ids. (#6212)
Browse files Browse the repository at this point in the history
  • Loading branch information
orizi authored Aug 14, 2024
1 parent 0083fff commit d8e4f5b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions crates/cairo-lang-compiler/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use cairo_lang_filesystem::ids::{CrateId, FileLongId};
use cairo_lang_lowering::db::LoweringGroup;
use cairo_lang_parser::db::ParserGroup;
use cairo_lang_semantic::db::SemanticGroup;
use cairo_lang_utils::unordered_hash_set::UnorderedHashSet;
use cairo_lang_utils::{LookupIntern, Upcast};
use thiserror::Error;

Expand Down Expand Up @@ -134,11 +135,14 @@ impl<'a> DiagnosticsReporter<'a> {
}

let modules = db.crate_modules(*crate_id);
let mut processed_file_ids = UnorderedHashSet::<_>::default();
for module_id in modules.iter() {
if let Ok(module_files) = db.module_files(*module_id) {
for file_id in module_files.iter().copied() {
found_diagnostics |=
self.check_diag_group(db.upcast(), db.file_syntax_diagnostics(file_id));
if processed_file_ids.insert(file_id) {
found_diagnostics |= self
.check_diag_group(db.upcast(), db.file_syntax_diagnostics(file_id));
}
}
}

Expand Down

0 comments on commit d8e4f5b

Please sign in to comment.