Search code examples
vscode-extensionsvscode-tasksplantuml

Is it possible to automatically select command option while running extension command in task?


I’m using «PlantUML» extension, and I want to export diagram automatically on file save. For this purpose I found «Trigger Task on Save» extension and tried write task that will execute command «command:plantuml.exportCurrent» on save of any .puml file.

settings.json (for «Trigger Task on Save» extension)

{
    "triggerTaskOnSave.on": true,
    "triggerTaskOnSave.restart": true,
    "triggerTaskOnSave.tasks": {
        "Export current diagram to SVG": [
            "*.puml"
        ]
    },
}

tasks.json

{
    "version": "2.0.0",
    "cwd": "${workspaceFolder}",
    "tasks": [
        {
            "label": "Export current diagram to SVG",
            "command": "${command:plantuml.exportCurrent}",
        }
    ],
}

This export command requires from user to select file format (file format select options). I need to export diagram in svg format. Is it possible to automatically select «svg» option in task?


Solution

  • It should be possible if you set (in the PlantUML extension) your export format to SVG (so it won't ask you the format when you export):

    enter image description here