mirror of https://github.com/astral-sh/ruff
[ty] Don't create a related diagnostic for the primary annotation of sub-diagnostics (#21845)
This commit is contained in:
parent
b845e81c4a
commit
4364ffbdd3
|
|
@ -888,6 +888,10 @@ impl Annotation {
|
|||
pub fn hide_snippet(&mut self, yes: bool) {
|
||||
self.hide_snippet = yes;
|
||||
}
|
||||
|
||||
pub fn is_primary(&self) -> bool {
|
||||
self.is_primary
|
||||
}
|
||||
}
|
||||
|
||||
/// Tags that can be associated with an annotation.
|
||||
|
|
|
|||
|
|
@ -349,6 +349,7 @@ pub(super) fn to_lsp_diagnostic(
|
|||
sub_diagnostic
|
||||
.annotations()
|
||||
.iter()
|
||||
.filter(|annotation| !annotation.is_primary())
|
||||
.filter_map(|annotation| {
|
||||
annotation_to_related_information(db, annotation, encoding)
|
||||
}),
|
||||
|
|
|
|||
Loading…
Reference in New Issue