Huachao / vscode-restclient

REST Client Extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=humao.rest-client
MIT License
5.28k stars 438 forks source link

Add default values in @prompt variables #1082

Open fbridger opened 2 years ago

fbridger commented 2 years ago

As a Developer, I would like to define a default value for Prompt Variables

###
# @prompt variableWithoutDefaultValueAndDescription
# @prompt variableWithDescriptionAndWithoutDefaultValue Your variable description goes here
# @prompt variableWithDefaultValueAndWithout=DefaultValue
# @prompt variableWithDefaultValueAndDescription=DefaultValue Your one-time password in your mailbox
gbgrout commented 4 days ago

I'd also suggest that an existing variable, even if valueless, be allowed as the default value, e.g.

# @prompt variableWithDefaultValueFromExistingVariableAndDescription=@existing_variable Your one-time password in your mailbox

and would suggest that the prompt display the default value, perhaps in square brackets, whether hard-coded or from a variable (the value of which, not the variable name, would be displayed), e.g.

Desired temperature scale? [Fahrenheit]