Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support different debug config for different launch targets #2801

Merged
merged 7 commits into from
Aug 11, 2023

Conversation

RichardLuo0
Copy link
Contributor

This changes the behaviour

The following changes are proposed:

  • Allow command substitution launchTagetsXXX and getLaunchTagetsXXX to accept target name

The purpose of this change

If there are multiple targets in the project, this pr allows using different configs for different targets.
An example launch.json:

{
  "configurations": [
    {
      "name": "Debug a",
      "type": "cppdbg",
      "request": "launch",
      "program": "${input:target-a}",
      "cwd": "${workspaceFolder}",
    },
    {
      "name": "Test a",
      "type": "cppdbg",
      "request": "launch",
      "program": "${input:target-a-test}",
      "cwd": "${workspaceFolder}",
      "args": [
          "--gtest_filter=a.example"
      ],
    },
    {
      "name": "Debug subproject",
      "type": "cppdbg",
      "request": "launch",
      "program": "${input:target-subproject}",
      "cwd": "${workspaceFolder}",
      "args": [
          "-xxxx"
      ],
    },
  ],
  "inputs": [
    {
      "id": "target-a",
      "type": "command",
      "command": "cmake.launchTargetPath",
      "args": {
        "targetName": "a"
       }
    },
    {
      "id": "target-a-test",
      "type": "command",
      "command": "cmake.launchTargetPath",
      "args": {
        "targetName": "a-test"
      }
    },
    {
      "id": "target-subproject",
      "type": "command",
      "command": "cmake.launchTargetPath",
      "args": {
        "targetName": "subproject"
      }
    }
  ]
}

@RichardLuo0
Copy link
Contributor Author

@microsoft-github-policy-service agree [company="default"]

@RichardLuo0
Copy link
Contributor Author

@microsoft-github-policy-service agree company="default"

@bobbrow
Copy link
Member

bobbrow commented Oct 18, 2022

Thank you for the PR! We will take a look in the next few days and let you know if we have any feedback. Please also add a short description of the change in CHANGELOG.md and give yourself credit for your work.

@bobbrow bobbrow modified the milestones: 1.13, On Deck Oct 20, 2022
Copy link
Collaborator

@gcampbell-msft gcampbell-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RichardLuo0 This PR looks reasonable to me! Could you update to most recent main and fix the changelog conflict?

You'll want to make a new section in the changelog for the next release which will be 1.16. Thanks for the contribution!

src/extension.ts Outdated Show resolved Hide resolved
@gcampbell-msft
Copy link
Collaborator

Great! Thanks for your updates and contribution!

Approving and then merging pending tests passing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants