terrastruct / d2-vscode

VSCode extension for D2 files.
https://d2lang.com
BSD 3-Clause "New" or "Revised" License
240 stars 11 forks source link

Add a 'recompile' button #133

Open carine-laine opened 9 months ago

carine-laine commented 9 months ago

Use case: Working with imports and several files, diagram preview on the right side. When I update one of the imported files, I have to go back to the diagram file and hit save to refresh the preview. It'd be better if I could just click on a button in the preview itself.

Visually, that would be something like the Obsidian plug-in (although it doesn't seem to support imports at all) image

BarryNolte commented 9 months ago

After giving this some thought, the 'refresh/recompile/F5' button is the way to go. I had thought to put a file watch on the imports, but that leads me down the rabbit hole of keeping track of imports, imports that import (and so on), additions to the imports and deletions of the imports. All of course doable, but that is a bug factory, and a refresh button is causing something to happen that is already coded to happen.

I've got a large PR I'm working on, but I'll get to this right after that gets accepted.

carine-laine commented 8 months ago

I agree - KISS.