-
Notifications
You must be signed in to change notification settings - Fork 490
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
filter diagnostics #6001
filter diagnostics #6001
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 15 files at r1, all commit messages.
Reviewable status: 1 of 15 files reviewed, 1 unresolved discussion (waiting on @gilbens-starkware, @orizi, and @Tomer-StarkWare)
crates/cairo-lang-diagnostics/src/diagnostics.rs
line 309 at r1 (raw file):
} pub fn get_all(&self, with_duplicates: bool, db: &TEntry::DbType) -> Vec<TEntry> {
plz doc. Explain what "duplicates" are because this is not obvious to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 14 of 15 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @gilbens-starkware, @orizi, and @Tomer-StarkWare)
b0b7cde
to
52067c2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @gilbens-starkware, @mkaput, and @orizi)
crates/cairo-lang-diagnostics/src/diagnostics.rs
line 309 at r1 (raw file):
Previously, mkaput (Marek Kaput) wrote…
plz doc. Explain what "duplicates" are because this is not obvious to me.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 11 of 15 files reviewed, 1 unresolved discussion (waiting on @gilbens-starkware, @orizi, and @Tomer-StarkWare)
crates/cairo-lang-diagnostics/src/diagnostics.rs
line 309 at r1 (raw file):
Previously, Tomer-StarkWare (TomerC-StarkWare) wrote…
Done.
please doc what is considered a "duplicate". same message? same location? both?
52067c2
to
21c27ea
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 11 of 15 files reviewed, 1 unresolved discussion (waiting on @gilbens-starkware, @mkaput, and @orizi)
crates/cairo-lang-diagnostics/src/diagnostics.rs
line 309 at r1 (raw file):
Previously, mkaput (Marek Kaput) wrote…
please doc what is considered a "duplicate". same message? same location? both?
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 11 of 15 files reviewed, 3 unresolved discussions (waiting on @mkaput, @orizi, and @Tomer-StarkWare)
crates/cairo-lang-diagnostics/src/diagnostics.rs
line 309 at r1 (raw file):
Previously, mkaput (Marek Kaput) wrote…
please doc what is considered a "duplicate". same message? same location? both?
+1
crates/cairo-lang-diagnostics/src/diagnostics.rs
line 49 at r2 (raw file):
None } /// Returns true if the two diagnostics are of the same kind.
As not any diagnostic must have a kind
field, it is worth adding this clarification.
Suggestion:
/// Returns true if the two should be regarded as the same kind when filtering duplicate diagnostics.
crates/cairo-lang-diagnostics/src/diagnostics.rs
line 317 at r2 (raw file):
for (idx, diag) in diagnostic_with_dup.iter().enumerate() { indexed_dup_diagnostic.push((idx, diag)); }
Suggestion:
let indexed_dup_diagnostic = diagnostic_with_dup.iter().enumerate().map(|idx, diag| (idx, diag));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 4 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @orizi and @Tomer-StarkWare)
crates/cairo-lang-diagnostics/src/diagnostics.rs
line 308 at r3 (raw file):
/// Get diagnostics without duplication, such that there will be no 2 diagnostics that points to /// the same location in the user code, and are of the same kind.
nit
Suggestion:
/// Get diagnostics without duplication.
///
/// Two diagnostics are considered duplicated if both point to
/// the same location in the user code, and are of the same kind.
21c27ea
to
8727e55
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 14 of 15 files reviewed, 2 unresolved discussions (waiting on @gilbens-starkware, @mkaput, and @orizi)
crates/cairo-lang-diagnostics/src/diagnostics.rs
line 49 at r2 (raw file):
Previously, gilbens-starkware (Gil Ben-Shachar) wrote…
As not any diagnostic must have a
kind
field, it is worth adding this clarification.
Done.
crates/cairo-lang-diagnostics/src/diagnostics.rs
line 317 at r2 (raw file):
for (idx, diag) in diagnostic_with_dup.iter().enumerate() { indexed_dup_diagnostic.push((idx, diag)); }
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r4, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @gilbens-starkware and @orizi)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @orizi and @Tomer-StarkWare)
crates/cairo-lang-diagnostics/src/diagnostics.rs
line 335 at r4 (raw file):
diagnostic_without_dup.push(diag); prev_diagnostic_indexed = Some(diag); }
Suggestion:
let mut prev_diagnostic_indexed = indexed_dup_doagnostic.next().unwrap();
let mut diagnostic_without_dup = vec![prev_diagnostic_indexed];
for diag in indexed_dup_diagnostic {
if prev_diagnostic_indexed.1.is_same_kind(diag.1)
&& prev_diagnostic_indexed.1.location(db).user_location(files_db).span
== diag.1.location(db).user_location(files_db).span
{
continue;
}
diagnostic_without_dup.push(diag);
prev_diagnostic_indexed = diag;
}
8727e55
to
c9c3d12
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 12 of 15 files reviewed, 2 unresolved discussions (waiting on @gilbens-starkware, @mkaput, and @orizi)
crates/cairo-lang-diagnostics/src/diagnostics.rs
line 335 at r4 (raw file):
diagnostic_without_dup.push(diag); prev_diagnostic_indexed = Some(diag); }
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 3 files at r5, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @gilbens-starkware and @orizi)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @orizi)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @orizi)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @orizi)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Tomer-StarkWare)
crates/cairo-lang-lowering/src/diagnostic.rs
line 105 at r5 (raw file):
} fn is_same_kind(&self, _other: &Self) -> bool {
doc.
remove _
c9c3d12
to
e334c13
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @orizi)
crates/cairo-lang-lowering/src/diagnostic.rs
line 105 at r5 (raw file):
Previously, orizi wrote…
doc.
remove_
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 15 files at r1, 4 of 4 files at r6, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @Tomer-StarkWare)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 4 of 4 files at r6, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @Tomer-StarkWare)
This change is