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

Extension is not deactivated on closing the editor window #567

Closed
seanmcbreen opened this issue Nov 24, 2015 · 9 comments
Closed

Extension is not deactivated on closing the editor window #567

seanmcbreen opened this issue Nov 24, 2015 · 9 comments
Assignees
Labels
api bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Milestone

Comments

@seanmcbreen
Copy link

From @ArtemGovorov on November 16, 2015 7:15

My extension spins up a few processes that I'd like to kill when it's deactivated.
The deactivation callback for ExtensionContext

context.subscriptions.push({dispose: () => ...});

works perfectly when I stop debugger for the Extension Development Host. However, if I just close the editor window on OSX, the deactivation callback is not invoked, so I can see all created processes hanging around and not being killed.

Copied from original issue: Microsoft/vscode-extensionbuilders#113

@seanmcbreen seanmcbreen added bug Issue identified by VS Code Team member as probable bug enhancement labels Nov 24, 2015
@seanmcbreen
Copy link
Author

From @ArtemGovorov on November 16, 2015 7:34

Here's the workaround I use for now for OSX:

  process.on('SIGTERM', function () {
    // extension deactivation code
  });

@seanmcbreen
Copy link
Author

From @bpasero on November 16, 2015 7:38

@ArtemGovorov is this only during extension development? Not when having the extension installed and closing the window?

@seanmcbreen
Copy link
Author

From @ArtemGovorov on November 16, 2015 7:39

@bpasero Same for the installed extension (on OSX)

@seanmcbreen
Copy link
Author

From @bpasero on November 16, 2015 8:2

@jrieken fyi that would be pretty bad, is the PH connected to the lifecycle service somehow?

@seanmcbreen
Copy link
Author

From @egamma on November 16, 2015 8:7

@dbaeumer you shut down the language server on shutdown and it works correct?

@seanmcbreen
Copy link
Author

From @dbaeumer on November 16, 2015 9:29

@egamma no, I currently fix this on the server side by observing the streams and exit the server is the input stream closes.

@daviwil
Copy link
Contributor

daviwil commented Nov 24, 2015

See also: #537

@alexdima alexdima added api and removed enhancement labels Nov 25, 2015
@egamma egamma mentioned this issue Dec 9, 2015
34 tasks
@alexdima alexdima added this to the Dec 2015 milestone Dec 9, 2015
@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 assigned aeschli and unassigned alexdima Dec 16, 2015
@alexdima
Copy link
Member

this was in the test plan

@jrieken jrieken added the verified Verification succeeded label Dec 17, 2015
@jrieken jrieken assigned jrieken and unassigned aeschli Dec 17, 2015
@egamma egamma mentioned this issue Jan 6, 2016
59 tasks
@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
api bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants