Skip to content

Feature Request: tasks get inputs from nodejs or shell #251006

Open
@Antecer

Description

@Antecer

We hope that in VSCode's tasks, it's possible to use Node.js scripts or shell scripts to dynamically generate candidate lists, allowing us to obtain the latest custom options before executing the script, rather than relying on static predefined choices.

I think the tasks.json will like this:

{
    "version": "2.0.0",
    "inputs": [
        {
            "id": "pickTarget",
            "type": "process",
            "command": "node",
            "args": [
                "${workspaceFolder}/tools/get_targets.mjs"
            ]
        }
    ],
    "tasks": [
        {
            "label": "buildDebug",
            "type": "shell",
            "command": "cmd.exe",
            "args": [
                "/c",
                "xmake config --mode=debug && xmake project -k compile_commands && xmake build ${input:pickTarget}"
            ],
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "group": {
                "kind": "build",
                "isDefault": false
            }
        }
    ]
}

Metadata

Metadata

Assignees

Labels

feature-requestRequest for new features or functionalitytasksTask system issues

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions