hoon0422 / dynamic-inputs

vscode dynamic inputs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

Features

  • Supports multi value selection
  • Supports other script languages (bash, python, nodejs etc.)
  • Supports memoization of the parameter using var parameter in args and dynamic-inputs.read command
  • Supports remap options to values by using unwrap

Commands

  • dynamic-inputs.read - attempts to read from memory or shows a selection list
  • dynamic-inputs.write - always offers to a selection and saves the selection to the memory if args.var is given

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

About

vscode dynamic inputs

License:MIT License


Languages

Language:TypeScript 95.2%Language:Shell 3.9%Language:JavaScript 0.9%