lostintangent / codeswing

VS Code extension for building web applications ("swings") using a interactive and editor-integrated coding environment
https://aka.ms/codeswing
MIT License
977 stars 45 forks source link

Allow saving a scratch swing #3

Closed lostintangent closed 3 years ago

radiantly commented 3 years ago

Firstly - this is a fantastic extension! Great work!

Just an idea, but maybe there could be a config option where all temporary swings are saved in a given directory. This would really help out in scenarios where you want to reference something you tried a bit back, but didn't really save as a separate swing. Each temp swing could be saved in a sub-directory with the date/time as dir name.

lostintangent commented 3 years ago

Hey! I think that's a great idea 💡 So maybe we could introduce two new settings:

  1. Directory for storing temp swings - By default, this could be a folder within the temp directory (e.g. $TMPDIR/codeswing), but it would allow users to specify their own custom location

  2. Format string for naming the temp swings - This would define the naming convention for each temp swing's folder, and by default, could be set to the date and time

I'd also likely rename temp swings to "scratch" swings, since they'd no longer be technically temporary (since you could point them at a directory that you're maintaining). I like that name better anyways, since it's consistent with the "scratch notes" in GistPad (which is another extension I maintain).

lostintangent commented 3 years ago

This is now shipped! Scratch swings are now stored in temp storage by default, but you can customize it to use a custom folder 🎉