d2-vscode icon indicating copy to clipboard operation
d2-vscode copied to clipboard

add task provider to run d2

Open gavin-ts opened this issue 2 years ago • 7 comments
trafficstars

provide task to simply run d2 (e.g. on a file and create an svg right next to it (can use the preview settings for layout/theme etc))

maybe on a whole directory, or maybe to format the whole workspace

see https://stackoverflow.com/questions/55135876/extension-api-task-provider-build-task-example

gavin-ts avatar Feb 24 '23 18:02 gavin-ts

this should be relatively straightforward.

BarryNolte avatar Feb 24 '23 19:02 BarryNolte

With PR #48, this task is complete

BarryNolte avatar Feb 28 '23 00:02 BarryNolte

#48 provides a command to run but a d2 render task could also be helpful in some cases

gavin-ts avatar Feb 28 '23 03:02 gavin-ts

Could you be more specific?

BarryNolte avatar Feb 28 '23 03:02 BarryNolte

vscode.tasks.registerTaskProvider vs commands.registerCommand

this has the same features but is different from #47 in that this is a command rather than registering a task provider that can be used e.g. from the tasks: run task command

https://user-images.githubusercontent.com/85081687/221334706-054024bb-0b04-4152-afb4-5e827837297b.mp4

Screen Shot 2023-02-24 at 7 53 12 PM

gavin-ts avatar Feb 28 '23 03:02 gavin-ts

Got it, should this even be available? Doesn't make much sense to me.

BarryNolte avatar Feb 28 '23 03:02 BarryNolte

There's a lot of cool things that tasks support https://code.visualstudio.com/docs/editor/tasks

gavin-ts avatar Feb 28 '23 05:02 gavin-ts