Skip to content

Commit 8b026dc

Browse files
author
Akos Kitta
committed
fix: params name
1 parent 007edc7 commit 8b026dc

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/debug.ts

+13-13
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export function activateDebug(_: vscode.ExtensionContext): vscode.Disposable {
2222
'arduino.debug.start',
2323
async (params: StartDebugParams) => {
2424
const launchConfig = await createLaunchConfig(params);
25-
return startDebug(params.launchConfigDirPath, launchConfig);
25+
return startDebug(params.launchConfigsDirPath, launchConfig);
2626
}
2727
),
2828
vscode.commands.registerCommand(
@@ -51,7 +51,7 @@ export interface StartDebugParams {
5151
* If the launch config file is absent, it will be created.
5252
* If not defined, it falls back to `sketchPath/.vscode/launch.json` and uses VS Code APIs to alter the config.
5353
*/
54-
readonly launchConfigDirPath?: string;
54+
readonly launchConfigsDirPath?: string;
5555
/**
5656
* Absolute path to the `arduino-cli.yaml` file. If not specified, it falls back to `~/.arduinoIDE/arduino-cli.yaml`.
5757
*/
@@ -117,10 +117,10 @@ function isCustomDebugConfig(arg: unknown): arg is CustomDebugConfig {
117117
const cortexDebug = 'cortex-debug';
118118

119119
async function startDebug(
120-
launchConfigDirPath: string | undefined,
120+
launchConfigsDirPath: string | undefined,
121121
launchConfig: ArduinoDebugLaunchConfig
122122
): Promise<StartDebugResult> {
123-
await updateLaunchConfigs(launchConfigDirPath, launchConfig);
123+
await updateLaunchConfigs(launchConfigsDirPath, launchConfig);
124124
return vscode.debug.startDebugging(undefined, launchConfig);
125125
}
126126

@@ -220,7 +220,7 @@ function parseJson(raw: string): any | undefined {
220220
}
221221

222222
function buildDebugInfoArgs(
223-
params: Omit<StartDebugParams, 'launchConfigDirPath'>
223+
params: Omit<StartDebugParams, 'launchConfigsDirPath'>
224224
): Readonly<{
225225
file: string;
226226
args: readonly string[];
@@ -306,11 +306,11 @@ function replaceValue(
306306
// 3. same as (2) but use jsonc to nicely update the JSON file
307307
// 4. use the getConfiguration('launch') API to update the config. It must be verified whether it works in Theia
308308
async function updateLaunchConfigs(
309-
launchConfigDirPath: string | undefined,
309+
launchConfigsDirPath: string | undefined,
310310
launchConfig: ArduinoDebugLaunchConfig
311311
): Promise<void> {
312-
const launchConfigs = await (launchConfigDirPath
313-
? loadLaunchConfigsFile(launchConfigDirPath)
312+
const launchConfigs = await (launchConfigsDirPath
313+
? loadLaunchConfigsFile(launchConfigsDirPath)
314314
: vscode.workspace.getConfiguration().get<LaunchConfigs>('launch') ??
315315
createEmptyLaunchConfigs());
316316

@@ -323,10 +323,10 @@ async function updateLaunchConfigs(
323323
launchConfigs.configurations.splice(index, 1, launchConfig);
324324
}
325325

326-
if (launchConfigDirPath) {
327-
await fs.mkdir(launchConfigDirPath, { recursive: true });
326+
if (launchConfigsDirPath) {
327+
await fs.mkdir(launchConfigsDirPath, { recursive: true });
328328
await fs.writeFile(
329-
path.join(launchConfigDirPath, 'launch.json'),
329+
path.join(launchConfigsDirPath, 'launch.json'),
330330
JSON.stringify(launchConfigs, null, 2)
331331
);
332332
} else {
@@ -354,11 +354,11 @@ function isLaunchConfigs(arg: unknown): arg is LaunchConfigs {
354354
}
355355

356356
async function loadLaunchConfigsFile(
357-
launchConfigDirPath: string
357+
launchConfigsDirPath: string
358358
): Promise<LaunchConfigs> {
359359
try {
360360
const raw = await fs.readFile(
361-
path.join(launchConfigDirPath, 'launch.json'),
361+
path.join(launchConfigsDirPath, 'launch.json'),
362362
{ encoding: 'utf8' }
363363
);
364364
const maybeConfigs = parseJson(raw);

0 commit comments

Comments
 (0)