Skip to content

Fix mismatched VS Code debug launch environments - #5527

Open
rupayon123 wants to merge 1 commit into
platformio:developfrom
rupayon123:fix/vscode-debug-launch-env-5526
Open

rupayon123 wants to merge 1 commit into
platformio:developfrom
rupayon123:fix/vscode-debug-launch-env-5526

Conversation

@rupayon123

Copy link
Copy Markdown

Fixes #5526.

When VS Code launch generation uses the default environment, the debugger may select a build_type = debug environment while the executable and toolchain metadata came from default_envs. Generate those two launch paths from the selected debug environment, while preserving the normal environment metadata used by other IDE files. If debug metadata is unavailable, fall back to the environment whose metadata was generated so the launch entry remains internally consistent.

Validation:

  • Added regression coverage for the split-environment case and metadata fallback; both focused tests pass on Python 3.14.
  • Black, isort, Pylint, codespell, and git diff --check pass for the changed files.
  • The existing VS Code CLI initialization test began installing a second platform/toolchain and did not complete; it is not claimed as passing. The full suite and Windows debugger session were not run.

Prepared with AI assistance; the patch and focused test results were reviewed before submission.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

This branch has not been deployed

No deployments
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.

Generated "PIO Debug" launch entries mix two environments when "default_envs" and "build_type = debug" point to different environments

2 participants