Skip to content

fix: use LSP-provided project folder for debug sessions - #125

Open
asterite wants to merge 1 commit into
masterfrom
ab/fix-debug-test-project-folder
Open

fix: use LSP-provided project folder for debug sessions#125
asterite wants to merge 1 commit into
masterfrom
ab/fix-debug-test-project-folder

Conversation

@asterite

@asterite asterite commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Problem Resolved

No issue.

Summary of Changes

When trying to "Debug" via the code lens it only worked if the test to run was in a project that matched the workspace's root. But for example if you open a directory with multiple Noir projects (like Aztec-Packages) and try to debug anything there, it didn't work.

The nargo.debug.dap and nargo.debug.test command handlers were ignoring the --program-dir and --package arguments from LSP code lens. nargo.debug.dap delegated to workbench.action.debug.start discarding all args, and nargo.debug.test hardcoded projectFolder: '${workspaceFolder}'.

When a Noir project is nested inside the VS Code workspace (e.g. VS Code opened at ~/workspace but the project is at ~/workspace/my-app), the debugger fails because it can't find Nargo.toml at the workspace root.

Extract --program-dir and --package from the LSP code lens arguments and pass them through to the debug launch configuration for both commands. When --program-dir is not provided (e.g. manual launch), the existing findNearestPackageFrom fallback in resolveDebugConfiguration still applies.

PR Checklist

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

The `nargo.debug.dap` and `nargo.debug.test` command handlers were
ignoring the `--program-dir` and `--package` arguments from LSP code
lens. `nargo.debug.dap` delegated to `workbench.action.debug.start`
discarding all args, and `nargo.debug.test` hardcoded
`projectFolder: '${workspaceFolder}'`.

When a Noir project is nested inside the VS Code workspace (e.g.
VS Code opened at `~/workspace` but the project is at
`~/workspace/my-app`), the debugger fails because it can't find
`Nargo.toml` at the workspace root.

Extract `--program-dir` and `--package` from the LSP code lens
arguments and pass them through to the debug launch configuration
for both commands. When `--program-dir` is not provided (e.g. manual
launch), the existing `findNearestPackageFrom` fallback in
`resolveDebugConfiguration` still applies.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@asterite
asterite requested a review from TomAFrench September 4, 2026 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant