Ignore diagnostics with empty ranges

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra 2021-11-19 16:30:26 +01:00
parent a023950f28
commit b0afc80678
2 changed files with 2 additions and 0 deletions

View file

@ -263,6 +263,7 @@ impl DiagnosticMessage {
.buffer()
.read(cx)
.diagnostics_in_range::<usize, usize>(cursor_position..cursor_position)
.filter(|(range, _)| !range.is_empty())
.min_by_key(|(range, diagnostic)| (diagnostic.severity, range.len()))
.map(|(_, diagnostic)| diagnostic.clone());
if new_diagnostic != self.diagnostic {