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

Diagram preview

Open jpike88 opened this issue 7 months ago • 2 comments

Having syntax highlighting is nice. But without live preview, this plugin's kind of minimal. It's a lot more preferable right now to paste things into the d2 playground or use the VSCode extension instead, so there's live visual feedback of changes being made.

jpike88 avatar May 14 '25 04:05 jpike88

Hello there!

I absolutely want to have diagram preview working via the extension but I'm having difficulty finding time to work on this at the moment.

What is needed is to figure out a way to wrap D2 into an LSP and use that in the extension to trigger things from Zed events. Only then the extension could, for example, save the output to a temp folder and ask Zed to open it. Not sure this is the best approach, but I'm open to suggestions and implementations.

gabeins avatar May 20 '25 16:05 gabeins

Today Zed Preview 0.194.0 was released with a feature that may make this feature easier to implement: https://github.com/zed-industries/zed/pull/32694

gabeins avatar Jul 02 '25 18:07 gabeins