Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dedupping parser diagnostics on file ids. #6212

Merged
merged 1 commit into from
Aug 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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