Skip to content

Accept additional parameter argsString for arguments in string format #138

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

Closed
felipecrs opened this issue May 6, 2020 · 4 comments · Fixed by #139
Closed

Accept additional parameter argsString for arguments in string format #138

felipecrs opened this issue May 6, 2020 · 4 comments · Fixed by #139

Comments

@felipecrs
Copy link
Contributor

felipecrs commented May 6, 2020

VS Code does not support passing arguments to args in a string instead of an array of string. See microsoft/vscode#83678.

However, due to that, is impossible for users to use "prompt for arguments" when launching a debug session.

VS Code team suggest the extension owners to provide an additional parameter for debbuging configuration. See microsoft/vscode#83678 (comment)

It would look like then:

{
  "version": "0.2.0",
  "configurations": [
      {
        "type": "bashdb",
        "request": "launch",
        "name": "Bash-Debug (simplest configuration)",
        "program": "${file}",
        "cwd": "${workspaceFolder}",
        "argsString": "-foo -bar /hello/world -o -p"
      }
    ]
}

And then, we would be able to do something like:

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "bashdb",
      "request": "launch",
      "name": "Bash-Debug (simplest configuration)",
      "program": "${file}",
      "cwd": "${workspaceFolder}",
      "argsString": "${input:arguments}"
    }
  ],
  "inputs": [
    {
      "id": "arguments",
      "type": "promptString",
      "default": "--help",
      "description": "The arguments to pass to the script"
    }
  ]
}
@rogalmic
Copy link
Owner

rogalmic commented May 7, 2020

This will break the integrated/external terminal, since the vscode api used for those requires array of args. See RunInTerminalRequest + RunInTerminalRequestArguments.

Having said that, I would also prefer to pass full args as one string, but it will be possible only when mentioned api methods allow to specify to use bash explicitly + provide command as single string.

@felipecrs
Copy link
Contributor Author

So how about transforming the commandline string into an array?

@rogalmic
Copy link
Owner

rogalmic commented May 7, 2020

Well, this requires handling of arg quoting, which proves to be hard and should not be part of extension. Args are sometimes more complex values.

@felipecrs felipecrs changed the title Accept additional parameter commandline for arguments in string Accept additional parameter argsString for arguments in string format May 13, 2020
@felipecrs
Copy link
Contributor Author

@rogalmic do you mind taking a look at microsoft/vscode#97655 and cast your vote if you agree?

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

Successfully merging a pull request may close this issue.

2 participants