-
Notifications
You must be signed in to change notification settings - Fork 3
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
Restart without saving #1
Comments
I'm actually having a hard time understand this request. What use case is there where you'd not want to save your work before a restart? Visual Studio will ask you about unsaved files if I don't automatically save them for you? |
The same scenarios when you'd want to close VS without saving your files or solution. If Visual Studio will ask about unsaved files anyway, then that sounds like a perfect solution. Can we just let it fall back to prompting for save if/only if VS deems it necessary? |
OK. Thanks for the explanation Justin. I don't work that way, so I couldn't see why someone would want their documents not to be saved. :-) I'm certainly happy to add an option to not automatically save, but to err on the side of caution for most people I'd rather have the auto-save be on by default. But that should be fine for you right, as you turn it off once and that's it. And you'd be able to change it back it you change your mind :-P |
Sure. That would be fine. But couldn't you just remove it altogether? |
As we discussed offline, an option to auto-save or not auto-save will allow people to choose which behavior they want. I actually wish all 'new and improved' features that Microsoft add would have an option to turn it off! It was my original intention to add this option, but I forgot to add it to the backlog and forgot about it. |
If we can check for unsaved changes and only offer a restart confirmation box if there are no unsaved changes, then VS will handle the Yes/No/Cancel case when there are unsaved files/projects/solution and will show what items need to be saved. |
The restart confirmation box will remain, with or without auto-saving. They are two separate things. The restart confirmation dialog is to prevent accidentally clicking on the |
The built-in Visual Studio box acts as a confirm box. |
If the auto-save option is enabled the user will never see the built-in dialog. |
That's not good for anyone, right? |
Here's how we can detect if there are any unsaved changes: (Courtesy of Ryan Molden) ` RunningDocumentTable rdt = new RunningDocumentTable(this); // assuming this is an IServiceProvider, such as a Package, or ServiceProvider.GlobalProvider // If we get here no items in the RDT were dirty, there should be no save prompt |
And a further tip: "You should use IVsRunningDocumentTable3.IsDocumentDirty, so you could still enumerate as below but instead of using IVsPersistDocData2 you probably want to call IVsRunningDocumentTable3.IsDocumentDirty passing in the cookie from the RunningDocumentInfo inside the foreach loop. It returns a bool. AFAIK I is EVERY file/artifact that is open in VS and considered dirty and in need of save. It is how the save dialog is constructed on solution close." |
More advice: |
Please give me the option to Restart VS without having to Save All.
Thanks
The text was updated successfully, but these errors were encountered: