mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-02-08 17:25:52 -05:00
Adds show last quick pick command
This commit is contained in:
24
src/commands/showLastQuickPick.ts
Normal file
24
src/commands/showLastQuickPick.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
'use strict';
|
||||
import { commands, window } from 'vscode';
|
||||
import { Command, Commands, getLastCommand } from './commands';
|
||||
import { Logger } from '../logger';
|
||||
|
||||
export class ShowLastQuickPickCommand extends Command {
|
||||
|
||||
constructor() {
|
||||
super(Commands.ShowLastQuickPick);
|
||||
}
|
||||
|
||||
async execute() {
|
||||
const command = getLastCommand();
|
||||
if (!command) return undefined;
|
||||
|
||||
try {
|
||||
return commands.executeCommand(command.command, ...command.args);
|
||||
}
|
||||
catch (ex) {
|
||||
Logger.error('[GitLens.ShowLastQuickPickCommand]', ex);
|
||||
return window.showErrorMessage(`Unable to show last quick pick. See output channel for more details`);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user