When showing the next diagnostic, advance to the next *primary* one

Antonio Scandurra and Nathan Sobo created

Co-Authored-By: Nathan Sobo <nathan@zed.dev>

Change summary

crates/editor/src/lib.rs | 1 +
1 file changed, 1 insertion(+)

Detailed changes

crates/editor/src/lib.rs 🔗

@@ -2209,6 +2209,7 @@ impl Editor {
         let buffer = self.buffer.read(cx.as_ref());
         let diagnostic_group_id = dbg!(buffer
             .diagnostics_in_range::<_, usize>(selection.head()..buffer.len())
+            .filter(|(_, diagnostic)| diagnostic.is_primary)
             .next())
         .map(|(_, diagnostic)| diagnostic.group_id);