@@ -4184,6 +4184,57 @@ namespace ts.projectSystem {
4184
4184
session . clearMessages ( ) ;
4185
4185
} ) ;
4186
4186
4187
+ it ( "disable suggestion diagnostics" , ( ) => {
4188
+ const file : FileOrFolder = {
4189
+ path : "/a.js" ,
4190
+ content : 'require("b")' ,
4191
+ } ;
4192
+
4193
+ const host = createServerHost ( [ file ] ) ;
4194
+ const session = createSession ( host , { canUseEvents : true } ) ;
4195
+ const service = session . getProjectService ( ) ;
4196
+
4197
+ session . executeCommandSeq < protocol . OpenRequest > ( {
4198
+ command : server . CommandNames . Open ,
4199
+ arguments : { file : file . path , fileContent : file . content } ,
4200
+ } ) ;
4201
+
4202
+ session . executeCommandSeq < protocol . ConfigureRequest > ( {
4203
+ command : server . CommandNames . Configure ,
4204
+ arguments : {
4205
+ preferences : { disableSuggestions : true }
4206
+ } ,
4207
+ } ) ;
4208
+
4209
+ checkNumberOfProjects ( service , { inferredProjects : 1 } ) ;
4210
+ session . clearMessages ( ) ;
4211
+ const expectedSequenceId = session . getNextSeq ( ) ;
4212
+ host . checkTimeoutQueueLengthAndRun ( 2 ) ;
4213
+
4214
+ checkProjectUpdatedInBackgroundEvent ( session , [ file . path ] ) ;
4215
+ session . clearMessages ( ) ;
4216
+
4217
+ session . executeCommandSeq < protocol . GeterrRequest > ( {
4218
+ command : server . CommandNames . Geterr ,
4219
+ arguments : {
4220
+ delay : 0 ,
4221
+ files : [ file . path ] ,
4222
+ }
4223
+ } ) ;
4224
+
4225
+ host . checkTimeoutQueueLengthAndRun ( 1 ) ;
4226
+
4227
+ checkErrorMessage ( session , "syntaxDiag" , { file : file . path , diagnostics : [ ] } , /*isMostRecent*/ true ) ;
4228
+ session . clearMessages ( ) ;
4229
+
4230
+ host . runQueuedImmediateCallbacks ( 1 ) ;
4231
+
4232
+ checkErrorMessage ( session , "semanticDiag" , { file : file . path , diagnostics : [ ] } ) ;
4233
+ // No suggestion event, we're done.
4234
+ checkCompleteEvent ( session , 2 , expectedSequenceId ) ;
4235
+ session . clearMessages ( ) ;
4236
+ } ) ;
4237
+
4187
4238
it ( "suppressed diagnostic events" , ( ) => {
4188
4239
const file : FileOrFolder = {
4189
4240
path : "/a.ts" ,
0 commit comments