@@ -104,7 +104,11 @@ class RobotCodeDebugConfigurationProvider implements vscode.DebugConfigurationPr
104104 ...( debugConfiguration . robotPythonPath ?? [ ] ) ,
105105 ] ;
106106
107- debugConfiguration . args = [ ...config . get < string [ ] > ( "robot.args" , [ ] ) , ...( debugConfiguration . args ?? [ ] ) ] ;
107+ debugConfiguration . args = [
108+ ...config . get < string [ ] > ( "robot.args" , [ ] ) ,
109+ ...( Array . isArray ( defaultLaunchConfig ?. args ) ? defaultLaunchConfig . args : [ ] ) ,
110+ ...( debugConfiguration . args ?? [ ] ) ,
111+ ] ;
108112
109113 debugConfiguration . variableFiles = [
110114 ...config . get < string [ ] > ( "robot.variableFiles" , [ ] ) ,
@@ -368,7 +372,7 @@ export class DebugManager {
368372 args . push ( `robotcode.debugger.modifiers.ExcludedByLongName${ separator } ${ excluded . join ( separator ) } ` ) ;
369373 }
370374
371- const testLaunchConfig =
375+ const testLaunchConfig : { [ Key : string ] : unknown } =
372376 vscode . workspace
373377 . getConfiguration ( "launch" , folder )
374378 ?. get < { [ Key : string ] : unknown } [ ] > ( "configurations" )
@@ -382,7 +386,7 @@ export class DebugManager {
382386 testLaunchConfig . target = "" ;
383387 }
384388
385- const paths = config . get ( "robot.paths" , [ ] ) ;
389+ const paths = config . get < Array < string > > ( "robot.paths" , [ ] ) ;
386390
387391 return vscode . debug . startDebugging (
388392 folder ,
@@ -393,9 +397,12 @@ export class DebugManager {
393397 name : "RobotCode: Run Tests" ,
394398 request : "launch" ,
395399 cwd : folder ?. uri . fsPath ,
396- paths : paths ,
397- args : args ,
398- console : config . get ( "debug.defaultConsole" , "integratedTerminal" ) ,
400+ paths : "paths" in testLaunchConfig ? [ ...( testLaunchConfig . paths as Array < string > ) , ...paths ] : paths ,
401+ args : "args" in testLaunchConfig ? [ ...( testLaunchConfig . args as Array < string > ) , ...args ] : args ,
402+ console :
403+ "console" in testLaunchConfig
404+ ? testLaunchConfig . console
405+ : config . get ( "debug.defaultConsole" , "integratedTerminal" ) ,
399406 runId : runId ,
400407 dryRun,
401408 } ,
0 commit comments