File tree Expand file tree Collapse file tree 3 files changed +14
-15
lines changed Expand file tree Collapse file tree 3 files changed +14
-15
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,6 @@ pub struct Diagnostic {
43
43
pub message : String ,
44
44
pub severity : Option < Severity > ,
45
45
pub code : Option < NumberOrString > ,
46
- pub tags : Option < Vec < DiagnosticTag > > ,
46
+ pub tags : Vec < DiagnosticTag > ,
47
47
pub source : Option < String > ,
48
48
}
Original file line number Diff line number Diff line change @@ -84,19 +84,18 @@ pub mod util {
84
84
None => None ,
85
85
} ;
86
86
87
- let tags = if let Some ( ref tags) = diag. tags {
88
- let new_tags = tags
89
- . iter ( )
90
- . map ( |tag| match tag {
91
- helix_core:: diagnostic:: DiagnosticTag :: Unnecessary => {
92
- lsp:: DiagnosticTag :: UNNECESSARY
93
- }
94
- helix_core:: diagnostic:: DiagnosticTag :: Deprecated => {
95
- lsp:: DiagnosticTag :: DEPRECATED
96
- }
97
- } )
98
- . collect ( ) ;
87
+ let new_tags: Vec < _ > = diag
88
+ . tags
89
+ . iter ( )
90
+ . map ( |tag| match tag {
91
+ helix_core:: diagnostic:: DiagnosticTag :: Unnecessary => {
92
+ lsp:: DiagnosticTag :: UNNECESSARY
93
+ }
94
+ helix_core:: diagnostic:: DiagnosticTag :: Deprecated => lsp:: DiagnosticTag :: DEPRECATED ,
95
+ } )
96
+ . collect ( ) ;
99
97
98
+ let tags = if !new_tags. is_empty ( ) {
100
99
Some ( new_tags)
101
100
} else {
102
101
None
Original file line number Diff line number Diff line change @@ -614,9 +614,9 @@ impl Application {
614
614
}
615
615
} ) . collect ( ) ;
616
616
617
- Some ( new_tags)
617
+ new_tags
618
618
} else {
619
- None
619
+ Vec :: new ( )
620
620
} ;
621
621
622
622
Some ( Diagnostic {
You can’t perform that action at this time.
0 commit comments