Skip to content

Commit fcd76fb

Browse files
committed
Create the completion item set only a single time
1 parent b36a174 commit fcd76fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ export class TerminalCompletionService extends Disposable implements ITerminalCo
225225
const resourceCompletions = await this.resolveResources(completions.resourceRequestConfig, promptValue, cursorPosition, `core:path:ext:${provider.id}`, capabilities, shellType);
226226
this._logService.trace(`TerminalCompletionService#_collectCompletions dedupe`);
227227
if (resourceCompletions) {
228+
const labels = new Set(completionItems.map(c => c.label));
228229
for (const item of resourceCompletions) {
229-
const labels = new Set(completionItems.map(c => c.label));
230230
// Ensure no duplicates such as .
231231
if (!labels.has(item.label)) {
232232
completionItems.push(item);

0 commit comments

Comments
 (0)