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

Event when vscode quit. #941

Closed
ghost opened this issue Dec 2, 2015 · 4 comments
Closed

Event when vscode quit. #941

ghost opened this issue Dec 2, 2015 · 4 comments
Assignees
Labels
verified Verification succeeded
Milestone

Comments

@ghost
Copy link

ghost commented Dec 2, 2015

is it there a way to get an event, like onDidCloseTextDocument, when vscode is about to quit?

@alexdima alexdima self-assigned this Dec 3, 2015
@alexdima
Copy link
Member

alexdima commented Dec 3, 2015

we need to implement calling deactivate

@egamma egamma mentioned this issue Dec 3, 2015
34 tasks
@alexdima
Copy link
Member

alexdima commented Dec 9, 2015

With 98473e0, VSCode's extension host will now call deactivate() if extensions export it and call dispose() on ExtensionContext.subscriptions on shutdown, then will wait 1s before exiting

@alexdima alexdima closed this as completed Dec 9, 2015
@alexdima alexdima added this to the Dec 2015 milestone Dec 9, 2015
@egamma egamma mentioned this issue Jan 6, 2016
59 tasks
@alexdima alexdima added the verified Verification succeeded label May 27, 2016
@remy-barros
Copy link

And what if we need to do some more complex stuff on deactivation? Something that takes some time like sync files in ftp server? Is there a way to delay vscode closing proccess?

@alexdima
Copy link
Member

alexdima commented Oct 22, 2016

@remy-barros

@dbaeumer and I did a change where you can return a promise from the deactivate function. The VSCode extension host will go down in 10 seconds regardless if your promise completes or not (we must have a time box). If you are doing data critical things in the deactivate, I believe the approach is wrong, perhaps you could always save the files to a temporary location and synchronize at better times than on shut-down. Also, the deactivate is not the time to veto or prompt for saving, etc. deactivate means VS Code is going down or has went down due to a crash. If you want to have some sort of veto API, then please create a new issue asking for it.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

2 participants