Skip to content

[Bug] Unable to select a launch target from a workspace file when .vscode/launch.json exists #4586

@arghness

Description

@arghness

Brief Issue Summary

If I have a "launch {}" section in my workspace file, and a .vscode/launch.json file, the "Run and Debug" tab lists all the launch targets from both sources in the pulldown.

However, if I try to debug a ctest target from the "Testing" tab, when it provides a pulldown to select a target, it shows duplicate targets from .vscode/launch.json. If I remove .vscode/launch.json it will show targets from the workspace file.

This also applies to the new setting "cmake.ctest.debugLaunchTarget", It won't allow me to use a target from the workspace file, if .vscode/launch.json is present.

Workspace showing the issue (please open the workspace file, not the folder): ctest_issue.zip

Run and debug tab:
Image

Pulldown after pressing "Debug Test" button on "test1":
Image
This shows the targets from launch.json twice, but says 2 of them are in the workspace, from the path underneath. If I try to select one from the workspace, it actually selects one from launch.json.

CMake Tools Diagnostics

{
  "os": "linux",
  "vscodeVersion": "1.104.3",
  "cmtVersion": "1.21.36",
....
  "settings": [
    {
      "communicationMode": "automatic",
      "useCMakePresets": "always",
      "configureOnOpen": false
    }
  ]
}

Debug Log

N/A

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    buga bug in the product

    Type

    No type

    Projects

    Status

    Blocked

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions