@@ -288,13 +288,16 @@ async function exerciseServerWorker(testDir: string, tsserverPath: string, repla
288
288
}
289
289
} , isAt ? 0.5 : 0.00005 ) ;
290
290
291
+ // auto-imports are too slow to test everywhere
292
+ const requestWithAutoImports = prng . random ( ) < 0.02 ;
293
+
291
294
const invokedResponse = await message ( {
292
295
"command" : "completionInfo" ,
293
296
"arguments" : {
294
297
"file" : openFileAbsolutePath ,
295
298
"line" : line ,
296
299
"offset" : column ,
297
- "includeExternalModuleExports" : prng . random ( ) < 0.01 , // auto-imports are too slow to test everywhere
300
+ "includeExternalModuleExports" : requestWithAutoImports ,
298
301
"triggerKind" : 1 ,
299
302
}
300
303
} , isAt ? 0.5 : 0.001 ) ;
@@ -311,6 +314,30 @@ async function exerciseServerWorker(testDir: string, tsserverPath: string, repla
311
314
] ,
312
315
}
313
316
} ) ;
317
+
318
+ // Auto-import completions frequently cause issues with completion entry details.
319
+ if ( requestWithAutoImports ) {
320
+ const completionEntries = invokedResponse . body . entries ;
321
+ for ( let entry of completionEntries ) {
322
+ if ( entry . hasAction && entry . source !== undefined && "data" in entry ) {
323
+ const { name, source, data } = entry ;
324
+
325
+ // 'completionEntryDetails' can take multiple entries; however, it's not useful for diagnostics
326
+ // to report that "this command failed when asking for details on any of these 100 completions."
327
+ await message ( {
328
+ "command" : "completionEntryDetails" ,
329
+ "arguments" : {
330
+ "file" : openFileAbsolutePath ,
331
+ "line" : line ,
332
+ "offset" : column ,
333
+ "entryNames" : [
334
+ { name, source, data } ,
335
+ ] ,
336
+ }
337
+ } )
338
+ }
339
+ }
340
+ }
314
341
}
315
342
316
343
const triggerCharIndex = triggerChars . indexOf ( curr ) ;
0 commit comments