Files
vscode-gitlens/src/commands/showLastQuickPick.ts
Eric Amodio 0a9559f5a5 Reworks commanding structure for less redundancy
Adds command args copying when needed
2017-06-28 01:06:20 -04:00

24 lines
714 B
TypeScript

'use strict';
import { commands, window } from 'vscode';
import { Command, Commands, getLastCommand } from './common';
import { Logger } from '../logger';
export class ShowLastQuickPickCommand extends Command {
constructor() {
super(Commands.ShowLastQuickPick);
}
async execute() {
const command = getLastCommand();
if (command === undefined) return undefined;
try {
return commands.executeCommand(command.command, ...command.args);
}
catch (ex) {
Logger.error(ex, 'ShowLastQuickPickCommand');
return window.showErrorMessage(`Unable to show last quick pick. See output channel for more details`);
}
}
}