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

Add prompt for arguments when launching debugger #63

Closed
gregersn opened this issue Dec 3, 2019 · 7 comments · Fixed by #56
Closed

Add prompt for arguments when launching debugger #63

gregersn opened this issue Dec 3, 2019 · 7 comments · Fixed by #56
Assignees
Labels
feature-request Request for new features or functionality good first issue Good for newcomers on-testplan Added to test plan
Milestone

Comments

@gregersn
Copy link

gregersn commented Dec 3, 2019

With the java extension for VS Code, when editing launch parameters, you can set args to be "${command:SpecifyProgramArgs}" which will prompt for arguments.

A similar feature for Python would have been most appreciated.

@gregersn gregersn added triage-needed Needs assignment to the proper sub-team feature-request Request for new features or functionality labels Dec 3, 2019
@karthiknadig
Copy link
Member

Thank you for the suggestion! We have marked this issue as "needs decision" to make sure we have a conversation about your idea. We plan to leave this feature request open for at least a month to see how many 👍 votes the opening comment gets to help us make our decision.

@karthiknadig karthiknadig removed the triage-needed Needs assignment to the proper sub-team label Dec 3, 2019
@luabud luabud self-assigned this Jan 29, 2020
@novirium
Copy link

novirium commented Feb 3, 2021

This would be very useful if implemented. While we can already use a promptString input in launch.json to allow user input to args when debugging, this is limited to a single argument (as the args value is a list of strings, not one long string, and variable substitution only works within strings).

There has been discussion about this in various places (cpp-tools, js-debug, and vscode itself), and the straightforward solution has been to introduce a new parameter for the debugger in launch.json: argsString. This has been successfully implemented by bash-debug in this PR. The upshot is the content of argsString is parsed by shell-quote, and the resulting array of strings is appended to the normal args parameter.

This would allow users to use a VSCode promptstring input to allow arbitrary command arguments during debug (which would be really useful!) with something like:

launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Test CLI (input)",
            "type": "python",
            "request": "launch",
            "module": "mycli",
            "argsString": "${input:argPrompt}"
        },
    ],
    "inputs": [
        {
            "id": "argPrompt",
            "description": "CLI arguments",
            "default": "",
            "type": "promptString"
        }
    ]
}

@luabud
Copy link
Member

luabud commented Feb 6, 2021

@novirium this is great, thanks for bringing it up!

@gregersn
Copy link
Author

Is there any progress on this? Manually adding parameters to launch settings every time I need to debug a new script gets tedious.

@luabud luabud removed their assignment Jan 14, 2022
@luabud
Copy link
Member

luabud commented Jan 14, 2022

@gregersn Apologies, no progress on this yet. It's something that is on our radar but not ETAs as of now.

@xavierdubhc
Copy link

Hello, I'd really appreciate something like this, is there any plan on adding this :) ?

@ceusebi-eb
Copy link

Not from the team but I stumbled across this and with this snippet:

{
    "version": "0.2.0",
    "inputs": [
        {
            "id": "fileArguments",
            "description": "The arguments to send to the debugger",
            "type": "promptString",
            "default": "",
        }
    ],
    "configurations": [
        {
            "name": "Python: Current File",
            "type": "python",
            "console": "integratedTerminal",
            "request": "launch",
            "program": "${file}",
            "args": "${input:fileArguments}",
            "justMyCode": true
        }
    ]
}

It is possible to obtain multiple parameters split as you type them
image

image

VsCode Version: 1.73.1
Python extension Version: v2022.18.2

@cwebster-99 cwebster-99 added the good first issue Good for newcomers label Jan 12, 2023
@paulacamargo25 paulacamargo25 added this to the June 2023 milestone Jun 8, 2023
@paulacamargo25 paulacamargo25 modified the milestones: June 2023, July 2023 Jun 28, 2023
@paulacamargo25 paulacamargo25 transferred this issue from microsoft/vscode-python Jul 24, 2023
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Jul 24, 2023
@paulacamargo25 paulacamargo25 added on-testplan Added to test plan and removed triage-needed Needs assignment to the proper sub-team labels Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality good first issue Good for newcomers on-testplan Added to test plan
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants