Skip to content

Allow configuring input values #35

@OldStarchy

Description

@OldStarchy

Tasks can have input values that prompt the user. When saving I want it to use the default value png rather than prompting.

tasks.json

{
	"version": "2.0.0",
	"tasks": [
		{
			"label": "Generate graphic for currently open file",
			"type": "shell",
			"command": "curl",
			"args": [
				"--request", "POST",
				"--upload-file", "${file}",
				"${config:plantuml.server}/${input:plantUml.outputFormat}",
				"--output", "${fileDirname}/${fileBasenameNoExtension}.${input:plantUml.outputFormat}",
			],
			"problemMatcher": [],
		},
	],
	"inputs": [
		{
			"id": "plantUml.outputFormat",
			"type": "pickString",
			"description": "What kind of output format do you want",
			"options": [
				"png",
				"svg",
				"txt",
				"pdf",
			],
			"default": "png",
		}
	]
}

settings.json

{
	"plantuml.server": "http://localhost:8080",
	"triggerTaskOnSave.tasks": {
		"Generate PNG for currently open file": [ // Force `${input:plantUml.outputFormat}` to be "png" here
			"*.puml",
			"*.uml",
		]
	}
}

The workaround for now is to duplicate the task and remove the input, but its not very DRY.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions