Skip to content

Commit b1cd91b

Browse files
authored
de-dupe terminal suggest commands for which there are specs (microsoft#251142)
fix microsoft#244918
1 parent 10066c9 commit b1cd91b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

extensions/terminal-suggest/src/terminalSuggestMain.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,9 @@ export async function getCompletionItemsFromSpecs(
280280
const labels = new Set(items.map((i) => typeof i.label === 'string' ? i.label : i.label.label));
281281
for (const command of availableCommands) {
282282
const commandTextLabel = typeof command.label === 'string' ? command.label : command.label.label;
283-
if (!labels.has(commandTextLabel)) {
283+
// Remove any file extension for matching on Windows
284+
const labelWithoutExtension = isWindows ? commandTextLabel.replace(/\.[^ ]+$/, '') : commandTextLabel;
285+
if (!labels.has(labelWithoutExtension)) {
284286
items.push(createCompletionItem(
285287
terminalContext.cursorPosition,
286288
currentCommandString,

0 commit comments

Comments
 (0)