@@ -493,36 +493,36 @@ suite('RunInTerminalTool', () => {
493
493
494
494
test ( 'should handle cd /d flag when directory matches cwd' , async ( ) => {
495
495
const testDir = 'C:\\test\\workspace' ;
496
- const options = createRewriteOptions ( `cd /d ${ testDir } && echo hello` , 'session-1' ) ;
496
+ const options = createRewriteParams ( `cd /d ${ testDir } && echo hello` , 'session-1' ) ;
497
497
workspaceService . setWorkspace ( {
498
498
folders : [ { uri : { fsPath : testDir } } ]
499
499
} as any ) ;
500
500
501
- const result = await runInTerminalTool . rewriteCommandIfNeeded ( options , options . parameters as IRunInTerminalInputParams , undefined , 'pwsh' ) ;
501
+ const result = await runInTerminalTool . rewriteCommandIfNeeded ( options , undefined , 'pwsh' ) ;
502
502
503
503
strictEqual ( result , 'echo hello' ) ;
504
504
} ) ;
505
505
506
506
test ( 'should handle cd /d flag with quoted paths when directory matches cwd' , async ( ) => {
507
507
const testDir = 'C:\\test\\workspace' ;
508
- const options = createRewriteOptions ( `cd /d "${ testDir } " && echo hello` , 'session-1' ) ;
508
+ const options = createRewriteParams ( `cd /d "${ testDir } " && echo hello` , 'session-1' ) ;
509
509
workspaceService . setWorkspace ( {
510
510
folders : [ { uri : { fsPath : testDir } } ]
511
511
} as any ) ;
512
512
513
- const result = await runInTerminalTool . rewriteCommandIfNeeded ( options , options . parameters as IRunInTerminalInputParams , undefined , 'pwsh' ) ;
513
+ const result = await runInTerminalTool . rewriteCommandIfNeeded ( options , undefined , 'pwsh' ) ;
514
514
515
515
strictEqual ( result , 'echo hello' ) ;
516
516
} ) ;
517
517
518
518
test ( 'should handle cd /d flag with quoted paths from issue example' , async ( ) => {
519
519
const testDir = 'd:\\microsoft\\vscode' ;
520
- const options = createRewriteOptions ( `cd /d "${ testDir } " && .\\scripts\\test.bat` , 'session-1' ) ;
520
+ const options = createRewriteParams ( `cd /d "${ testDir } " && .\\scripts\\test.bat` , 'session-1' ) ;
521
521
workspaceService . setWorkspace ( {
522
522
folders : [ { uri : { fsPath : testDir } } ]
523
523
} as any ) ;
524
524
525
- const result = await runInTerminalTool . rewriteCommandIfNeeded ( options , options . parameters as IRunInTerminalInputParams , undefined , 'pwsh' ) ;
525
+ const result = await runInTerminalTool . rewriteCommandIfNeeded ( options , undefined , 'pwsh' ) ;
526
526
527
527
strictEqual ( result , '.\\scripts\\test.bat' ) ;
528
528
} ) ;
@@ -531,12 +531,12 @@ suite('RunInTerminalTool', () => {
531
531
const testDir = 'C:\\test\\workspace' ;
532
532
const differentDir = 'C:\\different\\path' ;
533
533
const command = `cd /d ${ differentDir } && echo hello` ;
534
- const options = createRewriteOptions ( command , 'session-1' ) ;
534
+ const options = createRewriteParams ( command , 'session-1' ) ;
535
535
workspaceService . setWorkspace ( {
536
536
folders : [ { uri : { fsPath : testDir } } ]
537
537
} as any ) ;
538
538
539
- const result = await runInTerminalTool . rewriteCommandIfNeeded ( options , options . parameters as IRunInTerminalInputParams , undefined , 'pwsh' ) ;
539
+ const result = await runInTerminalTool . rewriteCommandIfNeeded ( options , undefined , 'pwsh' ) ;
540
540
541
541
strictEqual ( result , command ) ;
542
542
} ) ;
@@ -545,26 +545,26 @@ suite('RunInTerminalTool', () => {
545
545
const instanceDir = 'C:\\instance\\workspace' ;
546
546
const workspaceDir = 'C:\\workspace\\service' ;
547
547
const command = `cd /d ${ instanceDir } && npm test` ;
548
- const options = createRewriteOptions ( command , 'session-1' ) ;
548
+ const parameters = createRewriteParams ( command , 'session-1' ) ;
549
549
550
550
workspaceService . setWorkspace ( {
551
551
folders : [ { uri : { fsPath : workspaceDir } } ]
552
552
} as any ) ;
553
553
const instance = createInstanceWithCwd ( { fsPath : instanceDir } as any ) ;
554
554
555
- const result = await runInTerminalTool . rewriteCommandIfNeeded ( options , options . parameters as IRunInTerminalInputParams , instance , 'pwsh' ) ;
555
+ const result = await runInTerminalTool . rewriteCommandIfNeeded ( parameters , instance , 'pwsh' ) ;
556
556
557
557
strictEqual ( result , 'npm test' ) ;
558
558
} ) ;
559
559
560
560
test ( 'should handle cd /d flag with semicolon separator' , async ( ) => {
561
561
const testDir = 'C:\\test\\workspace' ;
562
- const options = createRewriteOptions ( `cd /d ${ testDir } ; echo hello` , 'session-1' ) ;
562
+ const options = createRewriteParams ( `cd /d ${ testDir } ; echo hello` , 'session-1' ) ;
563
563
workspaceService . setWorkspace ( {
564
564
folders : [ { uri : { fsPath : testDir } } ]
565
565
} as any ) ;
566
566
567
- const result = await runInTerminalTool . rewriteCommandIfNeeded ( options , options . parameters as IRunInTerminalInputParams , undefined , 'pwsh' ) ;
567
+ const result = await runInTerminalTool . rewriteCommandIfNeeded ( options , undefined , 'pwsh' ) ;
568
568
569
569
strictEqual ( result , 'echo hello' ) ;
570
570
} ) ;
0 commit comments