Adds new GitLens custom view

This commit is contained in:
Eric Amodio
2017-08-30 12:26:30 -04:00
parent ed58dc3b49
commit 9782a81e46
69 changed files with 983 additions and 644 deletions

View File

@@ -1,11 +1,10 @@
'use strict';
import { MessageItem, window } from 'vscode';
import { Command, CommandContext, Commands } from './common';
import { Command, CommandContext, Commands, isCommandViewContextWithCommit } from './common';
import { GlyphChars } from '../constants';
import { GitService } from '../gitService';
import { GitService, GitStashCommit } from '../gitService';
import { Logger } from '../logger';
import { CommandQuickPickItem } from '../quickPicks';
import { StashCommitNode } from '../views/stashCommitNode';
export interface StashDeleteCommandArgs {
confirm?: boolean;
@@ -21,12 +20,9 @@ export class StashDeleteCommand extends Command {
}
protected async preExecute(context: CommandContext, args: StashDeleteCommandArgs = { confirm: true }) {
if (context.type === 'view' && context.node instanceof StashCommitNode) {
if (isCommandViewContextWithCommit<GitStashCommit>(context)) {
args = { ...args };
const stash = context.node.commit;
args.stashItem = { stashName: stash.stashName, message: stash.message };
args.stashItem = { stashName: context.node.commit.stashName, message: context.node.commit.message };
return this.execute(args);
}