Skip to content

Commit affdd03

Browse files
Increase auto-import frequency; turn off completionEntryDetails. (#104)
1 parent 9a54fd8 commit affdd03

File tree

1 file changed

+1
-33
lines changed

1 file changed

+1
-33
lines changed

src/utils/exerciseServer.ts

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ async function exerciseServerWorker(testDir: string, tsserverPath: string, repla
289289
}, isAt ? 0.5 : 0.00005);
290290

291291
// auto-imports are too slow to test everywhere
292-
const requestWithAutoImports = prng.random() < 0.02;
292+
const requestWithAutoImports = prng.random() < 0.05;
293293

294294
const invokedResponse = await message({
295295
"command": "completionInfo",
@@ -314,38 +314,6 @@ async function exerciseServerWorker(testDir: string, tsserverPath: string, repla
314314
],
315315
}
316316
});
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-
let { name, source, data } = entry;
324-
// `source` may or may not be relative.
325-
if (path.isAbsolute(source)) {
326-
source = path.join(testDirPlaceholder, path.relative(testDir, source)).replace(/\\/g, "/");
327-
}
328-
// Technically data is supposed to be opaque... but what can you do?
329-
if (typeof data.fileName === "string" && path.isAbsolute(data.fileName)) {
330-
data.fileName = path.join(testDirPlaceholder, path.relative(testDir, data.fileName)).replace(/\\/g, "/");
331-
}
332-
333-
// 'completionEntryDetails' can take multiple entries; however, it's not useful for diagnostics
334-
// to report that "this command failed when asking for details on any of these 100 completions."
335-
await message({
336-
"command": "completionEntryDetails",
337-
"arguments": {
338-
"file": openFileAbsolutePath,
339-
"line": line,
340-
"offset": column,
341-
"entryNames": [
342-
{ name, source, data },
343-
],
344-
}
345-
})
346-
}
347-
}
348-
}
349317
}
350318

351319
const triggerCharIndex = triggerChars.indexOf(curr);

0 commit comments

Comments
 (0)