@@ -22,7 +22,10 @@ import {
2222 BranchTrackingStatusNode ,
2323 CommitFileNode ,
2424 CommitNode ,
25+ ContributorNode ,
26+ FileHistoryNode ,
2527 FolderNode ,
28+ LineHistoryNode ,
2629 RemoteNode ,
2730 RepositoryNode ,
2831 ResultsFileNode ,
@@ -34,10 +37,7 @@ import {
3437 ViewRefNode ,
3538 viewSupportsNodeDismissal
3639} from './nodes' ;
37- import { ContributorNode } from './nodes/contributorNode' ;
3840import { Strings } from '../system/string' ;
39- import { FileHistoryNode } from './nodes/fileHistoryNode' ;
40- import { LineHistoryNode } from './nodes/lineHistoryNode' ;
4141
4242export interface RefreshNodeCommandArgs {
4343 maxCount ?: number ;
@@ -392,10 +392,17 @@ export class ViewCommands implements Disposable {
392392 }
393393
394394 private openFileRevision (
395- node : CommitFileNode | ResultsFileNode | StashFileNode ,
395+ node : CommitFileNode | ResultsFileNode | StashFileNode | StatusFileNode ,
396396 options : OpenFileRevisionCommandArgs = { showOptions : { preserveFocus : true , preview : false } }
397397 ) {
398- if ( ! ( node instanceof CommitFileNode ) && ! ( node instanceof ResultsFileNode ) ) return undefined ;
398+ if (
399+ ! ( node instanceof CommitFileNode ) &&
400+ ! ( node instanceof StashFileNode ) &&
401+ ! ( node instanceof ResultsFileNode ) &&
402+ ! ( node instanceof StatusFileNode )
403+ ) {
404+ return undefined ;
405+ }
399406
400407 let uri = options . uri ;
401408 if ( uri == null ) {
@@ -417,6 +424,19 @@ export class ViewCommands implements Disposable {
417424 return openEditor ( uri , options . showOptions || { preserveFocus : true , preview : false } ) ;
418425 }
419426
427+ private openFileRevisionInRemote ( node : CommitFileNode ) {
428+ if ( ! ( node instanceof CommitFileNode ) || node instanceof StashFileNode ) return undefined ;
429+
430+ const args : OpenFileInRemoteCommandArgs = {
431+ range : false
432+ } ;
433+ return commands . executeCommand (
434+ Commands . OpenFileInRemote ,
435+ node . commit . toGitUri ( node . commit . status === 'D' ) ,
436+ args
437+ ) ;
438+ }
439+
420440 private async openChangedFileChanges (
421441 node : CommitNode | StashNode ,
422442 options : TextDocumentShowOptions = { preserveFocus : false , preview : false }
@@ -503,19 +523,6 @@ export class ViewCommands implements Disposable {
503523 return commands . executeCommand ( Commands . DiffWith , diffArgs ) ;
504524 }
505525
506- private openFileRevisionInRemote ( node : CommitFileNode | StashFileNode | StatusFileNode ) {
507- if ( ! ( node instanceof CommitFileNode ) && ! ( node instanceof StatusFileNode ) ) return undefined ;
508-
509- const args : OpenFileInRemoteCommandArgs = {
510- range : false
511- } ;
512- return commands . executeCommand (
513- Commands . OpenFileInRemote ,
514- node . commit . toGitUri ( node . commit . status === 'D' ) ,
515- args
516- ) ;
517- }
518-
519526 private openInTerminal ( node : RepositoryNode ) {
520527 if ( ! ( node instanceof RepositoryNode ) ) return undefined ;
521528
0 commit comments