@@ -84,7 +84,7 @@ export namespace CommandArguments {
84
84
85
85
function pluralizedContextLabel ( singular : string , plural : string ) {
86
86
return ( args : any ) => {
87
- const { files } = ( args as any ) as CommandArguments . IGitContextAction ;
87
+ const { files } = args as any as CommandArguments . IGitContextAction ;
88
88
if ( files . length > 1 ) {
89
89
return plural ;
90
90
} else {
@@ -423,7 +423,7 @@ export function addCommands(
423
423
label : trans . __ ( 'Show Diff' ) ,
424
424
caption : trans . __ ( 'Display a file diff.' ) ,
425
425
execute : async args => {
426
- const { model, isText } = ( args as any ) as {
426
+ const { model, isText } = args as any as {
427
427
model : Git . Diff . IModel < string > ;
428
428
isText ?: boolean ;
429
429
} ;
@@ -516,7 +516,7 @@ export function addCommands(
516
516
trans . __ ( 'Open selected files' )
517
517
) ,
518
518
execute : async args => {
519
- const { files } = ( args as any ) as CommandArguments . IGitContextAction ;
519
+ const { files } = args as any as CommandArguments . IGitContextAction ;
520
520
for ( const file of files ) {
521
521
const { x, y, to } = file ;
522
522
if ( x === 'D' || y === 'D' ) {
@@ -549,7 +549,7 @@ export function addCommands(
549
549
trans . __ ( 'Diff selected files' )
550
550
) ,
551
551
execute : async args => {
552
- const { files } = ( args as any ) as CommandArguments . IGitFileDiff ;
552
+ const { files } = args as any as CommandArguments . IGitFileDiff ;
553
553
for ( const file of files ) {
554
554
const { context, filePath, isText, status } = file ;
555
555
@@ -656,7 +656,7 @@ export function addCommands(
656
656
trans . __ ( 'Stage or track the changes of selected files' )
657
657
) ,
658
658
execute : async args => {
659
- const { files } = ( args as any ) as CommandArguments . IGitContextAction ;
659
+ const { files } = args as any as CommandArguments . IGitContextAction ;
660
660
for ( const file of files ) {
661
661
await gitModel . add ( file . to ) ;
662
662
}
@@ -671,7 +671,7 @@ export function addCommands(
671
671
trans . __ ( 'Stage the changes of selected files' )
672
672
) ,
673
673
execute : async args => {
674
- const { files } = ( args as any ) as CommandArguments . IGitContextAction ;
674
+ const { files } = args as any as CommandArguments . IGitContextAction ;
675
675
for ( const file of files ) {
676
676
await gitModel . add ( file . to ) ;
677
677
}
@@ -686,7 +686,7 @@ export function addCommands(
686
686
trans . __ ( 'Start tracking selected files' )
687
687
) ,
688
688
execute : async args => {
689
- const { files } = ( args as any ) as CommandArguments . IGitContextAction ;
689
+ const { files } = args as any as CommandArguments . IGitContextAction ;
690
690
for ( const file of files ) {
691
691
await gitModel . add ( file . to ) ;
692
692
}
@@ -701,7 +701,7 @@ export function addCommands(
701
701
trans . __ ( 'Unstage the changes of selected files' )
702
702
) ,
703
703
execute : async args => {
704
- const { files } = ( args as any ) as CommandArguments . IGitContextAction ;
704
+ const { files } = args as any as CommandArguments . IGitContextAction ;
705
705
for ( const file of files ) {
706
706
if ( file . x !== 'D' ) {
707
707
await gitModel . reset ( file . to ) ;
@@ -727,7 +727,7 @@ export function addCommands(
727
727
trans . __ ( 'Delete these files' )
728
728
) ,
729
729
execute : async args => {
730
- const { files } = ( args as any ) as CommandArguments . IGitContextAction ;
730
+ const { files } = args as any as CommandArguments . IGitContextAction ;
731
731
const fileList = representFiles ( files ) ;
732
732
733
733
const result = await showDialog ( {
@@ -770,7 +770,7 @@ export function addCommands(
770
770
trans . __ ( 'Discard recent changes of selected files' )
771
771
) ,
772
772
execute : async args => {
773
- const { files } = ( args as any ) as CommandArguments . IGitContextAction ;
773
+ const { files } = args as any as CommandArguments . IGitContextAction ;
774
774
const fileList = representFiles ( files ) ;
775
775
776
776
const result = await showDialog ( {
@@ -828,7 +828,7 @@ export function addCommands(
828
828
trans . __ ( 'Ignore these files (add to .gitignore)' )
829
829
) ,
830
830
execute : async args => {
831
- const { files } = ( args as any ) as CommandArguments . IGitContextAction ;
831
+ const { files } = args as any as CommandArguments . IGitContextAction ;
832
832
for ( const file of files ) {
833
833
if ( file ) {
834
834
await gitModel . ignore ( file . to , false ) ;
@@ -839,7 +839,7 @@ export function addCommands(
839
839
840
840
commands . addCommand ( ContextCommandIDs . gitIgnoreExtension , {
841
841
label : args => {
842
- const { files } = ( args as any ) as CommandArguments . IGitContextAction ;
842
+ const { files } = args as any as CommandArguments . IGitContextAction ;
843
843
const extensions = files
844
844
. map ( file => PathExt . extname ( file . to ) )
845
845
. filter ( extension => extension . length > 0 ) ;
@@ -855,7 +855,7 @@ export function addCommands(
855
855
trans . __ ( 'Ignore these files extension (add to .gitignore)' )
856
856
) ,
857
857
execute : async args => {
858
- const { files } = ( args as any ) as CommandArguments . IGitContextAction ;
858
+ const { files } = args as any as CommandArguments . IGitContextAction ;
859
859
for ( const selectedFile of files ) {
860
860
if ( selectedFile ) {
861
861
const extension = PathExt . extname ( selectedFile . to ) ;
@@ -879,7 +879,7 @@ export function addCommands(
879
879
}
880
880
} ,
881
881
isVisible : args => {
882
- const { files } = ( args as any ) as CommandArguments . IGitContextAction ;
882
+ const { files } = args as any as CommandArguments . IGitContextAction ;
883
883
return files . some ( selectedFile => {
884
884
const extension = PathExt . extname ( selectedFile . to ) ;
885
885
return extension . length > 0 ;
@@ -967,22 +967,22 @@ export function addMenuItems(
967
967
if ( command === ContextCommandIDs . gitFileDiff ) {
968
968
contextMenu . addItem ( {
969
969
command,
970
- args : ( {
970
+ args : {
971
971
files : selectedFiles . map ( file => {
972
972
return {
973
973
filePath : file . to ,
974
974
isText : ! file . is_binary ,
975
975
status : file . status
976
976
} ;
977
977
} )
978
- } as CommandArguments . IGitFileDiff ) as any
978
+ } as CommandArguments . IGitFileDiff as any
979
979
} ) ;
980
980
} else {
981
981
contextMenu . addItem ( {
982
982
command,
983
- args : ( {
983
+ args : {
984
984
files : selectedFiles
985
- } as CommandArguments . IGitContextAction ) as any
985
+ } as CommandArguments . IGitContextAction as any
986
986
} ) ;
987
987
}
988
988
} ) ;
@@ -1148,7 +1148,7 @@ namespace Private {
1148
1148
switch ( operation ) {
1149
1149
case Operation . Clone :
1150
1150
// eslint-disable-next-line no-case-declarations
1151
- const { path, url } = ( args as any ) as IGitCloneArgs ;
1151
+ const { path, url } = args as any as IGitCloneArgs ;
1152
1152
result = await model . clone ( path , url , authentication ) ;
1153
1153
break ;
1154
1154
case Operation . Pull :
0 commit comments