Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic checkpoints #16

Open
rvillacis opened this issue Jun 23, 2020 · 5 comments
Open

Automatic checkpoints #16

rvillacis opened this issue Jun 23, 2020 · 5 comments

Comments

@rvillacis
Copy link

It would be very helpful if a setting could be added so that a checkpoint is automatically created when you open a document that has already been saved/named (I understand the extension does not support unsaved files)or every x number of minutes.

I use auto-save to quickly save and run the latest version of programs across different programming languages, and instead of doing Ctrl-Z multiple times to go back on changes you could just revert to a checkpoint with one click.

@jgentes
Copy link

jgentes commented Jun 27, 2020

Agreed, I installed the checkpoint extension and the first time I needed to use it I discovered that I had not saved any checkpoints.

@amiramitai
Copy link
Contributor

amiramitai commented Apr 25, 2021

I have just created something like this (very hacky) and came to suggest that feature. It creates a checkpoint on each time you save the document. Also it's funny because it says that it doesn't support unsaved documents, and each save is a really good checkpoint because you are ready to run whatever you just wrote. It's here: https://github.com/amiramitai/vscode-checkpoints

@jgentes
Copy link

jgentes commented Apr 26, 2021

@amiramitai looks nice! I can tell you that Webstorm also has problems with renamed / deleted files. If you name the file back to the original name, or create a new file with the old deleted filename, it will allow you to recover the contents of the file. Maybe follow something similar?

My only feedback would be that it would be nice to inline the commands into the right-click menu while clicking on the file in the original tree structure rather than a separate area for checkpoints. Nice work!

@amiramitai
Copy link
Contributor

I think it's neat that it's placed on the side. it works the same way as the timeline tab. When I wanted to think how I'll be implementing this, I went to check if there's any "source control/versioning" apis for vscode. The thing with the renames would be to get into the implementation. Anyway, opened a PR 🤞 #17

@micnil
Copy link
Owner

micnil commented May 2, 2021

@amiramitai PR is now merged and published.

You can enable the setting checkpoints.addCheckpointOnSave to automatically run the "Add Checkpoint" command on each save. You might want to combine this with disabling askForCheckpointName, so you won't get prompted with a dialog everytime.

Let me know if you experience any problems! :)

And thank you @amiramitai !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants