-
Notifications
You must be signed in to change notification settings - Fork 562
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
LS: Fix duplicated and misplaced diagnostics #6446
LS: Fix duplicated and misplaced diagnostics #6446
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 3 of 3 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Arcticae, @Draggu, @orizi, and @piotmag769)
crates/cairo-lang-diagnostics/src/diagnostics.rs
line 335 at r1 (raw file):
let files_db = db.upcast(); let mut indexed_dup_diagnostic = diagnostic_with_dup.iter().enumerate().sorted_by_key(|(idx, diag)| {
if you're opting for heavy weapons here, then consider using https://docs.rs/itertools/latest/itertools/trait.Itertools.html#method.sorted_by_cached_key0
ce865ea
to
038bb85
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.
Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @Draggu, @orizi, and @piotmag769)
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 3 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @orizi and @piotmag769)
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: complete! all files reviewed, all discussions resolved (waiting on @piotmag769)
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 3 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @Arcticae)
The diagnostics were not sorted properly, because of lack of including their kind in sorting before deduplication
(
.format()
is a derivative of that)Also added a check for file relevance, so that vfs-based diagnostics aren't included in the mapping phase
This change is