vscode-powershell icon indicating copy to clipboard operation
vscode-powershell copied to clipboard

add debug configuration for scripts with command-line arguments

Open peetrike opened this issue 2 years ago • 2 comments

Prerequisites

  • [X] I have written a descriptive issue title.
  • [X] I have searched all issues to ensure it has not already been reported.

Summary

There was a configuration in past for launching debugger for scripts with command-line arguments. It would be nice to have it back.

Proposed Design

  {
    "type": "PowerShell",
    "request": "launch",
    "name": "PowerShell Launch Current File w/Args Prompt",
    "script": "${file}",
    "args": [
      "${command:SpecifyScriptArgs}"
    ],
    "cwd": "${file}"
  },

peetrike avatar Jul 24 '23 09:07 peetrike

${command:SpecifyScriptArgs} still works! You can add it to whatever custom debug configuration you create. I'm not sure it was ever in a provided configuration snippet, as I'm not finding it in the Git history for package.json.

andyleejordan avatar Aug 03 '23 20:08 andyleejordan

It takes a bit time to find ${command:SpecifyScriptArgs} from documentation. The ready configuration would make it simpler to debug scripts that accept command-line parameters.

It might happen, that the abovementioned configuration was not part of the extension. But I have that in my older repositories and in project scaffolding. And I don't remember from where I got that.

peetrike avatar Aug 11 '23 07:08 peetrike