igrek8 / dynamic-inputs

vscode dynamic inputs
MIT License
4 stars 2 forks source link
dynamic-options populate-options vscode vscode-extension

Dynamic Inputs (Visual Studio Code)

This extension lets you populate a dynamic list of options from which you can pick a value during debugging or running tasks.

Features

Commands

Demo

demo

Setup

  1. Create a script which populates options by writing JSON array to stdout
  2. Create a script for debugging
  3. Run a task with a dynamic variable
  4. Debug the script with a dynamic variable

Variables

Supported variables in interpolation

Map options to values

Given

[
  { "label": "$(notebook-state-success) A", "value": "A", "picked": true },
  { "label": "$(notebook-state-error) B", "value": "B" },
  { "label": "$(notifications-configure) C", "value": "C" }
]

To receive ["A", "B"] as your selection, you can use the following JSON path expression $[*].value

Playground

git clone https://github.com/igrek8/dynamic-inputs
code dynamic-inputs/playground

Credits

Icons made by Freepik from www.flaticon.com