(commands: TT.VSCodeCommand[] = [])
| 8 | // - https://code.visualstudio.com/docs/getstarted/keybindings (anything keybound is a command) |
| 9 | |
| 10 | const runVSCodeCommands = async (commands: TT.VSCodeCommand[] = []): Promise<void> => { |
| 11 | if (!commands.length) { |
| 12 | return |
| 13 | } |
| 14 | for (const command of commands) { |
| 15 | if (typeof command === 'string') { |
| 16 | // string named commands |
| 17 | await vscode.commands.executeCommand(command) |
| 18 | } else if (Array.isArray(command)) { |
| 19 | // array commands with params |
| 20 | const [name, params] = command |
| 21 | await vscode.commands.executeCommand(name, params) |
| 22 | } |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | export default runVSCodeCommands |
no outgoing calls
no test coverage detected