Skip to content

Commit 92f5c08

Browse files
committed
Don't await realpath calls sequentially
1 parent fcd76fb commit 92f5c08

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/vs/workbench/contrib/terminalContrib/suggest/browser/terminalCompletionService.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ export class TerminalCompletionService extends Disposable implements ITerminalCo
406406
// - (absolute) `cd c:/src/` -> `cd c:/src/folder1/`, ...
407407
// - (tilde) `cd ~/src/` -> `cd ~/src/folder1/`, ...
408408
this._logService.trace(`TerminalCompletionService#resolveResources direct children`);
409-
for (const child of stat.children) {
409+
await Promise.all(stat.children.map(child => (async () => {
410410
let kind: TerminalCompletionItemKind | undefined;
411411
let detail: string | undefined = undefined;
412412
if (foldersRequested && child.isDirectory) {
@@ -423,7 +423,7 @@ export class TerminalCompletionService extends Disposable implements ITerminalCo
423423
}
424424
}
425425
if (kind === undefined) {
426-
continue;
426+
return;
427427
}
428428

429429
let label = lastWordFolder;
@@ -443,7 +443,7 @@ export class TerminalCompletionService extends Disposable implements ITerminalCo
443443
if (child.isFile && fileExtensions) {
444444
const extension = child.name.split('.').length > 1 ? child.name.split('.').at(-1) : undefined;
445445
if (extension && !fileExtensions.includes(extension)) {
446-
continue;
446+
return;
447447
}
448448
}
449449

@@ -467,7 +467,7 @@ export class TerminalCompletionService extends Disposable implements ITerminalCo
467467
replacementIndex: cursorPosition - lastWord.length,
468468
replacementLength: lastWord.length
469469
});
470-
}
470+
})()));
471471

472472
// Support $CDPATH specially for the `cd` command only
473473
//

0 commit comments

Comments
 (0)