File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -132,15 +132,21 @@ let dceTextToDiagnostics = (
132132 }
133133
134134 let issueLocationRange = new Range ( startPos , endPos ) ;
135+ let diagnosticText = text . trim ( ) ;
135136
136137 let diagnostic = new Diagnostic (
137138 issueLocationRange ,
138- text . trim ( ) ,
139+ diagnosticText ,
139140 DiagnosticSeverity . Warning
140141 ) ;
141142
142- // This will render the part of the code as unused
143- diagnostic . tags = [ DiagnosticTag . Unnecessary ] ;
143+ // Everything reanalyze reports is about dead code, except for redundant
144+ // optional arguments. This will ensure that everything but reduntant
145+ // optional arguments is highlighted as unecessary/unused code in the
146+ // editor.
147+ if ( ! diagnosticText . toLowerCase ( ) . startsWith ( "optional argument" ) ) {
148+ diagnostic . tags = [ DiagnosticTag . Unnecessary ] ;
149+ }
144150
145151 if ( diagnosticsMap . has ( processedFileInfo . filePath ) ) {
146152 diagnosticsMap . get ( processedFileInfo . filePath ) . push ( diagnostic ) ;
You can’t perform that action at this time.
0 commit comments