Vscode-powershell: Add MRU to argument prompt when debugging a PowerShell script

Created on 31 Jul 2020  ·  9Comments  ·  Source: PowerShell/vscode-powershell

Summary of the new feature

When one debugs a PowerShell script with the "PowerShell Launch Current File w/Args Prompt" configuration:

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

the input field is pre-filled with the most recent arguments input on the previous debug session.

It would be useful to have a list of most recently used argument lists, so that one could easily test the same script with several sets of arguments.

Proposed technical implementation details (optional)

The list should be sorted by most-recently used argument list.

Area-Debugging Issue-Enhancement Up-for-Grabs

All 9 comments

I realize this change probably needs to be done in VScode itself, not in the extension. Correct?

IIRC that UI and last input feature is provided by VSCode and not the extension. You might want to raise this issue in the https://github.com/microsoft/vscode project.

IIRC that UI and last input feature is provided by VSCode and not the extension. You might want to raise this issue in the https://github.com/microsoft/vscode project.

I'm on my way... but who actually implements SpecifyScriptArgs?

Sigh, sad thing is that I implemented that feature 2 years ago according to Git. 🤷‍♂️

So? Back to square one... The VScode guys have closed the issues there 'cos it's extension related... 😝

Back to square one...

No no, we have the feature request here now and we've recognised we own the code for it

We use VSCode's showInputBox() method which allows you to enter arbitrary text but AFAICT it doesn't support any sort of dropdown with canned input. Then there's showQuickPick which shows a dropdown list of items to pick from but does not allow for arbitrary text entry. Is there a "dropdown combo" input box that I'm missing in the API?

FWIW if I could find the appropriate VSCode API for this style of input control, the implementation would likely be very simple.

The way I see VSCode handle this today is to first pop a quickPick box:

image

Which includes an item to specify a new value e.g. + Create new branch... which when clicked pops an inputBox:

image

If that is the only way to implement this then I would not be in favor of doing so as it makes the common case harder.

That said, I can't believe VSCode doesn't provide the equivalent of a Combobox
image

Was this page helpful?
0 / 5 - 0 ratings