Ignore diagnostics with empty ranges
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
a023950f28
commit
b0afc80678
2 changed files with 2 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue