Skip to content

Enable history in input prompt #158470

@stefanrybacki

Description

@stefanrybacki

To provide a way to enable history in the input prompt, used for launch.json and tasks.json. This would enable developers to re-use the previously used values for the same input, without having to edit the default field all the time.

See this practical example (from rogalmic/vscode-bash-debug#139):

image

Instead of writing manually or relying on the default value, it would be extremely useful to have a history of the last used values, which could be presented as a list of options to pick above of input prompt or even simply having the last value in the field (instead of the default).

In this specific scenario, I'm debugging a big amount of bash scripts in a single repository, all of them with their own set of optional and positional arguments (and any sort of mix between them), which makes unfeasible to create a new configuration property in launch.json for every possibility.

But this, of course, would not be only useful for this, since the input prompt is acceptable from other fields as well.

For the specification, it could be something like (look at the commented line):

{
  "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",
      "history": true, // <-- this activates the history for this input
      "description": "The arguments to pass to the script"
    }
  ]
}

Note there was a previous feature request (#97655) which did not reach enough votes, however I feel, that this time, as more people are using vscode it might get there.

Metadata

Metadata

Assignees

Labels

debugDebug viewlet, configurations, breakpoints, adapter issuesfeature-requestRequest for new features or functionality

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions