Skip to content

Support single-string args in launch.json #2621

@weikanglim

Description

@weikanglim

Is your feature request related to a problem? Please describe.

I'd like the ability to create a launch.json that prompts the user for the exact args to be passed through to my debugging program. The user types in the args into the prompt, and the args is passed through to the launching program.

For example, if launching go.exe with debugger, I expect the user to be able to type test ./... in the prompt, and the resulting program go.exe test ./... is ran with debugging:
image

My understanding based on this comment, is that VSCode now allows args to be either a string-array or a string type. However, it is up to the debugging extension to support the newly-added string type.

Desired supported launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch Package",
            "type": "go",
            "request": "launch",
            "mode": "auto",
            "program": "${workspaceFolder}",
            "console": "integratedTerminal",
            "args": "${input:args}"
        }
    ],
    "inputs": [
        {
            "id": "args",
            "type": "promptString",
            "description": "Args for launch package",
        }
      ]
}

Currently, this configuration results in the following error:
image

Describe the solution you'd like
The string-typed args should be handled to support this scenario.

Describe alternatives you've considered
N/A

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    DebugIssues related to the debugging functionality of the extension.FeatureRequestFrozenDueToAgeHelpWantedIssues that are not prioritized by the maintainers. Help is requested from community contributors.debug/configIssues for config discrepancies b/n settings.json, launch.json, launch with F5, run test, debug test

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions