1

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?

Artemio
  • 13
  • 2

1 Answers1

0

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

Fuhrmanator
  • 11,459
  • 6
  • 62
  • 111
  • I can’t believe I missed that option, that solves the issue. Thank you. But still maybe in future in some other extension I will need to do as I described above, is it possible? – Artemio Sep 07 '22 at 06:52
  • @Artemio as a general problem in VSCode, I am not sure. There are probably ways with GUI scripting tools in Windows or other OS. – Fuhrmanator Sep 07 '22 at 21:56