mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-07 00:06:24 +03:00
Ignore diagnostics with empty ranges
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
a023950f28
commit
b0afc80678
@ -2242,6 +2242,7 @@ impl Editor {
|
||||
.diagnostics_in_range::<_, usize>(search_start..buffer.len())
|
||||
.find_map(|(range, diagnostic)| {
|
||||
if diagnostic.is_primary
|
||||
&& !range.is_empty()
|
||||
&& Some(range.end) != active_primary_range.as_ref().map(|r| *r.end())
|
||||
{
|
||||
Some((range, diagnostic.group_id))
|
||||
|
@ -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…
Reference in New Issue
Block a user