Skip modules without priv uses when computing unused imports diagnostics#9829
Skip modules without priv uses when computing unused imports diagnostics#9829integraledelebesgue wants to merge 2 commits intooptimization/diagnostic-materializationfrom
Conversation
|
This change is part of the following stack: Change managed by git-spice. |
37603a6 to
31b692a
Compare
2e764f4 to
73591db
Compare
31b692a to
a2586c5
Compare
73591db to
1dd5d57
Compare
orizi
left a comment
There was a problem hiding this comment.
@orizi reviewed 1 file and all commit messages, and made 2 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on integraledelebesgue).
crates/cairo-lang-semantic/src/db.rs line 378 at r1 (raw file):
ModuleItemId::Use(use_id) => Some(use_id), _ => None, })
Suggestion:
.filter_map(|info| try_extract_matches!(info.item_id, ModuleItemId::Use))crates/cairo-lang-semantic/src/db.rs line 389 at r1 (raw file):
add_unused_import_diagnostics(db, all_used_uses, use_id, diagnostics); } }
Suggestion:
})
.peekable();
if private_uses.peek().is_none() {
return;
}
let Ok(all_used_uses) = db.module_all_used_uses(module_id) else {
return;
};
for use_id in private_uses {
add_unused_import_diagnostics(db, all_used_uses, use_id, diagnostics);
}
}
piotmag769
left a comment
There was a problem hiding this comment.
@piotmag769 reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on integraledelebesgue).
Arcticae
left a comment
There was a problem hiding this comment.
@Arcticae reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on integraledelebesgue).
piotmag769
left a comment
There was a problem hiding this comment.
@piotmag769 reviewed 1 file and all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on integraledelebesgue).
wawel37
left a comment
There was a problem hiding this comment.
@wawel37 made 2 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on orizi).
crates/cairo-lang-semantic/src/db.rs line 378 at r1 (raw file):
ModuleItemId::Use(use_id) => Some(use_id), _ => None, })
Done
crates/cairo-lang-semantic/src/db.rs line 389 at r1 (raw file):
add_unused_import_diagnostics(db, all_used_uses, use_id, diagnostics); } }
Done
orizi
left a comment
There was a problem hiding this comment.
@orizi made 1 comment and resolved 2 discussions.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on integraledelebesgue).
orizi
left a comment
There was a problem hiding this comment.
@orizi reviewed 1 file and all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on integraledelebesgue).
Summary
A little optimization for further gain of diagnostic performance in CairoLS
Type of change
Please check one: