diff --git a/src/commands/quickCommand.steps.ts b/src/commands/quickCommand.steps.ts index 8549b4b..6418011 100644 --- a/src/commands/quickCommand.steps.ts +++ b/src/commands/quickCommand.steps.ts @@ -60,8 +60,6 @@ import { ReferencesQuickPickItem, RefQuickPickItem, RepositoryQuickPickItem, - RevealInSideBarQuickPickItem, - SearchForCommitQuickPickItem, TagQuickPickItem, } from '../quickpicks'; import { Arrays, Iterables, Strings } from '../system'; @@ -1468,12 +1466,7 @@ async function getShowCommitOrStashStepItems< const items: (CommandQuickPickItem | QuickPickSeparator)[] = [new CommitFilesQuickPickItem(state.reference)]; if (GitCommit.isStash(state.reference)) { - items.push( - QuickPickSeparator.create(), - new RevealInSideBarQuickPickItem(state.reference), - QuickPickSeparator.create(), - new CommitCopyMessageQuickPickItem(state.reference), - ); + items.push(QuickPickSeparator.create(), new CommitCopyMessageQuickPickItem(state.reference)); items.push( QuickPickSeparator.create('Actions'), @@ -1496,12 +1489,6 @@ async function getShowCommitOrStashStepItems< }), ); } else { - items.push( - QuickPickSeparator.create(), - new RevealInSideBarQuickPickItem(state.reference), - new SearchForCommitQuickPickItem(state.reference), - ); - const remotes = await Container.instance.git.getRemotesWithProviders(state.repo.path, { sort: true }); if (remotes?.length) { items.push( @@ -1836,18 +1823,10 @@ async function getShowCommitOrStashFileStepItems< if (GitCommit.isStash(state.reference)) { items.push( QuickPickSeparator.create(), - new RevealInSideBarQuickPickItem(state.reference), - QuickPickSeparator.create(), new CommitCopyMessageQuickPickItem(state.reference), QuickPickSeparator.create('Actions'), ); } else { - items.push( - QuickPickSeparator.create(), - new RevealInSideBarQuickPickItem(state.reference), - new SearchForCommitQuickPickItem(state.reference), - ); - const remotes = await Container.instance.git.getRemotesWithProviders(state.repo.path, { sort: true }); if (remotes?.length) { items.push( diff --git a/src/quickpicks/quickPicksItems.ts b/src/quickpicks/quickPicksItems.ts index 1d5273c..77de75e 100644 --- a/src/quickpicks/quickPicksItems.ts +++ b/src/quickpicks/quickPicksItems.ts @@ -1,8 +1,5 @@ import { commands, QuickPickItem, QuickPickItemKind } from 'vscode'; -import { Commands, GitActions } from '../commands'; -import { Container } from '../container'; -import { GitCommit, GitReference, GitRevisionReference } from '../git/models'; -import { SearchPattern } from '../git/search'; +import { Commands } from '../commands'; import { Keys } from '../keyboard'; declare module 'vscode' { @@ -196,61 +193,3 @@ function hasFlags(flags: T[], has?: T | T[]): boolean { return has.length === 0 ? flags.length === 0 : has.every(f => flags.includes(f)); } - -export class RevealInSideBarQuickPickItem extends CommandQuickPickItem { - constructor( - private readonly reference: GitRevisionReference, - item: QuickPickItem = { - label: `$(eye) Reveal ${GitReference.isStash(reference) ? 'Stash' : 'Commit'} in Side Bar`, - description: GitReference.isStash(reference) ? '' : 'can take a while', - }, - ) { - super(item, undefined, undefined); - } - - override async execute(options?: { preserveFocus?: boolean; preview?: boolean }): Promise { - if (GitCommit.isStash(this.reference)) { - void (await GitActions.Stash.reveal(this.reference, { - select: true, - focus: !(options?.preserveFocus ?? false), - expand: true, - })); - } else { - void (await GitActions.Commit.reveal(this.reference, { - select: true, - focus: !(options?.preserveFocus ?? false), - expand: true, - })); - } - } -} - -export class SearchForCommitQuickPickItem extends CommandQuickPickItem { - constructor( - private readonly reference: GitRevisionReference, - item: QuickPickItem = { - label: '$(search) Search for Commit in Side Bar', - }, - ) { - super(item, undefined, undefined); - } - - override async execute(options?: { preserveFocus?: boolean; preview?: boolean }): Promise { - void (await Container.instance.searchAndCompareView.search( - this.reference.repoPath, - { - pattern: SearchPattern.fromCommit(this.reference), - }, - { - label: { - label: `for ${GitReference.toString(this.reference, { icon: false })}`, - }, - reveal: { - select: true, - focus: !(options?.preserveFocus ?? false), - expand: true, - }, - }, - )); - } -}