Revert "Fix editor::GoToDiagnostics cycle (#24446)" (#24568)

This reverts commit 4f65cfa93d.

Release Notes:

- N/A
This commit is contained in:
Kirill Bulatov 2025-02-10 19:13:12 +02:00 committed by GitHub
parent de8d4d00ce
commit 4f7200527c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 188 deletions

View file

@ -10299,26 +10299,14 @@ impl Editor {
if entry.diagnostic.is_primary
&& entry.diagnostic.severity <= DiagnosticSeverity::WARNING
&& entry.range.start != entry.range.end
// if we match with the active diagnostic, skip it
&& Some(entry.diagnostic.group_id)
!= self.active_diagnostics.as_ref().map(|d| d.group_id)
{
let entry_group = entry.diagnostic.group_id;
let in_next_group = self.active_diagnostics.as_ref().map_or(
true,
|active| match direction {
Direction::Prev => {
entry_group != active.group_id
&& (active.group_id == 0 || entry_group < active.group_id)
}
Direction::Next => {
entry_group != active.group_id
&& (entry_group == 0 || entry_group > active.group_id)
}
},
);
if in_next_group {
return Some((entry.range, entry.diagnostic.group_id));
}
Some((entry.range, entry.diagnostic.group_id))
} else {
None
}
None
});
if let Some((primary_range, group_id)) = group {