@@ -22,7 +22,7 @@ export function activateDebug(_: vscode.ExtensionContext): vscode.Disposable {
22
22
'arduino.debug.start' ,
23
23
async ( params : StartDebugParams ) => {
24
24
const launchConfig = await createLaunchConfig ( params ) ;
25
- return startDebug ( params . launchConfigDirPath , launchConfig ) ;
25
+ return startDebug ( params . launchConfigsDirPath , launchConfig ) ;
26
26
}
27
27
) ,
28
28
vscode . commands . registerCommand (
@@ -51,7 +51,7 @@ export interface StartDebugParams {
51
51
* If the launch config file is absent, it will be created.
52
52
* If not defined, it falls back to `sketchPath/.vscode/launch.json` and uses VS Code APIs to alter the config.
53
53
*/
54
- readonly launchConfigDirPath ?: string ;
54
+ readonly launchConfigsDirPath ?: string ;
55
55
/**
56
56
* Absolute path to the `arduino-cli.yaml` file. If not specified, it falls back to `~/.arduinoIDE/arduino-cli.yaml`.
57
57
*/
@@ -117,10 +117,10 @@ function isCustomDebugConfig(arg: unknown): arg is CustomDebugConfig {
117
117
const cortexDebug = 'cortex-debug' ;
118
118
119
119
async function startDebug (
120
- launchConfigDirPath : string | undefined ,
120
+ launchConfigsDirPath : string | undefined ,
121
121
launchConfig : ArduinoDebugLaunchConfig
122
122
) : Promise < StartDebugResult > {
123
- await updateLaunchConfigs ( launchConfigDirPath , launchConfig ) ;
123
+ await updateLaunchConfigs ( launchConfigsDirPath , launchConfig ) ;
124
124
return vscode . debug . startDebugging ( undefined , launchConfig ) ;
125
125
}
126
126
@@ -220,7 +220,7 @@ function parseJson(raw: string): any | undefined {
220
220
}
221
221
222
222
function buildDebugInfoArgs (
223
- params : Omit < StartDebugParams , 'launchConfigDirPath ' >
223
+ params : Omit < StartDebugParams , 'launchConfigsDirPath ' >
224
224
) : Readonly < {
225
225
file : string ;
226
226
args : readonly string [ ] ;
@@ -306,11 +306,11 @@ function replaceValue(
306
306
// 3. same as (2) but use jsonc to nicely update the JSON file
307
307
// 4. use the getConfiguration('launch') API to update the config. It must be verified whether it works in Theia
308
308
async function updateLaunchConfigs (
309
- launchConfigDirPath : string | undefined ,
309
+ launchConfigsDirPath : string | undefined ,
310
310
launchConfig : ArduinoDebugLaunchConfig
311
311
) : Promise < void > {
312
- const launchConfigs = await ( launchConfigDirPath
313
- ? loadLaunchConfigsFile ( launchConfigDirPath )
312
+ const launchConfigs = await ( launchConfigsDirPath
313
+ ? loadLaunchConfigsFile ( launchConfigsDirPath )
314
314
: vscode . workspace . getConfiguration ( ) . get < LaunchConfigs > ( 'launch' ) ??
315
315
createEmptyLaunchConfigs ( ) ) ;
316
316
@@ -323,10 +323,10 @@ async function updateLaunchConfigs(
323
323
launchConfigs . configurations . splice ( index , 1 , launchConfig ) ;
324
324
}
325
325
326
- if ( launchConfigDirPath ) {
327
- await fs . mkdir ( launchConfigDirPath , { recursive : true } ) ;
326
+ if ( launchConfigsDirPath ) {
327
+ await fs . mkdir ( launchConfigsDirPath , { recursive : true } ) ;
328
328
await fs . writeFile (
329
- path . join ( launchConfigDirPath , 'launch.json' ) ,
329
+ path . join ( launchConfigsDirPath , 'launch.json' ) ,
330
330
JSON . stringify ( launchConfigs , null , 2 )
331
331
) ;
332
332
} else {
@@ -354,11 +354,11 @@ function isLaunchConfigs(arg: unknown): arg is LaunchConfigs {
354
354
}
355
355
356
356
async function loadLaunchConfigsFile (
357
- launchConfigDirPath : string
357
+ launchConfigsDirPath : string
358
358
) : Promise < LaunchConfigs > {
359
359
try {
360
360
const raw = await fs . readFile (
361
- path . join ( launchConfigDirPath , 'launch.json' ) ,
361
+ path . join ( launchConfigsDirPath , 'launch.json' ) ,
362
362
{ encoding : 'utf8' }
363
363
) ;
364
364
const maybeConfigs = parseJson ( raw ) ;
0 commit comments