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

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra 2021-11-18 16:04:16 +01:00
parent 0e51365770
commit 643545e91e

View file

@ -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);