From 34180ac9bef8c781c25952e26b29d8daa43bb451 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 19 May 2021 18:23:51 -0700 Subject: [PATCH] Remove code allowing multiple ids for a command This doesn't appear to be used anywhere --- .../src/commands/commandManager.ts | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/extensions/typescript-language-features/src/commands/commandManager.ts b/extensions/typescript-language-features/src/commands/commandManager.ts index 7bf1d7e33aa..b7b58bf7ede 100644 --- a/extensions/typescript-language-features/src/commands/commandManager.ts +++ b/extensions/typescript-language-features/src/commands/commandManager.ts @@ -6,7 +6,7 @@ import * as vscode from 'vscode'; export interface Command { - readonly id: string | string[]; + readonly id: string; execute(...args: any[]): void; } @@ -22,17 +22,9 @@ export class CommandManager { } public register(command: T): T { - for (const id of Array.isArray(command.id) ? command.id : [command.id]) { - this.registerCommand(id, command.execute, command); + if (!this.commands.has(command.id)) { + this.commands.set(command.id, vscode.commands.registerCommand(command.id, command.execute, command)); } return command; } - - private registerCommand(id: string, impl: (...args: any[]) => void, thisArg?: any) { - if (this.commands.has(id)) { - return; - } - - this.commands.set(id, vscode.commands.registerCommand(id, impl, thisArg)); - } -} \ No newline at end of file +}