File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,6 +43,6 @@ pub struct Diagnostic {
4343 pub message : String ,
4444 pub severity : Option < Severity > ,
4545 pub code : Option < NumberOrString > ,
46- pub tags : Option < Vec < DiagnosticTag > > ,
46+ pub tags : Vec < DiagnosticTag > ,
4747 pub source : Option < String > ,
4848}
Original file line number Diff line number Diff line change @@ -84,19 +84,18 @@ pub mod util {
8484 None => None ,
8585 } ;
8686
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 ( ) ;
9997
98+ let tags = if !new_tags. is_empty ( ) {
10099 Some ( new_tags)
101100 } else {
102101 None
Original file line number Diff line number Diff line change @@ -614,9 +614,9 @@ impl Application {
614614 }
615615 } ) . collect ( ) ;
616616
617- Some ( new_tags)
617+ new_tags
618618 } else {
619- None
619+ Vec :: new ( )
620620 } ;
621621
622622 Some ( Diagnostic {
You can’t perform that action at this time.
0 commit comments