@@ -4131,10 +4131,10 @@ namespace ts.projectSystem {
4131
4131
checkErrorMessage ( session , "semanticDiag" , { file : file1 . path , diagnostics : [ ] } ) ;
4132
4132
} ) ;
4133
4133
4134
- it ( "info diagnostics" , ( ) => {
4134
+ it ( "suggestion diagnostics" , ( ) => {
4135
4135
const file : FileOrFolder = {
4136
4136
path : "/a.js" ,
4137
- content : 'require("b")' ,
4137
+ content : "function f(p) {}" ,
4138
4138
} ;
4139
4139
4140
4140
const host = createServerHost ( [ file ] ) ;
@@ -4177,7 +4177,7 @@ namespace ts.projectSystem {
4177
4177
checkErrorMessage ( session , "suggestionDiag" , {
4178
4178
file : file . path ,
4179
4179
diagnostics : [
4180
- createDiagnostic ( { line : 1 , offset : 1 } , { line : 1 , offset : 13 } , Diagnostics . File_is_a_CommonJS_module_it_may_be_converted_to_an_ES6_module )
4180
+ createDiagnostic ( { line : 1 , offset : 12 } , { line : 1 , offset : 13 } , Diagnostics . _0_is_declared_but_its_value_is_never_read , [ "p" ] , "suggestion" , /*reportsUnnecssary*/ true )
4181
4181
] ,
4182
4182
} ) ;
4183
4183
checkCompleteEvent ( session , 2 , expectedSequenceId ) ;
@@ -4241,8 +4241,8 @@ namespace ts.projectSystem {
4241
4241
session . clearMessages ( ) ;
4242
4242
} ) ;
4243
4243
4244
- function createDiagnostic ( start : protocol . Location , end : protocol . Location , message : DiagnosticMessage , args : ReadonlyArray < string > = [ ] ) : protocol . Diagnostic {
4245
- return { start, end, text : formatStringFromArgs ( message . message , args ) , code : message . code , category : diagnosticCategoryName ( message ) , source : undefined } ;
4244
+ function createDiagnostic ( start : protocol . Location , end : protocol . Location , message : DiagnosticMessage , args : ReadonlyArray < string > = [ ] , category = diagnosticCategoryName ( message ) , reportsUnnecessary ?: { } ) : protocol . Diagnostic {
4245
+ return { start, end, text : formatStringFromArgs ( message . message , args ) , code : message . code , category, reportsUnnecessary , source : undefined } ;
4246
4246
}
4247
4247
} ) ;
4248
4248
0 commit comments