-
Notifications
You must be signed in to change notification settings - Fork 309
Prompt for arguments? #844
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
Comments
The mock debugger shows how to ask the user for a string/name from a launch config: |
Since microsoft/vscode#12735 has been implemented it is now possible to provide "Prompt for Arguments" functionality as an extension and use it in launch.json and task.json. |
@weinand Can you give an example of a task (entry of task.json) which uses a prompt to add command arguments? |
@weinand Can you ? |
Applying what is said in https://code.visualstudio.com/docs/editor/variables-reference#_input-variables to the example from above: {
"version": "2.0.0",
"tasks": [
{
"label": "run tests",
"command": "mocha",
"args": [
"--opts", "tests/mocha.opts",
"-g", "'${input:someArgs}'"
]
}
],
"inputs": [
{
"id": "someArgs",
"type": "promptString",
"description": "enter some arguments"
}
]
} (I did not verify that this works...) |
I verified that it works -- https://github.com/Microsoft/vscode-node-debug/issues/108#issuecomment-581815593 You can put an inputs section into launch.json, and reference the defined variables in your launch configurations. Now I want ONE MORE thing - a way to get the OLD arg behavior allowing a space delimited arg string, because I want one generic configuration to debug any old script, like:
With an input section as above with "id": "argValues" |
@marvingreenberg your ONE MORE thing is covered by this feature request: microsoft/vscode#83678 |
Sigh. Closed, due to overthinking. I can think of three approaches that
would be fine (allow args to be a list OR a space delimited string - , OR
have 'args' and 'argString' (mutually exclusive, and some people would use
the string of of convenience in super of imprecision) OR just do the
referenced flattening on the lists of lists and just document that input
"promptLists" have this behavior, or introduce some weird syntax
${[arglist]} to emphasize the difference)
…On Tue, May 5, 2020, 11:31 AM Andre Weinand ***@***.***> wrote:
@marvingreenberg <https://github.com/marvingreenberg> your ONE MORE thing
is covered by this feature request: microsoft/vscode#83678
<microsoft/vscode#83678>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://github.com/microsoft/vscode-node-debug/issues/108#issuecomment-624126462>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABU5A45NNSV6WX2XO2MPPTRQAWO3ANCNFSM4CT3NF2Q>
.
|
@marvingreenberg I just noticed that this issue lives in the "vscode-node-debug" repository and not "vscode", so it does not ask for a generic VS Code solution (which is not feasible for the reasons explained in length in microsoft/vscode#83678). What you suggest is actually possible in a specific extension: node-debug could support an alternative /cc @connor4312 for js-debug |
I don't want to comment too much in what is obviously the wrong place (as my earlier comment was) I apologize - and I see that 83678 is not closed permanently. Oh, but I can't comment Over there. I'm definitely +1 on @weinand suggestion to inject (e.g.) _args for string array - it is creative and provides a good appraoch for differnt uses including |
@marvingreenberg I've unlocked microsoft/vscode#83678 |
I'm working on a large Node project that's made up of several different packages, each one with a suite of tests. I have a
launch.json
configuration per package to run each test suite individually. But when I'm trying to debug a single failing test, the overhead of running the entire suite can really slow things down.In those cases, I go in and manually edit the
launch.json
and add some arguments to theargs
field to tell Mocha to only run matching tests with the-g
option:However, this isn't super discoverable for other people on the team. Ideally, I'd like to make a configuration that prompts the user to provide a string that can be passed as the argument.
I really like how
${command.PickProcess}
allows me to create a dynamic configuration with a GUI to prompt me for the process to attach to. Is there any way to do something similar for an argument value? If not, can I humbly submit this as a feature request? 😄The text was updated successfully, but these errors were encountered: