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 = (
132
132
}
133
133
134
134
let issueLocationRange = new Range ( startPos , endPos ) ;
135
+ let diagnosticText = text . trim ( ) ;
135
136
136
137
let diagnostic = new Diagnostic (
137
138
issueLocationRange ,
138
- text . trim ( ) ,
139
+ diagnosticText ,
139
140
DiagnosticSeverity . Warning
140
141
) ;
141
142
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
+ }
144
150
145
151
if ( diagnosticsMap . has ( processedFileInfo . filePath ) ) {
146
152
diagnosticsMap . get ( processedFileInfo . filePath ) . push ( diagnostic ) ;
You can’t perform that action at this time.
0 commit comments