import { inject , injectable } from 'inversify' ; import { ICommandManager } from '../../application/types/commandManager' ; import { CommitDetails } from '../../common/types' ; import { ICommitViewerFactory } from '../../viewers/types' ; import { command } from '../registration' ; import { IGitCommitViewExplorerCommandHandler } from '../types' ; @ injectable ( ) export class GitCommitViewExplorerCommandHandler implements IGitCommitViewExplorerCommandHandler { constructor ( @ inject ( ICommandManager ) private commandManager , @ inject ( ICommitViewerFactory ) private commitViewerFactory ) { } @ command ( 'git.commit.view.hide' , IGitCommitViewExplorerCommandHandler ) public async hideCommitView ( _commit ) { await this . commandManager . executeCommand ( 'setContext' , 'git.commit.view.show' , false ) ; } @ command ( 'git.commit.view.show' , IGitCommitViewExplorerCommandHandler ) public async showCommitView ( _commit ) { await this . commandManager . executeCommand ( 'setContext' , 'git.commit.view.show' , true ) ; } @ command ( 'git.commit.view.showFilesOnly' , IGitCommitViewExplorerCommandHandler ) public async showFilesView ( _commit ) { this . commitViewerFactory . getCommitViewer ( ) . showFilesView ( ) ; } @ command ( 'git.commit.view.showFolderView' , IGitCommitViewExplorerCommandHandler ) public async showFolderView ( _commit ) { this . commitViewerFactory . getCommitViewer ( ) . showFolderView ( ) ; } }