Coder Social home page Coder Social logo

quentingllmt / vscode-memento-inputs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from joelspadin/vscode-memento-inputs

0.0 0.0 0.0 247 KB

Visual Studio Code task inputs that remember their last-used values

License: MIT License

TypeScript 100.00%

vscode-memento-inputs's Introduction

Memento Inputs

This extension lets you create task input variables which act like pickString and promptString but remember the value you previously entered and default to it the next time they are used.

The extension name comes from the API used to store the last-used values.

Usage

In your tasks.json, create an input variable with type command and set the command and args as follows:

promptString:

  • command: memento.promptString
  • args:
    • id: Name to use for storing the last-used value.
    • description: Shown in the quick input to provide context for the input.
    • default: Default value that will be used if no last-used value has been set.
    • placeholder: Optional text to display if the input box is empty.

pickString:

  • command: memento.pickString
  • args:
    • id: Name to use for storing the last-used value.
    • description: Shown in the quick input to provide context for the input.
    • options: An array of options for the user to pick from.
    • default: Default value that will be used if no last-used value has been set.

Below is an example of a tasks.json that defines tasks to build an application and deploy it to some other device.

When starting a build, it will prompt for the build mode. Where the regular pickString would always default to production, this will default to whichever mode you last picked.

When deploying the application, it will prompt for the IP address of the target device. Where the regular promptString would always default to 192.168.1.42, this will default to whatever text you last entered.

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Build",
            "group": { "kind": "build", "isDefault": true },
            "type": "shell",
            "command": "npm",
            "args": ["run", "build", "--mode", "${input:buildMode}"]
        },
        {
            "label": "Deploy",
            "type": "shell",
            "command": "npm",
            "args": ["run", "deploy", "--address", "${input:address}"]
        }
    ],
    "inputs": [
        {
            "id": "buildMode",
            "type": "command",
            "command": "memento.pickString",
            "args": {
                "id": "buildMode",
                "description": "Build mode",
                "options": ["production", "dev"],
                "default": "production"
            }
        },
        {
            "id": "address",
            "type": "command",
            "command": "memento.promptString",
            "args": {
                "id": "address",
                "description": "Target IP address",
                "default": "192.168.1.42",
                "placeholder": "IP address"
            }
        }
    ]
}

vscode-memento-inputs's People

Contributors

joelspadin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.